Category Archives: Computers

Enabling virtual consoles in OpenSolaris

OpenSolaris was lacking virtual console for a while. This support was made available since build snv_124. However, due to various bugs, it is turned off by default. To enable virtual consoles, do the following.

$ pfexec svcadm enable vtdaemon
$ pfexec svcadm enable console-login:vt2
$ pfexec svcadm enable console-login:vt3
$ pfexec svcadm enable console-login:vt4
$ pfexec svcadm enable console-login:vt5
$ pfexec svcadm enable console-login:vt6

To enable hot keys for switching virtual consoles, do the following.

$ pfexec svccfg -s vtdaemon setprop options/hotkeys=true
$ pfexec svcadm refresh vtdaemon
$ pfexec svcadm restart vtdaemon

Console security is enabled by default. What it means is that if you leave a virtual console and move to another one, the previous virtual console will be locked and you will have to provide the password to unlock it. If you don’t like that, turn the security off.

$ pfexec svccfg -s vtdaemon setprop options/secure=false
$ pfexec svcadm refresh vtdaemon
$ pfexec svcadm restart vtdaemon

If you have already logged into an X session while doing this, logout and wait for Xorg to restart. After that, you should be able to switch between the virtual consoles by pressing the hotkey Alt + Ctrl + F#, where # => 1 to 7. Console 1 is the primary console, 2-6 are virtual consoles and 7 is the Xorg.

Random links for week 50

  • We were troubleshooting an interesting problem with GCC/gdb that caused gdb to report an argument passed by reference as if it was passed by value. In the process, I was digging up some DWARF information. Ever wondered what exactly gcc is adding to support the debuggers when you use ‘-g’ switch? Michael J. Eager has an excellent “Introduction to DWARF Debugging Format” article.
  • I Found that Sun Studio dbx can handle binaries created by GCC with DWARF-2 debugging information very well. Sun Wiki has a page describing the DWARF differences between Sun Studio and GCC compilers.
  • Last week, the launch of Russian missile, Bulava caused quite a stir in Norway. Russian strategic nuclear forces blog claims that the test was a failure. However, I see some comments that suggests that the spiral motion was a feature instead of a bug. Here is the video of one of those UFO (later identified as Bulava) sightings.
  • To include a little more variety in my exercise routines, I am planning to include some Plyometrics. Currently, I am improving my weighted squats by going for high intensity squats. Squats is one of the exercise that I hate. However, in terms of fitness routines, I find doing something that I hate pays off very well.

Random links for week 46

  • Editing big chunks of text in Firefox text area is a pain. I am using “It’s all Text” Firefox add-on to edit text from a text area in external editors like Emacs, Vim, etc. I have configured my add-on to use emacsclient. I use this heavily when I have to edit text in TWiki, Bugzilla, WordPress, etc. This post is written in Emacs using this add-on.
  • Speaking of TWiki, I discovered last week that there is an Emacs major mode for editing TWiki markup. It is erin.el, named after Erin Gray. It has some WYSIWYG capabilities and a markup sampler. I will start using it to see how useful it would be.
  • I started using Org-babel, that lets you to execute source code in various languages within Org-mode documents. It is really cool! It can also do cool syntax highlighting in the exported files.
  • I store my daily weight measurements as an Org table in Emacs. I was using Gnuplot to plot these values to track progress. Last week, I learned about R project and started experimenting a bit with it as well. Data visualization really helps.
  • From next week, I am adding HIIT cardio sessions to my exercise routine. I am going to have my HIIT sessions on non-lifting days, which seems to be the most recommended strategy. I don’t love cardio as much as lifting weights. But, I am eagerly looking for experimenting with HIIT.

Fix mouse cursor jumping to top left corner of screen on OpenSolaris

Update 2009-11-07: This issue is fixed in OpenSolaris build snv_126.

OpenSolaris dev repository update snv_116 introduced an XOrg bug that caused the mouse cursor to jump to the top left corner of the screen very frequently. Apparently, there is some floating point math issue is involved using MMX/SSE2 instructions. I was living with the workaround posted on bugzilla. I was hoping that the bug would soon be fixed in the subsequent updates. Yesterday, I updated to build snv_122 and found that the issue still exists. Hence, I am posting about the workaround to fix this issue.

$ pfexec bash
# cp -p /usr/X11/bin/i386/Xorg /usr/X11/bin/i386/Xorg.orig 
# echo 'xf86SigioReadInput+9?w 770f 9090 9090' | mdb -w /usr/X11/bin/i386/Xorg

This bug is currently tracked in bugster.

Per-user Mercurial Installation

Recently, I had to install Mercurial on one of our Solaris 10 development machines without root access. The installation procedure was a little bit tricky. So, I thought it would be helpful to share the experience.

First, I downloaded Mercurial source and extracted it. This is a standard procedure for installing any package from source.

$ wget http://mercurial.selenic.com/release/mercurial-1.3.tar.gz
$ tar -zxvf mercurial-1.3.tar.gz
$ cd mercurial-1.3

The installation mechanism is directly controlled by the Makefile. Per-user installation can be selected by choosing Makefile target install-home, install-home-bin or install-home-doc. The target install-home is a collection of install-home-bin and install-home-doc targets. The target install-home-bin builds/installs Mercurial binaries and the target install-home-doc builds/installs Mercurial documentation. To build the documentation, we would need ASCIIDOC and XMLTO. So, I decided to skip building the documentation. The target that I chose was install-home-bin. The installation prefix can be controlled by the environment variable HOME.

The build process uses C compiler to compile Mercurial extensions written in C and linker to create the shared libraries. We need to specify the desired compiler and linker through CC and LD environment variables respectively. When using GCC, we need to specify CFLAGS to build relocatable objects. If the Python library is located in a non-standard location, we have to specify LDFLAGS appropriately as well. Here is how my compilation line looked like.

$ make install-home-bin HOME=/home/praveen/chaos.SunOS CC=gcc CFLAGS="-fPIC" \
    LDSHARED="gcc -shared" LDFLAGS="-L/opt/csw/lib -Wl,-R/opt/csw/lib"

Read more »

GNOME Metacity dual screen issue in OpenSolaris 2009.06

With the latest OpenSolaris 2009.06, maximizing windows managed by Metacity (GNOME) will maximize the windows across both screens. This is due to an issue that Metacity was trying to use a wrong Xinerama type. This issue is fixed in the mercurial repository. However, the fix was not on time to make it into the final release of OpenSolaris 2009.06. But, there is a quick workaround for this issue. Here is the set of instructions.

Step 1. Backup your current metacity.

$ pfexec cp /usr/bin/metacity /usr/bin/metacity.orig

Step 2. Download the fixed Metacity binary from developer’s site and replace the original binary.

$ wget http://www.gnome.org/~erwannc/bugs/8748/metacity -O /tmp/metacity
$ pfexec cp /tmp/metacity /usr/bin/metacity

Note: Don’t do this in one step using wget -O /usr/bin/metacity. This broke my system.

Step 3. (Optional) By now, your new Metacity should have already started working. If not, replace the current instance by hand.

$ metacity --replace

Happy dual-screening on your OpenSolaris 2009.06!

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 »