Posts Tagged linux
Debugging Wifi on Ubuntu Linux
To actually get ubuntu to give you some logging when connecting to wifi (you know so that you can act according to some information rather than at random):
- Become superuser
- Run killall NetworkManager
- Run NetworkManager –no-daemon
This will then give you output for every stage of the connection process.
Network manager is (I believe) the tool that handles the overall process of opening a wifi connection using different processes (iwlist, iwconfig, wpa_supplicant etc) to do the actual connection.
Notes
Messages of the form “supplication connection state change number -> number” are (i think) from wpa_supplicant. Someone who isn’t me should change NetworkManager so that these are written in english. For now note that the states mean the following:
0 – WPA is disconnected
1 – WPA is inactive (no enabled connections and wpa isn’t trying to connect
2 – WPA is scanning
3 – WPA is associating (a loose-form of connection)
4 – WPA is associated
5 – WPA 4-way hand shake
6 – WPA group handshake
7 – WPA completed
I was seeing a lot of 3 -> 0 state changes when I was debugging. [This was taken from the wpa_supplicant source code in src/common/defs.h]
Add comment March 7, 2009
Backing up one’s home directory with tar
This is something that should be fairly easy. However in practice there are some problems:
- Tar has a proliferation of options and can be an effort to use – at least if you are using it infrequently
- One’s home directory often contains large files (like perfectly legally downloaded music and videos), which you don’t really want to back up repeatedly.
- Some applications put rather large things in hidden directories under your home directory
There are various solutions:
(more…)
3 comments April 20, 2008
How to stop the bell ringing in bash
To stop bash from trying to ring the bell add
set bell-style none
to the /etc/inputrc file. You can also be added to a local ~/.inputrc file – but this won’t work if
you log in as root.
Also, note that this won’t stop other applications from trying to ring the
bell – for this it might be best to switch off the bell at BIOS level.
See man bash.
Other applications whose bells you might like to stop:
less: Use the -q option. This can be acheived permanently by adding alias less=”less -q” to your .bashrc file.
man: man uses the $PAGER environment variable to display man pages, or the default pager (normally less) otherwise. Therefore add export PAGER=”less -q” to your .bashrc file.
vim: By default vim rings the bell. To stop this type set vb t_vb= at the colon-line, or add it to your .vimrc file.
emacs: Set the variable ring-bell-function to a function that doesn’t do anything. (setq ring-bell-function (lambda () nil)
1 comment March 9, 2008
How to not break your hands when using key combinations (using *nix)
I find that trying to use both hands when entering key combinations feels slightly less inclined to cause injury than using the same hand. For example, instead of pressing control-C with only your left hand, you hold the control button with your right hand and with you left hand press a control button. This approach seems to limit the degree to which you need to contort your fingers – however I’m not a doctor, so perhaps you shouldn’t believe what I say.
As one might expect, there is a slight hurdle to jump to retrain oneself to use a completely new set of keybindings, which just happen to be pressing the same keys.
Before one can set out on such a mission there are some problems with the alt key that need to be negotiated. The alt key on the right-hand side is used as a modifier to enter interesting characters.By rebinding it so as to behave like the alt key on the right hand-side, you can perform alt-containing key combinations with either hand.
This rebinding can be done for one session by typing the following commands into the shell:
xmodmap -e "keycode 113 = Alt_L" #This should make the left hand alt key (key 113) behave like a left handed alt. xmodmap -e "clear mod5" #This should stop any key (and particular key 113) from being used to insert non-latin characters.
To make this permament one needs to modify the .xmodmap file in one’s home directory – or create it should it not exist. The arguments to the -e options are then added to this file. .xmodmap should then be executed by xmodmap when X starts.
For the purpose of cutting and pasting, the new section added to one’s .xmodmap file looks like:
<pre>
keycode 113 = Alt_L
clear mod5
</pre>
Notes
See “man xmodmap” for more details on how it works.
If your love for bizarre characters exceeds you desire for possible less contorted hands, you could try rebinding a different key to act as ‘mod5′. I might recommend using the windows (super) and context menu keys for this.
You should be able to do this with the ‘add’ command – though not that this takes keysyms rather than keycodes as arguments. (This will, hopefully, make sense after consulting the manual).
On windows one can use the freeware program Sharpkeys to carry out this change. This works by setting changing an appropriate registry key.
Add comment March 9, 2008
