M-x Kelsin

Posts

Install Xmonad on Debian Lenny

Date
Monday, February 23, 2009 at 10:36 pm
Tags
linux debian xmonad xmobar haskell

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:

  • It can install it's packages into my home directory. Binaries in ~/.cabal/bin and all libraries needed.
  • These libraries take precedence over system installed ghc libraries.
  • No non-stable packages are needed at all.
  • Installs the most recent versions of xmonad, xmonad-contrib and xmobar and any libraries they need.
  • 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!

Htmlize bug or How I formatted my code from last post

Date
Monday, February 23, 2009 at 10:50 pm
Tags
emacs htmlize code

I recently stubled across this post where Ruslan outlines a great custom Emacs function for slightly editing htmlize output for blog posts. The only problem is the current htmlize doesn't work with cvs Emacs which I am using.

Luckily I found the bug report. Hopefully this gets in to htmlize soon. For now my solution is to download htmlize.el and change the line that the bug report mentions:

for f = face then (face-attribute f :inherit)

becomes

for f = face then (or (face-attribute f :inherit) 'unspecified)

After doing this I just added a slightly edited version of Ruslan's function with a load-file command to load my custom htmlize.el (over the version included with Debian's emacs-goodies-el package). My changes remove the font size setting, set overflow: auto and added a padding: 5px to the pre tags.

