Samba 4 // Linux console // Delete machines

OBJECT2DELETE=Workstation03 ldbdel -H $SAMBA_LDB “$(ldbsearch -H $SAMBA_LDB “(sAMAccountName=$OBJECT2DELETE)” dn | grep -v ‘^#’ | head -n 1 | grep ‘dn:’ | sed ‘s|dn:\ ||’ | grep ‘DC’)” Advertisements

script/console ftp upload one liner

With curl: curl -o /dev/null -s –connect-timeout 5 -T $TMPDIR/z_id.$CH_ID -u LOGIN:PASS ftp://URL:PORT/FILE.txt With ncftpput /usr/bin/ncftpput -u LOGIN -p PASS -P PORT -t 30 -F -T ‘UPLOADPREFIX’ -S ‘UPLOADSUFFIX’ -z -V URL /dls “FILE” ATTENTION: Add -DD to delet the local file afterwards. ATTENTION2: Quote ‘$’ in password with ‘\\\’ like ‘mypasscontains\\\$’

BASH vs. JSON :)

curl -s “https://www.pegelonline.wsv.de/webservices/rest-api/v2/stations.json?includeTimeseries=true&includeCurrentMeasurement=true”| jq -j –tab ‘.[] | select( ( .timeseries[0].currentMeasurement.stateMnwMhw==”low” or .timeseries[0].currentMeasurement.stateMnwMhw==”high” ) and .timeseries[0].shortname==”W” ) | [ .number, .water.longname, .longname, .latitude, .longitude, .timeseries[0].currentMeasurement.stateMnwMhw, .timeseries[0].currentMeasurement.trend, .timeseries[0].currentMeasurement.value ] | “\(.[0])|\(.[1])|\(.[2])|\(.[3])|\(.[4])|\(.[5])|\(.[6])|\(.[7])\n”‘)