[ Content | View menu ]

Distro-hopping!

I have just finished compiling the list of OS’s I want to try at some point. When I get a new laptop I’ll try a few of these and stick with each for a few days at least - however I don’t expect to stick to any of them because I just really like Arch.

I’m sure there is a distro-hopper in all of us. What I like is that I can try a distro, find a feature I liek and, almost certainly, implement it on another distro. This means that without having to reinstall everything on my computer, I can just change a bit of it to get the feature I want. Well, here is my list:

  1. Linux:
    • Debian
    • CRUX
    • Slackware
    • Gentoo
    • LFS
  2. BSD:
    • FreeBSD
    • OpenBSD
    • NetBSD
    • DragonFlyBSD
  3. Other:
    • ReactOS
    • MenuetOS

Filed in Linux, under , , on May 16, 2008
0 Comments

Roll over “Hello, world!”.

“Hello, world!” is the standard sanity check for programming. It checks that the user is competent, and that the compiler/interpreter is working properly. It is traditional, and has been in use for a very long time, however, it is also boring. If you look in any programming textbook, it will start you off with “Hello, world!”.

Now, me and a few other Linuxers (Archers, to be specific) think that this is way too boring and common. We don’t want something that every script kiddie and his grandma is implementing, so a new program was suggested: “Arch is the best!”.

The project had a rapid initial growth, and has been ported to 35 programming languages, with a total of 60 implementations, and has been translated into 19 different (mostly) human languages. The growth is slowing somewhat now, but still quite fast. I hope that “Arch is the best!” will eventually replace “Hello, world!”, even if just for Archers.

“Hello, world!” is boring! Be different! Be exciting! Be new! Use “Arch is the best!”! Now, go forth and spread the word of Arch’s superiority!

Arch is the best! Website

Filed in Linux, under on May 15, 2008
0 Comments

Why do people say the untrue?

I have often wondered why people say that Linux terminal commands are unintuitive. Let us look at the following commands, and I shall explain where their names come from:

  1. ls = list
  2. cd = change directory
  3. sudo = super user do
  4. pwd = print working directory
  5. chmod = change mode
  6. chown = change owner
  7. And so on, and so forth.

As you can see, all the commands are a very simple acronym. Well, except the ones it is assumed that any competent person will be able to understand anyway, such as ‘echo’, which echoes text to the screen.

I have no sympathy for people who come to Linux from Windows, only to leave again and complain that the ‘unintuitive’ terminal commands are what scared them away. What, did you expect Linux to be a free version of Windows? Well, it’s not. You could set up a series of aliases in Bash to enable the usage of Windows terminal commands, and make it look like Windows, but at its heart it would still be a Linux system - a beast quite different to that of a Windows system.

Oh, and before I stop writing, Arch is the best!

Filed in Linux, under , , , , , on May 14, 2008
1 Comments

Kernel Update Woes

Last night I installed a kernel update and, well, performance has not been optimal, let’s just put it like that. I have had quite a few program crashes, and the computer seems to be using a bit more RAM. Also, the upgrade broke my installation of the opensource ATI driver - I have had to switch back to vesa which is, obviously, not as good.

One thing that scared me the most was that the upgraded kernel refused to recognise my portable harddrive, the one I store all of my stuff on. It recognised my second portable harddrive, which only has a few files on, but not the one I use for everything. I had to leave it plugged in for half an hour before an entry in /dev/ was created for it, though now it seems to be working perfectly.

All in all, not a very smooth upgrade, though I hope modified packages for the new kernel (such as radeon drivers) wil be issued soon-ish, so I can get my system to where it was before.

Filed in Linux, under , , on May 13, 2008
0 Comments

Laptop is out of action

I had the wonderful idea of cleaning out my laptop earlier. I look it to bits and cleaned it. It is amazing how much dust was inside! After seeing it all I am amazed it didn’t overheat faster that it already did. The fan couldn’t actually move for thick dust between it and the processor’s heatsink.

Anyway, after removing mountains of dust from this old and in need of replacement laptop, I tried putting it back together. Tried being the key word here. There are four wires connecting the top of the case to the bottom, one of them is a long wire so it was easy. The other three are very short and my fingers aren’t thin enough to put them back in.

So I am sat here using my desktop computer, with a useless laptop next to me. I have a long pair of tweezers somewhere, I shall look for them tomorrow. If I can’t find them, and therefore can’t put my laptop together, I shall continue using my desktop. Which, if you care, looks like this:

