Emacs configs and Github

November 7, 2009 Leave a comment

Its been quite a while since I last had time to write something! Well, not so much as lack of time, but maybe lack of stuff to write about. I have been working in a completely different domain for the last 3 months or so.

Anyways, one of the many things I did to keep my work environment sane and to make my emacs experience better, was to learn a bit of elisp. Then I almost threw away from the previous ~/.emacs that I had, and moved everything together in ~/.emacs.d . Now I’d say thats not the most brilliant idea, since, I made the decision and realised the backup was a week old!

However, my emacs configuration is a lot better now than what it used to be. Things are kept and maintained in a more logical order, or so I presume. Oh! and Github! I now have a real backup system, complete with delta and such.

For the more curious of you, here is the link to the public git repo of my emacs configuration directory.

So let me know how I can improve the elisp-foo in there. Also do share your own methodologies of maintaining your emacs config, the plugins and so on.

Categories: Linux Tags: ,

Managing my windows

May 17, 2009 4 comments

Hah, what a joke. I have been using XMonad for about a year now (well I kept trying different things in between, but came back to it everytime). The most prominent ones (based on how long I used it) other than XMonad are StumpWM, Awesome (2.x) and Openbox.

This morning however, I was particularly inclined to give ratpoison a try once more. Yes, its StumpWM old stable, but still I thought that since I know C better than Lisp, I might enjoy the experience after all. An hour later of searching through DeviantArt for beautiful ratpoison setups to inspire me, I came across ScrotWM (sounds awkwards I know). It is in AUR, so a makepkg later I was ready to run a spanking new WM, which turned out to be quite a disappointment since xft fonts won’t work, and google didn’t turn up enough documentation. Hell, it aint any different from Awesome and XMonad either.

So, I was getting cosy with a decent ratpoison setup, and a problem with gaps showing up alongside the terminal borders, led me to google and finally to Musca. Yet another window manager. Phew. The developer apparently inspired from dwm and ratpoison, tried to combine the best of both worlds. Guess what, its got a huge thread in the Arch Forums too. How come I didn’t notice it earlier?

So then, as it turns out, Musca is ratpoison (or StumpWM for that matter) with the keybindings done right. MPlayer has some problems getting fullscreen, till I used -fstype=none (yea my friend google told me that), made an alias to set it right once and for all. Its written in C, and only 1 file! Tried reading the source, not much luck there though.

Hence, Musca stays on my system for the time being, and till I re-energise myself to configure it to my hearts content, I am back to XMonad.

Categories: Linux Tags:

Idling at home!

May 15, 2009 1 comment

In between browsing stackoverflow and going back to watching movies, at times I feel like writing something. Well not literature per se, its coding I am talking about. I am at this strange junction where language, syntax and paradigm comes across as easilly understandable, however, none of my pet projects ever gets to see the end of it.

Its either “oh boy this database querrying stuff is boring”, or “html and css? hmm lets drop this whole web app thing”, and sometimes sudoku is too challenging while project euler isn’t interesting at all to spend an afternoon chasing maths.

I do read the programming sections in arch forums and ubuntu forums, and yes stackoverflow too, which brings me back to this feeling that despite having studied CS I dont have much coding experience. I know computational theory is quite good but we really had too much theory in unniversity.

So, for this week, I chose yet another language to take a sneak peak into. Ruby. The poignant guide is one of the most amusing texts I have read so far. I seriously hope someday studying all this languages will open my mind to a different dimension where the programming gods finally bless me and I get to complete my first pet project.

Categories: General Tags:

Live CD ain’t all that easy

May 13, 2009 1 comment

Whoa. I have been hearing about the linux-live thing for a while now, thought of using it for making a live-cd of the LFS project I was working on for the final year project. Now, while I did follow the LFS book, I wanted to ship with slightly more recent versions of the packages and ended up with kernel 2.6.29

First it complained about AUFS support not being there (yes I forgot to compile that module :P) then the linux-live script worked fine but the resulting iso would only boot into a blank screen. I wish I knew enough to find out what the actual problem was 😦

