Monday, November 9, 2009

Play Tetris in Emacs!

One finds every now and then something surprising in any installed Linux system. For several years I have known that with Emacs one can do just about everything one really needs to do with a computer. Well, at least if you don't want to edit video clips or compose music with it.

Today I realized that it is possible to play Tetris using the XEmacs of my Debian box. Just type ESC x tetris and you are ready to forget coding or writing your next article for the top journal of your field!

Sunday, November 8, 2009

Uncompress files using CLI

I usually uncompress all kinds of packaged files from the command line. Unfortunately, I rarely remember which command line tool I should use for some specific packaging format. It is even more difficult to remember all the options needed for the appropriate tool.

Now that I found a cool hack in the ArchWiki, I never need to look for more information about how to uncompress a .tbz2, .tgz or .bz2 file -- I just use extract filename.

Add the following snippet of code to your .bashrc and you are ready to extract any file (if your system has the corresponding tool installed).


extract () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xvjf $1 ;;
*.tar.gz) tar xvzf $1 ;;
*.tar.xz) tar xvJf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xvf $1 ;;
*.tbz2) tar xvjf $1 ;;
*.tgz) tar xvzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*.7z) 7z x $1 ;;
*.xz) unxz $1 ;;
*.exe) cabextract $1 ;;
*) echo "\`$1': unrecognized file compression" ;;
esac
else
echo "\`$1' is not a valid file"
fi
}

Tuesday, November 3, 2009

Less time spent hacking means more time for studies!

It's been a while since my last blog posting. During the last two months I've spent most of my hours awake studying economics and finance with little time left for following the open source news or testing distributions and applications.

At the moment I use two desktop systems simultaneously. One of them is an old Pentium box running Debian stable and the other is an eMac with OS X. During the last two months I've become more and more OS agnostic, the OS itself is not as important as the fact that I get things done using whatever system and software I use either because I chose it or because the school policy forces me to use the software.

Unfortunately, I have noticed that using a couple of years old version of Excel for OS X is not a substitute for Excel 2007. But unfortunately for me, I cannot learn to write Visual Basic macros using OpenOffice.

During the last two months, most of my "real" computing was done with GNU Octave. It was really helpful for checking the solutions for some of the trickier problems in linear algebra. I hope I'll have time to learn more Octave during the spring when I'll take an advanced course in finance. Of course, we are expected to use Excel and VB for the coursework, but I think learning to solve the problems using Octave could not do any harm. On the other hand, it was a pleasant surprise to see that R will be used for advanced econometrics. I looking forward to participating in the course!

Tuesday, September 8, 2009

Using a mixed environment - OS X and Debian

Some time ago, I wrote about my first experiences with an old eMac I got from my parents. I've been pretty happy with the system, even if the OS X 10.3.9 is not as fancy as the latest incarnations of this extremely user friendly OS.

I decided to keep the best of two worlds: I kept the OS X installed (no Debian or NetBSD on this system!). Thus I can still use Excel that is unfortunately absolutely necessary for anyone studying economics and business administration. Of course one can probably calculate everything with OpenOffice Calc, but using OpenOffice at home just does not help me in learning for the spreadsheet exam I have to pass using Excel in the computer lab at the school.

For word processing and some occasional hacking, I decided to install Aquamacs. For typesetting the texts, I installed MacTeX.

As I have too much old boxes in my room in the dorm, I decided not to install more open source apps in the eMac. At the moment I mostly use the Debian box (eVectra 1 GHz, 256 Mb RAM) in the console mode using a ssh connection. The box is not connected to a monitor or to a keyboard, but it does have a pair of loadspeakers for playing my collection of ogg files ripped with ripit. In addition, the Debian box is used for doing some math with GNU Octave.

I am sure, there are many readers who would just "liberate" the eMac but, alas, we are not living in a perfect world where we could freely decide which software to use. The world is a dirty place, just like Ivo Welch writes in Corporate Finance: An Introduction after a discussion of finance in perfect markets:

The real world is definitely dirtier than our perfect one, and you can't just close your eyes and wish you were still in Kansas.

Saturday, September 5, 2009

Lubuntu test release

Lubuntu (download) is Ubuntu 9.10 with LXDE desktop environment. FA quote from the LXDE blog:
The lubuntu project is advancing. lynxis just published a lubuntu test iso based on the seeds by David Sugar and additional patches. It is just 381 MB and a second one only 292 MB.


Lubuntu is probably interesting especially for the Ubuntu users who have been looking for a lightweight Ubuntu derivative to use on some old box.

Monday, August 31, 2009

Wordgrinder -- Word Processor for the Linux Console

One of the few things I miss from the years when I used MS-DOS is WordPerfect 5.1. It was a perfect application for writing and few WYSIWYG word processors if any have been as userfriendly as WP was. For the last seven or eight years I've been constantly looking for a perfect word processor. I have used KWord, Abiword, OpenOffice, LyX and even Emacs for writing. Sometimes, I have planned to install a copy of WordPerfect under FreeDOS just to recreate the simple desktop with no distractions like Firefox. But there were, of course, things like Tetris and Civilization that sometimes kept me from writing for days.



Today I decided to test yet another Linux word processor -- WordGrinder is probably the one and only console mode word processor that exists for Linux. It is as simple as it gets, but not too simple. WordGrinder uses a binary format for its files, which makes them unreadable for ordinary text editors. It can, however, export the files to plain text and html. The latest version (0.3) should even export the text to LaTeX and troff for the geekiest users. Unfortunately, my Debian still has the version 0.2 that does not support all of the fancy stuff mentioned in the web site for WordGrinder.

Friday, August 28, 2009

Slackware 13.0 Released!

Slackware is the oldest surviving Linux distribution. Now Patrick Volkerding has released version 13.0 of this distribution that aims to keep things simple.

The biggest news in the release announcement is the addition of the official 64-bit port. Of course, this should not be very exciting for the readers of Lightweight Linux as we are happy to continue using our 32-bit hardware. In addition to the KDE4.2.4, Slackware 13.0 provides the users with XFCE 4.6.1. And of course, you can always choose to install some of the lightweight window managers if you intend to use Slack with an old computer.