Vote Obama/Biden 2008 - Together We Can!
 

fak3r

dim high beams for oncoming traffic


HOWTO: conky config (conkyrc) for Debian Part 2

I changed around my Conky , and it’s something you could do forever, but it’s great because it can be as heavy or light as you want it. Recently I dropped almost all together to run (full on this forthcoming). I found a panel that will house things like nm-applet output, but was missing things like a simple clock, network activity, etc. So now, using most of the same code/look that I used here, I have a small, transparent strip at the bottom of the showing me time, date, proc, proc temp, network up, network down, and power status (battery, AC and the level of charge). It looks good, it’s light, it’s all I need. Nice to bring some of the memory requirements down from as well.

# Create own window instead of using  (required in nautilus)
own_window true
own_window_hints undecorated,below,skip_taskbar
background no
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer true
# fiddle with window
use_spacer right
use_xft true
# Update interval in seconds
update_interval 3.0
# Minimum size of text area
minimum_size 10000 5
# Draw shades?
draw_shades yes
# Text stuff
draw_outline no # amplifies text if yes
draw_borders no
uppercase no # set to yes if you want all text to be in uppercase
# Stippled borders?
stippled_borders 8

# border margins
border_margin 1
# border width
border_width 1
# Default colors and also border colors, grey90 == #e5e5e5
default_color white
default_shade_color black
default_outline_color white
own_window_colour brown
own_window_transparent yes
# Text alignment, other possible values are commented
#alignment top_left
#alignment top_right
alignment bottom_left
#alignment bottom_right
# Gap between borders of  and text
gap_x 10
gap_y 5
# stuff after 'TEXT' will be formatted on 
override_utf8_locale no
#xftfont Terminus:size=8
xftfont Terminus:size=10
xftalpha 0.8
#Mail:${color}${execi 300 python ~/scripts/gmail.py}
TEXT

${offset 0}${color }${time %H:%M} ${color slate grey}${time %Z    }Date: ${color }${time %a, } ${time %e %B %G} ${offset 0} ${offset 0}   ${color slate grey}Proc:${color} $cpu%${offset 5}${acpitemp}C${offset 5}${cpugraph 16,100 000000 ffffff} ${offset 0}   ${color slate grey}Net:${offset 5}${color}Up:${upspeed wlan0}k/s${offset 5}${upspeedgraph wlan0 16,100 000000 ffffff}${offset 0}   ${color}Dn:${downspeed wlan0}k/s${color}${offset 5}${downspeedgraph wlan0 16,100 000000 ffffff}   ${color slate grey}    Power:${offset 5}${color}${battery}

Try it, you might like it - I’ll keep working on it, I’m sure I’ll find more things to add/improve. rocks.

HOWTO: convert an AVI or to DVD (VOB) in Linux

I have some AVIs that I needed to get into the format so I could burn them to . I knew I could do this in , but didn’t know how. Here is how I did it with GNU/ (testing - ). First I installed the GTK+ app, Avidemux (don’t worry, we’ll get back to the commandline soon). The I opened the in Avidemux - after it imported it I clicked on FILE -> SAVE -> SAVE VIDEO - then choose where to save the file. I saved it as movie.mpg so it would work with my next step. This took some time for me, even with my duo-core 1.6Mhz 1Gig RAM laptop, but once it was complete I could play the mpg file in multimedia apps, so it worked. Now we need to make it into the format that you can burn to . These are the weird looking folders named VIDEO_TS and AUDIO_TS that you’ll burn to the root of the . To build this from an mpg is pretty easy, you need to install the commandline app dvdauthor. Once this is downloaded we need a simple XML file to tell dvdauthor what to do, so I created a base/simple one - open your text editor of choice (vim ftw!) and create a new file:

vi dvdauthor.xml

with the contents (NOTE: change all ( and )s to brackets, apparently neither the pre or code tag accepts brackets in them in wordpress - reminder to self, fix this):

(dvdauthor dest="")
  (vmgm /)
   (titleset)
     (titles)
       (pgc)
         ( file="movie.mpg" chapters="0,15:00,30:00,45:00,1:00:00"/)
       (/pgc)
      (/titles)
   (/titleset) 

Now run dvdauthor referring to new XML file:

dvdauthor -x dvdauthor.xml

When it’s done you’ll have a new directory called , with the contents VIDEO_TS and AUDIO_TS. Open your favorite burning app (I recommend GnomeBaker) and place those two direcotries in the root of the and burn. Notice that in the XML file we called out chapters as 0, 15, 30, 45, 1 hour - obviously these can be further tweaked to be ‘real’ chapters, or left out all together. I’m sure there’s a GUI authoring app that helps you do this, if you figure it out post below and let me know. HTH!

HOWTO: fix fonts in Debian Lenny/Sid

Fonts FTWAfter a…slight slip up, I finally had the chance to install from scratch on my laptop (Dell ) the way I’ve always wanted it with GNU/ - and partitioned with LVM ( Volume Management).  After that I set out to get the to look as good in as they did (by default) in .  After much scouring around online I found a pretty easy tweak that got me most of the way. As root:

dpkg-reconfigure fontconfig-

In the dialog choose these options; Autohinter, Automatic and No. Now issue this command:

dpkg-reconfigure fontconfig

