Fedora 18

After a two month delay, Fedora 18 is finally here.  So far, I have been surprised by two things:

  1. Phasing out of “preupgrade” for “fedup“.  Seriously?  How’s “fedup –network 18” better than “preupgrade“?  Especially, when dealing with desktop users…
  2. How much new stuff I found in the Release Notes.  I didn’t have much time to follow the development process last year, but even without that, I realized that a lot of my knowledge is quite outdated.  Specifically: GRUB vs GRUB2 configuration, chkconfig/service vs. systemctl, date/hostname/etc migration to some*ctl scripts, network management (both with NetworkManager and with interface naming changes), and lots more.

And I haven’t even upgraded yet.  I wonder what will come next.

P.S.: if you must know, I’ve written a huge rant on the whole Fedora direction, but after page 35 or so it got a little bit out of control, so I deleted it and left you with the above.

Configuring the Apache MPM on Fedora

Configuring the Apache MPM on Fedora

If you take nothing else away from this article, let it be that you should tailor your MPM’s MaxClients setting so that your web server won’t try to allocate more resources than you have available. Better that a visitor wait a moment for a connection than that the server should dip into swap for more memory and bring the entire virtual machine to a crawl.

–i-am-a-dummy

Here is a handy command-line option for MySQL client: –i-am-a-dummy, or, if you don’t have a sense of humor, –safe-updates.  When used, this will prevent updating or deleting rows without explicitly specifying a WHERE clause.  It will also limit the number of SELECT and JOIN results.

Fixing MySQL error “Cannot load from mysql.proc. The table is probably corrupted”

Fixing MySQL error “Cannot load from mysql.proc. The table is probably corrupted”

After a recent upgrade of some of my CentOS 6.3 servers to MySQL 5.5 from the Remi repository, I started noticing errors like this one in the logs, especially during backups:

MySQL: SHOW FUNCTION STATUS WHERE Db = ‘name’: Cannot load from mysql.proc. The table is probably corrupted

A quick search revealed that this is do to ‘mysqld_upgrade’ script not being run automatically against the existing database.  A quick and simple solution is to just run the script manually.  Of course, a full database backup is recommended before doing so.  Mine worked just fine though.

Bash directory bookmarks

While reading through the comments to this Habrahabr article (in Russian), I came across an excellent tip for the directory bookmarks in bash shell.  Here’s how to set it up.

Firstly, add the following lines to your .bashrc or .bash_profile file:

# Bash Directory Bookmarks
# From: http://habrahabr.ru/post/151484/#habracut
alias m1='alias g1="cd `pwd`"'
alias m2='alias g2="cd `pwd`"'
alias m3='alias g3="cd `pwd`"'
alias m4='alias g4="cd `pwd`"'
alias m5='alias g5="cd `pwd`"'
alias m6='alias g6="cd `pwd`"'
alias m7='alias g7="cd `pwd`"'
alias m8='alias g8="cd `pwd`"'
alias m9='alias g9="cd `pwd`"'
alias mdump='alias|grep -e "alias g[0-9]"|grep -v "alias m" > ~/.bookmarks'
alias mload='source ~/.bookmarks'
alias ah='(echo;alias | grep "g[0-9]" | grep -v "m[0-9]" | cut -d" " -f "2,3"| sed "s/=/ /" | sed "s/cd //";echo)'

Secondly, if you are already using ~/.bookmarks file for anything, change the two references to it in the above lines to some other file.  It’s where your directory bookmarks will be stored.

Thirdly, if you prefer to save the bookmarks between your bash sessions, add the “mload” command to the end of your .bashrc or .bash_profile file, and “mdump” to your .bash_logout file.

Start a new bash shell and you are all set.

Using this setup is extremely easy.  Navigate to the directory that you want to bookmark, and save it under the numbered bookmark:

$ cd /var/www/html
$ m1

When you want to navigate back to that folder, simply call the numbered bookmarks:

$ g1

If you need to refresh your memory, issue “ah” command (think: aliases help), and it will print out the list of your current numbered bookmarks with the directory paths associated with them.

In case you need more than nine bookmarks, simply extend the lines in your .bashrc or .bash_profile file to run through more numbers, or use some other bookmark naming convention that works for you.

Enjoy.

P.S.: A quick Google search points to the author’s page, which links to a more advanced solution – bashmarks.