Tag Archives: tips

Setting up FTPS using vsftpd for WordPress plugins auto upgrade

One of the handy features in the latest WordPress is the support to upgrade plugins in one click through the WordPress administration interface. It needs FTP or FTPS access to the server where you have hosted your WordPress installation. But turning on FTP for users (non-anonymous) is a bad idea. Using FTP involves transferring user passwords as plain text during authentication. This is a great security concern and the primary reason for why one shouldn’t turn on FTP for user accounts. However, WordPress also supports FTPS, FTP over SSL. This shouldn’t be confused with SSH FTP or Secure FTP. FTPS uses TLS or SSL for authentication and commands. Let us see how to setup FTPS on a server using vsftpd.

Step 1: Install vsftpd

Using the package manager for your distribution, install vsftpd. On Debian and Ubuntu, it can be installed by the following command.

$ sudo apt-get install vsftpd

Step 2: Configure FTPS

Edit /etc/vsftpd.conf and do the following.

Read more »

Turning off loud system beep in OpenSolaris Gnome and GDM

Since OpenSolaris started using Gnome 2.24, I started getting loud system beeps those were produced on the PC speaker device that by-passes the audio device. Gnome uses kbd to generate this beep. This beep is so loud that it is really annoying. Also it hurts one’s ears when listening to music using a headset. The volume of the beep can’t be controlled by the system volume control. To turn off the beep or control the volume, one must use the xset(1) utility. The beep can be turned off by issuing the command xset -b or xset b off in (Gnome) terminal. One can also control the volume through xset b . However this is not persistent across logins. You will lose this setting once you log off and log on. Theoretically adding this to ~/.xprofile should work to make it persistent. It used to work till snv_101a. However for unknown root cause, it doesn’t work anymore.

Gnome:
In order to make this persistent, one should edit the Gconf properties for Metacity. First install the SUNWgnome-config-editor package by issuing the command pfexec pkg install SUNWgnome-config-editor. Then invoke gconf-editor from a terminal. Go to apps -> metacity -> general and uncheck audible_bell property and exit gconf-editor. This should disable the system beep for all applications under Gnome and make the change persistent.

Turn Gnome sytem beep off

Turn Gnome sytem beep off

Read more »

Identifying what is holding up your boot speed in Linux

For a while now, I was not happy with the speed my Debian GNU/Linux booted. It was taking approximately 1:10 minutes to drop me in the GDM prompt. Today, I decided that I will try to probe into what exactly is happening. I have already heard of bootchart a few years ago. However I never had a chance to use it. So, I installed bootchart. I am not going to talk in detail about the installation. It is available in Debian and Ubuntu repositories. If you are using some other distribution, you can either find it in the repository or compile it from the source.

After installation, reboot the system and add 'init=/sbin/bootchartd' to the 'kernel' command line arguments in Grub. This will use bootchartd as init and bootstartd will in turn start the original init. If alternative init environment like init-ng is used, there might be additional arguments needed. Please consult the bootchartd man page for more information. Once the systems boots, the data collected is available in /var/log/bootchart.tgz. Run bootchart to generate bootchart.png from /var/log/bootchart.tgz.

After doing this, I figured out that udevadm is taking almost 30 seconds. I later figured out that the udev rule that tries to rename 'wlan0' to 'eth1' is the culprit (search on Google). Then I commented the 'eth1' line in /etc/udev/rules.d/70-persistent-net.rules, rebooted and did the bootchart thing again. I was happy to see that a portion of around 30 seconds is now removed from my boot time. That’s great!

Before udev fix After udev fix
Bootchart before udev fix Bootchart after udev fix

Modifying Control and Caps Lock keys under OpenSolaris and Linux

Since I started using Emacs, I started using the Control key more than I had used it before. That is when I started using my Caps Lock key as Control key. In the beginning, I swapped the Control key and the Caps Lock key. However while doing pair programming on my computer, my colleagues found this setup a bit unfriendly. So, I decided to give up my Caps Lock key and started using Caps Lock as an additional Control key. Under Linux, Gnome has an option to do this using the “Keyboard Preferences” application. However I was not able to find this option in OpenSolaris Gnome. So, I have to take the old xmodmap way of doing this. This works under Linux as well. I hope that this would work on all UNIX variants that uses xmodmap. But I haven’t verified it personally.

To make Caps Lock key as an additional Control key, add the following to .Xmodmap file in your home directory. This configuration is automatically applied when you restart your X (Gnome) session. For the first time, you can manually apply this by running xmodmap ~/.Xmodmap.

!
! Make Caps Lock as an additional Control.
!
remove Lock = Caps_Lock
add Control = Caps_Lock

Please note that ! is the commenting character for xmodmap files.

But if you want to retain the Caps Lock function and swap it back to Control key, add the following to your .Xmodmap file.

!
! Swap Caps Lock and Control.
!
remove Lock = Caps_Lock
remove Control = Control_L
keysym Control_L = Caps_Lock
keysym Caps_Lock = Control_L
add Lock = Caps_Lock
add Control = Control_L