Screenshot: Openbox

Luckily, my dad has said he will reward me after my GCSEs (so in a few weeks time) by getting me a new laptop. I eagerly await that date!

Filed in Computing, under , , on May 11, 2008
0 Comments

dzen & dmenu

I have been fiddling with my laptop recently and have just set up two must-have programs for minimal users, dzen and dmenu. dzen is a status bar that displays whatever is sent to it on standard input, so it is a useful output for monitoring programs. dmenu displays a simple menu that accepts a list of options seperated by newlines on standard input, and echoes the selected output on standard output.

dzen

I decided to use the output of conky-cli as the standard input for dzen, as I knew the .conkyrc syntax and could quite easily modify it to my needs. I found a pretty good starting .conkyrc on the Arch forums. I edited it a little, and ended up with this:
background yes
update_interval 0.5
use_spacer none
no_buffers yes

TEXT
< Processor: ${cpu cpu0}% | RAM: ${mem} of ${memmax} | Swap: ${swap} of ${swapmax} | Load: ${execi 5 /usr/shbin/load} | Battery: ${execi 5 /home/barrucadu/battery.sh} >

Here is my /usr/shbin/load script:
#!/bin/bash
uptime | grep -o -E "load average:(.*)" | sed 's/^load average: //'

And here, is my /home/barrucadu/battery.sh script:

#!/bin/bash

echo "#!/usr/bin/python" >> battery.py
echo -ne "print round((" >> battery.py
echo -ne `cat /proc/acpi/battery/BAT1/state | grep "remaining capacity:" | sed "s/remaining capacity: //" | sed "s/ mAh//" && \
cat /proc/acpi/battery/BAT1/info | grep "design capacity:" | sed "s/design capacity: //" | sed "s/ mAh//"` | sed "s/ /.0\//" >> battery.py
echo ".0)*100), \"%\"" >> battery.py
chmod +x battery.py
./battery.py | sed "s/.0 %/%/"
rm battery.py

Not the most elegant of solutions, but it works great. I have a simple status bar showing my CPU usage, RAM, swap, load averages and battery life.

dmenu

For dmenu, I created a series of files - the names of which correspond to actions on the menu. I then created a "commands" file which contains a pairing of menu options to commands. Here is my dmenu.sh file:
#!/bin/bash

cd /home/barrucadu/menu/
dmenu="dmenu -nb #000000 -nf #ffffff -sb #000000 -sf #aaaaff -fn snap"
dmenu_submenu=`$dmenu < Categories`
dmenu_program=`$dmenu < $dmenu_submenu`
dmenu_execute=`cat Commands | grep "$dmenu_program: " | sed "s/$dmenu_program: //"`
$dmenu_execute &

Here is my Categories file:Applications
Games
Places
System

The Applications file:Archive Manager
Calculator
Disc Burner
Document Viewer
File Manager
FTP Client
Image Editor
Messenger
Music Player
Office Suite
Terminal
Text Editor
Video Player
Web Browser

Games:GTK Life
Hunt The Wumpus
Nethack
Zangband
Zork 1
Zork 2
Zork 3

Places:Root
Home
Media

System:GTK Themer
Network Manager
Partitioner
Package Manager

And finally, Commands:--Applications--
Archive Manager: xarchiver
Calculator: galculator
Disc Burner: recorder
Document Viewer: epdfview
File Manager: pcmanfm
FTP Client: filezilla
Image Editor: gimp
Messenger: amsn
Music Player: quodlibet
Office Suite: soffice
Terminal: xakura
Text Editor: emacs
Video Player: vlc
Web Browser: opera

--Games--
GTK Life: gtklife
Hunt The Wumpus: sakura -e wump
Nethack: sakura -e nethack
Zangband: zangband
Zork 1: sakura -e zork1
Zork 2: sakura -e zork2
Zork 3: sakura -e zork3

--Places--
Root: pcmanfm /
Home: pcmanfm /home/barrucadu/
Media: pcmanfm /media/

--System--
GTK Themer: gtk-chtheme
Network Manager: /usr/lib/wicd/gui.py
Partitioner: gksu gparted
Package Manager: shaman

There you have it! I have a nice system monitor and menu all set up. I have created a shortcut with xbindkeys so that pressing the Menu key runs my script, and though I doubt I will use it often, it is a nice thing to have.

Filed in Linux, under , , , , on May 10, 2008
0 Comments

Linux is roughly twice as good as Windows in quite an important respect.

