Categories
GNU/Linux

GNU/Linux ODATA Query Examples

ODATA Query Option Description
$orderby Uri parameter for sorting…
$select Uri parameter to select specific coluimns…
$top Uri parameter to limit the result…
$skip Uri parameter to skip number of rows…
$filter Uri parameter to filter result…
$expand Uri parameter to expand related entity…
$inlinecount Uri parameter to include a total record count…

 

Example to retrieve metadata from JBoss DV Odata service…

https://localhost:8443/odata/vdbname/$metadata

 

Retrieve all records in JSON format…

https://localhost:8443/odata/vdbname/modelname?$format=json

 

Order by column ‘Name’ and retrieve first 5 records…

https://localhost:8443/odata/vdbname/modelname?amp;$orderby=Name&$top=5

 

Order by column ‘Name’ and retrieve records 6-10 records…

https://localhost:8443/odata/vdbname/modelname?$orderby=Name&skip=5&$top=5

 

Filter ODATA result ($filter=Name eq ‘John’)…

https://localhost:8443/odata/vdbname/modelname?$filter=Name%20eq%20%27John%27

Select specific rows…

https://localhost:8443/odata/vdbname/modelname?$select=ID,Name,Description

 

Categories
GNU/Linux

GNU/Linux Test LDAP server SSL/TLS connection

Test LDAP server SSL/TLS connection using LDAP commandline client…

ldapsearch -H ldaps://dc01.totietoot.nl -b "OU=Employees,OU=Totietoot,DC=Totietoot,DC=nl" "userPrincipalName=john@totietoot.nl" -W -D john@totietoot.nl -d 1
Categories
GNU/Linux

GNU/Linux JBoss Fuse Shell ActiveMQ Commands

Display basic queue information…

activemq:query -QQueue=* --view Name,EnqueueCount,DequeueCount,QueueSize

Display queue messages…

activemq:browse --amqurl tcp://localhost:61616  --user [username] --password [password] queue:[queuename]

Purge a specific message from the command line…

activemq:purge --msgsel "JMSMessageID='ID:XXXXXXXX-000000-0000000000000-0:0:00:0:0'" [queuename]

Purge all messages from a specific queue…

activemq:purge [queuename]
Categories
GNU/Linux

GNU/Linux OpenSSH Key QuickRef

Generate a SSH Key Pair:

>ssh-keygen -t rsa

Convert SSH2 Public Key to OpenSSH Public Key

>ssh-keygen -i -f id_ssh2.pub > id_openssh.pub

Convert OpenSSH Public Key to SSH2 Public Key

>ssh-keygen -e -f id_openssh.pub > id_ssh2.pub

Get Key Fingerprint MD5

ssh-keyscan -p [port] [hostname] > [hostkeyfpfile]
ssh-keygen -l -f [hostkeyfpfile] -E md5
Categories
GNU/Linux

GNU/Linux FreeBSD/FreeNAS Basics

Update repository and install packages:

>pkg upgrade
>pkg install nano

Enable SSHD:

>sysrc sshd_enable=yes

Force a OwnCloud (plugin) full scan on a FreeNAS machine:

su -m www -c '/usr/pbi/owncloud-amd64/bin/php /usr/pbi/owncloud-amd64/www/owncloud/occ files:scan --all'