Logout and log back into your and your should be *noticeably* nicer looking. Of course after that you have to drive yourself crazy tweaking the settings for and RGB lines, installing any and all ttf-* apt-get sees, but hey, that’s what choice is all about! ;) Fonts

HOWTO: automatically reconfigure Xorg in Debian

Xorg logoIf you’re like me, you’ve messed up your .conf before and wanted to start over with the default that you know dpkg-reconfigure can set it to.  Because of this I’m posting here because I’ve needed it multiple times in the past and have tired of looking it up!  To automatically reconfigure in or issue the following:

sudo dpkg-reconfigure -phigh xserver-

Then logout/login or restart X via contrl-alt-backspace.  As one who tweaks things a bit more than he should, this has saved me a few times now. Props go to a poster on this page.

HOWTO: sound after hibernate in Linux (Gusty/Lenny)

Ignignokt says - Using a key to gouge expletives on another’s vehicle is a sign of trust and friendshipWith all the tweaking to get my Dell Vostro 1500 working with , it’s still been an annoyance to get working evertime after hibernation. It goes to sleep fine, it wakes up fine, it obeys all of the power preferences I defined within fine too, it’s just that when it comes out of hibernation, the is usually off. It’s not muted, it’s off. Trying to restart alsa (the server) is a lession in frustration, so until now I’ve been ignoring it since it was rare that I would need it, but still…come on. This week I came across a solution in the Debian Forums that creates a new task for to do before it shuts down and before it starts up.: “Create the file /etc/pm/sleep.d/49sound…

mkdir /etc/pm
vi /etc/pm/sleep.d49sound

with the following contents:

function kill_sound_apps() {
pidsnd=$(lsof | grep /dev/snd | awk '{ print $2 }')
pidmixer=$(lsof | grep /dev/mixer | awk '{ print $2 }')
piddsp=$(lsof | grep /dev/dsp | awk '{ print $2 }')
kill $pidsnd $pidmixer $piddsp
}

case "$1" in
|suspend)
kill_sound_apps
modprobe -r snd_hda_intel
;;
thaw|resume)
modprobe snd_hda_intel
;;
*)
;;
esac

exit $?

Then just make it executable:

# chmod +x /etc/pm/sleep.d/49sound

So before shutting down, properly shuts down the , and when it comes back it, it properly starts the . As always, this *should* work, but the fact that it hasn’t been updated in Gusty is one of the reasons I’m shifting to on this ‘top.

NOTE: yes, I am thinking of making Ignignokt my official mascot. “Using a key to gouge expletives on another’s vehicle is a sign of trust and friendship

HOWTO: use monit to keep Lighttpd and Varnish running

IgnignoktThanks to a post from Steve over at -administration.org, I finally got around to setting up monit, the little monitoring app we use at work to keep things sane.  I was getting around to installing it at home, but it became more urgent when went down last week; without it running there’s nothing to handle requests on :80, so as a webserver it’s dead. So here’s my monitrc for the webserver fronted by , acting in the reverse proxy/http accel role. Varn is listening on 80, then, if things aren’t cached, it forwards things on to listening on 82. Lighty also listens on the standard 443 for HTTPS requests, so we check that as well.

check process  with pidfile /var/run/varnishd.pid
start program = "/etc/init.d/ start"
stop program = "/etc/init.d/ stop"
if cpu > 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if totalmem > 200.0 MB for 5 cycles then restart
if children > 250 then restart
if loadavg(5min) greater than 10 for 8 cycles then stop
if failed host 127.0.0.1 port 80 protocol http
then restart
if 3 restarts within 5 cycles then timeout

check process  with pidfile /var/run/.pid
start program = "/etc/init.d/ start"
stop program = "/etc/init.d/ stop"
if cpu > 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if totalmem > 200.0 MB for 5 cycles then restart
if children > 250 then restart
if loadavg(5min) greater than 10 for 8 cycles then stop
if failed host 127.0.0.1 port 82 protocol http
then restart
if failed host 127.0.0.1 port 443 type tcpssl protocol http
with timeout 15 seconds
then restart
if 3 restarts within 5 cycles then timeout

So now we have monit watching , , Postifx, MySQL and OpenSSH - restarting things if they fail, and emailing me the status when they do.  Next on to some long term trending with Cacti providing some rrd graphing and then we’ll really have an idea of what this box is doing and be able to tune it accordingly.

HOWTO: notes on securing Debian

Looking over the  own harden-doc guide online, (which is a monster of a resource) as well as Debian Help’s security page gave me some excellent new ideas on how to secure and in general.   Also today i found a netstat command with some nice switches to help you figure out what is listening on each port in an easy to read layout, -plunt:

netstat -plunt

Plus it’s fun to say, ‘plunt’. Lastly there’s a good overview of deborphan (which assists you in keeping your system clear of unneeded packages) with coverage on how to use it at Debian Adminstrator.org. But in the comments a thread talks about how it’s better to use aptitude, as this does it automatically.


  • Recent Comment

    • MikeG: I do consulting and have no paid holidays etc. So I figure on 47 weeks a year. This allows for holidays I am...
    • sapien1980: good post! thanks :)
    • fak3r: @Shawn Certainly that would be more accurate, my orginal post was more of a use if you were trying to figure...
    • fak3r: –AZ-Sen: Jon Kyl –AZ-01: Rick Renzi –AZ-05: J.D. Hayworth –CA-04: John Doolittle...
    • assisted living: this is awesome…i will grow old and get drunk