Live Chat!

Why my written shell script doesn’t work in cygwin?

0 votos Vota!!

May 20th, 2010 mysurface

You may facing the problem like this. The workable shell script in Linux, after you copy and paste into windows editor and save as .sh, it doesn’t work under Cygwin shell. Why?
Bear in mind that, Cygwin shell giving you a *nix environment (either Unix or Linux), which is actually a bash environment. Everything task carry [...]

Posted in Common, cygwin, dos2unix | Hits: 47225 | No Comments »

List command line history with timestamp

5 votos Vota!!

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: 122556 | 11 Comments »

Top Ten Processes Watcher

1 votos Vota!!

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: 82169 | 1 Comment »

Wordpress exploit: we been hit by hidden spam link injection

2 votos Vota!!

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: 68921 | 37 Comments »

Discover user guides and manuals within your linux system

1 votos Vota!!

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: 35439 | 2 Comments »

Simple use of find to search for files in command line

1 votos Vota!!

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: 34208 | No Comments »

rpm and yum rescue tips on Fedora

1 votos Vota!!

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: 34225 | No Comments »

where is my command binaries and its configurations?

1 votos Vota!!

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: 22978 | No Comments »

Obtain some system statistics from vmstat

1 votos Vota!!

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: 55233 | 4 Comments »

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

5 votos Vota!!

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: 89555 | 20 Comments »