Turns out there is (was?) another live cd making script available. Larch. Though evidently it is supposed to have been made keeping Arch in mind, the site claims it is compatible with other distros too. Hmmm. Guess what I got with it?

Kernel Panic – Not Syncing: Attempted To Kill Init Error

Wonder what went wrong! Then I got a plan, lets livify the Arch that I use as my main system. 10 minutes later I was starring at the same error. Whoa. I was kinda relieved as I thought that my initscripts were at fault here.

Luckily, my project guide accepted the work without the live-cd and here I am stuck with a final year project and no idea how to show it to the rest of the world!

Categories: Linux Tags: ,

Just found NERDTree !!

February 15, 2009 Leave a comment

Thats right, a nerdtree. Pretty strange name for a plugin but I guess its quite justified if you consider only nerds use a console text editor so much as to consider turning it into an IDE, slow and steady.

Nerdtree is a plugin for vim.

vim with nedtree plugin

This allows you to browse that directory of yours and open a file in the editor.  Press ‘?’ in the nerdtree window to see what else can be done with it.

Oh and you start nerdtree with “:NERDTree”.

Categories: General Tags:

What time is it?

February 9, 2009 Leave a comment

People using a panel probably has a clock somewhere in there. I know I did, when I used gnome-panel and then later pypanel/tint2 with openbox. Recently, though, I changed to pure openbox, with no panels and system tray. Yes, thats kinda boring, but I still use an old 15″ CRT display and screen real estate is something I don’t like to waste.

Now, while openbox’s key bindings took care of my window managing needs, I started missing the small little clock at the corner. I had conky set up just to display the time and date, but more often than not, it was under the browser or the pdf I was glancing through.

A panel, just for the sake of a clock? Nah thats just preposterous. Then I realised that I already had xbindkeys running, for the mpd controls and all that. So I wrote a really-tiny-little script that displays the time, date and battery for 5 seconds and then goes away.

For the time being, its just a shell script running in an urvtc instance. Maybe someday I will put it in zenity or something like that. However, for what its worth, it shows me the time at a key press, and lets me carry on the good work.

#!/bin/zsh
echo “DATE :: $(date +”%Y, %dth %B – %A”)”
echo “TIME :: $(date +”%r %Z”)”
echo -n “BATTERY :: $(acpi|grep -Eo “[0-9%,:]{3,}”|tail -n1)”
sleep 5
exit

Nice and easy, and a proof of the insane customizability of a linux desktop.

Categories: Linux Tags:

Setting up slime (emacs and sbcl)

February 7, 2009 6 comments

I decided to have a go at slime again. After having tried to learn lisp for a couple of weeks last year, I decided its time I learned something job oriented and hence spent a lot more time in python and java. However, not that I am getting bored, I am back to slime :).

I never got used to emacs really, but since slime looks like the best thing for lisp, and the cusp repl somehow doesnt work for me, I took the plunge again.

Installed the emacs-cvs and slime-cvs from the arch repositories,

pacman -S emacs-cvs slime-cvs

Now, after slime is installed it prints some lines, telling you to put certain things in your ~/.emacs . Strangely though, after I started slime from emacs, the REPL didn’t look familiar!! It was different last time, only I forgot what the difference is.

And then the “comma” didn’t work. It’s supposed to bring up a command prompt but instead it just printed a literal comma! Wonders wonders…

After almost a couple of hours of googling, and trying a bunch of things, I went in to #emacs @freenode, and learnt from there that slime now doesnt even load the REPL by default, and it was only then that I noticed that I wasn’t typing at the REPL but at the *inferior-lisp* buffer. No wonder the “comma” didnt work as well as a lot of other stuffs.

So, here is how the new slime works, you got to load up the repl and other stuffs manually. Here’s the slime part of my ~/.emacs

