Check These Out
host is a simple utility for performing DNS lookups. It is normally used to convert names to IP addresses and vice versa. When no arguments or options are given, host prints a short summary of its command line arguments and options.
This command disable sending of start/stop characters.
It's useful when you want to use incremental reverse history search forward shortcut (Ctrl+s).
To enable again, type:
$ stty -ixoff
Using netcat, usuallly installed on debian/ubuntu.
Also to test against a sample server the following two commands may help
echo got milk? | netcat -l -p 25
python -c "import SocketServer; SocketServer.BaseRequestHandler.handle = lambda self: self.request.send('got milk?\n'); SocketServer.TCPServer(('0.0.0.0', 25), SocketServer.BaseRequestHandler).serve_forever()"
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
tail with coloured output with the help of perl - need more colours? here is a colour table:
http://www.tuxify.de/?p=23
inputfile.txt is a space-separated textfile, 1st column contains the items (id) I want to put into my SQL statement.
39 = charactercode for single tick '
$1 = first column
If inputfile.txt is a CSV-file separated by "," use FS= to define your own field-separator:
$ awk 'BEGIN {FS=","; }{printf "select * from table where id = %c%s%c;\n",39,$1,39; }' inputfile.txt
You might want to secure your AWS operations requiring to use a MFA token. But then to use API or tools, you need to pass credentials generated with a MFA token.
This commands asks you for the MFA code and retrieves these credentials using AWS Cli. To print the exports, you can use:
`awk '{ print "export AWS_ACCESS_KEY_ID=\"" $1 "\"\n" "export AWS_SECRET_ACCESS_KEY=\"" $2 "\"\n" "export AWS_SESSION_TOKEN=\"" $3 "\"" }'`
You must adapt the command line to include:
* $MFA_IDis ARN of the virtual MFA or serial number of the physical one
* TTL for the credentials
using -u is better for standardizing date output and timezones, for servers in different timezones.