analyze debug queries output for wordpress

2011-02-09 2 min read Wordpress

Some time back, my website became too slow and I started getting timeout response for quite a lot of my pages. When I analyzed things, I found the issue was with the DB queries taking a lot of time. So, I thought of getting my hands dirty and started with installing the plugin “Debug Queries”. Just in case, you don’t know about the plugin, it lists all the queries to DB along with the time taken for the query when a Admin user visits any page.

Continue reading

List all the rpms by size – quick way to find out what is eating your disk space in root partition

2010-10-13 1 min read Bash Fedora

Here is a quick command to check the list of installed packages by their size in reverse order. Very useful if you want to remove unwanted rpms just to clean up some space on your disk:

  <td>
    <div class="text codecolorer">
      rpm -q -a --qf "%10{SIZE}\t%{NAME}\n" | sort -k1,1nr |more
    </div>
  </td>
</tr>
1

Sample output:

78070452    kernel
78060477    kernel
50708634    jre
50316408    libgcj
48581593    wireshark
47778643    gimp
47674675    jre
47303084    qt-x11
45838912    otrs
45657248    chromium-libs
42070128    wxPython

Continue reading

Execute mysql command from shell

2010-02-04 1 min read Database

phpMyAdmin is a very slow application if you want to execute a query on your database. If you know the name of the database then any GUI tool is an overhead. So I have written a one liner shell script to do that for me 🙂

Here&#8217;s the script:

echo &#8221;select * from table where field like &#8221;%$1%&#8221;&#8221;|mysql -h doamin.com -u amit -p -D amit -r –password=hello

When run with one argument it will execute the sql query directly without asking for password also.

Continue reading