Check These Out
This type of join is clearly documented in the bash manual. Only the first character of IFS is used for the delimiter.
This is meant for the bash shell. Put this function in your .profile and you'll be able to use tab-completion for sshing any host which is in your known_hosts file. This assumes that your known_hosts file is located at ~/.ssh/known_hosts. The "complete" command should go on a separate line as such:
function autoCompleteHostname() {
local hosts=($(awk '{print $1}' ~/.ssh/known_hosts | cut -d, -f1));
local cur=${COMP_WORDS[COMP_CWORD]};
COMPREPLY=($(compgen -W '${hosts[@]}' -- $cur ))
}
complete -F autoCompleteHostname ssh
Installs pip packages defining a proxy
A common programming question for interviewers to ask potential job candidates is to code "FizzBuzz". That is, if a number is divisible by 3, then it should display "Fizz". If a number is divisible by 5, it should display "Buzz". If it is divisible by both, then it should display "FizzBuzz". Otherwise, display the current number between 1 and 100.
Easy and direct way to find this out.
Obviously, you can replace 'man' command with any command in this command line to do useful things. I just want to mention that there is a way to list all the commands which you can execute directly without giving fullpath.
Normally all important commands will be placed in your PATH directories. This commandline uses that variable to get commands. Works in Ubuntu, will work in all 'manpage' configured *nix systems.
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"
}
faster ;) but your idea is really cool
It really disables all ICMP responses not only the ping one.
If you want to enable it you can use:
$ sudo -s "echo 0 > /proc/sys/net/ipv4/icmp_echo_ignore_all"