Archive for the 'how-to' Category

english, how-to

Linux bluetooth modem how-to

Edit: Wordpress messes up the formatting. Use normal quotes, replace — with two -.

First, some details about my setup.

  • Very cheap bluetooth adapter - because I didn’t knew if it was going to work with linux
  • Nokia 6310i - extremely stable GPRS connection
  • Dell Inspiron 1501 notebook running Arch Linux- it doesn’t really matter
  • Wap Unlimited from Orange - unlimited access to http hosts - good enough for webmail, blogging, etc

Install the necessary software:

bluez-utils, bluez-libs and wvdial should do. Run

pacman -Sy bluez-utils bluez-libs wvdial

…for Arch Linux or

apt-get install bluez-utils bluez-libs wvdial

…for Debian, Ubuntu and some other distributions. Anyway, you get the point. For other distros read the docs.

After installing it, we configure the software.

First, edit /etc/bluetooth/hcid.conf. Mine looks like this:

options {
autoinit yes;
security auto;
pairing multi;
pin_helper /etc/bluetooth/givepin;
}

device {
name “computer”;
class 0×100;
pkt_type DH1,DM1,HV1;
iscan enable; pscan enable;
lm master;
lp hold,sniff,park;
auth enable;
encrypt enable;
}

Now we need to configure rfcomm. First, find the MAC address of your mobile phone. You can insert the bluetooth adapter, start the HCI daemon by running hcid, and scan using hcitool scan. If you don’t have the file /dev/rfcomm0, create it by running mknod -mode 666 /dev/rfcomm0 c 216 0.

Then create the file /etc/bluetooth/givepin, which will give us a pin number:

#!/bin/sh
echo “PIN:12345″

Change with another, more secure number.

Then edit the file /etc/bluetooth/rfcomm.conf. It should look like below:

rfcomm0 {
# Automatically bind the device at startup
bind yes;

# Bluetooth address of the device
device 00:00:00:00:00:00; #change with the MAC found previously

# RFCOMM channel for the connection
channel 1;

# Description of the connection
comment “Bluetooth modem”;
}

Next we configure wvdial. Add at the end of /etc/ppp/peers/wvdial the following lines:

lcp-echo-failure 0
lcp-echo-interval 0

The main conf file for wvdial, /etc/wvdial should look like the one below. Replace wap in the init string with your access point’s name.

[Dialer Defaults]
Modem = /dev/rfcomm0
Baud = 115200
Init1 = ATZ
Init2 = AT+cgdcont=1,,”wap”
Carrier Check = no
Stupid Mode = no
Phone = *99***1#
New PPPD = yes
ISDN = 0
Modem Type = Analog Modem
Username = ”
Password = ”

When you first connect your phone, you need to pair it with the computer. Run passkey-agent –default your_pin first.

Start the HCI daemon by running hcid.

Connect to your phone by running rfcomm connect rfcomm0.

When you do this the first time, your phone will probably ask permission for pairing and a PIN number. Use the PIN you entered above.

Connect to GPRS by running wvdial.

Set the correct DNS servers by running cp /etc/ppp/resolv.conf /etc/.

If necessary, set the browser to use a proxy server. For Orange Romania, use 82.217.247.252:8799.

english, how-to

Ubuntu Feisty & Canon i250 howto

I had some problems with my printer’s Linux drivers, but now it works OK. This may work on other versions of Ubuntu or other distributions that use the dpkg/apt package management system. This is what you need to do:

First, make sure you have all the dependencies and needed packages:

sudo apt-get install libpng3 libtiff4 cupsys alien

If you want a GUI to configure CUPS and you are using Gnome, also install gnome-cups-manager. If you are using KDE I think you need to install kdeprint.

Download the official Linux drivers:

cd ~
wget http://download.canon.com.au/bj/i250linux/bjfilteri250-2.3-0.i386.rpm
wget http://download.canon.com.au/bj/i250linux/bjfiltercups-2.3-0.i386.rpm

