Thursday, July 16, 2009

s/screen/tmux

I've replaced GNU Screen with tmux as my preferred terminal
multiplexer. The main reason is that the defaults are better in tmux
and I don't have to worry about setting up a config file. For
example, with screen, I need a (rather simple) configuration file
to get the status line that I get with tmux by default. I also like
Ctrl-b better than Ctrl-a used by screen as Ctrl-a is a heavily
used key combination (emacs, terminals with emacs-like line editing
etc).

tmux seems to use less memory than screen and for me this is be a big
plus as there is very little RAM left on my VPSs when running the
various fastcgi and squeak processes.

The code for tmux is arguably better than that of screen and it is
under a BSD license. Recently it was imported into the Open BSD
base system. This is what Theo had to say about the software:
The most impressive thing about tmux, in my view, is how
frustrating the code audit was. In 2 hours, I found only one
or two nits that had very minor security consequences. It was
not accepted into the tree based on license alone. It is high
quality code.
Here's an interview with the author of tmux:

Sunday, July 12, 2009

s/GCC/Clang

I've been using Clang as a drop-in replacement for GCC for compiling C
code and so far it has been pretty good. While I did not see any
drastic increase in performance of the generated code, the compile
times have come down considerably. For example, compiling a fresh tree
of the latest emacs pretest took 1m55s using GCC on my quad-core
box. The same test with Clang took just over a minute. Other things
that I've built using Clang that are working well without any problems
include: GNU Smalltalk, cmus, tmux and a whole bunch of stuff.

Clang is a C/C++ and Objective-C frontend for the LLVM "compiler
infrastructure". As of now, the C and Objective-C frontends have
reached production quality on x86 and x86-64. The C++ frontend is no
way near completion and is not expected to be complete in the near
future.

Apart from the compilation speed one other feature that is in favour
of Clang is the shockingly expressive diagnostics. Along with the
message, the exact code fragment that is causing the problem is also
shown. If the C++ frontend is able to provide this feature and I'm
sure it will as it is a fundamental goal, this feature alone is going
to propel the adoption of Clang. GCC sure does have its place thanks
to the support of other languages like Ada, Fortran, Java, Pascal
etc. However Clang improving at this rate is surely going to supplant
GCC atleast on the primary hardware platforms. The BSDs in particular
are quite keen on replacing GCC as is evident from the funding of the
development of the Portable C compiler. With Clang already compiling
the kernel source and 99% of the userland, FreeBSD is seriously
considering replacing GCC with Clang in the base system. I think it is
just a matter of time.

An excellent intro to Clang can be found here:

Clang features can be found here: http://clang.llvm.org/features.html

Instructions for building Clang can be found in the Clang Getting Started
page. In addition to the instructions given there, I added
--enable-optimized to the configure script when building llvm to avoid
building the debug versions as they tend to take up a lot of disk
space.

Building programs with Clang is easy. It comes with a gcc compatible
driver called "clang" so all you need to do is to make sure
llvm/Release/bin is in PATH and run configure as

CC=clang ./configure

LinuxMint 7 "Gloria"

It's been six months and time for change. I’ve switched from OpenSuSE
11.1 to Linux Mint 7. Prior to that I was running ArchLinux for a year
and it was a solid distribution with a fantastic package manager. But
after Chip Magazine came out with the 11.1 DVD I wanted to try out
OpenSuSE 11.1. OpenSuSE, overall, has been mostly stable for me and I
loved the artwork. While things like package upgrades were efficient
through the use of binary (x)deltas, the package manager itself drove
me nuts. It was way too slow on my not-so-fast connection. Over the
course of six months, I had to install a few packages from the build
service which prompted me to add a few additional repositories. Now
everytime the package manager was launched it tried to refresh the
package list. While I understand the reasons it simply was
annoying. Sometimes the refreshing would simply hang. So everytime I
had to hit Skip Refresh after launching the package manager and the
whole exercise was irritating.

Another reason was the PulseAudio sound system. This caused the
biggest pain and I din't manage to resolve the problem. Sound input
never worked and the output volume was too low. To add to the misery,
I had a skype meeting and the webcam was not working. While the camera
was picked up the device /dev/video0 had permission issues. I'm sure
these things can be fixed after enough googling but I simply didn't
have the patience for it. I had issues running virtual machines under
KVM.

Finally, my / partition had grown to 80% of its size which is a signal
that enough cruft has accumulated on my system and that usually is
when I switch to another distro :)

I had been watching the progress of Linux Mint and when 7 came out I
decided to switch. Thanks to its Ubuntu base, installation was a
breeze and post-install, I didn't have to hunt for codecs as the
installed mplayer played most of the videos I threw at it. Artwork is
as good as OpenSuSE's and even the menu was very similar. The
"mint-green on dark" theme looks very nice and overall it's a lovely
green desktop.

The package manager (mintInstall) has a list of "featured"
applications for things like Adobe Reader (stay away from it!), Skype,
VLC, Audacity etc. Handy.

Audio is still controlled by PulseAudio but on Mint7 there was a
control panel to control it and I was able to adjust the output to an
audible level. Sound input is still not working. Skype picked up the
webcam and that is a relief.

Overall, I really like the system. Boots fast, plenty of packages
thanks to Ubuntu and Debian underneath, nice green desktop, KVM
virtual machines not complaining. Happy!

Saturday, July 11, 2009

9x18

I was looking for a bigger font for my terminals as 6x13 was starting
to look too small on my display. For terminals, I prefer the crisp and
sharp appearance of bitmap fonts although Envy Code R is not bad at
all. Ctrl-Rightclicking on XTerm gives you a menu where you can select
a large font which turns out to be 9x18.

Originally part of the ucs-fonts package, the font got merged into
core X distribution. This is what the website says about the font:

9x18 is an improved version of 9x15 that has more space above and
below the base characters to increase readability and to allow
overstriking combining characters to work properly.

Indeed, the font is nice and tall (although some may say spindly) with
a good inter-line spacing making it a good choice for terminals. Also
the font has a good coverage of characters. For example, it includes
all mathematical symbols, smiley and even chess pieces (terminal based
FEN viewer anyone?)

-Misc-Fixed-Medium-R-Normal--18-120-100-100-C-90-ISO10646-1 is the
actual XLFD 9x18 is aliased to but on my machines (Ubuntu and
OpenSuSE), the fonts.alias file did not have the entries so I had to add
them manually.

Versions of -misc-fixed family are also available for Windows. My cmd.exe
windows use 6x13 giving me plenty of lines of clear text.

Monday, July 06, 2009

...

For the last two weeks, I've been down with chicken pox. While the first
10 days were pretty bad things are improving as I'm finally off of curd
rice and raw onions and slowly getting back to eating some tasty food.

This little period of rest is a god-send for me as I was getting worked
up at work and an ever piling reading list adding to the irritation. The
last few days, apart from reading, the tool seeker in me has found some
really cool tools and when you start dreaming of use cases for these
cool toys and tools, the pain and the irritation just vanish. Hopefully,
I shall blog about them here this week as I'll be quarantined for atleast
another week.