Praveen’s Journal

July 23, 2008

Completely clueless

Filed under: General — Tags: , , — Praveen Kumar @ 1:59 pm

On my OpenSolaris. What could be more exciting than this?

praveen@athena:~$ /opt/sfw/bin/emacs
Fatal error (11).Segmentation Fault (core dumped)

praveen@athena:~$ file core
core:           ELF 32-bit LSB core file 80386 Version 1, from 'emacs'

praveen@athena:~$ gdb -c core /opt/sfw/bin/emacs
GNU gdb 6.3.50_2004-11-23-cvs
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-pc-solaris2.11"...(no debugging symbols found)

Core was generated by `/opt/sfw/bin/emacs'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /opt/sfw/lib/libXaw3d.so.5...(no debugging symbols found)...done.
Loaded symbols for /opt/sfw/lib/libXaw3d.so.5
Reading symbols from /usr/lib/libXmu.so...done.
Loaded symbols for /usr/lib/libXmu.so
Reading symbols from /usr/lib/libXt.so.4...done.
Loaded symbols for /usr/lib/libXt.so.4
Reading symbols from /usr/lib/libSM.so.6...done.
Loaded symbols for /usr/lib/libSM.so.6
Reading symbols from /usr/lib/libICE.so.6...done.
Loaded symbols for /usr/lib/libICE.so.6
Reading symbols from /usr/lib/libXext.so.0...done.
Loaded symbols for /usr/lib/libXext.so.0
Reading symbols from /usr/lib/libtiff.so.3...done.
Loaded symbols for /usr/lib/libtiff.so.3
Reading symbols from /usr/lib/libjpeg.so.62...done.
Loaded symbols for /usr/lib/libjpeg.so.62
Reading symbols from /usr/lib/libpng12.so.0...done.
Loaded symbols for /usr/lib/libpng12.so.0
Reading symbols from /lib/libz.so.1...done.
Loaded symbols for /lib/libz.so.1
Reading symbols from /lib/libm.so.2...done.
Loaded symbols for /lib/libm.so.2
Reading symbols from /opt/sfw/lib/libungif.so.4...done.
Loaded symbols for /opt/sfw/lib/libungif.so.4
Reading symbols from /usr/lib/libXpm.so.4...done.
Loaded symbols for /usr/lib/libXpm.so.4
Reading symbols from /usr/lib/libX11.so...Segmentation Fault (core dumped)

praveen@athena:~$ file core
core:           ELF 32-bit LSB core file 80386 Version 1, from 'gdb'

June 14, 2008

Modifying Control and Caps Lock keys under OpenSolaris and Linux

Filed under: General — Tags: , , , — Praveen Kumar @ 4:07 pm

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

March 29, 2008

Remote file editing on GNU Emacs using TRAMP

Filed under: General — Tags: , , — Praveen Kumar @ 7:54 am

I have been using GNU Emacs for programming for nearly 9 years now. It is exciting to keep discovering new extensions to Emacs throughout. I have heard of Ange-FTP before that can be used for remote file editing using FTP. However, I have never tried remote file editing on a local Emacs session. In most of the scenarios, I was dealing with editing files on the remote machines by invoking Emacs locally on those machines. But this time, I felt that invoking GNU Emacs (22) on my tiny VPS would be an overkill. So, I decided to try out remote file editing from a local Emacs session.

Even though I knew that I can do this with AgneFTP, I didn’t really care to read the info about it as I don’t run FTP on my server. The first hit on Google when I searched about remote file editing on Emacs was TRAMP (Transparent Remote [file] Access, Multiple Protocol). I am using GNU Emacs 23 trunk snapshot. TRAMP is included by default in GNU Emacs 22+. Configuration of TRAMP was quite simple. I had to load the module and set the protocol for remote access. Just a two liner in my .emacs did the trick.

(require 'tramp)
(add-to-list 'tramp-default-method-alist '("praveen.kumar.net.in" "" "ssh"))

The three entries for tramp-default-method-alist element are host, user and protocol. You can fill in the host, the user or both. Another interesting use of TRAMP is editing files as root on local machine. This can be quite handy as well. Take a look at TRAMP user guide for full configuration options. Once I added these lines, I was able to open /home/praveen/.bashrc on my server using the file name as /praveen.kumar.net.in:~/.bashrc in the normal find-file (C-x C-f) function. Happy remote editing!

Powered by WordPress