Convert them to DEBs:

sudo alien –scripts bjfilteri250-2.3-0.i386.rpm
sudo alien –scripts bjfiltercups-2.3-0.i386.rpm

Before the “scripts” option should be two “-”, I don’t know why they are not displayed correctly.

Install the DEBs and remove the packages:

sudo dpkg -i bjfiltercups_2.3-1_i386.deb bjfilteri250_2.3-1_i386.deb
rm bjfiltercups-2.3-0.i386.rpm bjfilteri250_2.3-1_i386.deb bjfiltercups_2.3-1_i386.deb bjfilteri250-2.3-0.i386.rpm

Symlink some libraries, because the driver uses some old versions:

sudo ln -s /usr/lib/libtiff.so.4 /usr/lib/libtiff.so.3
sudo ln -s /usr/lib/libpng.so.3 /usr/lib/libpng.so.2

Restart CUPS:

sudo /etc/init.d/cupsys restart

Now just configure your printer. If using Gnome, go to System > Administration > Printing. The driver you need to use is /usr/share/cups/model/canoni250.ppd.

You should be done, print something to test that everything works OK.

english, how-to

Dell Inspiron hotkeys - usable for any linux distribution

We are going to use LinEAK. The hotkeys controlling the brightness should work even without an operating system (at least they do with the 1.7.0 BIOS on my Inspiron 1501). In adition, after following my instructions, the volume up, volume down and mute keys will be working.

First install LinEAK. You may compile the source or use a package. For Arch Linux use:

sudo pacman -Sy lineakd lineak_defaultplugin

We are going to use the keycode configuration for Dell D600, because it matches Dell Inspiron keyboards:

lineakd -c DELL-D600

Now edit the configuration file, because at the moment we just asigned some functions to the keys.

nano ~/.lineak/lineakd.conf

The last lines of the file should look something like this:

AudioLowerVolume = “amixer sset Master 10%- unmute”
AudioMute = “amixer sset Master mute”
AudioRaiseVolume = “amixer sset Master 10%+ unmute”

Edit or add them, if they don’t exist. Notice that you need amixer installed. You can change the percents to adjust how much the volume will lower or raise.

Next add LinEAK tot the list of startup programs. If you are using Gnome, go to System -> Preferences -> Sessions -> New. Use the name “LinEAK” and the command “lineakd &”. Click OK and log out. After you login, you should be able to control the volume using Fn+Page Up, Fn+Page Down and Fn+End, like on Windows and Ubuntu (on Ubuntu they work out-of-the-box).

english, how-to

Injection capable bcm43xx driver - 2.6.20-16-generic kernel

As I promised, here you go. Just the 32 bit version for now. Works with current Ubuntu kernel, 2.6.20-16-generic and supports packet injection.

Tested and OK with my Dell 1390 WiFi card, using the bcm4311 chipset.

If you haven’t installed the firmware files:

cd ~

wget http://ubuntu.cafuego.net/pool/feisty-cafuego/bcm43xx/bcm43xx-firmware_1.3-1ubuntu2_all.deb

sudo dpkg -i ./bcm43xx-firmware_1.3-1ubuntu2_all.deb

sudo rm ./bcm43xx-firmware_1.3-1ubuntu2_all.deb

Install the module:

sudo rm /lib/modules/2.6.20-16-generic/kernel/drivers/net/wireless/bcm43xx/bcm43xx.ko

wget http://www.linux-geek.org/files/bcm43xx-2.6.20-16-injection.tar.bz2

sudo tar xvjf ./bcm43xx-2.6.20-16-injection.tar.bz2 -C /lib/modules/2.6.20-16-generic/kernel/drivers/net/wireless/bcm43xx/

Test it:

sudo rmmod bcm43xx

sudo modprobe bcm43xx

sudo iwlist scan

english, free software, how-to, linux

Aircrack WEP cracking how-to

