..the things I don't want to forget

Main menu

Archives

Post navigation

It’s taken me a while to mess around with the Linux RT system, so here’s a somewhat full documentation of what I did. I assume some Linux compiling knowledge and a safe environment to actually do this, such as a chroot environment or a virtual machine or your roommate’s computer who isn’t going to know what happened.

I’ll start with a simple program in C to test the RT Kernel. Get it here, adapted from the official docs’ provided example. You can compile it on your regular stock kernel as such:$ gcc -o test_rt test_rt.c -lrt
You can then run the program a number of times to see what the minimum run time is.$ time sudo ./test_rt
My personal record is about 10 seconds on a stock kernel on VirtualBox running a single CPU. However, we know that testing this program on a standard machine with low load is not indicative of a `real` real time system. So we now run our program under high load. But first, we need to simulate that high load:$ sudo stress -c 1000 -i 100 -m 2 --vm-keep -t 120
(note that the -m 2 uses (2 * 256)MB of memory, so make sure you have enough!)
And then, we’ll run the test_rt program again.

Patching the Kernel

In this example I’m working with kernel 3.8.4. You may want to use a different version of the kernel, in which case look for the highest version of the patch available here: https://www.kernel.org/pub/linux/kernel/projects/rt/
And download the corresponding vanilla kernel here: https://www.kernel.org/pub/linux/kernel/v3.x/

And moving along, here’s how we patch:

In your home directory go to the Download folder and download the patch file in bz2 format (mandatory for this exercise) and the vanilla kernel.

For those of you who don’t know, I was lucky enough to be selected to receive a Nokia N900 for trial courtesy of WOMworld Nokia. I will write about my experience using the phone as a first-time smartphone user soon enough; I don’t think I’ve had enough time to build a first impression

For now though, here’s a howto on the first thing anyone would want to do with a 3G phone: turning it into a modem. This applies to someone in my scenario who is connecting a Nokia N900 to a Linux machine (also known as tethering). However it should apply the same to any other machine using the same concepts. Which is that you can plug the phone in, expect it to register as a USB modem, and use a dialer to dial out.

Step 1: Connect Your Phone
Make sure your phone is connected to the machine via the US cable that comes packaged with the phone. Upon connecting your phone to the machine you will see a pop-up on the phone that asks how you would like to connect this device, with the options being “Mass Storage mode” or “PC Suite Mode”. Technically you should be able to use the phone as a modem even without making a choice here, but if you can’t connect without choosing, choose “PC Suite Mode”.

Step 2: Make sure the phone is recognised as a USB modem
Make sure the phone (Nokia N900 in this case) is recognised as a USB modem by the machine. To do so run lsusb from the terminal. Which should give you something along the lines ofBus 002 Device 007: ID 0421:01c8 Nokia Mobile Phones Next run ifconfig from the terminal, you should see a new device “usb0″. This is where you know you’re good to go. If you don’t get this, well, unplug the phone from the machine and try again.

Step 3: Make sure your phone is no longer connected to the internet. edit: this step is dependent on your provider. You may not need this
That means shut down your Internet Connection (generally your 3G) on the N900. And on the N900 this was a little more difficult than I expected; because I did initially set my phone to connect whenever it can. Turning the 3G services off did nothing to override the previous settings, the phone just tries to reconnect again. That means you will have to first make sure you turn off the settings to “Always Connect” and only then turn the Internet Connection off.

Step 4: Configure your dialer
I use wvdial and i recommend you do too. If you don’t have it, install it (ie “sudo apt-get install wvdial). For this step there’s one really important detail that you will need to know which is your APN (Access Point Name). This differs across carriers so google for your carrier / ISP’s APN first. The next thing to know will be the credentials required to login. I’m using DiGi where the APN is “diginet”; the username “guest” and the password “guest”. The rest of the settings aren’t too different from my 3G broadband settings identified here. Note: the modem in my case is registered as /dev/ttyACM0 which IIRC is a standard USB modem, but you will want to confirm the location of your modem before actually configuring your dialer

Step 5: Dial
As mentioned I use wvdial, so all I need to do is to ensure I have configure the config file at /etc/wvdial.conf and from terminal type sudo wvdial. I have included the wvdial config file below which of course works for me. Your own config file shouldn’t look that much different with the exception of the APN, the Username, the Password and maybe the Phone number.

4. plug in the modem and run `sudo usb_modswitch`. do another `lsusb` to make sure the device is registered properly as in step 1. `vim /etc/udev/rules.d/45-huawei1550.rules` and paste the following line:

Tip #1 – Are you really using vim?
First off, you need to figure out if you’re using VI or VIM.
No they are not the same and are not intended to be.
I believe ubuntu ships with vi and not vim so you do not get vim out of the box.
Some distros alias `vi` to `vim` but trust me, you will want to get used to typing `vim` not `vi`
This way you’re always sure you’re using vim and not vi

Tip #2 – Cursor Navigation:1 takes you to the first line:122 takes you to the 122nd line:$ take you to the last line`a` moves the cursor one character forward and enables INSERT`i` does not move the cursor, it sets the cursor to INSERT wherever it is.`o` moves the cursor one line down and enables INSERT

Tip #3 – File / Edit Management`u` undoes your last action:w saves the file:q quits whatever you’re doing provided there’s no change to the file:wq saves the file and then exits:q! quits vim without saving
Do Not make it a habbit of hitting :wq!
This forces a save without a warning if there’s supposed to be one.

There’s a complete review written here, but in short : the gameplay is a lot like Worms Armegeddon, the sound effects are cool, and the controls are really intuative.

Plus the AI’s pretty good (dunno if that’s a good thing)

The other alternative is wormux which has a pretty good game engine, a lil more stable with lesser bugs, and nicer characters. But Hedgewars is without a doubt more addictive and more user-friendly and more intuative.

All laptop batteries are created equal by Their Maker. But even so, some last longer than others despite coming out of the same production lines. Why? Because although it is manufactured to last (say) 5 hours, sometimes you only get 2 hours before it dies. Usually that means that your actual capacity is lower than what it was manufactured to be.

Here’s how you can figure out how useful your battery really is:

install acpi if it’s not yet available

sudo aptitude install acpi

Open a terminal / console and type:

acpi -V

See those details? Thats some minimal details available. Now for a more detailed view do this:

cat /proc/acpi/battery/BAT0/info

Look at the design capacity and last full capacity:

If you’re last full capacity is under the design capacity, then your battery cannot store as much power as it should and will therefore die faster than it should.

If the last full capacity is under 50% of the design capacity, I’d consider getting a new one.

These are 13 alternatives for Linux. If you google around you’ll find other similar lists, but the ones on my list are actually working, are in relatively active development as of June 1st 2009 and / or has a future. I’m not going to bother arranging this in any particular order, so here it is, all in one go.

Arora – Small, lightweight, buggy

Swiftfox – Big, Bloated, but faster then it’s siblings. Has a cooler logo

Flock – Social stuff which can be cool when you’re surfing youtube or facebook