Check These Out
The above command will open a Remote Desktop connection from command line, authenticate using default username and password (great for virtual machines; in the exampe above it's administrator:password), create a shared folder between your machine and the other machine and configure resolution to best fit your desktop (I don't like full screen because it make the desktop panels to disappear). The command will run in the background, and expect to receive parameters. You should enter hostname or IP address as a parameter to the command, and can also override the defaults parameters with your own.
Booting the VM headless via VBoxHeadless requires knowledge of the VM's network in order to connect. Using VBoxManage in this way and you can SSH to the VM without first looking up the current IP, which changes depending on how you have your VM configured.
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
Converts any number of seconds into days, hours, minutes and seconds.
sec2dhms() {
declare -i SS="$1"
D=$(( SS / 86400 ))
H=$(( SS % 86400 / 3600 ))
M=$(( SS % 3600 / 60 ))
S=$(( SS % 60 ))
[ "$D" -gt 0 ] && echo -n "${D}:"
[ "$H" -gt 0 ] && printf "%02g:" "$H"
printf "%02g:%02g\n" "$M" "$S"
}
Thanks to knoppix5 for the idea :-)
Print selected lines from a file or the output of a command.
Usage:
$ every NTH MAX [FILE]
Print every NTH line (from the first MAX lines) of FILE.
If FILE is omitted, stdin is used.
The command simply passes the input to a sed script:
$ sed -n -e "${2}q" -e "0~${1}p" ${3:-/dev/stdin}
print no output
$ sed -n
quit after this many lines (controlled by the second parameter)
$ -e "${2}q"
print every NTH line (controlled by the first parameter)
$ -e "0~${1}p"
take input from $3 (if it exists) otherwise use /dev/stdin
${3:-/dev/stdin}
Shows all block devices in a tree with descruptions of what they are.
Shows all block devices in a tree with descruptions of what they are.