Check These Out
alternatively, run the spinner for 5 seconds:
timeout 5 bash -c 'spinner=( Ooooo oOooo ooOoo oooOo ooooO oooOo ooOoo oOooo); while true; do for i in ${spinner[@]}; do for j in seq 0 ${#i}; do echo -en "\b\b"; done; echo -ne "${i}"; sleep 0.2; done; done'
works on Linux and Solaris. I think it will work on nearly all *nix-es
Of course you will have to install Digest::SHA and perl before this will work :)
Maximum length is 43 for SHA256. If you need more, use SHA512 or the hexadecimal form: sha256_hex()
yes 6 (tail from 6th line)
Try modifying the numbers in the "(i*(i>>8|i>>9)&46&i>>8))^(i&i>>13|i>>6)" part.
Crudely stolen from http://www.xkcdb.com/9067
Tee can be used to split a pipe into multiple streams for one or more process to work it. You can add more " >()" for even more fun.
man screen:
"-D -R Attach here and now. In detail this means: If a session is running, then reattach. If necessary detach and logout remotely first. If it was not running create it and notify the user. This is the author?s favorite."
Explanation:
* The date command evaluated to today's date with blank padded on the left if single digit
* The grep command search and highlight today's date
* The --before-context and --after-context flags displays up to 6 lines before and after the line containing today's date; thus completes the calendar.
I have tested this command on Mac OS X Leopard and Xubuntu 8.10
The (in)famous "FizzBuzz" programming challenge, answered in a single line of Bash code. The "|column" part at the end merely formats the output a bit, so if "column" is not installed on your machine you can simply omit that part. Without "|column", the solution only uses 75 characters.
The version below is expanded to multiple lines, with comments added.
for i in {1..100} # Use i to loop from "1" to "100", inclusive.
do ((i % 3)) && # If i is not divisible by 3...
x= || # ...blank out x (yes, "x= " does that). Otherwise,...
x=Fizz # ...set x to the string "Fizz".
((i % 5)) || # If i is not divisible by 5, skip (there's no "&&")...
x+=Buzz # ...Otherwise, append (not set) the string "Buzz" to x.
echo ${x:-$i} # Print x unless it is blanked out. Otherwise, print i.
done | column # Wrap output into columns (not part of the test).