Disclaimer: Notice that you are only allowed to crack your personal network, please don’t use this information for other purposes.

If you are using a Broadcom 43xx based wireless card, Dell 1390, for example, install the module compiled by me (that’s for the 2.6.20-15-generic kernel, for the 2.6.20-16-generic one compile it yourself or wait until I’ll provide one get it here) . If you are using another wireless network card, search for instructions about patching your driver here.

Now that we have to proper driver, let’s install aircrack-ng 0.9. You may use another version, but this one includes the PTW attack, witch is faster and requires less packages. You’ll need to install some dev packages (actually, I think sudo apt-get install build-essential should do).

cd ~
wget http://download.aircrack-ng.org/aircrack-ng-0.9.tar.gz
tar -xzf ./aircrack-ng-0.9.tar.gz
cd aircrack-ng-0.9
make
sudo make install

If you got no error, aircrack-ng is installed. Now we activate the monitoring mode by running sudo airmon-ng start eth1.

Then you start airodump-ng by running sudo airodump-ng eth1 so that you can note the channel, the ESSID and the BSSID. ifconfig eth1 and note you MAC address.

Now we create a folder where to save the *.cap files and start airodump-ng.

mkdir ./dumps
cd ./dumps
airodump-ng -c channel - -bssid BSSID -w dump eth1

Now we do fake authentification (run the following command in another terminal, because we don’t want to stop airodump).

aireplay-ng -1 0 -e ESSID -a BSSID -h YOUR_MAC eth1

Next we start packet injection (in the same terminal as the fake authentification).

aireplay-ng -3 -b BSSID -h YOUR_MAC eth1

