To Serve Current Directory on Web without Installing a Web Server – Use it Share your Files to your friend over the Web
$ python -m SimpleHTTPServer 8080
This Command will serve the current directory tree at http://$HOSTNAME:8080/
So if you wished to share some files with your friend over the Internet streaming them right from your pc then just run this script, check your IP using whatismyip.com and then ask your friend to open,
http://Your IP:8080/ for example http://123.34.56.12:8080/ and he/she can copy your files immediately
To Run a Linux Command at a Given Time
echo “ls -l” | at midnight
OR
echo “ls -l” | at 10am Jul 21
Now , the first command will do a “ls -l” at midnight , and to run any other command at a specific time just type in the command then the pipe operator(|) follwed by “at time”
Like the second command will do a “ls -l” at 10 am on july 21st
Update Twitter From the Linux Command Line
curl -u user:pass -d status=”I am Tweeting from the shell” http://twitter.com/statuses/update.xml
Now all you have to do is replace user by your twitter username , pass by your password and the text inside status to whatever you wish to set your status too .
It uses cUrl library to post your messsage
To Display Programs/Process consuming Maximum Memory
ps aux | sort -nk +4 | tail
The above command displays the 10 most resource hogging process consuming big share of your memory.
An Impressive One – List of Commands you use Often at Shell
history | awk ‘{a[$2]++}END{for(i in a){print a[i] ” ” i}}’ | sort -rn | head
See What is Stored inside your RAM
This command will display all strings currently stored in your RAM , will sure make you feel Good if you love to play with your PC
sudo dd if=/dev/mem | cat | strings
Download An Entire Website
wget –random-wait -r -p -e robots=off -U mozilla http://www.example.com
-p parameter tells wget to include all files, including images.
-e robots=off you don’t want wget to obey by the robots.txt file
-U mozilla as your browsers identity.
–random-wait to let wget chose a random number of seconds to wait, avoid get into black list.
Other Useful wget Parameters:
–limit-rate=20k limits the rate at which it downloads files.
-b continues wget after logging out.
-o $HOME/wget_log.txt logs the output
Lst The Size (In Human Readable Form) Of All Sub Folder From The Current Location
du -h –max-depth=1
A Very Simple And Useful Stop Stop Watch
time read (ctrl-d to stop)
time read -sn1 (s:silent, n:number of characters. Press any character to stop)
Shutdown a Windows Machine From Linux
net rpc shutdown -I ipAddressOfWindowsPC -U username%password
This will issue a shutdown command to the Windows machine. username must be an administrator on the Windows machine. Requires samba-common package installed. Other relevant commands are:
net rpc shutdown -r : reboot the Windows machine
net rpc abortshutdown : abort shutdown of the Windows machine
Type:
net rpc
to show all relevant commands
Jump to a Directory, Execute a Command and Jump Back to Current DIR
(cd /tmp && ls)
Set Audiable Alarm When An IP Address Comes Online
ping -i 60 -a IP_address
Waiting for your server to finish rebooting? Issue the command above and you will hear a beep when it comes online. The -i 60 flag tells ping to wait for 60 seconds between ping, putting less strain on your system. Vary it to your need. The -a flag tells ping to include an audible bell in the output when a package is received (that is, when your server comes online).
Watch Network Service Activity in Real-Time
lsof -i
RIP Audio From a Video File
mplayer -ao pcm -vo null -vc dummy -dumpaudio -dumpfile
replace accordingly
0 comments:
Post a Comment