;;; Function to format buffer for a blog
;;;
;;; Edited to not set font size,
;;; set overflow: auto and add padding
(defun my-htmlize-region (beg end)
  "Htmlize region and put into <pre> tag style that is left in
   <body> tag plus add font-size: 8pt"
  (interactive "r")
  (let* ((buffer-faces (htmlize-faces-in-buffer))
         (face-map (htmlize-make-face-map (adjoin 'default
                                                  buffer-faces)))
         (pre-tag
          (format
           "<pre style=\"%s padding: 5px; overflow: auto;\">"
           (mapconcat #'identity
                      (htmlize-css-specs
                       (gethash 'default face-map))
                      " ")))
         (htmlized-reg (htmlize-region-for-paste beg end)))
    (switch-to-buffer-other-window "*htmlized output*")
    ;; clear buffer
    (kill-region (point-min) (point-max))
    ;; set mode to have syntax highlighting
    (nxml-mode)
    (save-excursion
      (insert htmlized-reg))
    (while (re-search-forward "&lt;pre&gt;" nil t)
      (replace-match pre-tag nil nil))
    (goto-char (point-min))))

(global-set-key [(f5)]
                (lambda (beg end)
                  (interactive "r") (my-htmlize-region beg end)))

And there we go! F5 now works and htmlize's the region for quick and easy paste into wordpress!

Switching Linux's Again: Ubuntu -> Debian

Date
Sunday, February 22, 2009 at 11:55 pm
Tags
linux ubuntu debian xmonad emacs

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.

Drcox Desktop 02-22-2009

The 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-2009

I'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!

Already 2 new Wordpress plugins

Date
Sunday, February 22, 2009 at 12:42 am
Tags
wordpress widgets plugins

Already had to add some more!

Last.Fm Records

This was the best Last.Fm plugin I found. I just wanted to display like 9 album covers and that's it. This one worked first, and I tried about 6 of them before this one. Most didn't look good or didn't have an option to remove the text. I did end up editing this one though. Near the end of the file I changed "plugin.php" to "options-general.php" to move the admin menu item from the Plugins menu to the Settings menu where ALL of my other plugins put their options page.

Sociable

For a social bookmarks plugin I wanted the ability to display a list of small icons and it had to have Twitter. After searching for a while this one satisfied both requirements.

Lightbox 2

This one is pretty simple but it auto puts the lightbox affect on all images on my site. I want to find a good gallery plugin too. Wordpress image handling is very nice now but I need to find two features for my dad's site:

  1. Auto handling of thumbnails and main size. If I upload a HUGE photo, I want wordpress to store this photo. Then make two different sizes of it to display. The main size like 800x800 and then a smaller thumbnail for display on a post.

  2. I want it to be able to watermark the big photo, either on demand or saved onto it. Either way works.

Word Press Plugins

Date
Saturday, February 21, 2009 at 2:47 pm
Tags
wordpress widgets plugins

I've added three plugins to my wordpress install and I'm pretty excited about all three.

Twitter Tools

First we have a very complex twitter plugin. Along with the widget you see on the right, this plugin also manages posting to twitter when I make a blog post. I'm not using any other features but the plugin can post blog posts with every tweet, a digest of every day's tweets, or a digest of every week's tweets. This plugin does not support multiple widgets on the page (because it does so much other stuff and saves your settings outside of widget settings) but there are others that do in case you want to follow multiple twitter accounts on your blog.

WoW Armory

Second we have a WoW-Armory plugin which you can see on the right of the blog (below the twitter plugin). Very simple install and this does support having multiple widgets with different characters if that was important (eventually I will probably do that with my alts).

Related Posts by Tags Widget

This is a very simple related posts widget. It only displays on a single post's page (so click on the post title to see it in the sidebar on the right). This one is simple and just sorts by tag relations (not fancy keywords or anything). It does what I want for now and if I see related posts not syncing up I will fix it.

For now this settles my desire to install plugins. We'll see if I add any more in the future :)

iPhone Thoughts

Date
Friday, February 20, 2009 at 9:35 pm
Tags
iphone

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.

I googled a lot today about the different cell phone's and phone OS's out there and it really seems limited. Here is what I've gathered so far:

Windows Mobile / Symbian
I'm grouping these together cause I'm getting the same feel from both. It seems the OS's are pretty limited in features and while both have apps, a ton are not free and neither is anywhere close to the number of apps that the iPhone has (for normal and jailbroken phones). Reviews of phones that use these OS's seem to constantly talk about limits.
Palm
Coming out with a new OS soon but it doesn't seem to be here. Doesn't have the cool geeky features I want. Kind of looped into the above group.
Blackberry
What I would probably get if I didn't get an iPhone. Seems really strong at what it does, just doesn't do everything I want. Also suffers from the lack of app community problem that all of the above phones do.
OpenMoku
I really want an OpenMoku phone, but since the announcement the iPhone has droped in price by a lot and delivered while this phone hasn't done basically anything. They made a public release which really poor software. I wish this would get more corporate backing cause at the moment the OS is lagging behind other's big time. Most of the reviews of the interfaces that are out there all hate it.
Google Android
This actually has everything I want. Linux based, a good API, corporate backing. The problem? WHERE ARE THE PHONES! One phone from T-Mobile doesn't cut it. Seriously let's get more android phones on the market before Apple does something more that makes the current Android features seem out-dated.
iPhone
When I talk about the iPhone I only am talking about a phone that has been jailbroken. I want to ssh into my phone. I want to tether my laptop through it. I want to run NES emulator's on it. I want to look up LDAP addresses and use it as a GPS. I want to check email, I want to listen to music, I want to get cool instrument apps on it. A jailbroken iPhone can do all of that.  I'm sick of Apple's DRM and limitations but jailbreaking solves most of them. I am giving money to evil but at the same time there aren't other options that satisfy what I need to do with the phone. I REALLY want an open source phone but none give you a BSD base with OpenSSH installed yet.

Oh well... eventually maybe the phone circuit will be better, but for now with me being on AT&T currently anyway, it really looks like a jailbroken iPhone is the way to go.

Hello World

Date
Friday, February 20, 2009 at 9:25 pm
Tags

Hey guys, this is the start of my blog "M-x Kelsin". As some readers will note the title is an Emacs reference. This blog will be about a lot of stuff but I'm sure Emacs, Linux, Ruby on Rails and Music will be a big part of it. Enjoy :)

Tags

apple bash blog boston bug calendar code computer concert debian emacs email firefox food games git google haskell heroku htmlize intel-i810 iphone irssi keyboard linux music mutt os-x php plugins programming ps3 recording review rpg ruby ruby-on-rails server sinatra sync ubuntu ups wedding widgets wordpress work wow xbox360 xmobar xmonad xorg zendrum

RSS
Valid XHTML 1.0 Strict