Now wait until you have something like 50.000 IVS (displayed in the #Data column). Then stop airodump-ng (CTRL+C). Run aircrack-ng -z dump*.cap. If it finds the key in a few seconds, we are done. If not, stop aircrack-ng (CTRL+C) and start airodump-ng again using the same command.

english, how-to

Install Pidgin IM 2.0.0 on Ubuntu Linux

No deb available, so we are going to install it from source.

First, we install the (development) packages needed to compile Pidgin IM.

sudo apt-get build-dep gaim

We remove gaim.

sudo apt-get –purge autoremove gaim

We download pidgin to the home folder and extract it.

cd ~
wget http://heanet.dl.sourceforge.net/sourceforge/pidgin/pidgin-2.0.0.tar.bz2
tar xvjf ./pidgin-2.0.0.tar.bz2

We compile and install Pidgin IM.

cd pidgin-2.0.0
./configure
make
sudo make install

We test Pidgin IM by running pidgin.

english, how-to

Dell 1390 native linux driver how-to UPDATED

Edit: Added the module for the 64 bit kernel, built by Andy. See instructions below. I can’t test it at the moment, but it works for him.

Edit 2: New module for the 32 bit kernel, supporting packet injection. For some reason, it is not reporting the correct signal quality, but apart from that it’s working ok. Download it if you plan to use aircrack-ng.

Edit 3: For the 2.6.20-16-generic kernel you just need to install the firmware files, skip everything else. Injection capable module coming soon.

Edit 4: You can get the injection capable module for 2.6.20-16-generic from here.

There were some problems with the first version of the tutorial. You needed to download the not so small kernel source, you needed to use an unstable and unsupported kernel version and you couldn’t use modules compiled by the Ubuntu team (fglrx, vmware player and server, etc). Now, you can profit from the full speed of your Dell 1390 Wifi card while still using the official Ubuntu kernel. This guide is intended just for the 2.6.20-15-generic kernel.

You download the firmware package into the home folder.

cd ~

wget http://ubuntu.cafuego.net/pool/feisty-cafuego/bcm43xx/
bcm43xx-firmware_1.3-1ubuntu2_all.deb

Everything on a single line for the wget command!

Install the firmware files and remove the package.

sudo dpkg -i ./bcm43xx-firmware_1.3-1ubuntu2_all.deb

rm ./bcm43xx-firmware_1.3-1ubuntu2_all.deb

Download the module for the 32 bit kernel or the module for the 64 bit version (compiled by Andy using my instructions).

wget http://linux-geek.org/files/bcm43xx.tar.bz2

OR

wget http://www.linux-geek.org/files/bcm43xx-64bit.ko.tar.bz2

OR

wget http://www.linux-geek.org/files/bcm43xx-packet-injection.tar.bz2

And finally, we replace the bcm43xx driver provided by the Ubuntu kernel with the driver ported by me, from the 2.6.21-rc7 kernel.

sudo rm /lib/modules/2.6.20-15-generic/kernel/drivers/net/wireless/bcm43xx/bcm43xx.ko

sudo tar xvjf ./bcm43xx.tar.bz2 -C /lib/modules/2.6.20-15-generic/kernel/drivers/net/wireless/bcm43xx/

OR

sudo tar xvjf ./bcm43xx-64bit.ko.tar.bz2 -C /lib/modules/2.6.20-15-generic/kernel/drivers/net/wireless/bcm43xx/

Now reboot your computer. The module’s name is the same, bcm43xx. If you are not sure how to test if the wifi card is working, run

sudo modprobe bcm43xx

iwlist scan

BTW, the programs contained within the wireless-tools package are not going to complain about Wireless Extensions anymore, like they did with the 2.6.21 kernel.

Below is a screenshot taken while testing the module. Note that the displayed speed is not limited by the wifi card, it is limited by my internet connection.

Slackware 11 download with the hacked bcm43xx module.

english, how-to

Dell 1390 native linux driver how-to

Edit: The things described in this how to are still working, but you’ll have some problems. Use this one instead.

Dell 1390 is a wireless network card used in some Dell notebooks. It is using the Broadcom 4311 chipset. Until a few days ago, everybody was using ndiswrapper and the Windows drivers to get it working under Linux. The bcm43xx driver is supporting it starting from the 2.6.20 kernel release, but it was quite buggy: random disconnects and very slow speed (actually, the best speed I got was something like 90 KB/s). Release candidate versions of the 2.6.21 kernel seem to resolve all this issues. This a guide to help you compile the latest kernel version (don’t worry, you don’t need to configure it) and use the native linux driver for you Dell 1390 wireless card. Why should you use it? Well, WPA works OK now (I couldn’t get it working with ndiswrapper), scanning and configuration are a little bit faster, the signal power seems to be improved (but I may be wrong) and it supports monitoring mode (wep cracking and stuff). Now, the actual how-to.

First, because most of the commands we’ll be running require root access, we are becoming root (sudo kind of sucks when you have to use it on every line):

sudo su

Now, you should update your package list and upgrade your system and install the packages required to compile the kernel.

apt-get update

apt-get dist-upgrade

apt-get install kernel-package libncurses5-dev fakeroot wget bzip2

Next, we download the kernel source.

cd /usr/src

wget ftp://kernel.org/pub/linux/kernel/v2.6/testing/linux-2.6.21-rc7.tar.bz2

We extract and symlink it…

tar xjf ./linux-2.6.21-rc7.tar.bz2

ln -s ./linux-2.6.21-rc7 ./linux

Import the current kernel configuration (there may be some warnings displayed, not to worry).

cd linux

cp /boot/config-`uname -r` ./.config

make menuconfig

We import the configuration file with the “Load an Alternate Configuration File” option and choosing “.config”. Then we make sure MSI is disabled (we don’t want to use the pci=nomsi option, isn’t it?) by going to the Bus Options (PCI… ) menu and if necessary disabling Message Signaled Interrupts. Exit and save the configuration. Now we compile the kernel the Ubuntu way.

make-kpkg clean

fakeroot make-kpkg –initrd –append-to-version=-inspiron1501 kernel_image kernel_headers

Now get a cup of coffee or something like that because it takes some time. Next, we install the newly created packages.

cd ../

dpkg -i linux-headers-2.6.21-rc7-inspiron1501_2.6.21-rc7-inspiron1501-10.00.Custom_i386.deb

dpkg -i linux-image-2.6.21-rc7-inspiron1501_2.6.21-rc7-inspiron1501-10.00.Custom_i386.deb

We install the firmware files.

wget http://ubuntu.cafuego.net/pool/feisty-cafuego/bcm43xx/bcm43xx-firmware_1.3-1ubuntu2_all.deb

dpkg -i ./bcm43xx-firmware_1.3-1ubuntu2_all.deb

rm ./bcm43xx-firmware_1.3-1ubuntu2_all.deb

Then we restart the notebook and if we don’t know how to configure our wireless network we search for a tutorial.

Now everything should work ok. If it is not, you should try modprobe bcm43xx and then iwlist scan. If you still have problems, post a comment containing the output of dmesg.

english, how-to, linux, mobile devices

Windows Mobile 5 and Linux

Inca un post partial in engleza, tot pentru ca in target probabil nu sunt multi romani.

Romana

Descarcarea surselor synce cu suport Windows Mobile 5:

cd /usr/src
svn co https://svn.sourceforge.net/svnroot/synce/branches/libsynce/WM5/libsynce
svn co https://svn.sourceforge.net/svnroot/synce/branches/librapi2/WM5/librapi2
svn co https://svn.sourceforge.net/svnroot/synce/trunk/vdccm

Compilarea:

1) libsynce

