Check These Out
echo "Hello world!" | sprunge # Redirect a stream to a pastebin
sprunge ~/.bashrc # Send a file to a pastebin
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"
}
Reads a username from
I've wanted this for a long time, finally just sat down and came up with it. This shows you the sorted output of ps in a pretty format perfect for cron or startup scripts. You can sort by changing the k -vsz to k -pmem for example to sort by memory instead.
If you want a function, here's one from my http://www.askapache.com/linux-unix/bash_profile-functions-advanced-shell.html
$ aa_top_ps(){ local T N=${1:-10};T=${2:-vsz}; ps wwo pid,user,group,vsize:8,size:8,sz:6,rss:6,pmem:7,pcpu:7,time:7,wchan,sched=,stat,flags,comm,args k -${T} -A|sed -u "/^ *PID/d;${N}q"; }
apt-get install trash-cli
Commandline program that allows you put folders or files in the standard KDE/Unity desktop trash.
This will launch a listener on the machine that will wait for a connection on port 1234. When you connect from a remote machine with something like :
nc 192.168.0.1 1234
You will have console access to the machine through bash.
\n Separates out the architectures on different lines.
this will connect to your hosted website service through the cPanel interface and use its backup tool to backup and download the entire website, locally.
(do not forget to replace : YourUsername , YourPassword and YourWebsiteUrl for it to work )
Assume that you have a form , in the source look for something similar to :
input name="rid" type="TEXT"
input name="submit" value="SUBMIT" type="SUBMIT" align="center"
Then exec the command to get the response into html
More info : www.h3manth.com
Instead of using force un-mounting, it's better to find the processes that currently use the relevant folder.
Taken from:
http://www.linuxhowtos.org/Tips%20and%20Tricks/findprocesses.htm