Check These Out
Given a file of FQDN, this simple command resolves the IP addresses of those Useful for log files or anything else that outputs domain names.
Great for sysadmins! Don't forget to pass the vlan to your port in a manageable switch.
After vconfig, you should use
$sudo ifconfig eth0.[VID] up
Now the interface is up, you can use dhclient or ifconfig again to get an ip address.
standard image viewers do not seem to be able to open a FIFO file. xloadimage was the first one i've stumbled upon that can handle this.
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"
}
Takes the same arguments that ack does. E.g. ack-open -i "searchterm" opens all files below the current directory containing the search term. The search term is also highlighted within vim if you have hlsearch set. Works on zsh, unsure if it works on bash.
Note: ubuntu users have to change ack to ack-grep unless you already have it aliased (as I do)
bash/ksh subshell redirection (as file descriptors) used as input to diff
pings a server once per second, and beeps when the server is unreachable.
Basically the opposite of:
$ ping -a server-or-ip.com
which would beep when a server IS reachable.
You could also substitute beep with any command, which makes this a powerful alternative to ping -a:
$ while true; do [ "$(ping -c1W1w1 server-or-ip.com 2>/dev/null | awk '/received/ {print $4}')" = 1 ] && date || echo 'server is down!'; sleep 1; done
which would output the date and time every sec until the ping failed, in which case it would echo.
Notes:
Requires beep package.
May need to run as root (beep uses the system speaker)
Tested on Ubuntu which doesn't have beep out of the box...
$ sudo apt-get install beep