I once had a need to monitor the origin of HTTP requests, track it in real time from web server log. Since this need was actually nothing more but pure curiosity, I was not willing to pay for it. So I started looking for free solutions for this purpose. Here is what it all ended at…Continue reading
Idea behind this trick is very simple yet powerful enough to avoid unexpected consequences when some results file is being appended long enough by your process.Continue reading
You may want to read a log file for newly appended data. You could do it by knowing how many lines you read before and how many lines you have “now”. But when you have large log files, this approach will become very slow – try to run “wc -l” on file which has tens of millions of lines and you’ll see how slowly it counts. And you would have to do something like that each time you are reading new portion of data. What to do? Read log in bytes instead. Here is how.Continue reading
If you have a need to check whether picture is good or corrupted, you can easily do it with command line utility “identify”.Continue reading
Say you have some text and some pattern that you want to provide for grep. Everything is easy, until you want to extract only the pattern-matching part, not the whole line that has the match. What to do?
You can “grep” and use pipe for further processing, like sed or awk. But did you know that you can do it solely with grep?Continue reading
Sometimes you might encounter situations when cron jobs are needed to be run with intervals shorter than least possible option provided by crontab (1 minute). Although you should consider converting such tasks into daemons, in some cases it might really be enough to just solve it “quick and dirty” way. Here is how.Continue reading
Have you ever seen something like this?
[root@linux ~]# less test
"test" may be a binary file. See it anyway?
Sometimes you may encounter situations, when you wish to display all possible combinations of characters from given charset (e.g. some brute-force task). For example, print “a … zzz”, i.e. range is “a … z” and maximum length is 3. You can easily do this in bash, with the help of recursion.Continue reading
Let’s suppose that you have just opened Linux terminal for the first time in your life. Your wish is to write nothing but “Hello World” type of thing. As this command is one-liner, you can simply do this:Continue reading