Saturday, 29 June 2013

Change repeat rate in awesome WM

I had noticed that when you keep a button pressed in KDE it takes less time to repeat that character than when I do the same in Awesome. To get my desired behaviour, I had to set something called the auto-repeat rate option. A quick look at the manual page [1] tells us that we can turn it off either completely r for specific buttons. We can also the delay of auto-repeat and the rate of repetition, if XFree86-Misc extension of X server is implemented. Now, I had to find the delay and repetition rate values that I felt comfortable with. So, I found out the values in my KDE environment [2]. When I tried the values in Awesome, I was back in my comfort zone with the keyboard. The last step was to set the values every time Awesome started [3] and my system was all set.

[1] To see the options, try man xset, search for the option r or the string "autorepeat".

[2] The values can be found using the following command.

xset q | grep rate

[3] In the rc.lua file, just add the following line. You might want to customize the values for yourself.

os.execute("xset r rate 220 30")

Friday, 28 June 2013

Cleaning up MySQL binary logs

While analyzing disk usage, I found that /var/lib/mysql was running into gigabytes. I use MySQL for local testing. So, there is no way I can generate that much data. When I checked the folder out, there were many logs files which were eating up the space. Following the docs, clearing them was rather easy. All I had to do was run the following command on MySQL console.

purge binary logs before '2013-06-28 00:00:00';

Only one catch here: this will work only when log_bin option in my.cnf is not commented out.

Thursday, 27 June 2013

Rails not detecting iconv

Whenever I started rails console or server, I was getting the following line about iconv.

no iconv, you might want to look into it.

I tried installing iconv package followed by the gem. Yet, I was unable to get rid of the message. I was not bothered much about the message till I started using rubyzip gem for creating some archives as it requires iconv gem. The solution is quite simple actually. Just add iconv to the Gemfile and rubyzip works fine. Also, the error line disappears. Of course, this is just a by-pass to get things working. I might go for an analysis some time later. Suggestions for that are welcome.