(eval-after-load “slime”
‘(progn
(setq slime-lisp-implementations
‘((sbcl (“/usr/bin/sbcl”))
(clisp (“/usr/bin/clisp”)))
common-lisp-hyperspec-root “/home/sujoy/documents/hyperspec/”)
(slime-setup ‘(slime-asdf
slime-autodoc
slime-editing-commands
slime-fancy-inspector
slime-fontifying-fu
slime-fuzzy
slime-indentation
slime-mdot-fu
slime-package-fu
slime-references
slime-repl
slime-sbcl-exts
slime-scratch
slime-xref-browser))
(slime-autodoc-mode)
(setq slime-complete-symbol*-fancy t)
(setq slime-complete-symbol-function ‘slime-fuzzy-complete-symbol)
(add-hook ‘lisp-mode-hook (lambda () (slime-mode t)))))

(require ‘slime)

I am using SBCL, and put in these lines in my sbcl config to start the swank server automagically when sbcl starts 🙂

(require ‘asdf)
(push “/usr/share/emacs/site-lisp/slime/” asdf:*central-registry*)
(asdf: oos ‘asdf:load-op ‘swank)

; start swank
(setf swank:*use-dedicated-output-stream* nil)
(setf swank:*communication-style* :fd-handler)
(swank:create-server :dont-close t)

Well, I wrote none of this stuffs myself, mixed and matched from various configs to give me something that actually worked. Hopefully, this will save someone an hour of looking through old configs.

Categories: Programming Tags: ,

Intel graphics and other stuffs

December 30, 2008 Leave a comment

Arch got a kernel update,  kernel26 2.6.27.10-1 and xf86-video-intel is at 2.4.3-1. This seems to have fixed the issue with the TTM buffer manager in glxgears somewhat. I now get a fps of around 350, which is way better than the earlier 62fps.

However, the lag is visible just using xcompmgr along with xmonad. Transparnet urxvt seems to have problem displaying more than a couple of pages of scrolling text. Hopefully, the next update will improve it. 🙂

Transparent terminals are probably useless but still somewhat beautiful looking for an otherwise dumb tiling WM.

Yaourt broke due to some update in the AUR website, although its been fixed now. Just enter this command to update yaourt,

yaourt -S yaourt

simple, ain’t it? I just use arson though. Somehow I like to manually do a makepkg and pacman -U 🙂

Categories: Linux Tags: ,

Starting wireless from the terminal

December 21, 2008 3 comments

Wicd has always been nice to me 🙂 However, there are times when I don’t need X, and so I manually up the wireless using ifconfig and iwconfig. The Arch wiki suggests that I use network profiles along with netcfg. Its nice but for a simple dhcp or a static IP one shouldn’t have to install another app.

It was then that one user in #archlinux gave me a script to bring up the wireless interface with a simple script in rc.d. Pretty simple, clean and plays along nicely with Arch’s KISS principle I would say. I changed the dhcp to static (yes I use it at home only, so no need for dhcp at the moment), and there she comes up precious. 🙂

The usage is a simple /etc/rc.d/wifi {start|stop|restart }

No more typing in a thousand things, and I got a nice Arch way of doing it. For anyone interested, I dropped it in here, just grab the wifi file and place it in /etc/rc.d/ and offcourse make it executable.

Categories: Network Tags:

Xorg7.4 brings input hotplugging and new intel drivers

December 20, 2008 Leave a comment

The recent update in the Xorg package broke the settings for quite a few people. Xorg7.4 brings with it input-hotplugging, meaning that input devices are now detected by hal dynamically as and when they are added. Hence, the good old /etc/X11/xorg.conf now needs to be modified to be used with the new evdev driver.

Keyboard, touchpad, mouse, etc are now to be configured in hal policies, in arch its located here, /etc/hal/fdi/policy/. The wiki entry describes in detail the whole process. Offcourse you can just disable the hotplugging feature altogether, by adding the following in the xorg configuration,

Section "ServerFlags"
Option "AutoAddDevices" "False"
EndSection

Along with the change in input device configuration, the new Xorg also brings us the new intel driver, which also replaces the i810 driver for intel chipsets. And voila, glxgears no more shows the usual framerate, instead the refresh rate is displayed. It also displays an error regarding the “TTM buffer manager”, which is supposed to be fixed with the arrival of the linux 2.6.28 kernel.

So, those of you who haven’t updated their system yet, take a look around and edit the X configuration accordingly before you restart X and get into a situation where neither your keyboard or mouse works.

Categories: Linux Tags: