Archive

Archive for the ‘Linux’ Category

Accidental Firefox Quits

April 24th, 2010 No comments

Whilst using Firefox I normally use the key press Ctrl+w to close the tabs, however on occasion my fingers strayed into Ctrl+q which, to my horror, quit Firefox!

A quick Google pointed me towards a post on the useful Add-On Mirrors site. I then went to the homepage of the author and installed the nice tool KeyConfig.

A quick restart of Firefox, then open KeyConfig (via Tools > KeyConfig), search for the Ctrl+q key press and disable.

Another restart of Firefox and it’s complete, no more accidental quits of Firefox! KeyConfig is a very nice and simple to use Add-On and will certainly be added to my default Firefox pack from now on, ace!

Tags: ,

SSH Magic

April 7th, 2010 No comments

A friend of mine just recently posted a trick with long hostnames when using SSH. I have commented before many times when I see people making aliases or shorthand’s like this that they just don’t know about the magic that is possible in the SSH configuration file.

Take for example this, imagine having a long hostname, with an odd port and a different user. Typing that would be a pain, most people would do something like:

alias ssh-short="ssh -p 12345 someotheruser@somelong.hostname.com"

In their ~/.bashrc, however the same can be filled into the configuration file. Edit the file ~/.ssh/config (or make it!):

Host short
  HostName somelong.hostname.com
  User someotheruser
  Port 12345

After doing this you can simply do:

$ ssh short

How much easier do you need it to be?!

Tags: , ,

Unrar Bug

February 22nd, 2010 No comments

So I was recently scripting with the unrar tool and discovered something stupid:

unrar t file.rar
if [ $? -eq 0 ]; then
  echo "Rar file is good?"
fi

However it was returning zero all the time, even when the file wasn’t a rar:

# unrar t file.rar
 
UNRAR 3.80 freeware      Copyright (c) 1993-2008 Alexander Roshal
 
file.rar is not RAR archive
# echo $?
0

So it fails the test but returns zero regardless. This makes it very unhelpful for using in scripting. Fortunately enough a mate on IRC discovered that his version did.

So I first download the existing SRPM and installed it:

# yumdownloader --source unrar
# rpm -i unrar*.srpm

Then I installed that and simply modified so I downloaded the latest, created a RPM and installed.

I have submitted the updated spec file to RPMfusion.

Tags: ,

WPA2 Wireless With Linux

February 18th, 2010 No comments

This is a simple tutorial produced by me and my good mate enigma. It is aimed at Gentoo and uses the Broadcom drivers but this should replicate to other systems.

The first step is to get your drivers and for Broadcom, which is relatively easy as they produce them for us. So first download the driver (these drivers support BM4311-, BCM4312-, BCM4321-, and BCM4322-based cards) and was also successful in this case with BCM4328.

Check that the package ‘linux-headers’ is installed, this is really just for completeness sakes. Gentoo would not work for long without this package!

(gentoo)# emerge linux-headers
... output ...

Unpack the downloaded drivers and build for your current kernel:

(gentoo)# tar -xzf hybrid-portsrc-ARCH-VERSION.tar.gz
(gentoo)# make -C /lib/modules/`uname -r`/build M=`pwd`
... output ...

Remove any existing wireless drivers.

(gentoo)# rmmod ndiswrapper b43 ssb bcm43xx b43legacy

Add in some modules required for WPA wireless:

(gentoo)# modprobe ieee80211_crypt_tkip

Test the newly built wireless driver:

(gentoo)# insmod wl.ko
(gentoo)# iwconfig
.. output ...
(gentoo)# iwlist scanning
... output ...

If that is working we can copy in the driver to the kernel and add to the autoload:

(gentoo)# cp wl.ko /lib/modules/`uname-r`/kernel/net/wireless/
(gentoo)# rmmod wl
(gentoo)# modprobe wl
(gentoo)# echo 'wl' >>/etc/modules.autoload.d/kernel-2.6

So now we have a working driver we can go on to configure for WPA. Alter the /etc/conf.d/net (note we assume that eth0 is wireless):

# Prefer wpa_supplicant over wireless-tools
modules=( "wpa_supplicant" )
 
# It's important that we tell wpa_supplicant which driver we should
# be using as it's not very good at guessing yet
wpa_supplicant_eth0="-Dmadwifi"

Next set up the network in the /etc/wpa_supplicant/wpa_supplicant.conf:

# This setting is required or the connection will not work
ctrl_interface=/var/run/wpa_supplicant
 
# Ensure that only root can read the WPA configuration
ctrl_interface_group=0
 
# Let wpa_supplicant take care of scanning and AP selection
ap_scan=1
 
# Only WPA-PSK is used. Any valid cipher combination is accepted
network={
  ssid="example"
  proto=WPA RSN   # RSN is needed for WPA2
  key_mgmt=WPA-PSK
  pairwise=CCMP TKIP
  group=CCMP TKIP WEP104 WEP40
  psk=06b4be19da289f475aa46a33cb793029d4ab3db7a23ee92382eb0106c72ac7bb
  #The higher the priority the faster it connects
  priority=2
}

And that is it, you should find that your wireless is enabled on boot.

Thanks should also go to DJ Kaos for the preparation of the driver.

Tags: ,

Acer Aspire One Tips

September 29th, 2009 No comments

Just came across a really good site with lots of tips and tricks for the AA1.

I have owned this dinky wee notebook for sometime now and can highly advise it for anyone looking for a Linux Notebook.

Some tricks I have are:

Alt+F2 > xfce-settings-show > Desktop > Behaviour > Show desktop menu on right click.
The will enable the XFCE menu on right click, which is useful to me.

Alt+F2 > xfce-settings-show > Sessions and Startup > Advanced > Launch Gnome services on startup
This will allow NetworkManger to use gnome-keyring and therefore finally store the keys for wireless!

Simple but effective!

Tags: ,