Battery life. My laptop’s battery is fairly old and worn down, it has a maximum capacity of 25%, and so any way to increase its life is a chance to be siezed. On Windows the battery lasted roughly 10 minutes, a bit less. I have just been running my laptop without external power for about 20 minutes now, and the battery life has just dropped to 3%.

This is quite an amazing achievement, because not only have I dont nothing to preserve battery life, I have always been told that Linux is worse than Windows with laptop batteries!

I just thought I would share this rather interesting fact with you all. if I had known about this earlier, i would have switched to Linux much sooner than I did.

Filed in Linux, under , , , on May 8, 2008
0 Comments

I must be mad. I installed Emacs.

Please, someone send the men in white coats to lock me up. I installed Emacs, despite all warnings about my sanity. When I installed it, there was a noise - as if a thousand braincells cried out in terror and were suddenly silenced. Despite my fading sanity (C-x C-s to save a file? Who thought that up!?), I am rather enjoying it, despite forgetting all the keyboard shortcuts after I learn them. Oh well, perseverence is the key! I will survive, and eventually become an Emacs user! The going will be tough, and the cost to my sanity will be great, but I will manage it!

One thing that Emacs has impressed me with is the huge depth of features. It does everything. If I wanted, I could probably find an extension to sync my computer clock, update my system, or work as a cron daemon. I know that there is an extension to make Emacs act as a webserver, and since the language to create extensions is a variant of Lisp - Emacs Lisp, the number of possible extensions is limited only by the programmers imagination.

I’m using it as much as possible - even for writing shellscripts when I have nano. I am not, however, using it to write this blog post because I think I need a break from the sanity-removing feature-packed monster of a text editor that is Emacs. If you don’t hear from me for a few days, assume I have gone mad, engraved “EMACS!” on my skin, and eaten my liver.

Filed in Computing, under , , , , , on May 6, 2008
1 Comments

One of the reasons I love Linux: Choice

I love Linux. I do. For many reasons. One of these reasons is choice, I can choose between many different ways of doing something, and if I so desire can have a machine completely different to everyone else’s. That is just not possible with Windows. With Windows you have no choice about the components of the OS, not even the GUI.

If you didn’t guess from the last sentance, I decided to choose a new GUI. I have been using, and love, Openbox. In fact, I still use it on my desktop computer, and have it installed on my laptop, but it is not the default session in GDM. What I chose to use was Xmonad - a tiling window manager.

Xmonad

A tiling window manager is rarely seen on nowadays. They discard the regular floating method of other window managers, and instead tile windows on the screen. Of course, the method of tiling can be customised to give you more control. This tiling means that at any one time, the entire screen is in use, and you can switch between windows/workspaces, and maximize windows, as the touch of a button.

All of this makes a tiling window manager rather efficient. I shall keep Openbox around for a while longer, as jumping straight from a floating window manager to Xmonad (which I have been told is particularly strict) is a rather steep learning curve. I expect I’m only going to start Openbox up if someone else needs to use my laptop because, let’s face it, if you sat an ordinary person in front of a tiling window manager they wouldn’t have a clue what to do.

Anyway, I like tiling window managers. I encourage you to try one. I only tried one because I love my ability to choose in Linux, and had been told that they were good. I ended up becomming a user, and fan. I love choice.

Filed in Linux, under , , , , , on May 5, 2008
0 Comments

My first longish Bash script!

Hello friends! I have just written my first longish Bash script, and it will be very useful in the future. This script uses a series of menus to install and (partially) configure a GUI for Arch Linux after a fresh install. I have yet to test it, as I imagine running a script that fiddles with Xorg on an already set-up computer may not be the best idea, however when I next install Arch on a machine I will test it.

The script has the following categories:

  • Desktop Environment / Window Manager, containing 5 programs.
  • Applications, containing 14 submenus, and a total of 47 programs.
  • Games, containing 9 programs.
  • Utilities, containing 9 submenus and a total of 24 programs.

If course, I will never have all of the programs installed at once, as I have several different options for each category - for example, why would I want three display managers installed? Anyway, this script will be most useful when I next need to install Arch somewhere. When I do so and fix all the bugs in this, I may post it here for you all to benefit from it.

Anyway, to give you an idea of what I mean by "longish", this script has 32 functions, 1,177 lines, and 17,976 characters. Not bad for someone who has only ever written one or two line scripts before.

Filed in Linux, under , , , on
0 Comments