Archive for the ‘Linux’ Category

Quick overview over nearby wireless lan hotspots

Thursday, March 6th, 2014

Here is a useful little command to get a quick overview over nearby hotspots:

 iw dev wlan0 scan  | grep 'SSID\|signal\|primary channel'
        SSID: 5g_station
                 * primary channel: 36
        signal: -42.00 dBm
        SSID: 2g_station
                 * primary channel: 6
        signal: -72.00 dBm

vimrc for latex

Wednesday, March 5th, 2014

Ah yes – finally – blog post time again :)

Since I am currently writing a lot of latex with vim I thought I backup share my ~/.gvimrc on my blog:

1
2
3
4
5
6
7
8
9
:setlocal spell spelllang=en_us " enable spell checking (Ctrl x + s for suggestions)
:set wrap			" wrap too long lines
:set guioptions-=m 		" disable menu bar
:set guioptions-=T		" disable toolbar
:set spellfile=/path/to/spellfile-en.utf-8.add
:set colorcolumn=80		" show a red bar in column 80
:set textwidth=80		" automatically break after column 80
:set encoding=utf-8  		" The encoding displayed.
:set fileencoding=utf-8  	" The encoding written to file. Use file -bi  <file> to verify

Puppet

Tuesday, August 7th, 2012

I started to roll out puppet to manage our servers at work and have to say I am impressed. It really changed the way I think about managing systems and is so much cleaner and easier to understand than the ‘traditional’ way.
Just being able to automate often repeated steps like enabling LDAP access or distributing config files makes puppet worthwhile. That the configuration is self documenting and versioned makes puppet priceless.
I will not post a tutorial here, just links to a few I found useful:

If you have to manage more than two or three servers, read up on puppet and consider using it (or any other configuration management tool).  It will be worth the time learning it.

Automatic Updates on debian stable

Saturday, August 4th, 2012

To automate the installations of updates on our servers I am experimenting with the package unattended-updates. Good introductions can be found here:

I have to admit that I am a bit uneasy, but in the past year of applying updates by hand nothing ever broke. So I assume that this should not cause any problems. At least it will cut down the spam flood of nagios notices when updates become available :)

 

Installing the NVIDIA driver for multiple kernels

Thursday, December 1st, 2011

I know it is totally obvious, but I never tried to figure out how to build the NVIDIA driver for more than one kernel. I always just reinstalled it and assumed it has to be that way. As it turns out I was wrong. With the -k switch you can build the driver for any not-running kernel:

sh NVIDIA-Linux-x86-280.13.run -K -k 2.6.33.4-smp -a

-K builds only the kernel module and does not uninstall the current driver

-a accepts the license

-k is the uname -r output of the kernel to build (you can also use the name of the directory in /lib/modules)

Rebooting via dbus

Sunday, November 13th, 2011

If you ever wondered how your window manager can shutdown or reboot your computer without asking for a root password, then the most likely answer is dbus.

This command will reboot a machine running dbus:

dbus-send --print-reply --system --dest=org.freedesktop.Hal \
/org/freedesktop/Hal/devices/computer \
org.freedesktop.Hal.Device.SystemPowerManagement.Reboot

You can replace “Reboot” with “Shutdown” to power off the machine completely.

Setting up us_de keyboard layout on Slackware 13.37 and Ubuntu

Monday, September 19th, 2011

It’s been some time since I talked about my us_de Keyboard layout (and a long time since I last blogged ;)) so I think it is time to update the installation instructions. You can download the layout here: us_de keyboard layout.

To set it up on Slackware do the following:

  1. Save the us_de file to /etc/X11/xkb/symbols/
  2. Copy 90-keyboard-layout.conf from /usr/share/X11/xorg.conf.d/ to /etc/X11/xorg.conf.d/
  3. Take a look at the example and change the line Option “XkbLayout” “us” to Option “XkbLayout” “us_de”
  4. Save it and restart X :)

For Ubuntu you can find all the information there: http://people.uleth.ca/~daniel.odonnell/Blog/custom-keyboard-in-linuxx11

The short version:

  1. Save the us_de file to /usr/share/X11/xkb/symbols/
  2. Edit /usr/share/X11/xkb/rules/evdev.xml and add a block like this to the <layoutList>section:
    <layout>
    <configItem>
    <name>us_de</name>
    <shortDescription>USde</shortDescription>
    <description>USde</description>
    <languageList><iso639Id>eng</iso639Id></languageList>
    </configItem>
    <variantList/>
    </layout>
  3. Then go to System->Preferences->Keyboard and klick on the Layouts tab.
  4. There click “Add”.
  5. Pick “By language”
  6. Set “Language” to “English” and “Variants” to “USde”.
  7. Click on “Add”
  8. Then remove your old layout (or move USde up as frist choice)

So much for easy to use eh ;)

Have fun with my layout!

 

Firefox middle mouse button on Linux

Sunday, January 31st, 2010

I noticed that firefox did *something* when clicking the middle mouse button without hovering a link. I finally found out what it did and how to disable it:

http://aymanh.com/archives/2006/01/27/firefox-and-middle-click-clipboard-url

So setting middlemouse.contentLoadURL to false keeps firefox from trying to load the current clipboard content.

Remapping mouse buttons

Sunday, May 31st, 2009

Yesterday I got a new mouse. A Logitech G5. Being a nice mouse overall it has a small little flaw: clicking the mouse wheel is not that easy because you can click it in three ways. Down and from left and right.

As I frequently use the middle mouse button I was not happy (because it often misinterpreted a click for a wiggle-left). As a geek I thought: wiggling the mouse wheel to the left is even easier than clicking on it. I would no longer have to lift my finger off the left mouse button. The question was: How can I remap this 7th mouse button?

After some research I found it was very easy to remap the button.

First you have to correctly configure the mouse in your Xorg configuration file:

Section "InputDevice"
Identifier "Logitech G5"
Driver "evdev"
Option "CorePointer"
Option "Device" "/dev/input/by-id/usb-Logitech_USB_Gaming_Mouse-event-mouse"
Option "ZAxisMapping" "invert"
Option "Emulate3Buttons" "false"
Option "Buttons" "9"
Option "Resolution" "800"
EndSection

(My thanks go to chuck)

From there it took a bit more research to learn that I can use xmodmap  to easily remap the mouse buttons:

xmodmap -e "pointer = 1 7 3 4 5 6 2 8 9"

Remaps button 7 into the poistion of button 2 ( mouse- wheel-click). For more information visit the very good tutorial by HP.

Now I just had to put the “pointer = 1 7 3 4 5 6 2 8 9” part into a file into my home directory (surprisingly called .Xmodmap) and let Fluxbox execute it at startup.

Now I just have to get used to other mice not worknig like that ;-)