cd libsynce/
./bootstrap
./configure
make
make install
cd ..

2) librapi2

cd librapi2/
./bootstrap
./configure
make
make install
cd ..

3) vdccm

cd vdccm/
make -f Makefile.cvs
./configure
make
make install
cd ..

In timp ce am compilat aceste programe am primit mai multe erori si a fost necesara editarea fisierelor sursa. Daca patiti la fel si nu va descurcati, contactati-ma pe email sau postati un comment aici.

Conectarea PDA-ului/telefonului prin USB:

1) Compilarea driverului usb-rndis

cd /usr/src
svn co https://svn.sourceforge.net/svnroot/synce/trunk/oleavr-files/usb-rndis
cd usb-rndis/
make
./clean.sh
make install

2) Gasirea interfete folosite de usb-rndis

dmesg | grep “eth[0-9″>: register” | grep “rndis_host” | tail -1

Daca totul a mers bine, veti vedea o linie de genul

eth1: register ‘rndis_host’ at usb-0000:00:02.0-2, RNDIS device, 80:00:60:0f:e8:00

3) Asignarea adresei ip

ifconfig eth1 169.254.2.2 netmask 255.255.255.0 up

Daca e cazul, inlocuiti eth1 cu interfata obtinuta prin rularea comenzii de mai sus.

4) Realizarea conexiunii

Aceste comenzi vor trebui rulate de user-ul pe care il folositi in mod normal.

vdccm -s 40
triggerconnection 169.254.2.1

5) Testarea conexiunii

pls /

Daca primiti o lista cu directoarele de pe dispozitivul mobil, totul a mers bine.

Accesul la file system-ul dispozitivului se realizeaza cel mai usor folosind un plugin pentru nautilus:

svn co https://svn.sourceforge.net/svnroot/synce/trunk/gnomevfs
cd gnomevfs/
./bootstrap
./configure
make
make install

In /etc/gnome-vfs-2.0/modules/default-modules.conf se adauga linia: synce: libsyncevfs.

Restartati sistemul.
Autentificati-va.
Conectati dispozitivul mobil.
Rulati din nou comenzile pentru asignarea adresei ip si realizarea conexiunii.
Rulati comanda nautilus synce:///.

Felicitari, ar trebui sa aveti acces la file system-ul dispozitivului.

English

Downloading synce with Windows Mobile 5 support:

