Archive for the ‘Linux’ Category

Ion3 Window Manager

Monday, August 25th, 2008

Those of you who know me, know I hate window managers and GUI in general under linux. After using nothing but screen for ages and testing a window manager here and there, I finally found a window manager I liked: Ion3.

In essence, Ion3 is screen… as a desktop manager. Based on PWM, Ion3 is meant to be a mouse-less window manager. After playing with it for a few days I was hooked. It’s interface is slim and sexy. It’s lightweight. Most importantly, it doesn’t remove the “command line” feel of screen. With hot-keys for changing desktops, moving and resizing windows, splitting upwards and down, and even hot-keys for launching applications.

The hot-keys for launching applications is really one of my favorite parts of Ion3. Using the F-keys, you can launch applications from a dynamic menu, open an ssh window, or create new desktops. Another great feature of Ion3 is that, while it feels like a command line, you still have full GUI. Firefox runs wonderfully under Ion3. Even flash videos play flawlessly.

I highly recommend trying Ion3. It’s installation is easy and quick. If you prefer a command line this is a great way to add some extra functionality to that command line.

Download: http://www.freshports.org/x11-wm/ion-3/

PWM Information: http://en.wikipedia.org/wiki/PWM_(window_manager)

Nano Syntax Highlighting

Wednesday, June 18th, 2008

As a nano user I often get flack from those around me who use Vim about not having syntax highlighting. So, after taking this for some time I decided to find a way to add syntax highlighting to nano and to my surprise, it is actually already built in and simply not enabled.

Here is the simple, step-by-step process:

  1. Copy the /etc/nanorc file to ~/.nanorc (depending on your distribution this file may be located elsewhere)
  2. Open ~/.nanorc with your favorite text editor (in this case, odds are good it’ll be nano)
  3. Find the commented lines beginning with “include”
  4. Uncomment for the languages you want to have syntax highlighted in

Amazingly simple. I’m actually rather surprised it wasn’t enabled by default, but I suppose in the spirit of being a tiny text editor (hence the name) the overhead was left to an “as needed” basis.

There are a few languages not already included, but you can simply add them in yourself. I wanted to add PHP and found this link. The syntax files themselves are also editable. Allowing you to add in rules or change syntax colors.

BackTrack2 Wireless

Saturday, May 24th, 2008

I’ve worked with a lot of people who had trouble with setting up wifi on BackTrack2 and decided it would be worth a post on how I manage it.

I prefer to do this task from the command line, since it allow more control, plus it shows you exactly what happens in the background of some of these GUI apps. I use 5 main commands for this: ifconfig, iwlist, egrep, iwconfig, and dhcpcd.

Before we can do anything, we need to make sure our ethernet card is turned on. To check this, simply run ifconfig with no options. If the only interface you see is the lo (local or loopback), then you are going to need to bring up (turn on) your interface with: ifconfig <interface> up for me, <interface> is eth0, but your machine may differ

Now that the device is up and running, let’s find out what networks we can connect to. (You may skip this step if you already know what you are connecting to.) For this, I will use iwlist and egrep. iwlist is used for listing all access points (APs) in range and egrep is grep’s big brother with more regex support. We use them in combination to produce output that is more useful (for our purposes) than if we simply used iwlist. We run iwlist as: iwlist <interface> scanning and then pipe it to egrep to parse out the ESSID (name of the AP) and the key (if it is encrypted). The final command looks something like this:

iwlist <interface> scanning | egrep “ESSID|key”

This will show us the ESSID and if it requires authentication or not.

Now that we have the information we need, let’s put it to good use. Ifconfig’s counterpart, iwconfig is for managing the wireless portion of your connection. The first thing we want to do is look at iwconfig and make sure the card is in the correct mode: managed. Type iwconfig and find your interface. If the mode is not managed, you will need to run:

iwconfig <interface> mode managed

Since this is for BackTrack2, we the card may have been put into passive mode by kismet or another wireless packet sniffer. Once we have the card correctly set, we need to tell it what we want to connect to. This requires the ESSID and the password if the network is encrypted. We run iwconfig as follows:

iwconfig <interface> essid <essid from before>

and for those of you with passwords

iwconfig <interface> essid <essid from before> key <hex password here>

After we do all this, we want to run iwconfig one more time to make sure that the Access Point was associated (we check this by seeing a MAC address rather than ‘Invalid’.)

Finally, after we have gotten all our wireless hooked up, we need to request an IP address. We use the following command

dhcpcd -nd <interface>

This has the dhcp client daemon request a new (-n) IP address (as well as other information) from the router for <interface>. The -d flag tells dhcpcd to be verbose. We will see our own MAC address printed and upon success we will see the IP address assigned to our machine.