Archive

Posts Tagged ‘config’

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: , ,

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: ,

GPG Errors

August 11th, 2009 No comments

Sometimes when you are installing RPM’s or Deb’s you will find yourself faced with GPG errors. Instead of ignoring them why not fix them!

Simply download the key by using the GPG tool:

gpg --keyserver pgpkeys.mit.edu --recv-key E6F33B6628973CC0

Then import that key into either apt:

gpg -a --export 010908312D230C5F | sudo apt-key add -

Or rpm:

gpg --export -a 010908312D230C5F >key.txt
rpm --import key.txt

Simple!

Tags: ,

HTML E-mails And Mutt

June 27th, 2009 2 comments

I find myself regularly using terminals and thus have grown to love any tool that allows me to remain in terminal. Mutt is only of those, a fantastic terminal mail client. The only issue is that most people these days send HTML e-mails rather than plain text. This means that when I open them in mutt it is very unreadable. However there is a very simple solution.

First off lets make a simple script to convert the HTML into text. Several terminal based browsers exist and these can do the conversion for us (make sure to place it in your PATH somewhere).

#!/bin/sh

if [ ! -z `which links | grep -v 'no links'` ]
then
  links -html-numbered-links 1 -html-images 1 -dump "file://$@"
elif [ ! -z `which lynx | grep -v 'no lynx'` ]
then
  lynx -force_html -dump "$@"
elif [ ! -z `which w3m | grep -v 'no w3m'` ]
then
  w3m -T text/html -F -dump "$@"
else
  cat $@
fi

Add this to your ~/.muttrc:

auto_view text/html
alternative_order text/enriched text/plain text text/html

And then this to your ~/.mailcap:

text/html;html2txt %s; copiousoutput

Start up Mutt and get nothing but text e-mails.

Tags: ,