cd /usr/src
svn co https://svn.sourceforge.net/svnroot/synce/branches/libsynce/WM5/libsynce
svn co https://svn.sourceforge.net/svnroot/synce/branches/librapi2/WM5/librapi2
svn co https://svn.sourceforge.net/svnroot/synce/trunk/vdccm

Compiling:

1) libsynce

cd libsynce/
./bootstrap
./configure
make
make install
cd ..

2) librapi2

cd librapi2/
./bootstrap
./configure
make
make install
cd ..

3) vdccm

cd vdccm/
make -f Makefile.cvs
./configure
make
make install
cd ..

During the compiling of this programs, there may be some errors. If this happens, you need to edit some source files. If you don’t know how, post a comment here or send me an email.

Connecting you device using an USB cable:

1) Compiling the usb-rndis driver

cd /usr/src
svn co https://svn.sourceforge.net/svnroot/synce/trunk/oleavr-files/usb-rndis
cd usb-rndis/
make
./clean.sh
make install

2) Finding the interface used by usb-rndis

dmesg | grep “eth[0-9″>: register” | grep “rndis_host” | tail -1

If everything went well, you will see a line like

eth1: register ‘rndis_host’ at usb-0000:00:02.0-2, RNDIS device, 80:00:60:0f:e8:00

3) Asigning the ip adress

ifconfig eth1 169.254.2.2 netmask 255.255.255.0 up

4) Connecting

This commands must be run by your normal user.

vdccm -s 40
triggerconnection 169.254.2.1

5) Testing the connection

pls /

If the command above returns a list with the folders from your PDA, everything is ok.

The most simple method to access your mobile device is to use a nautilus plugin.

svn co https://svn.sourceforge.net/svnroot/synce/trunk/gnomevfs
cd gnomevfs/
./bootstrap
./configure
make
make install

Add a line containing synce: libsyncevfs to /etc/gnome-vfs-2.0/modules/default-modules.conf .

Restart you computer.
Log in.
Connect you mobile device.
Run the commands for assigning the ip adress and connecting.
Run the command nautilus synce:///.

Now you should have acces to the filesystem of you mobile device.

english, how-to

Software unlock MPX200 running Windows Mobile 5

Deoarece, din cate stiu, nu sunt foarte multi oameni care ruleaza WM 5 voi scrie si o varianta in engleza a acestui post.

Romana

Pentru a decertifica un Motorola MPX-200 care ruleaza Windows Mobile 5, este nevoie de un card reader sau de un telefon pe care sa-l folositi in loc de card reader.

1) Descarca si extrage arhiva de aici.
2) Activeaza optiunea de a afisa fisierele ascunse.
3) Opreste telefonul si introdu cardul in card reader (sau in telefonul secundar).
4) Copiaza default.hv in directorul __TFAT_HIDDEN_ROOT_DIR__\ Windows\ de pe card.
5) Reintrodu cardul in telefon si porneste-l.
6) Conecteaza telefonul la PC si sincronizeaza-l cu Active Sync.
7) Ruleaza SDA_ApplicationUnlock.exe si deblocheaza telefonul. 8) Restarteaza telefonul
9) Copiaza cert.cab pe telefon si apoi se ruleaza-l.
10) Restarteaza telefonul. Acum ar trebui sa poti rula orice aplicatie.

English

To software unlock (decertificate) a Motorola MPX-200 running Windows Mobile 5, you will need a card reader or another phone to use it as a card reader.

1) Download and unzip this archive.
2) Enable the feature to see hidden files.
3) Switch off the phone and insert the storage card into the card reader.
4) Copy default.hv to the __TFAT_HIDDEN_ROOT_DIR__\Windows\ folder on the storage card.
5) Insert the card back to the phone and start the phone.
6) Connect the phone to the PC and synchronize it using Active Sync.
7) Run SDA_ApplicationUnlock.exe and unlock the phone. 8) Restart the phone.
9) Copy cert.cab to the phone and run it.
10) Restart your phone. Now you should be able to run any application.