Live Chat!

List command line history with timestamp

* * * ½   3 votos

October 16th, 2008 mysurface

History is a common command for shell to list out all the executed commands. It is very useful when it comes to investigation on what commands was executed that tear down the server. With the help of last command, you be able to track the login time of particular user as well as the the [...]

Posted in Common, history, last | Hits: 84491 | 6 Comments »

Top Ten Processes Watcher

* * * * * 1 votos

July 13th, 2008 mysurface

top command provides a dynamic real-time view of a running system. It can display system summary information as well as a list of tasks currently being managed by the Linux kernel. But if you want get something more specific, you must play some tricks on it. For example, I want a clean view of top [...]

Posted in head, tail, top, watch | Hits: 65309 | No Comments »

Wordpress exploit: we been hit by hidden spam link injection

*         1 votos

May 26th, 2008 mysurface

We been hit by hidden spam link injection (a modified version of goro spam injection), this crack injects spam links through wordpress wp_footer() or wp_head() hook. The spam links only reveal itself if crawled by search engine bot such as googlebot, and they are hidden from our eyes. We believe the cracker’s purpose is to [...]

Posted in Misc, curl, curlftpfs, file, find | Hits: 43887 | 34 Comments »

Discover user guides and manuals within your linux system

          0 votos

May 9th, 2008 mysurface

Do you realized that we can obtain a lots of user manuals and guideline documents from our system? There is a folder /usr/share/doc, you may find some useful docs already preinstalled by your distro. Those docs are in pdf or html format. I manage to find user manuals for valgrind, ipython, systemtap, boost etc.
I believes [...]

Posted in Common, echo, find | Hits: 29290 | 2 Comments »

Simple use of find to search for files in command line

* * * *   1 votos

May 2nd, 2008 mysurface

Find is a very strong command to search for files and folders. You can search for files based on certain criteria besides filename, such as file types, atime, belongs to which groups, file modes, etc. Because find command support a lots of options, therefore sometimes find command line looks very complicated, but actually it is [...]

Posted in Misc, file, find | Hits: 26818 | No Comments »

rpm and yum rescue tips on Fedora

*         1 votos

April 22nd, 2008 mysurface

You have to be careful when you run yum update and yum install, DON’T force kill it, kill -9 or pkill -9. Those action are consider very dangerous, may lead you to losing certain files. Seriously, I hate yum, when I really wanna cancel the process in the middle, by hitting ctrl+c doesn’t really work! [...]

Posted in Admin, awk, rpm, which, yum | Hits: 23657 | No Comments »

where is my command binaries and its configurations?

* * * *   1 votos

February 9th, 2008 mysurface

When we want to find out the absolute path for a command, we will usually use which.
For examples, if I want to check out the absolute path for mplayer, I may do this:
which mplayer
But there is another command can search for the binaries as well as configs and man pages.
whereis mplayer
And it will return this:
mplayer: [...]

Posted in Common, whereis | Hits: 19700 | No Comments »

Obtain some system statistics from vmstat

* * * * * 1 votos

December 8th, 2007 mysurface

vmstat know as virtual memory statistics reporter, but it gives more information the just only virtual memory.
Besides memory, it covers overall CPU usage, IO, Swap, Proc, System interupts and context switching. vmstat is pretty easy to use, ignores all other options, the normal usage will be looks like this:
vmstat [delay] [counts]
Let say, you want to [...]

Posted in Admin, date, tail, vmstat | Hits: 40107 | 4 Comments »

How to redirect output to a file as well as display it out

* * * * ½ 3 votos

December 6th, 2007 mysurface

To redirect standard output to a file is easy, you just need to use the redirection symbol, for example:
echo “hello world” > test.txt
But what if I want to display it out as well as store into a file?
Answer: tee
echo “hello world” | tee test.txt
Okay it seems very easy, how about append?
Related PostsDisplay & log command [...]

Posted in Text Manipulation, pipeline, python, tee | Hits: 45949 | 6 Comments »

stupid way to make mplayer repeatly play

          0 votos

November 3rd, 2007 mysurface

I am so desperately wanna make mplayer repeat a song, somehow I obtain a song in flv format. I fail to figure out how to make mplayer repeat, so here make a stupid workaround with bash for.
for (( ; ; )); do mplayer nicesong.flv; sleep 0.1; done
Kill it by hitting ctrl+c two times very fast!
heh! [...]

Posted in Bash, for, mplayer, sleep | Hits: 30400 | 14 Comments »