Aug 16 2012

Getting Broadcom wireless to work with Debian Wheezy (kernel 3.2)

Éverton Arruda

First of all: HAPPY 19th BIRTHDAY, DEBIAN!

Recently, I have reinstalled Debian Wheezy in my notebook, and as usual I had problems with my NVidia graphics and Broadcom wireless cards.

The NVidia graphics card is for another post. In this one i`ll show you how to get your Broadcom wireless card to work in Debian Wheezy (which is frozen, by the time i write this), with kernel 3.2

My wireles card is: Broadcom Corporation BCM4312 802.11b/g LP-PHY (rev 01)

I tried to compile the driver, as i usually do (as you can see in an older post[0] i wrote about it), but nothing happened. I tried to follow the steps in Debian`s wiki[1] and in one of those steps i got a message saying that the driver did not support the kernel version i was using.

So i went to ask Google about it and i found out that it really has no support for kernel 3.2, yet. But luckly we have another way to get it working.

All you have to do is add the necessary repositories to the sources.list, update your packages list and install the firmware package:

1
2
3
# echo "deb http://ftp.br.debian.org/debian/ wheezy main contrib non-free" >> /etc/apt/sources.list
# apt-get update
# apt-get install firmware-linux-nonfree firmware-b43-installer # or firmware-b43-lpphy-installer

And there it is! Or, at least, it should be.

The firmware package to install will depend on your Broadcom wireless card. You can check you cards with the lspci command.

I found this information on VivaOLinux[2]

Links:
[0] http://earruda.eti.br/blog/2010/07/getting-broadcom-wireless-cards-to-work-on-debian/
[1] http://wiki.debian.org/wl/
[2] http://ftp.vivaolinux.com.br/topico/Debian/Problemas-com-wireless-5


Jul 4 2012

A practical GIT web-tutorial. TryGit

Éverton Arruda

Want to learn how to use GIT[0]?

There’s a practical web-tutorial called tryGit, created by CodeSchool[1] and sponsored by GitHub[2], which is a great place to start.

All you have to do is access http://try.github.com/ and begin your studies.

Links:
[0] http://git-scm.com/
[1] http://www.codeschool.com/
[2] http://github.com/


Mar 29 2011

Iceweasel 4 on Debian Squeeze/Wheezy

Éverton Arruda

For those of you who don’t know what Iceweasel is, it’s written in Debian’s Wiki[0]:

Iceweasel is a fork Mozilla Firefox[1] with the following purpose :
1. backporting of security fixes to declared Debian stable version.
2. no inclusion of trademarked Mozilla artwork (because of #1 above)
Beyond that, they will be basically identical. (quoting Roberto C. Sanchez post in debian-devel mailing list)

Iceweasel’s (and Firefox’s) latest version, 4.0, was recently released[2], on Mach 22nd, and i’ve just upgraded Iceweasel 3.6 to Iceweasel 4.0 on my Debian Wheezy.

If you’d like to upgrade yours, follow the steps bellow.

1. Add Mozilla’s repository to sources.list
Edit the /etc/apt/sources.list file and add the repository’s address:

1
deb http://mozilla.debian.net/ squeeze-backports iceweasel-4.0

Even though it’s Squeeze’s repository, it worked fine on my Wheezy.
You can type the following command to add it:

1
# echo "deb http://mozilla.debian.net/ squeeze-backports iceweasel-4.0" >> /etc/apt/sources.list

2. Update packages list

1
# aptitude update

3. Install Iceweasel 4
You can check the version of iceweasel with the command bellow:

1
# aptitude show iceweasel

Install it with the following command:

1
# aptitude install iceweasel

Wait for it to finish and happy surfing!

Links/Sources:
[0] http://wiki.debian.org/Iceweasel
[1] http://mozilla.com/firefox
[2] http://blog.mozilla.com/blog/2011/03/22/mozilla-launches-firefox-4-and-delivers-a-fast-sleek-and-customizable-browsing-experience-to-more-than-400-million-users-worldwide-2/
[3] http://mozilla.debian.net/


Aug 12 2010

cron/USER: Permission denied

Éverton Arruda

I was trying to run crontab -e command and got this error message:

[git@pandora gitorious]$ crontab -e
cron/git: Permission denied

As the message says: it’s a permission problem. To solve this you’ll have to change /usr/bin/crontab‘s permissions:

1
# chmod 4755 /usr/bin/crontab

And if that does not solve your problem, check /var/spool/cron/‘s permissions, they should match: drwxr-xr-x (755).

Sources:
* http://www.webhostingtalk.com/archive/index.php/t-638933.html
* http://linux.derkeiler.com/Mailing-Lists/Debian/2003-09/3613.html


Jul 8 2010

Getting Broadcom wireless to work on Debian

Éverton Arruda

Debian-like distributions come with b43, or b43legacy, and ssb modules for broadcom wireless cards, but they never worked for me. Searching over the internet i found out that broadcom provides the driver for BCM4311-, BCM4312-, BCM4313-, BCM4321-, and BCM4322-based hardware, all we need to do is compile it and install the module. This is how we do it:

1 – Check your wireless card:
First of all we need to be sure that your wireless card is one of the BCMXXXX-based hardware:

1
$ lspci | grep Network

The return should be something like this:
08:00.0 Network controller: Broadcom Corporation BCM4312 802.11b/g (rev 01)

In that line you can see that my wireless card hardware is BCM4312, so it is supported.

2 – Download the Driver:
You can access Broadcom’s website[0] and download it or use wget to download it through shell.
For 32-bits CPUs:

1
$ wget -c http://www.broadcom.com/docs/linux_sta/hybrid-portsrc-x86_32-v5.60.48.36.tar.gz

For 64-bits CPUs:

1
$ wget -c http://www.broadcom.com/docs/linux_sta/hybrid-portsrc-x86_64-v5.60.48.36.tar.gz

3 – Remove the other modules:
Check if b43, b43legacy, ssb and/or an older version of wl modules exist:

1
$ lsmod  | grep "b43\|ssb\|wl"

Remove them, if they exist:

1
# rmmod b43 ; rmmod b43legacy ; rmmod ssb ; rmmod wl

Add b43, b43legacy and ssb to the blacklist, preventing them to be probed in initialization:

1
2
3
# echo "blacklist ssb" >> /etc/modprobe.d/blacklist.conf
# echo "blacklist b43" >> /etc/modprobe.d/blacklist.conf
# echo "blacklist b43legacy" >> /etc/modprobe.d/blacklist.conf

4 – Install the wl module:
Extract the tarball you downloaded and compile it, you’ll need to install the build-essential package to compile it:

1
2
3
4
5
# aptitude install build-essential -y
$ mkdir broadcom
$ cd broadcom
$ tar xvzf ../hybrid-portsrc-x86_<32/64>-<version>
$ make

If you have an older version of wl, which is usually in /lib/modules//kernel/net/wireless, you should rename or remove it, to avoid conflicts:

1
# mv /lib/modules/`uname -r`/kernel/net/wireless/wl.ko /lib/modules/`uname -r`/kernel/net/wireless/wl.ko.old

Copy the new wl.ko to /lib/modules//kernel/net/wireless and install it:

1
2
# cp wl.ko /lib/modules/`uname -r`/kernel/net/wireless/
# insmod wl.ko

Add it to /etc/modules to load it at boot time:

1
2
# echo "lib80211" /etc/modules
# echo "wl" /etc/modules

After these steps your wireless network should be working.

Troubleshooting
I had another problem: after rebooting, ssb module was being loaded even after being blacklisted, and the recently added wl module wasn’t.

To check if this is happening to you run the command below:

1
$ lsmod | grep ssb

If the command returns something, it means that the ssb module is being loaded, then you’ll have to:

1 – Remove ssb and wl modules:

1
# rmmod ssb; rmmod wl

2 – Back up the current boot ramfs, generate a new one and reboot system:

1
2
3
# cp /boot/initrd.img-`uname -r`  somewheresafe
# update-initramfs -u
# reboot

3 – Reinstall wl module:

1
2
3
# cp wl.ko /lib/modules/`uname -r`/kernel/net/wireless/
# insmod wl.ko
# depmode -a

And wl module will be loaded at boot time.

[0] http://www.broadcom.com/support/802.11/linux_sta.php


Mar 12 2010

Progress bar in cp command

Éverton Arruda

Reading Planet Debian (http://planet.debian.org) i’ve seen an interesting post, made by Daniel Stone (http://www.fooishbar.org/blog/tech/), in which he links to Chris Lamb’s blog (http://chris-lamb.co.uk/).

In the post, he answers the following question: ‘Can you get cp to give a progress bar like wget?’. The answer is the name of the post: ‘damn right you can’.

Check it out: http://www.fooishbar.org/blog/tech/cp-progress-bar-2010-03-04-12-15.html

:wq


Dec 4 2009

Creating Web Albums with gThumb

Éverton Arruda

If you want to create a web album with some images you have in your computer, with Linux as your OS, i recommend you to use gThumb.

gThumb is, as said in WikiPedia (http://en.wikipedia.org/wiki/GThumb):

… an open-source image viewer and organizer for the GNOME desktop environment released under the GNU General Public License. It was originally based on GQView, and is designed to have a clean, simple interface.

gThumb Homepage: http://gthumb.sourceforge.net/

INSTALLING GTHUMB:
I’m using Ubuntu 9.04, named Jaunty Jackalope, to write this tutorial, so the installation process is very simple, all you have to do is run:

1
# aptitude install gthumb

This should work the same way for Debian GNU/Linux, but if you’re using another distro Linux, you might have to compile gThumb.

CREATING WEB ALBUM:
When you run gThumb you’ll see this interface:

gThumb Interface

I mapped it to make it easier to follow:

gThumb Interface Mapped

The steps to create the Web Album are:
1 – Create directory to keep the images:
First create a directory and put the images you’d like to be in the album in it.

2 – Open directory with gThumb:
In gThumb interface, select the directory in which the images are (#1 in MAP)

3 – Select the images you’d like to show in the album:
After opening the directory, which contains the images, you’ll have to select the images you’d like to show in the album (#2 in MAP)

4 – Open the “Create Web Album” window and configure it:
Now, with all images selected, go to Tools > Create Web Album (#3 in MAP)
Then you should see a window like this:

gThumb Web Album Interface mapped

This is where you’ll configure your web album. The options are:

#1 – Where the web album files will be saved.
#2 – The name of the page, i recommend you to leave it as it is.
#3 – How many images per line and per column will be shown.
#4 – The title of the page, or header message, if you preffer.
#5 – The footer message of the page.
#6 – The theme that will be used in the web album.

The other options are not so important for me, so i didn’t put them in here.

In the end, you’ll have something like this: http://am.softwarelivre.org/galeria/fedora12releaseparty/

:wq


Sep 25 2009

Downloading files from Rapidshare through shell

Éverton Arruda

I’ve seen, at Viva o Linux (http://www.vivaolinux.com.br, in portuguese), a post talking about a ShellScript that downloads files from RapidShare through shell. As, sometimes, i download files from that site,  i decided to try it out and it worked fine for me.

This script uses wget to download the first html page, then it gets the link to the page that contains the link to the file, download this second page, checks the timer and waits for it to finish, after it finishes, the script starts the file download. I noticed that, if the download stops, this script continues from where it stopped.

This is how it goes:

1 – Download the ShellScript:

1
$ wget http://tokland.googlecode.com/svn/trunk/rapidshare/rapidshare-dl.sh

2 – Set execution permission:

1
$ chmod +x rapidshare-dl.sh

3 – Download File:
There are two ways you can do this:
Passing the link as an argument:

1
$ ./rapidshare-dl.sh http://link.to.rapidshare

You can also add more than one link:

1
$ ./rapidshare-dl.sh http://link.to.rapidshare http://another.link.to.rapidshare

Passing a text file as an argument:
Create a text file, named links.txt for example, and put each link in a different line, like:

1
2
3
http://link1.to.rapidshare
http://link2.to.rapidshare
http://link3.to.rapidshare

Then you run the script with the text file name as an argument:

1
$ ./rapidshare-dl.sh links.txt

You can create a link to the script in, or copy it to, the /usr/bin directory, making it executable from everywhere:

1
# ln -s $PATH_TO_SCRIPT/rapidshare-dl.sh /usr/bin/rapidshare-dl
1
# cp  rapidshare-dl.sh /usr/bin/rapidshare-dl

NOTE: This script works only in Unix-like systems.

There is also plowshare, which is another shellscript that does the same thing, and more, but i haven’t tested it yet. In the project page it says that it supports Megaupload, Rapidshare, 2Shared, 4Shared, ZShare, Badongo, DepositFiles and Mediafire, and it also uploads files to those share sites.
PlowShare Page: http://code.google.com/p/plowshare/


Jul 28 2009

Modem 3G Claro Huawei E226 no Debian Lenny/Ubuntu

Éverton Arruda

Comprei, recentemente, o modem 3G da Claro, fabricado pela Huawei, modelo E226, e infelizmente não consegui fazê-lo funcionar de cara no Debian Lenny, mas após alguns minutos de pesquisa a solução apareceu!

A solução que descreverei também funcionou do Ubuntu, nas versões Intrepid Ibex e no Jaunty Jackalope.

Você precisará do pacote wvdial, instale-o com o comando:

1
# aptitude install wvdial

Para saber mais detalhes sobre o pacote acesse este link: http://packages.debian.org/lenny/wvdial.

Após isso você deverá criar um arquivo de configuração para o wvdial, chamado wvdial.conf, com o seguinte conteúdo:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
[Dialer Defaults]
Carrier Check = off
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Password = claro
Ask Password = 0
Check Def Route = 1
Phone = *99***1#
Idle Seconds = 0
Modem Type = Analog Modem
Stupid Mode = 1
Compuserve = 0
Baud = 460800
Auto DNS = off
Dial Command = ATDT
Modem = /dev/ttyUSB0
ISDN = 0
Username = claro

[Dialer claro3g]
Stupid Mode = on
Password = claro
Auto Reconnect = off
Username = claro
Phone = *99***1#

conecte-se com o comando:

1
# wvdial -C wvdial.conf

E você estará conectado, mas ainda não será possível acessar qualquer endereço da internet, devido aos endereços dos servidores DNS estarem incorretos, então você deve adicionar as seguintes linhas ao arquivo /etc/resolv.conf:

1
2
nameserver 208.67.222.222
nameserver 208.67.220.220

Agora você poderá acessar a internet normalmente.

No Ubuntu, a configuração foi mais fácil devido à versão do network-manager, ao conectar o modem ao computador, este foi reconhecido normalmente e um assistente de configuração foi aberto automaticamente. Tudo o que tive que fazer para acessar a internet foi adicionar as linhas acima no arquivo /etc/resolv.conf após estar conectado, e deve ser após estar conectado porque o network-manager sobrescreve o arquivo /etc/resolv.conf toda vez.

Você pode, também, adicionar os endereços dos servidores DNS nas configurações da conexão da Claro no network-manager fazendo o seguinte: Sistemas > Conexões de Rede > Banda Larga Móvel > Editar conexão da Claro > Configurações IPv4 e adicionar os IPs 208.67.222.222, 208.67.220.220 na linha dos Servidores DNS e aplicar as alterações, assim você não terá que adicionar aquelas linhas no /etc/resolv.conf toda vez que conectar.

:wq


Jul 16 2009

VIM as a syntax highlighting pager

Éverton Arruda

I’ve been looking for a way to use less with syntax highlight and ended up in a page of Ubuntu Tutorials[0] website with a very good tip: Using VIM as a syntax highlighting pager[1].

All you’ll need is the package vim-full, só, in Debian-like systems, you’ll need to execute:

1
# aptitude install vim-full

Then, you’ll have to execute:

1
$ vim -u /usr/share/vim/vim72/macros/less.vim <FILE>

And you have it working!
NOTE: Depending on the version of your VIM, the path to less.vim might be different.

You can make this command simpler by creating an alias and adding it to your .bashrc file:

1
$ echo "alias vless=\"vim -u /usr/share/vim/vim72/macros/less.vim\"" >> ~/.bashrc

Now the system will need to re-read your .bashrc file, so the changes may be applied:

1
$ . ~/.bashrc

And after this you can test vless:

1
$ vless <FILE>

[0] http://ubuntu-tutorials.com
[1] http://ubuntu-tutorials.com/2008/07/14/use-vim-as-a-syntax-highlighting-pager/

:wq