Categories
GNU/Linux

GNU/Linux TCPDump QuickRef

Some tcpdump examples.

tcpdump -vv -i eth0 -w tcpdump.log ‘tcp port 443’
tcpdump -vv -i eth0 -w tcpdump.log dst 145.89.57.121

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
PowerShell Scripting

PowerShell Hex 2 Ascii Function

Function to convert a HEX value to Ascii. Example:

>fnHex2Ascii -HexValue “00000000”

function fnHex2Ascii()
{
  param (
    [string]$HexString
	)
  
  Clear-Variable -Name sAscii -ErrorAction SilentlyContinue
  $HexString -Split '(.{2})' | %{ if ($_ -ne "") { $sAscii+=[CHAR]([CONVERT]::toint16($_,16)) } }

  # Return metadata and body...
  return $sAscii 
}
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
MS Windows Server

MS Windows add a user to EFS encrypted content

Add user certificate to a specific encrypted file…

cipher /ADDUSER /CERTHASH:CERTIFICATE_THUMBPRINT file.txt

Add user certificate to a specific encrypted directory…

cipher /ADDUSER /CERTHASH:CERTIFICATE_THUMBPRINT /S:directory