Port php mysql scripts to php 7.0 from 5.x version

2018-04-23 2 min read Learning
Recently I got a script or series of scripts that were written for PHP 5.6x and hence used mysql_connect which as you know by now does not work with PHP 7.0. Since there were number of scripts, I thought it would be waste of time to change them manually and wrote a script to fix them. If you have similar situation then probably this few lines could help you. Since my scripts did not use all the functions so I did not put the sed commands for all of them but you get the idea 🙂 Continue reading

bash ansi codes to html for html reports from shell script

2017-02-20 1 min read bash
How many times you have felt that there was some simple way to convert bash ansi escape sequences ( colors as well in terminal ) to html equivalent so that you can send the same as html report in email. Here is simple solution. One way is to use ccze if you are using this for logs – colorize your logs and for more generic solution. dnf install python3-ansi2html.noarch after this is installed, you can use something like this: Continue reading

ShellCheck – check basic POSIX shell script errors

2015-08-03 1 min read bash Fedora
Here is description of the tool: Description : The goals of ShellCheck are: To point out and clarify typical beginner’s syntax issues, : that causes a shell to give cryptic error messages. To point out and clarify typical intermediate level semantic : problems, that causes a shell to behave strangely and : counter-intuitively. To point out subtle caveats, corner cases and pitfalls, that may : cause an advanced user’s otherwise working script to fail under Continue reading

nall – schedule your tasks like a pro

2014-10-06 1 min read Fedora
nall is a utility to run your scripts ( for whatever ) every defined period. Here is description: Description : Nall is a small gtk+ application that discretely fits into your freedesktop system tray (such as trayer). Its purpose is to spawn periodically every kind of script and display a one-line output in the tooltip window. The main usage of nall is monitoring or just notifying of almost everything (it just depends upon your imagination and ability to script). Continue reading

fork a new process in perl

2011-01-27 1 min read Uncategorized
I was doing something today and found that I require to fork a new process in perl. Now I had never done this earlier, so I did not know how to do this. First some background : I was doing some program very similar to http server, where the script accepts some input through a socket and then processes the same. In doing so I was seeing that the script was taking some time in processing the input and thus was not processing the second request until the first one was completed. Continue reading
Older posts