Wireless in Powerbook G4 part 2

Below is a small script to configure the network interfaces in the Powerbook. It will probably work in other Linux systems too, maybe some modifications would need to be made. wlan0 is the wireless interface and eth0 the broadband interface.


#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

echo "Checking whether NetworkManager is running"
if [ -f /var/run/NetworkManager.pid ]; then
        echo "NetworkManager is running, stopping it"
        /etc/init.d/network-manager stop
else
        echo "NetworkManager is not running"
fi

Interface() {
echo "Choose the name of the interface you want to configure"
echo "1 = Interface ethernet eth0"
echo "2 = Interface wireless wlan0"
echo "0 = Quit the program"
echo
read INT

if [ $INT = 1 ]; then
ETH=eth0

elif [ $INT = 2 ]; then
ETH=wlan0 
echo "Choose the essid you want to connect to"
iwlist $ETH scan | grep -i essid
read ESSID
iwconfig $ETH "$ESSID"

elif [ $INT = 0 ]; then
echo "Quitting"
exit 0
fi
}

Interface

Configure() {
echo
echo " 1 = static "
echo " 2 = dhcp "
echo " 0 to quit the program "
echo
read CHOICE

static() {
echo "Write the IP of the interface"
read IP
echo "Write the network mask"
read NETMASK
echo "Write the default gateway"
read ROUTE
echo "Configuraning the interface"
ifconfig $ETH $IP netmask $NETMASK
echo "Configuraning the gateway"
route add default gw $ROUTE
echo "search" > /etc/resolv.conf
echo "Write the IP of the first DNS server"
read DNS_1
echo nameserver $DNS_1 >> /etc/resolv.conf
echo "Write the IP of your second DNS server"
read DNS_2
echo nameserver $DNS_2 >> /etc/resolv.conf
} 

dhcp() {
        dhclient $ETH
        }

if [ $CHOICE = 1 ]; then
static

elif [ $CHOICE = 2 ]; then
dhcp

elif [ $CHOICE = 0 ]; then
echo "Quitting the program."
exit 0
fi
}

Configure

exit 0

Suggestions are always welcome. 🙂

Wireless in Powerbook G4

I have an old Powerbook G4 12 inch running Debian. I had issues connecting to the wireless if I was not using Gnome. I found out it was because of Network Manager. While Network Manager is running I can not connect to the wireless network from command line. Currently I am using OpenBox so it doesn’t connect automatically to the wireless. Here is a small howto.

First we check module b43 is installed.

[19:16:50] xavi@NewYork:/tmp $ sudo modinfo b43
filename:       /lib/modules/2.6.30-2-powerpc/kernel/drivers/net/wireless/b43/b43.ko
firmware:       FW13
license:        GPL
author:         Michael Buesch
author:         Stefano Brivio
author:         Martin Langer
description:    Broadcom B43 wireless driver
alias:          pcmcia:m02D0c0448f*fn*pfn*pa*pb*pc*pd*
alias:          ssb:v4243id0812rev10*
alias:          ssb:v4243id0812rev0F*
alias:          ssb:v4243id0812rev0D*
alias:          ssb:v4243id0812rev0B*
alias:          ssb:v4243id0812rev0A*
alias:          ssb:v4243id0812rev09*
alias:          ssb:v4243id0812rev07*
alias:          ssb:v4243id0812rev06*
alias:          ssb:v4243id0812rev05*
depends:        pcmcia,mac80211,ssb,input-polldev,pcmcia_core,rfkill,rng-core,cfg80211
vermagic:       2.6.30-2-powerpc mod_unload modversions 
parm:           bad_frames_preempt:enable(1) / disable(0) Bad Frames Preemption (int)
parm:           fwpostfix:Postfix for the .fw files to load. (string)
parm:           hwpctl:Enable hardware-side power control (default off) (int)
parm:           nohwcrypt:Disable hardware encryption. (int)
parm:           qos:Enable QOS support (default on) (int)
parm:           btcoex:Enable Bluetooth coexistance (default on) (int)
parm:           verbose:Log message verbosity: 0=error, 1=warn, 2=info(default), 3=debug (int)
[19:16:54] xavi@NewYork:/tmp $ lsmod | grep -i b43
b43                   138992  0 
rfkill                 15184  3 rfkill_input,b43
rng_core                7952  1 b43
mac80211              178904  1 b43
cfg80211               72376  2 b43,mac80211
input_polldev           7836  2 b43,ams
ssb                    51292  1 b43
pcmcia                 32336  2 b43,ssb
pcmcia_core            40868  3 b43,ssb,pcmcia
[19:17:09] xavi@NewYork:/tmp $ 

