I was looking around for a way of monitoring dmesg output in realtime.
Some distros allow you to tail -f /var/log/dmesg however this stops being written in Ubuntu after boot, so that's not so useful.
I then found the watch command, which executes a command every 2 seconds (configurable if you like). Just watching dmesg fills my terminal output from the start, which is less than useful, so I use tail to shrink it down a bit. The command:
watch "dmesg | tail -20"
does exactly what I was after.
Monday, May 25, 2009
Monday, February 2, 2009
hard drive temperature monitoring
After having a disk recently die due to heat, I bought an Antec P182 case, designed to keep drives cooler. (FYI: it works really well)
I was interested in monitoring my drive temperatures to see how it goes, and found the hddtemp package can do this. A sudo apt-get install hddtemp will install it for you. Say "Yes" to running the daemon on startup.
To get a list of your drives and where they're mounted, you can use the sudo fdisk -l command, along with df -h and mount to see where partitions end up on the filesystem.
To view the temperature of your drives:
sudo hddtemp /dev/sda
/dev/sda: WDC WD800JD-60LSA5: 40°C
hddtemp sensors also have a wrapper into conky, a lightweight system monitoring display program, with the option ${hddtemp /dev/sda}
General forum consensus seems to be as long as your drives are under 50C, you're fine. 50C-60C is a warning area, and over 60C you're cooking your drives and reducing their lifespan by over half!
I was interested in monitoring my drive temperatures to see how it goes, and found the hddtemp package can do this. A sudo apt-get install hddtemp will install it for you. Say "Yes" to running the daemon on startup.
To get a list of your drives and where they're mounted, you can use the sudo fdisk -l command, along with df -h and mount to see where partitions end up on the filesystem.
To view the temperature of your drives:
sudo hddtemp /dev/sda
/dev/sda: WDC WD800JD-60LSA5: 40°C
hddtemp sensors also have a wrapper into conky, a lightweight system monitoring display program, with the option ${hddtemp /dev/sda}
General forum consensus seems to be as long as your drives are under 50C, you're fine. 50C-60C is a warning area, and over 60C you're cooking your drives and reducing their lifespan by over half!
Labels:
applications,
conky,
drive,
hardware,
hddtemp,
monitoring,
sensors,
ubuntu
Sunday, February 1, 2009
new kernel not appearing in menu.lst
I updated to the latest Intrepid kernel, and when debconf asked if I wished to upgrade my menu.lst, I accidentally answered "Keep Current Version" instead of "Install Package Maintainer's Version", so the entry for the old kernel didn't appear in the boot list.
A sudo update-grub wouldn't fix it, though I found an open Launchpad Bug, in which it's suggested to rename your menu.lst, and update-grub again.
So,
sudo mv /boot/grub/menu.lst /boot/grub/menu.old
sudo update-grub
and I'm back in business!
This does however mean I have to setup custom entries I had before, such as my no splash, my vga parameter, and the chainloader into the Windows partition.
A sudo update-grub wouldn't fix it, though I found an open Launchpad Bug, in which it's suggested to rename your menu.lst, and update-grub again.
So,
sudo mv /boot/grub/menu.lst /boot/grub/menu.old
sudo update-grub
and I'm back in business!
This does however mean I have to setup custom entries I had before, such as my no splash, my vga parameter, and the chainloader into the Windows partition.
Wednesday, November 26, 2008
compositing without compiz
i don't like eye candy. compiz, wobbly windows, shadows, fading, taskbar previews; they all just annoy me. i want my computer to do what i'm asking it, and now. i run a slightly minimal desktop, with just openbox to manage windows, a gnome-panel for tasks and systray, and nautilus to put files on the desktop
despite this approach, proper window transparency is a useful feature. i spend most of my work day going between a terminal and configuration files, so it is good to have a semi-transparent terminal in front, and the file i'm working on behind, that i can read off (yes, two monitors would be more useful). how can we get this effect, without all the other useless cruft?
enter xcompmgr. this useful app handles compositing, without replacing the existing window manager. install it with sudo apt-get install xcompmgr, and run with just xcompmgr
start up a gnome-terminal (or stjerm), and set transparency to about 80%. move that window over some other windows or icons, and enjoy actual proper window transparency!
xcompmgr can also do drop shadows, and combined with transset, can be setup to make your windows transparent too. i'm not so into this, but there's a good summary on urukrama's openbox guide
despite this approach, proper window transparency is a useful feature. i spend most of my work day going between a terminal and configuration files, so it is good to have a semi-transparent terminal in front, and the file i'm working on behind, that i can read off (yes, two monitors would be more useful). how can we get this effect, without all the other useless cruft?
enter xcompmgr. this useful app handles compositing, without replacing the existing window manager. install it with sudo apt-get install xcompmgr, and run with just xcompmgr
start up a gnome-terminal (or stjerm), and set transparency to about 80%. move that window over some other windows or icons, and enjoy actual proper window transparency!
xcompmgr can also do drop shadows, and combined with transset, can be setup to make your windows transparent too. i'm not so into this, but there's a good summary on urukrama's openbox guide
Labels:
applications,
commandline,
gui,
window manager
Friday, November 21, 2008
mapping middle-click to a keyboard key
One of the biggest things I miss when using my laptop is the ability to select text in one window, then middle-click paste it into another. Sure, I can push both buttons together, but that requires a degree of accuracy, and it's supposed to be a quick, one-finger action, not a move-two-hands affair. I can imagine this would be infinitely useful using Linux on a Macbook too, as they don't even have right-click. I started looking round for a solution to this problem, and eventually found it.
First, we need install an old accessibility extension to X which is called xkbset. In Ubuntu or Debian, just sudo apt-get install xkbset. The original idea of this software is to provide support for people who might not be able to use a mouse or keyboard so well, so it enables things like MouseKeys (control the cursor with the numpad) and StickyKeys (hit shift, lift off, type a letter, get a capital), and SlowKeys (only register a keypress after a certain amount of time). But we're going to use it to map a keyboard key to a mouse button with MouseKeys.
First, we'll get rid of all the cursor-control stuff, so you can still use your numpad. As root, edit the file /usr/share/X11/xkb/compat/mousekeys and remove everything between interpret.repeat= False; and // New Keysym Actions. Notice this maps some new "keysym" actions below, specifically the one called Pointer_Button2.
Next, we'll make a script to configure xkbset, to turn MouseKeys on, to not turn it off after a period of inactivity, and to map a key of your choice to middle-click. Here's my ~/.middle-click.sh:
#!/bin/bash
# set XKB layout
setxkbmap -layout us
# turn on mousekeys
xkbset m
# stop mousekeys expiring after a timeout
xkbset exp =m
# map keysym to other keysym
xmodmap -e "keysym Menu = Pointer_Button2"
# this also works
# xmodmap -e "keycode 135 = Pointer_Button2"
This maps the Menu key (it's between Right Alt and Right Ctrl on my keyboard, looks like a menu with a mouse cursor) to mouse button 2, which is middle click. Notice I can also use any other key on the keyboard, by commenting out the keysym line, and using the keycode line. Keycodes are different from keyboard to keyboard, so to get the keycode of the key you wish to use, run xev in a terminal, push the key you desire, and watch the terminal output.
For the Mac users, left-click is button 1, and right-click is button 3. If I was using a Mac, I imagine I'd map Right Command to Button2, and Right Option to Button3. I hope the right side of these buttons has a different keycode to the left side. If not, I've read of people using F11 and/or F12. man xmodmap will tell you how to use a modifier like Cmd+F12 if you so desire.
Under Gnome, I use System -> Preferences -> Sessions to start this script as I log in, so I don't have to worry about it again. Don't forget to make your script executable with chmod +x ~/.middle-click.sh
First, we need install an old accessibility extension to X which is called xkbset. In Ubuntu or Debian, just sudo apt-get install xkbset. The original idea of this software is to provide support for people who might not be able to use a mouse or keyboard so well, so it enables things like MouseKeys (control the cursor with the numpad) and StickyKeys (hit shift, lift off, type a letter, get a capital), and SlowKeys (only register a keypress after a certain amount of time). But we're going to use it to map a keyboard key to a mouse button with MouseKeys.
First, we'll get rid of all the cursor-control stuff, so you can still use your numpad. As root, edit the file /usr/share/X11/xkb/compat/mousekeys and remove everything between interpret.repeat= False; and // New Keysym Actions. Notice this maps some new "keysym" actions below, specifically the one called Pointer_Button2.
Next, we'll make a script to configure xkbset, to turn MouseKeys on, to not turn it off after a period of inactivity, and to map a key of your choice to middle-click. Here's my ~/.middle-click.sh:
#!/bin/bash
# set XKB layout
setxkbmap -layout us
# turn on mousekeys
xkbset m
# stop mousekeys expiring after a timeout
xkbset exp =m
# map keysym to other keysym
xmodmap -e "keysym Menu = Pointer_Button2"
# this also works
# xmodmap -e "keycode 135 = Pointer_Button2"
This maps the Menu key (it's between Right Alt and Right Ctrl on my keyboard, looks like a menu with a mouse cursor) to mouse button 2, which is middle click. Notice I can also use any other key on the keyboard, by commenting out the keysym line, and using the keycode line. Keycodes are different from keyboard to keyboard, so to get the keycode of the key you wish to use, run xev in a terminal, push the key you desire, and watch the terminal output.
For the Mac users, left-click is button 1, and right-click is button 3. If I was using a Mac, I imagine I'd map Right Command to Button2, and Right Option to Button3. I hope the right side of these buttons has a different keycode to the left side. If not, I've read of people using F11 and/or F12. man xmodmap will tell you how to use a modifier like Cmd+F12 if you so desire.
Under Gnome, I use System -> Preferences -> Sessions to start this script as I log in, so I don't have to worry about it again. Don't forget to make your script executable with chmod +x ~/.middle-click.sh
Subscribe to:
Posts (Atom)