M-x Kelsin

A Hacking Blog

Emacs as a fast $EDITOR

I’ve been using vim as my $EDITOR setting for quite some time, and recently started using emacsclient. Two things about this setup bothered me. First I would have to switch to my emacs workspace in Xmonad in order to reach the editor, and when working on svn or git commits my cursor would be where it was last time I edited a commit. Not wanting to change the way Xmonad keeps emacs windows appearing on the same workspace or the way emacs saves my cursor position I found a way around both problems.

Slow Firefox - High Xorg CPU usage - Debian and Ubuntu - SOLVED

So the past few days I’ve noticed Firefox (Iceweasel actually) being incredibly slow. I don’t know if it’s more than it was on Ubuntu or not, but it was slow. I’ve also always felt that gtk apps were a bit slow on this machine but never really bothered to understand why.

Install Xmonad on Debian Lenny

I want to install a newer version of Xmonad than packaged with Debian Lenny on my Lenny systems in the cleanest way possible. I tried a bunch of things today and it turned out that the solution is really simple.

It turns out that the Haskell cabal-install program solved all of my problems:

  1. It can install it's packages into my home directory. Binaries in ~/.cabal/bin and all libraries needed.
  2. These libraries take precedence over system installed ghc libraries.
  3. No non-stable packages are needed at all.
  4. Installs the most recent versions of xmonad, xmonad-contrib and xmobar and any libraries they need.
  5. Cabal-install itself builds with the version of ghc in Debian Lenny (this wasn't the case in previous releases and Ubuntu Hardy).

This procedure installs the newest released version of Xmonad in my home directory along with all required libraries, xmonad-contrib and xmobar. My steps I used are as follows (Please check versions for cabal-install so that the wget command is correct):

# First install ghc and the dev libraries that cabal-install needs

sudo aptitude install ghc libghc6-network-dev libghc6-mtl-dev zlib1g-dev



# Goto a temp dir and download cabal

cd ~/tmp

wget http://hackage.haskell.org/packages/archive/cabal-install/0.6.2/cabal-install-0.6.2.tar.gz

tar -xzvf cabal-install-0.6.2.tar.gz

cd cabal-install-0.6.2



# Now run the bootstrap.sh script (as your user)

./bootstrap.sh



# Make sure to add ~/.cabal/bin to your patch

# I do this via this next line in my .bashrc

export PATH="$HOME/.cabal/bin:$PATH"



# Some needed libraries to build Xmonad and Xmobar

sudo aptitude install libx11-dev libxft-dev



# Now we install xmonad!

cabal update

cabal install xmonad

cabal install xmonad-contrib

cabal install xmobar

I’m extremely happy with this setup. All of my non-packaged files are in my home directory safely away from my Debian Stable system. This is due to cabal install being able to seemlessly install into ~/.cabal which really does work great. I’m very excited for this tool to be included in ghc soon!

Switching Linux's Again: Ubuntu -> Debian

Just switched my company laptop from Ubuntu to Debian. I switch Linux’s a lot. Right now I’m doing it cause I ran into some nasty bug’s on Ubuntu. I’m sure I will be installing Ubuntu on lots of machines soon anyway, especially in April.

My work laptop's desktop as of 02-22-2009The first bug came when I first installed Intrepid. I ran into the bug where the kernel fills my logs with errors from the wireless driver. Having your root partition fill up does some weird things. Around this point I installed Hardy again to get on a more stable platform. I recently tried to update to Intrepid again (this bug was solved in a recent kernel) but ran into other issues. Just small ones.

Then I read the Lenny release announcement on Valentines day, so that set this in motion. I can’t read release notes without wanting to install something.

My work laptop is a Lenovo (IBM) Thinkpad X61s. I love this machine for work and the install went smoothly. I havn’t had trouble with installing Linux in a long time. I did hit this bug with ncmpc, but I normally disable ipv6 anyway. A quick edit of /etc/modprobe.d/aliases and /etc/hosts to comment out ipv6 stuff and I’m all set. I really want to get into Debian packaging so I might use Lenny as a reason to do so. I’ve already told myself that I will stick to stable software as much as possible for work, and use my home Desktop and Laptop to experiment with different software.

Drcox Emacs 02-22-2009I’m using my compiled xmonad from my home directory at the moment (Had cabal install everything in .cabal on Ubuntu) but when I get ghc running again I will post about it.

After that I’ve installed the sid version of emacs (along with ttf-bitstream-vera, haskell-mode, ruby-elisp and emacs-goodies-el) so that I can use emacs 23 (I rely on a lot of features from 23, the least of which is nice fonts!). I’ve also installed mpd (with mpc, sonata and ncmpc, my xmonad config relies on this). My XMonad key bindings for audio keys work again (they didn’t on Intrepid, just simple windows manager keybindings that run mpc).

The one other thing I had to do to get my system back was make sure option “XkbOptions” “ctrl:nocaps” was in the keyboard driver section of the xorg.conf file. Can’t live with my Caps-Lock key not being another Left-Control!

iPhone Thoughts

So Caitlin and I both want to get smart phones at some point. Mainly I want to be able to check email on my phone. Not only is it important for work (the biggest reason) but I’m sick of my old really bad phone.