Stop Network Manager

bash$ sudo /etc/init.d/network-manager stop

Bring up wireless interface. Wlan0 in my case.

bash$ sudo ifconfig wlan0 up

Scan the available wireless networks.

bash$ sudo iwconfig wlan0 scanning

Connect to the ESSID

bash$ sudo iwconfig wlan0 essid

Get an IP from the wireless access point.

bash$ sudo dhclient wlan0 

Ping an external address to see you are connected to the internet.

[19:31:57] xavi@NewYork:/tmp $ !ping
ping -c 3 debian.org
PING debian.org (194.109.137.218) 56(84) bytes of data.
64 bytes from klecker.debian.org (194.109.137.218): icmp_req=1 ttl=50 time=119 ms
64 bytes from klecker.debian.org (194.109.137.218): icmp_req=2 ttl=50 time=116 ms
64 bytes from klecker.debian.org (194.109.137.218): icmp_req=3 ttl=50 time=101 ms

--- debian.org ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 101.768/112.858/119.928/7.940 ms
[19:32:02] xavi@NewYork:/tmp $ 

You should now be ready to go. I will write more on this later on.

Spain wins the World Cup

So Spain makes it to the front page of the New York Times and the Wall Street Journal. It’s a consequence of winning the Football World Cup. Guess the only thing left to say is congratulations.

I personally liked the football they made. For me the critical match was the one against Germany. Watching how the germans defeated “the boludos” was scary. At that moment for me Germany was a clear candidate for the World Cup. But Spain made a hell of a game against the germans. They kept the ball and gave almost no opportunities for the germans to score.

I was also afraid before the beginning of the final. The game hadn’t even started and Spain was already champion. Sounded to me like Maracanazo or Centenariazo.

The referee was pitiful. De Jong should have been off the pitch after the kick he gave to Xavi Alonso. Looks like the dutch were not willing to deploy total football, but more total karate. It was the referees responsibility to stop this and it was quite clear he didn’t.

I would like to mention the coach Vicente del Bosque. I feel amazed at how he keeps a low profile. He looks like the same person whether he wins, loses or ties. Looks like nothing moves him, always has the right word, not a bad word about the rivals. I wouldn’t say he is politically correct, but really humble. We all should learn a little from him.

Twenty per cent unemployment, a old job market, a fiscal deficit of around ten per cent, a failed economic model among other things are the problems the Spanish state faces. Really tough problems, no doubt about it. Let the spaniards celebrate today. They are already facing really tough problems. They needed something to cheer them up.

Wall Street and the World Cup

I was walking through Wall St. this morning and couldn’t help but notice that they had replaced some of the american flags with the flags of the FIFA World Cup finalist.

NY Stock Exchange

Good to know the NY Stock Exchange is not only about money and profits. The Dow Jones index has been going up for three straight days, let’s see how it opens up on Monday after a new World Cup champion.

Goodbye Maradona! Don’t come back

And yes. Maradona is gone. After losing to Germany four to zero he and the Argentinians have to hit the road and go back home.

I personally enjoyed each and every single one of Germany goals. Each of the them was like a slap in Maradonas face. Maradona was not able to move the bench properly, his team was a broken one, there was no midfield. Muller got to laugh on the first goal after Maradona refused to share the stage with him in a friendly match in Germany. On the third goal Schweinsteiger took the ball to the kitchen and then passed it for Friedrich to score. Take into account that the argentinian defense was formed by Higuian, Pastore and DiMaria. This goal was scored by the german central defender. This shows Maradona was a good player, but is not a coach and he certainly has a big mouth. He had no capacity to make the proper changes during the match.

Here is a small video of the match. It’s in spanish, but goals are a universal language.

By the way, happy Fourth!