I just released v1.0
of my Year End Stats WordPress plugin just in time for you to write your year-end review posts.
This release adds a lot of new features and is a mandatory update.
I just released v1.0
of my Year End Stats WordPress plugin just in time for you to write your year-end review posts.
This release adds a lot of new features and is a mandatory update.
Posted in Plugin Releases Tagged Plugin, release, WordPress, Year End Stats Leave a comment
After being “officially unemployed” for about a month (and after taking a nice break 😉 ) I have joined 10up.
Posted in Random/Personal Tagged 10up, WordPress, work 15 Comments
Today was my last day at Yahoo and for the first time in my decade long career I am “officially unemployed” 😉
Posted in Random/Personal Tagged work, Yahoo 16 Comments
This post has sat in my draft folder for more than 5 years. I was doing some cleaning and found that I didn’t publish this post and since it is still relevant I thought of pushing the publish button.
Being a web developer, most of the time I would be staring at PuTTY. I got sick of the default bright colours of PuTTY and was searching for ways to customize the display of my PuTTY window.
After some research, I found pre-packaged custom themes for PuTTY created by Ilya Grigorik. These themes are available as .reg files. You can directly download and use them or if you want, you can further customize them for your needs.
Below is the screenshot of the different themes that are available.
Wow! now my eyes have something pleasant to stare at, most of the times 😉
Posted in Unix/Server Stuff, Web Programming Tagged PuTTY, Theme, Tipbits/How to's Leave a comment
Sometime back I wrote about a simple awk script that I wrote which allowed me to find unique errors from Apache error log files.
After I wrote that script I found myself executing that script every day in the morning to figure out if there were any errors in my sites. After a couple of days I wrote another script to automatically parse the error log file and email me if there were any errors. As usual I thought of writing about it here so that it would be useful for someone else as well 🙂
Posted in Python, Unix/Server Stuff Tagged Apache, command line, Python 5 Comments
Recently I have done lot of data analysis in Python (more details about this in another post) and have started to like Pandas a lot. The other day I had to process some data from a Google Sheet and was wondering whether I could read the data as a Pandas DataFrame and after a quick search found the gspread
 package and within a few lines of code I was able to read data from Google Sheet into a Pandas DataFrame.
Posted in Python Tagged Google Sheet, Pandas, Python 4 Comments
Like my Twitter Avatar plugin, even my WP Github Gist plugin was broken recently due to changes in the underlying API that my plugin was using. This time it was because of the changes in the Gist Embed API.
Posted in Plugin Releases Tagged gist, github, Plugin, release, WordPress, wp-github-gist Leave a comment
Because of the recent changes in Twitter API, my Twitter Avatar Reloaded WordPress plugin stopped working. I rewrote the way my plugin communicates with Twitter and updated the code to use the new API and now my plugin works again.
Instead of rewriting the entire Twitter backend again, I am not using the excellent wp-twitter-api, provided by @timwhitlock which allows you to easily communicate with Twitter API from your WordPress plugin.
If you are a WordPress plugin developer and want to communicate to the Twitter API from your WordPress plugin, then I would highly recommend you to use wp-twitter-api, instead of creating your own.
The new version of the Twitter API needs you to make authenticated calls even to get some basic information about a twitter screen name. So after you installed the plugin you need to follow these steps so that the plugin could interact with the Twitter API.
This is a mandatory update. You can download the latest version of the Plugin from the Plugin’s homepage or install it using the Plugin installer.
Please keep the feedback coming and if you want me to add any new features or find a bug, please leave a comment or post about it in twitter.
Posted in Plugin Releases Tagged Plugin, release, Twitter Avatar Reloaded, WordPress Leave a comment
After I moved to WordPress Multisite recently, I had to closely watch the Apache error log file for a couple of days to make sure that there weren’t any configuration mismatch.
Initially I used run the tail
command to view the errors, but then I quickly realized that if there is a frequent error, then it becomes extremely difficult to find out other non frequent errors.
After some fiddling with the awk
and sort
commands, I came up with the following one liner that prints the unique errors with their count.
awk
script is executed for each line in the error log file.
The -F
directive is used to specify field separator. If you look at a single line in the apache error log file, you will notice that each field is enclosed by [
and ]
.
awk
allows us to specify multiple field separators by enclosing them between []
. That’s what we are specifying in -F[\[\]]
After splitting the fields, we need to filter out the lines that contain the term error
in the fourth field. That’s what happens in the next part of the command. Basically the part $4 == "error"{print $7}
prints the seventh field, which has the real error message if the fourth field is equal to the string “error”.
The next step is to sort all the error messages. This is done by piping the output to the sort
command.
The next step is to find the unique error messages and then count them. This is done by piping the output to the uniq
command. The -c
flag does the counting.
The last step is to sort the messages again by frequency and print them. This is done by the last sort
command. The -n
flag sorts by numbers and the flag -r
does the sorting by descending order.
Posted in Unix/Server Stuff Tagged Apache, awk, command line, one liner, sort, uniq Leave a comment
I use the Mac Terminal App a lot to ssh into remote servers. It all works great except for a single annoyance. If I leave the ssh tab open without any activity for sometime or put my Mac to sleep, then the tab gets frozen and becomes unresponsive. It takes a couple of minutes for it to log out of the server and become responsive again, so that I can reuse the tab again.
Whenever this happens, I have to close the unresponsive tab and open a new one, or wait for 5-10 minutes. I did some research about it and found that Mac Terminal App provides an escape command that can be used to forcefully log out of the remote server. All you need to do is to type the following command in the unresponsive tab.
~.
(Tilda followed by a dot)
I tried it and it works like a charm. It immediately logs you out of the frozen ssh tab and you can reuse your tab again without waiting for it to become responsive again.
Hope this small trick is useful for others as well 🙂
Posted in Unix/Server Stuff Tagged command line, Mac, SSH, terminal 4 Comments