Planet Larry

June 23, 2008

Ow Mun Heng

Automatic Raid Array Rebuilding

Hi guys, long time no post. Last post was at March and it's now already June.

Been busy as usual, however, not been dabbling as much as I "should" as I've been busy with other NON-FOSS related stuffs. (psst: I'm now heavily into photography. Went to shoot some Japan GT queens!! Kawaaiii)

Anyway, since this is a (nearly) purely an FOSS based blog, I'm gonna talk about my automatic Raid Rebuilding script.

You see, what happens is this, my postgresql box, (celeron 2x500GB in Raid 1) has a tendency to keep dieing once in a while for X reasons. (I have till now, been unable to locate the reason why it's dieing so often) I've tried to the write-all, read-all using dd but thus far, has not seen errors being thrown out. So, it's been a manual instance of...

go to work. see the email : Your raid has Died!
log onto the box, do the rebuild.

After a while, this just becomes tiring and I decided to fsck it and make it automatic.

Here's the script

#!/bin/bash

FAIL_DRV=`mdadm --detail /dev/md0 | grep faulty | awk '{print $6}'`

if [ -n "$FAIL_DRV" ]
then
  echo "Detected degraded array : $FAIL_DRV"
  echo "Starting automated array rebuild process"
  mdadm /dev/md0 --fail $FAIL_DRV --remove $FAIL_DRV --add $FAIL_DRV
else
  echo "Nothing to do"
fi


Simple eh..

So, now I don't have to come to work to see it all wonky because it'll automatically rebuild itself.

Some of you may ask, how come I don't just replace the drive? Because I can't find any replacement drive which is a PATA connection and at 500GB capacity! The largest I can find are 160GB.

Bummer

June 23, 2008 01:32 AM

June 21, 2008

George Kargiotakis

The quest for a better rxvt-unicode on Gentoo

Today, while studying I decided to manually run a prelink on my system. For no good reason. Just boredom I guess. The results were pretty interesting though. Among the output there was a line that made a very big impression to me. prelink: /usr/bin/urxvt: Cannot prelink against non-PIC shared library //usr//lib/opengl/nvidia/lib/libGL.so.1 Why oh why is libGL.so.1 inside the [...]

June 21, 2008 10:09 PM :: Greece  

Speed up multiple ssh connections to the same destination

When you are doing multiple ssh connections to one host there’s a way to speed them up by multiplexing them. When you open the first network connection a special socket is created and then all other connections to the destination machine pass through the first network connection and don’t open any new ones. All that [...]

June 21, 2008 08:50 AM :: Greece  

Dan Ballard

Lisp (SBCL) on Hardened Gentoo

My server, mindstab.net, runs Hardened Gentoo. I like it. It provides nice features from grsecurity and PaX like memory randomization, non executable writable memory, etc. However, it really doesn't get along so well with Lisp. Lisp in general seems to like executable and writable memory, and SBCL at least also doesn't like randomized memory. So it took a bit of work to get Lisp onto my server.

Approach 1: Failure
I spent a bunch of time trying to patch the build process in portage to coax SBCL into building. First, of course, I used gcc-config to disable the hardened gcc profile, and just use the vanilla one. Then I created a suid root shell script to call "paxctl -m -p -r -e $1" so that the sandboxed build process could disable PaX features on the SBCL binaries. I added the command to the ebuild, and created a patch to insert the command into SBCL's build process. The process goes like this, portage download's the SBCL source and a pre-compiled SBCL binary. The patched ebuild then calls my suid root script which disables PaX on the pre-compiled binary so it actually runs (as opposed to crashing under PaX) and then a new SBCL binary is built from the source and the pre-compiled binary builds a core file from the SBCL lisp source. The patched SBCL make.sh then again calls the suid root script on the new binary, so it will run. Then it should load the new core and recompile the system for itself. Sadly, while it runs at least, it chokes on the core file and hangs while using 100% cpu. I couldn't get past this so I eventually gave up. If anyone has any suggestions that'd be great.

Approach 2: Success
So the actually solution was as follows: Download the most recent precompiled SBCL binary from the website (1.0.15 for x86), run "paxctl -p -e -m -r -x -s " on src/runtime/sbcl (to cover all the bases). Then run "sh install.sh" to install SBCL to /usr/local. That's it.

The problem with this is you can't emerge lisp packages in portage, you have to install them by hand (unless maybe you want to fake inject the package into the portage database).

I downloaded a copy of slime, untarred it and popped it in my .emacs and I had a full lisp environment ready to go, and on my hardened machine no less. Not so bad.

June 21, 2008 07:07 AM :: British Columbia, Canada  

June 20, 2008

TopperH

Howto: AuthenTec AES1610 Fingerprint reader and gentoo

My laptop comes with a fingerprint reader that can be used for authentication:
Bus 006 Device 007: ID 08ff:1600 AuthenTec, Inc.


There is a project called fprint that allows users to use it under linux. There is not yet an ebuilt for it in the portage tree, but I found it in an overlay.

The main issue I found is that libfprint does not compile with gcc-4.1.2 (which is currently stable for gentoo amd64) because of an "-fgnu89-inline" error.
This option is not yet implemented in 4.1.2 so I decided to switch to gcc-4.3.1.

I assume layman is installed and working, otherwise take a look here.

# layman -a wschlich-testing
# echo =app-misc/fprint_demo-0.4 >> /etc/portage/package.keywords/general
# echo =media-libs/libfprint-0.0.6 >> /etc/portage/package.keywords/general
# echo =sys-auth/pam_fprint-0.2 >> /etc/portage/package.keywords/general
# emerge -av fprint_demo pam_fprint


and now, as a regular user under X:

$ fprint_demo


In the enroll tab enroll the right index finger moving it smoothly . Than test it in the verify tab. It will take dozens of tries before getting a correct match, this is why we are going to use the usual password method if the match fails.

Now we have to edit the /etc/pam.d/system-auth file inserting this line:
auth sufficient pam_fprint.so

before this one:
auth sufficient pam_unix.so try_first_pass likeauth nullok

June 20, 2008 08:18 PM :: Italy  

Asus PRO60Eseries + Gentoo = LOVE

OVERVIEW:

CPU : Duo T7250
DISPLAY: 13.3" WXGA
WIRELESS: 802.11abgn + Bluetooth
HD: 250GB
RAM: 3GB
revolver ~ # lspci
00:00.0 Host bridge: Intel Corporation Mobile Memory Controller Hub (rev 03)
00:02.0 VGA compatible controller: Intel Corporation Mobile Integrated Graphics Controller (rev 03)
00:02.1 Display controller: Intel Corporation Mobile Integrated Graphics Controller (rev 03)
00:1a.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Contoller #4 (rev 03)
00:1a.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5 (rev 03)
00:1a.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2 (rev 03)
00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03)
00:1c.0 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 1 (rev 03)
00:1c.1 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 2 (rev 03)
00:1c.2 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 3 (rev 03)
00:1c.3 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 4 (rev 03)
00:1d.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1 (rev 03)
00:1d.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2 (rev 03)
00:1d.2 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #3 (rev 03)
00:1d.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 (rev 03)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev f3)
00:1f.0 ISA bridge: Intel Corporation Mobile LPC Interface Controller (rev 03)
00:1f.1 IDE interface: Intel Corporation Mobile IDE Controller (rev 03)
00:1f.2 SATA controller: Intel Corporation Mobile SATA AHCI Controller (rev 03)
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 01)
02:00.0 Network controller: Intel Corporation Unknown device 4229 (rev 61)
05:00.0 SATA controller: JMicron Technologies, Inc. JMicron 20360/20363 AHCI Controller (rev 02)


What does not work:
  • The fingerprint reader (Bus 006 Device 002: ID 08ff:1600 AuthenTec, Inc.) [EDIT now it works]
  • The LCD backlight controls (CONFIG_ASUS_LAPTOP=Y doesn't help and acpi4asus doesn't compile)
What needs workarounds:
  • ALSA
00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03)
I needed to add "options snd-hda-intel model=lenovo" to /etc/modules.d/alsa and update modules.

What I have not tried yet:
  • Integrated 1.3 megapixels webcam (I don't really need a webcam)
  • [edit] now it works, see here


revolver# uname -snrv
Linux revolver 2.6.25-tuxonice-r4 #4 SMP PREEMPT Thu May 22 16:04:52

revolver ~ # eselect profile show
Current make.profile symlink
/usr/portage/profiles/default/linux/amd64/2008.0/desktop

Kernel config
make.conf

June 20, 2008 05:38 PM :: Italy  

Jürgen Geuter

The eclipse thing

I read an article recently about how to get the interactive django console running in pydev/eclipse (pydev is a plugin offering python supprt to eclipse). The whole shebang involved sacrificing around 10 goats and 7 virgins (as in computer science students ;-) ) to a blind man from Paris (do not ask me why, I don't know). It was very hacky, it was not able to support more than one installation (meaning that you had to go to the preferences for your IDE whenever you started working on another project. That does not only sound retarded, it actually is.

Django comes with a very good interactive shell that supports the two big shells that Python people tend to use: The "normal" python interpreter and iPython which pretty much anyone who has used Python for more than 5 minutes uses. iPython has support for tab completion, works everywhere and is all in all one of the most useful tools to anyone using python. So why would you want to work around that and cheat your IDE into providing something worse?

The whole IDE thing usually comes from Java, C++ and C# backgrounds: IDEs can help you write all that boilerplate code that those languages force you to spend your time on instead of doing something useful. People trained in that mindshare just cannot think about not using an IDE when it just does not work like that with dynamic languages.

IDEs for static languages work well cause everything is specified and fixed. You know what type a certain variable has so you can show problems with assignments as errors and whatnot. With dynamic languages you have absolutely no clue what type a variable could be. Of course you can have a debugger running in the background at all times having the code running while you write it but obviously that will not be feasible for long. IDEs just don't offer the benefit to dynamic languages that they offer to static ones.

Of course you can set eclipse up to do python syntax highlighting and use it as the slowest text editor ever but when you know that an IDE won't do that much good to you, getting a serious editor set up properly (and that includes learning how to use it) will make sure you don't have to wait for your IDE to catch up with what you're doing.

When you write Python what you want is a powerful text editor (like vim for example) that helps you work with the characters you type, that allows you to reformat things properly, that is scriptable (AFAIK eclipse's excuse for a text editor does not allow selecting columns for example, something incredibly useful). Then you want ipython in case you want to try something out live: Import your code and poke around in it, see if it's doing what you want. Next thing is to set up your preferred unit testing and write tests for the stuff you write. The tests do for you what the IDE might do for Java people: They make sure your code is doing what it is supposed to do. In addition if you work on anything more complex than one tiny script you should have one SCM (source code management system) installed and should know your way around with it (pick git, btw.): Make sure that you're not commenting out stuff all the time but that you really delete it if it's broken. You can get it back from the SCM but for now dead code makes things less readable. Throw a comment in there with a TODO item and just get on with it.

Eclipse is not a bad IDE actually. If I had to write JAVA I might use it. I played around with it for PHP once and it didn't completely suck (there were some nice HTML formatting plugins available), but in the end the slowness and how it made everything overly complex (even things that just aren't) made me look another way.

Text editors have been around for a long time and the two big ones (vim and emacs) together have around 50 years of experience writing text editors, they should have picked up a few thing along the way and there's a reason people still use them.

If you use a language that only is bearable with an IDE use one, but for other languages don't waste your precious resources on them.

June 20, 2008 02:49 PM :: Germany  

Attaching CDs to magazines ...



I got the new iX magazine (there was a "get three for free" campaign recently which this was the last one of), for those not knowing it, it used to be a very technical magazine about new trends in information technology, sometimes so specialized that you couldn't understand an article if you had not spend 10 hours before preparing. It was not your everyday magazine which was a property I really enjoyed: It tried not to be shallow.

Well that has changed, the last few issues all were quite bad and seem to solely focus on comparing software: They had a really shallow article on forums a few issues ago, this time it was blog software.

But this is not about the articles (I could write a whole post on why posting a RubyOnRails howto now makes you look like someone who has completely lost touch with the tech world) this is about the CD that came with it.

When I was younger I subscribed to a PC gaming magazine. They always had a CD coming with it that had all kinds of patches, demos and drivers on it (I was little and still using Windows back then ;-) ) so the CDs were really a nice thing to have: I had no Internet and the top-of-the-line connection was a 54kbit modem which ain't exactly fun to download stuff with.

Back then, CDs had a value because while the ping sucked (one month in between packets) the data transfer rate was really great (one packet gave you almost 700 MB of data).

Nowadays everyone with some interest into technology has an internet connection (at least in areas where iX is being read since it's a German magazine). Now for some people the aggregation of different blog software with their specs and short Pro- and Con-lists might be helpful but if they are interested in setting up a blog they will have an internet connection. If they wanna try out a few of the software packages they could just download them (seriously, how big is the average blog software? 3 Megs?).

Giving them a CD with it has a bunch of problems:

  • Environmental damage: You produce many CDs which are a pain in the ass to recycle (and no they do not belong into the normal trash or the German "gelber Sack").

  • People really interested in the software packages will go to the websites anyways looking for plugins, themes or just updated versions (with the speed in which many software projects move as soon as you download a version and have it burned to CDs there will be a new version out)

  • I have yet another coaster around.



The time of adding CDs to your magazine with software that people can get on the internet for free is long gone and you don't look like you are in touch with current tech if you have not realized that.

There are reasons to add CDs/DVDs to your magazine: Many movie/TV magazines have DVDs with legitimate copies of movies attached to them, that's useful (and a cheap way to get good movies for small money [sometimes]). If you get a free version of some software that you usually have to pay for it might make sense to add a CD/DVD with that to your magazine: Sometimes games magazines ship with full versions of somewhat older games for example. Those are all valid uses.

But just creating more stuff that I have to take care of recycling annoys me and makes you look amateurish. Get over it, the sales that you used to get because someone needed a driver for his hardware, his original CD was scratched but without the driver the graphics card wouldn't work and your magazine was the one that had the driver are long gone. It's cheaper to just go into an internet cafe and get the stuff if you really have no internet yourself.

The times of adding value to your product by aggregating stuff that's free are gone: There's value in your service testing things, but don't waste resources by burning all that software onto a CD.

June 20, 2008 09:55 AM :: Germany  

June 19, 2008

Thomas Capricelli

Release of cvxprocessing-1.0-beta1 (+tomography)

I’m releasing part of the code developed during my PhD. Those are tools useful in the field of convex processing, and more precisely to solve a problem called convex feasbility problem.

This is based on Qt4, and released mostly under the GPL (with an added restriction : you must cite my work if you use this). Oh.. and there are unit tests, examples, and documentation, too.

caution : rest of the post is for those mathematically oriented people, and no more related to free software.

The convex feasbility problem is to find a point in the intersection of closed convex sets inside a Hilbert space. Believe it or not, quite some real-life problems can be formulated as such, for examples some image reconstruction problems in medical imaging, or also in the field of signal processing.

There are a lot of algorithms to solve this, you can find more information about those in the bibliography of my papers, or those from my PhD advisor M. Combettes.

This code provides the necessary tools to play and test those algorithms. Besides all elementary methods on Euclidian/Hilbert Space, it provides a way to compute projections on different interesting convex sets. There are also the needed tools to experiment with tomography, which is one of the main application in my PhD. You can compute the radon transform of an image and use this as data in convex feasibility formulation.

This is of course mostly of interest for those working in convex optimization and/or tomography. I want to highligh the fact that sharing such kind of code is very rare in this community. I would have gained a lot of time at the beginning of my thesis if other people had provided such code.

link : http://labs.freehackers.org/wiki/cvx-processing

June 19, 2008 05:44 PM

Jürgen Geuter

Django Foundation

Good news in Django land: As it was posted a few days ago Django is now "ruled" by a foundation (just like Apache, Mozilla or Python). This marks an important date for Django because now entities interested in pushing Django forward can contribute not only in code but also in money towards the foundation which might lead to the opportunity of paying people to work on Django.

Also there's a roadmap for the way towards 1.0 which might calm down many of those that only consider something with the magic numbers 1.0 to be stable and usable.

The roadmap shows that the interesting changes will soon be merged into trunk (like for example newforms-admin) which will make working with Django even nicer than it is today. Exciting times.

June 19, 2008 04:45 PM :: Germany  

Nirbheek Chauhan

The much-delayed post

*Very* late, this post is. I hope it's not too late yet :)

I'm talking about something that was much-talked about, and people are probably following some of the suggestions made about this, but I think there should be some sort of standardisation.

Here's the header I use for all my GSoC code:


# vim: set sw=4 sts=4 et :
# Copyright: 2008 Gentoo Foundation
# Author(s): Nirbheek Chauhan <nirbheek.chauhan@gmail.com>
# License: GPL-2
#
# Immortal lh!
#


I encourage all of you to adopt the last two lines in your headers as well :D

June 19, 2008 07:44 AM :: Uttar Pradesh, India  

June 18, 2008

Brian Carper

Wish list

What's the Common Lisp version of Perlmonks or Ruby-forum? I have yet to find it.

comp.lang.lisp is largely crap. 50% of the traffic on that list is spam about shoes and fake watches. The other half is equally split between:

  • People debating tiny, silly semantic points of the Common Lisp Hyperspec.
  • People stuck in the 70's or 80's, talking about the good old days, ruminating about Lisp history.
  • Flame wars.
  • New people asking for help. Some get good honest advice and helpful answers, many are flamed and ridiculed into next week if they even hint that they dislike the parentheses.

The Common Lisp community (if you can call it that) is a bunch of really smart guys, but they all live isolated in hermit shacks up in the mountains and they spend their time doing magic tricks with Lisp that few people ever see, and if you wander too close they throw rocks at you.

What's the Common Lisp equivalent of perldoc or rdoc? We have the Hyperspec. It's an impressive document, but it's a bunch of painful HTML that looks like it was created in the early 90's, probably because it was. It reads like a dusty, dry, technical document probably because it is. What it's not, is friendly or easily readable.

Perl has CPAN, Ruby has rubygems, what does Lisp have? Either a hand-rolled system definition script, or if you're lucky an ASDF install file. ASDF is the semi-standard Lisp way of installing libraries, except that it doesn't quite work in Windows, it doesn't check dependencies or handle different versions of a package very well, and it doesn't work the same on all Lisp implementations. Many people in the so-called community think it's not very good.

The fellow running Lispcast makes another good point. Where can you download Lisp? It's not obvious.

You could say "OK Brian, good idea, now get to work!" The problem is that even if I had the time or willpower, I'm not the smartest guy in the world. I honestly don't think I could design and run and maintain a CPAN. And even if I did, would anyone use it? But I do know that there ARE plenty of smart, enthusiastic people using Lisp. Yet high-quality friendly code is largely not being produced.

Peter Christensen wrote about "langauge snobs" and the importance of community. One point made is that some really ugly, horrific languages have been extremely successful simply because they've been accessible and fun. An example given is the scripting language in Second Life, which has over 2.5 billion lines of code written in by tens of thousands of amateurs and has accurately modeled a realistic 3D environment with thousands of users at any given time. All in an ugly language some guy invented AND implemented in one week. The developers admit that the language is total crap, but it doesn't matter. 1) It has very good and accessible documentation, 2) it has a very newbie-friendly community, and 3) and it's easy to pick up, throw together some code and get immediate results. Three things Common Lisp lacks.

This is something I've said myself many times: an active, supportive, enthusiastic community is essential for the health of any programming language. Common Lisp simply doesn't have one and it's a shame.

I still secretly hope that Clojure or NewLisp or Arc turn out to be a huge success. They are the kinds of things Lisp needs today.

June 18, 2008 07:47 AM :: Pennsylvania, USA  

June 17, 2008

Patrick Nagel

Firefox “Download Day”

They asked for it - they got it… a nice DDoS ;) (spreadfirefox.com and mozilla.com were unreachable for a couple of minutes after 17:00 UTC).

Anyway… go ahead and download it, it’s a good piece of software. I tried out beta3 and the RCs, and I like the new version so much, that I’m now using Firefox as my default browser again (after more than two years with Konqueror as my default browser).

Download Day 2008

Nice birthday present by the way, Mozilla! Thanks! :)

June 17, 2008 06:17 PM :: Shanghai, China  

Bandan Das

Homework time

The best browser ever, landed on earth today but while big daddy was busy asking everyone to do their homework to get ready for the party, he failed to do his own.

First and foremost, as all of us came know a little later, the download day was not just 17th June, 2008; it was 17th June 2008 at 10:00 am PDT. No one ever cared to inform that important piece of shit. All big daddy wanted was a 1 million downloads in 24 hours, he didn't care how frustrated you would be to find out that you don't see your download at 12 am of June 17th, local time. And no Sir, I am not asking you to take care of all the time zones here, a simple countdown timer on the website would have been enough. Moral of the story: Big Daddy, you came up with something really impressive, you made us do our homework, but you failed to do your own!

Now, everyone knows that the digg effect is not just limited to sites on Digg's front page. Anyone can feel it; especially when you want 1 million downloaders to come to your site when you release the most anticipated browser ever, what on earth were you thinking ?! It's never going to be a breeze. Everyone knows that! Again, you failed to do your homework! Moral of the story: You promised us all the good things on June 17th, and all the good things you did give, but; the overall experience was somewhat dissapointing :(

Ok, now that my rant is over, I am off to start enjoying my brand new browser :)

read more

June 17, 2008 06:04 PM :: India  

Sean Potter

Gentoo Linux on my MacBook

I purchased my MacBook back in November of 2007, shortly after the Santa Rosa chipset update. I'd use Mac OS X a little previously, mostly in the form of trying out OSX86 on my old laptop. After using it for several months as my primary mobile platform, I decided it was time for something different.

OS X is nice and all. User-friendly, intuitive, and works fantastic with the hardware Apple ships. I still feel it's lacking in some areas where Linux excels, such as configurability and the space for customization. Not to mention that there's essentially no decent games out for OS X. I can install Linux and throw on a native version of UT2004 and play away now.

Installation wasn't horribly difficult, but Mac OS X was needed at least initially, and I didn't realize this. Gentoo now boots without an issue on the MacBook. All that I need to finish doing is installing the programs I need and setting up the WiFi.

I'm hoping that I have all the hardware working correctly in the next week or so, and that includes the web cam and touchpad. My only other concern is battery life. It'd be fantastic if I get the same amount or more battery out of the machine with Linux.

June 17, 2008 04:37 PM

Nirbheek Chauhan

AutotuA Weekly Status Report - I (and more ;)

Yes, I am alive and kicking. Although at a much slower pace than I would've liked ;)

So I sent my first weekly report over yesterday, you can either read the (excessively long and probably boring and or confusing) weekly report or you can, well, do something else :P

And guess what, next time onwards, all you have to do is checkout the AutotuA news page or subscribe to the "gsoc" label on this blog to stalk me.

Oh, right, this will also probably be my first post on the FLOSS India Planet!

Hello everyone!~ I'm Nirbheek Chauhan (also called as "slacker #1" by some). I was one of the co-ordinators of this tiny little event in IIT Kanpur's tech-festival Techkriti.

You might have heard about it and maybe seen the awesome speakers (and posters ;) of the event.

You've probably had the pleasure of conversing with the mastermind behind the whole event.

And maybe, just maybe, you've heard about "FOSSKriti" :D

PS: We'll (hopefully) be back next year, so this is shameless advance publicity ;p

June 17, 2008 04:29 PM :: Uttar Pradesh, India  

Brian Carper

Westinghouse, the saga continues

Friday a guy on the phone said he'd call me back Monday or Tuesday to give me an update on when / whether they're ever going to send me my monitor. Monday came and went with no call. Not really surprising.

I filed a complaint with the BBB today. We'll see how that goes. At the BBB Westinghouse has around 150 complaints in the past 36 months, but 133 of them were supposedly solved "satisfactorily" and Westinghouse somehow still has the highest possible rating at the BBB. I've read some things about the BBB not being an entirely neutral entity itself, but who knows. I'll start filing complaints with other consumer groups if I need to.

A good handful of people have left comments here at my blog saying they aren't going to buy anything from Westinghouse themselves, which is great to hear. I may mention my blog to Westinghouse next time I call them, if there is a next time. Is not sending me the monitor I paid for really worth losing a bunch of customers?

The sad thing is that I really do need a monitor with component and composite inputs, and they are somewhat rare (the local store had none except Westingcrap brand). However I have found a Gateway model that has them, so maybe that'll work out. I'd gladly take a refund from Westinghouse rather than a monitor at this point.

June 17, 2008 07:56 AM :: Pennsylvania, USA  

June 15, 2008

Michael Klier

Mail Client Quest

I've spent almost the whole last week testing different mail clients because I somewhat wasn't happy with mutt (especially the address book functionality sucks). Also, now that there are new methods in categorizing data, via tags/labels for example, the possibilities of processing my mails effectively with mutt seemed limited.

Until now I've used my INBOX as a staging area to organize tasks which are associated around the projects I am involved. I simply kept mails which required action on my behalf in my INBOX. Be it that I just have to reply or that I have to look at something or fix a bug, you get the picture. Since I get lots of emails (~1000 on an average week) things got quite messy in times and I sometimes forgot about some of those mails/tasks. What I ideally wanted to have is a way to label messages and then search my INBOX for mails which have a certain label assigned, or limit the number of mails I see by certain key words. The IMAP protocol supports user defined labels which would be a starting point, but mutt doesn't support them :-( (it should be noted here that mutt wasn't designed to work with IMAP in the first place).

I first took a look at sup. Sup is written in Ruby and promises a completely new approach to mail. Most of it's features are inspired by gmail and mutt. It supports labeling of messages, vim style key bindings and some really nifty quoting features like auto folding in mailing list threads. It's usage is quite intuitive when you come from mutt and I've used it exclusively over the last week. But, all those nice shiny features aside, sup has some major drawbacks. To allow labeling of messages it manages it's own index where it keeps all the related meta data. The problem with that, is that it doesn't update the mail status on the server side. Means, mails that appear as read in sup are still unread in the INBOX on the IMAP server. You also cannot move mails between IMAP folders, sup provides it's own folder mechanism though. Also, if you access your INBOX from another mail client and change things, like moving mails to folders etc. sup won't start anymore because you have to sync it's local index again with the IMAP account.

The other client I've tried was cone which is part of the courier-mta project. This mail client is designed from the ground to deal with IMAP accounts (it supports POP3 as well), therefore it allows labeling of messages. It also allows you to store it's configuration settings on the IMAP server itself and supports IMAP address books. That all would fit perfectly if it's user interface wouldn't be that crappy (IMO at least). Well, I have to say that I am quite used to have vim key bindings everywhere possible, browser, shell, editor (hah!) and preferably in my mail client as well. Also the way how mailinglist threads are visually presented in the INBOX listing is not satisfactory once you're used to the nice thread view mutt offers.

So it seems I won't get 100% lucky anytime soon. I didn't try alpine, because form what I've seen on some screenshots it doesn't provide a nice thread view. And before someone now says “gmail”, I don't like to have my private mail on a machine I have no control over whatsoever ;-).

At least I was able to solve my todo crisis. Tante mentioned remember the milk lately on friendfeed as being a nice tool to manage ones todo lists. While I have heard of it multiple times, I haven't tried it until two days ago. I have to say it's quite nice. I love the fact that you can navigate your online todo list with the keyboard only :-) and especially that you can mail new tasks, which then appear in your task INBOX (hah! another one). Though I would prefer not to have to process new tasks which I've send by mail in my task INBOX again.

So I think for now I'll stay with mutt, although it's IMAP support is somewhat limited.

What mail clients to you use and why? Do you have any suggestions? Did I miss one (ncurses/command line clients only)? Is there a nifty tool to integrated IMAP address books in mutt (I've searched but with no luck)?

UPDATE: Ok, it seems I was a little quick on this one, because cone has a nice threading view. You can enable it by using $ + T. I'll use cone now for the upcoming week and see if I can get used to it's different key bindings (I constantly hit ”j” and ”k” to navigate around but it doesn't work ;-)). Anyway, the better IMAP support will probably be worth it.

Read or add comments to this article

June 15, 2008 08:49 PM :: Germany  

Martin Matusiak

renewip: when the router keeps disconnecting

So we now all have broadband connections and everything is great, right? Well, not quite. Some providers have better services than others. My connection seems rather fragile at times and tends to die about once in three-four days. When that happens, no amount of resetting the equipment helps to get it working again. It’s an upstream issue that I have no control over.

But there is another problem. Once the cable modem starts working again, the router (which receives an IP address from my provider, and serves LAN and wifi locally) doesn’t seem to know this and doesn’t automatically re-establish a connection. Or I’m not really sure what it does, it’s a black box and there is a web interface to it, where there’s a button to press to do this, which sometimes works. But what really is happening, who knows. There seems to be a weird timing problem to the whole thing, where if I kill the power for both the modem and the router and they both come back at the same time, it generally works. However, if the modem is taking longer to negotiate a link, the router will be disconnected. And apparently doesn’t try to reconnect on its own, so I’ve been stuck rebooting the two a few times until the timing is right. Resetting them separately for some reason doesn’t seem to work.

So what can be done about it? Well, the router does have that stupid web interface, so it’s possible to make those clicks automatically if we’re disconnected. Python’s urllib makes this very easy to do. First we login with router_login, which submits a form with POST. Then we check the state of the internet connection with check_router_state, which just reads out the relevant information from the page. And if it’s disconnected we run renew_router_connection to submit another form (ie. simulating the button click on the web page).

Testing connectivity

More than just testing if the router has a connection to the provider, broadband connections sometimes have connectivity problems. Even if you can get a connection, the provider sometimes has problems on his network, meaning your connection doesn’t work anyway.

So I came up with a test to see how well the connection is working. It’s an optimistic test, so that first we assume we have a fully functional connection and ping yahoo.com. It doesn’t matter what host we use here, just some internet host that is known to be reliable and “always” available. For this to work these conditions must be met:

  1. We have to reach the gateway of the subnet where our broadband IP address lives.
  2. We have to reach the provider’s nameserver (known as dns1 in the code) to look up the host “yahoo.com”.
  3. We have to reach yahoo.com (we have their IP address now).

So first we ping yahoo.com. If that fails, it could be because dns lookup failed. So we ping the provider’s nameserver. If that fails, the provider’s internal routing is probably screwed up, so we ping the gateway. And if that fails too then we know that although we have an IP address, the connection is dead (or very unstable).

#!/usr/bin/env python
#
# Author: Martin Matusiak <numerodix@gmail.com>
# Licensed under the GNU Public License, version 3.
 
import os
import re
import sys
import time
import urllib
 
ip_factory = "192.168.2.1"
password = ""
 
inet_host = "yahoo.com"
 
 
def write(s):
    sys.stdout.write(s)
    sys.stdout.flush()
 
def grep(needle, haystack):
    if needle and haystack:
        m = re.search(needle, haystack)
        if m and m.groups(): return m.groups()[0]
 
def invoke(cmd):
    (sin, sout) = os.popen2(cmd)
    return sout.read()
 
def ping(host):
    cmd = 'ping -c1 -n -w2 ' + host + ' 2>&1'
    res = invoke(cmd)
    v = grep("rtt min/avg/max/mdev = [0-9.]+/([0-9.]+)/[0-9.]+/[0-9.]+ ms", res)
    if v: return int(float(v))
 
def find_lan_gateway():
    cmd = "route -n"
    res = invoke(cmd)
    v = grep("[0-9.]+\\s+([0-9.]+)\\s+[0-9.]+\\s+UG", res)
    if v: return v
 
def load_url(url, params=None):
    data = None
    if params: data = urllib.urlencode(params)
    f = urllib.urlopen(url, data)
    return f.read()
 
 
def router_login():
    form = {"page": "login", "pws": password}
    load_url("http://%s/login.htm" % ip, form)
 
def check_router_state():
    state = { "conn": None, "gateway": None, "dns1": None }
    router_login()
    s = load_url("http://%s/js/js_status_main.htm" % ip)
    if s:
        v = grep("var bWanConnected=([0-9]);", s)
        if v == "1": state['conn'] = True
        elif v == "0": state['conn'] = False
        if state['conn']:
            g = grep('writit\\("([0-9.]+)","GATEWAY"\\);', s)
            if g and g != "0.0.0.0": state['gateway'] = g
            g = grep('writit\\("([0-9.]+)","DNSIP"\\);', s)
            if g and g != "0.0.0.0": state['dns1'] = g
    return state

def renew_router_connection():
    router_login()
    form = {"page": "status_main", "button": "dhcprenew"}
    s = load_url("http://%s/status_main.htm" % ip, form)
    return s
 
 
 
ip = find_lan_gateway()
if not ip:
    ip = ip_factory
    write("LAN gateway detection failed, using factory ip %s for router\\n" % ip_factory)
else:
    write("Router ip: %s\\n" % ip)
 
while True:
    try:
        router = check_router_state()
        t = time.strftime("%H:%M:%S", time.localtime())
        if router['conn']:

            hosts = [(inet_host, inet_host),
                ("dns1", router['dns1']), ("gateway", router['gateway'])]
            connectivity = ""
            write("[%s] Connected  " % t)
            for (name, host) in hosts:
                delay = ping(host)
                if delay:
                    write("(%s: %s) " % (name, delay))
                    break
                else:
                    write("(%s !!) " % name)
 
            write("\\n")
        else:
            write("[%s] NOT CONNECTED, attempting reconnect\\n" % t)
            renew_router_connection()
    except Exception, e:
        cls = grep("<type 'exceptions.(.*)'", str(e.__class__))
        write("%s: %s\\n" % (cls, e))
    time.sleep(3)

Download this code: renewip.py

June 15, 2008 07:20 PM :: Utrecht, Netherlands  

Brian S. Stephan

Sender Policy Framework 2

Finally got Sender Policy Framework support added to my Postfix install like I said I would. HowtoForge was a big help, but I had to use g-cpan to generate Mail::SPF ebuilds. Just one of those things I was surprised wasn’t already in Gentoo.

Next up: testing that SpamAssassin supports SPF and penalizes failures. I think I have had everything in place to do that properly for a while, now, but I never actually checked…

June 15, 2008 04:45 PM :: Wisconsin, USA  

Thomas Capricelli

Toward release 1.0-alpha1 of Yzis

As some of you might know, I had to finish my Ph.D. and it took me a lot more time than previously planned. I’m happy to tell you that it is now finished. I’m officially a doctor in the field of applied mathematics, and I have more time to dedicate to free software.

One of my first goals is to release the sleeping code for yzis. There sure are a lot of issues with this code, and the KDE kpart is still unfinished, but I think we can release basic, working, tested applications. This would mean the curses-based nyzis and the qt4-based qyzis, both for Linux, Mac OS X, windows, and maybe some other platforms like the *bsd.

We created a project on freehackers redmine project manager to handle this new development. We expect to release 1.0-alpha1 next week-end (june 22th), and keep on testing/fixing bugs until 1.0. Then we should focus on the real fun stuff : kpart and other embeddings.

Oh, and, meanwhile, we moved the code from subversion to mercurial.

redmine project for bug reports

Yzis homepage

view yzis source under mercurial (you can also clone the repository from this url)

June 15, 2008 03:29 PM

Jürgen Geuter

Banshee

Been looking at GTK based audio players for quite a while (amarok is nice but it looks alien and the 1 branch is rotting more and more while work on the 2.X branch continues) and since banshee released their 1.0 recently I gave it a try.

The interface is somewhat different from amarok's but there's a few really great things about it:

  • last.fm streams don't just play one song, you can look a few songs into the future to see what's coming up

  • last.fm radio skipping/loving/banning works

  • Library import is quicker than with amarok

  • Interface feels snappier than amarok's

  • Video support - great for music videos and vidcasts



So it's really nice, but there's a few things that need change IMO:

  • Writing plugins right now is done in C# or Boo, I'd love to have some of the bigger scripting languages thrown in there (like Python). Boo is a scripting language but who the hell uses and knows it?

  • Cover art can only be downloaded automatically. Sometimes I do have music from a netlabel where banshee won't find the covers on amazon. I'd like to be able to set my own covers.



After some toying around with it it seems to be a really great player that's not plagued by the slowness that some mono apps seem to have, if you were looking for a good GTK based player, you might wanna try banshee.

June 15, 2008 02:56 PM :: Germany  

Johannes Gilger

SVN is not a content-tracker

jojo@host:~/svn/test$ svn add git-talk.pdf
A (bin) git-talk.pdf
jojo@host:~/svn/test$ svn commit -m ‘First file’
Adding (bin) git-talk.pdf
Transmitting file data .
Committed revision 1.
jojo@host:~/svn/test$ du -sh ../test-repo
6.5M ../test-repo
jojo@host:~/svn/test$ cp git-talk.pdf git-talk2.pdf
jojo@host:~/svn/test$ svn add git-talk2.pdf
A (bin) git-talk2.pdf
jojo@host:~/svn/test$ svn commit -m ‘Second file’
Adding (bin) git-talk2.pdf
Transmitting file data .
Committed revision 2.
jojo@host:~/svn/test$ du -sh ../test-repo
13M ../test-repo

I rest my case. Now some of you (those who know git and know why they use it) might say “so what, that is no secret” while others may flip over backwards. The second group of people is the one I wanted to reach ;)

June 15, 2008 10:02 AM :: Germany  

Brian Carper

My desk

Following in the footsteps of Sean Potter I took a photo of my desk.

My desk itself sucks, but I'm moving again in a year or so and didn't want to invest in a good one yet. I'm missing one of my big monitors (thanks Westinghouse) and in the meantime I have to settle for that old Apple display as my second monitor.

My mousepad is an Icemat; can you believe the green ones were cheaper than all the other colors? That shade of green is clearly the best. And my keyboard is a tasty Saitek Eclipse II, which is one of the most comfy keyboards I've found to type on (and it glows in the dark). Nothing too exciting beyond that.

June 15, 2008 02:32 AM :: Pennsylvania, USA  

June 14, 2008

Brian Carper

Python

People are stupid. We're blinded by our own prejudices and biases and preconceptions. It's kind of understandable because no one has enough time to really collect enough information to have an informed opinion about everything. So we end up extrapolating or relying on expert opinion or turning to our gut feeling. Inevitably we end up being wrong some of the time.

This leads to two problems. One is that being a person myself, I'm also stupid, meaning there are almost certainly some beliefs I currently hold that are wrong. The second is that from my perspective, I appear to be right about everything. This is trivially true of everyone; as soon as a person decides they're wrong, they change their mind right away and become right again. The problem then is how can I tell when I'm wrong and when I'm right? I quick objective glimpse at reality suffices most of the time, but sometimes we're still tricked.

Those two things in combination are a problem for everyone. I think the best anyone can do is to realize that this is the case, be open to being wrong, and to take some efforts to rectify it. At least minimize the damage, try to be as right about as many things as you can.

This is why e.g. I started learning Emacs even though I love Vim, and why I stick with it even though it's unpleasant at first. A lot of smart people say good thing about Emacs. My opinion of it is much different now than before I'd used it a lot. I think many things people say about it are wrong, but many are also right. There is some good stuff there.

For the same reason, I've decided to learn Python. I've been wanting to for quite a while anyways. In spite of the pain I've had trying to use it in the past, and my generally low opinion of the language, there may just be something worthwhile there. A lot of smart people say good things about it, and a lot of good programs are written in it. The community is large and active and enthusiastic.

My first shot was to try some of the stuff at Python Challenge. It's an interesting site full of puzzles that you need a programming language to solve; many of them are geared toward Python or toward libraries available in Python, but you can use any good language for many of them. I got through 17 of the puzzles last night, but I did look at "hints" on the forum for about half of those. A lot of them require sort of specialized knowledge apart from knowledge of Python, on a wide variety of subjects, so it's pretty fun.

My first pet peeve (of many to come, I'm sure): why doesn't python --help or python --version work? Instead you have to use python -h and python -V (capital V). This is non-standard. It worries me when people do things like this differently. But we'll see.

June 14, 2008 07:14 PM :: Pennsylvania, USA  

TopperH

Howto synaptics touchpad and usb mouse work together in gentoo

First of all event interface must be enabled in kernel:

Device Drivers --->
Input device support --->
<*> Event interface


Then xorg-server must be compiled with the "evdev" USE:

#echo 'INPUT_DEVICES="evdev keyboard mouse synaptics"' >> /etc/make.conf
#emerge -av1 xorg-server


Here is the relevant part of the /etc/X11/xorg.conf file:

Section "ServerLayout"
[...]
InputDevice "Mouse0" "AlwaysCore"
InputDevice "TouchPad" "SendCoreEvents"
EndSection

Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "ZAxisMapping" "4 5 6 7"
EndSection
Section "InputDevice"
Driver "synaptics"
Identifier "TouchPad"
Option "SendCoreEvents"
Option "Protocol" "auto-dev"
Option "SHMConfig" "on"
EndSection

What made the trick was to put the USB mouse in "AlwaysCore" and the touchpad in "SendCoreEvents"

June 14, 2008 02:13 PM :: Italy  

Leif Biberg Kristensen

More regular expression fun in PostgreSQL

Stimulated by the success of my previous foray into the regex arcana of Postgres, I finally took on a problem that has been bothering me for a long time. When I merge persons, shortlinks to the old person_fk may still be hanging around in sources and events. It’s not a matter of great concern, because the link from the old person to the new person will always remain in the database. But I still like to have the links pointing to the “right” person. To clean up in this, I decided to write a script that hunts through the entire database and updates shortlinks to merged persons. I used Perl for this one, because it’s the kind of problem that lends itself well to Perl’s inbuilt search-and-replace syntax (and because I really need some practice with the Perl db interface):

#! /usr/bin/perl

# update_shortlinks.pl
# finds notes and sources with shortlinks to merged persons
# and replaces old_person with new_person
# (C) leifbk 2008

use strict;
use DBI;

my $database = "DBI:Pg:dbname=pgslekt";
my $dbh = DBI->connect("$database") or die $DBI::errstr;

my $get_merged = $dbh->prepare("SELECT old_person_fk, new_person_fk FROM merged");
my $get_source = $dbh->prepare("SELECT source_id, source_text FROM sources WHERE source_text SIMILAR TO ?");
my $put_source = $dbh->prepare("UPDATE sources SET source_text = ? WHERE source_id = ?");
my $get_event = $dbh->prepare("SELECT event_id, event_note FROM events WHERE event_note SIMILAR TO ?");
my $put_event = $dbh->prepare("UPDATE events SET event_note = ? WHERE event_id = ?");

$get_merged->execute();
while (my ($old_person, $new_person) = $get_merged->fetchrow_array()) {
    my $regex = "%\\[p=" . $old_person . "[\\|\\]]%”;
    $get_source->execute($regex);
    while (my ($source_id, $source_text) = $get_source->fetchrow_array()) {
        print “Source $source_id, $source_text ($old_person -> $new_person)\n”;
        $source_text =~ s/(\[p=)$old_person([\|\]])/$1$new_person$2/g;
        $put_source->execute($source_text, $source_id);
    }
    $get_event->execute($regex);
    while (my ($event_id, $event_text) = $get_event->fetchrow_array()) {
        print “Event $event_id, $event_text ($old_person -> $new_person)\n”;
        $event_text =~ s/(\[p=)$old_person([\|\]])/$1$new_person$2/g;
        $put_event->execute($event_text, $event_id);
    }
}
$get_merged->finish;
$dbh->disconnect;

Don’t forget to backup your database before you start to play around with scripts of this kind.

June 14, 2008 01:22 PM :: Norway  

Thomas Capricelli

Entering the blogosphere….

I intend to use this blog to give insights about my free software development stuff, which is mainly related to Qt/KDE, gentoo, and the linux kernel.

June 14, 2008 12:18 PM

Niel Anthony Acuna

on my own and moving on

i’ve been puting off a lot of things lately. at the top of my list is to give some just attention to this little web space of mine. its not because i don’t have time anymore. its just that, i felt the need to explore some de-stressing activities other than writing my thoughts and rants down. i always found writing rather emotionally helpful, but during those carefree college days, i rarely
did anything to the point of exhaustion.

but im bringing my hiatus onto a peaceful end. good day! gentoo powerpc land!

June 14, 2008 03:37 AM :: Zamboanga, Philippines  

June 13, 2008

Jürgen Geuter

Python Webserver in 5 seconds

Since the old blog died and somebody was asking for the code, if you just need a webserver real quick to give someone in your net access to some files on your machine, go to the respective directory and run python -m SimpleHTTPServer which gives you exactly what it says, a simple HTTP server with the current dir as webserver root. No fancy-shmancy config necessary.

June 13, 2008 09:24 PM :: Germany  

George Kargiotakis

Αναλύοντας ένα attack σε honeypot

Ο Δημήτρης έχει μια αρκετά καλή ανάλυση ενός attack σε ένα honeypot που έχει στήσει για πειραματισμούς. Αξίζει να του ρίξετε μια ματιά… Επιτέλους μας την έπεσαν

June 13, 2008 03:16 PM :: Greece  

June 12, 2008

Jason Jones

My First Python Script

When I went in to my 6 month review about 4 month ago, I didnt know what I was in for.

I assumed things would go well because I had accomplished everything I set out to do and more, so I felt pretty good.

The interview went very well.  They complimented me on my work, the sales reports, the new web site, the money I was saving the company and all that.  Then he asked me what my goals would be for the next 6 months.

I didn't anticipate that, so, I asked him what he meant (read: stalled while I frantically thought of something I could do in six months).  He responded while I didn't listen at all - thinking.

About the time he was done saying whatever it was he was saying, the thought popped into my head, "Hey!  I'll try learning a new language!".

In the IRC room I lurk in daily, #UPHPU, the python language frequently was the subject of hot debate, so I blurted out,

"I'll learn Python."

And that was that.  Well...  It's now 4 months later, and the perfect opportunity presented itself for me to see what this Python is all about.

We received the old servers upon which the old website ran from the old company with whom we do no business anymore, thereby barring ourselves from further thievery.

I took a look at these servers and realized they are much beefier than the ones currently running the server.  So, my boss and I decided to wipe off the dross currently installed on them (read: Windows 2003 Server), and installed gentoo with a healthy LAPP stack on em'.

Well, the last thing I needed to do to get these suckers fully up and running was to install some sort of RAID monitoring system.  The old servers had the mdadm program taking care of the RAID.  These boxen have hardware RAID controllers on them, so using the mdadm monitor was out.

To make an already long story shorter, suffice it to say I found a program called cciss_vol_status which seemed to do the trick nicely.

I just needed to find a way to run it every day and email me the results.

Needless to say, this is where Python comes in.

My first impressions of Python, coming from PHP, of course, are the following:

  1. It seems very complicated.

  2. Why the need to import modules which PHP has natively?

  3. The learning curve for something new always sucks.  Thinking to myself, "I could have had this done 2 days ago, if I was doing it in PHP"

  4. Its syntax is radically different, and oddly attractive to me.

  5. From my noobie standpoint, it seems that Python has the potential to be much more powerful than PHP - after the learning curve.



Basically, I began writing the script yesterday, and worked on it for about 5 hours.  I finished the script after about 1.5 hours working on it today.  I'd have to say that 90% of the speed with which I finished it was due to the tutorials written online for the specific modules I needed.  The #python IRC channel provided a few clues as well.

Anyway...  I'd like to continue learning Python, but I'm not sure how suited it would be to web development.  I've got my nitche down really well within PHP, and it'd be a shame to stop that to learn something new - just for the sake of learning it.

The flip-side, however, is that with my knowledge of python (if I should choose to pursue it and learn it to the degree I know PHP), I'd be in a much better position to continue marketing myself.

We'll see.

Anyway...  That's today's story.

Life is good.

June 12, 2008 05:09 PM :: Utah, USA  

Luca Gasperini

Superkaramba and Gentoo

Nowadays it seems that superkaramba works well, in the past it was heavy and buggy and I used to have conky. There are no particular reasons that made me switch to superkaramba , other than moving from Gnome to Kde.

My superkaramba monitor is based on the dual cpu monitor by Loacoon, I changed it a little to show some useful stuff , some of them gentoo specific ( last sync, last emerges, currently emerging….. genlop is a dependency).

superkaramba

Here’s the code, on my system superkaramba themes are in ~/.kde3.5/share/apps/superkaramba/themes/

Superkaramba theme

June 12, 2008 03:21 PM :: Italy  

Thomas Keller

Ruby on Rails, part 2

OK, after I installed a first RoR testing environment on my home server, I started experimenting. Now I finally managed to have an application up and running - although it’s just a rough test app…. Thanks to vinniez, I also installed passenger (it in portage - masked, but working!) and went on like this: added the “-D [...]

June 12, 2008 02:38 PM

Sean Potter

New Car Stereo

I finally took the plunge and had a car stereo installed in my 1998 Chevy Prizm. It's a cheap Sony model, but it has a detachable faceplate and front auxiliary input. The auxiliary input is what I was after, however. Unlike my old car, a Dodge Stratus, the Prizm doesn't have a tape deck or CD player. I was forced to play my music over an FM transmitter that ate two AAA batteries every two-to-three days. Modern technology, eh?

I eventually broke the transmitter and started listening to the radio, which gets repetitive. Amanda suggested getting a car stereo, so I finally gave in and had it done. Rather than spending a few hours putting the wiring hardness together, I had the fine folks at Circuit City do it for a small fee.

It works great. Now I just need to fix my air conditioning or buy a new car. Greeat.

June 12, 2008 08:31 AM

June 11, 2008

Jürgen Geuter

Marketing through blogs

Marketing is old and I guess it won't go away very soon (though I'd love it to die) and especially with the advent of blogs many people started wondering how to make money from all of this.

The first idea was to make their blogs utterly worthless by plastering banners and advertising all over it. This worked for a while, but nowadays random ads don't really pay a lot unless someone clicks on them and many people have adblocking software running either on their computer or their brain. Ads are pretty much dead at least in the way that most people know them.

But with everything having to have a pricetag attached to it (cause if there's no money to be made it has to be utterly worthless, right [yes, that is sarcasm]) people had to come up with new ways to place their marketing in the stream of information. This lead to one of the most filthy kinds of advertising: The "pay per post" advertising.

The idea is simple: Some company pays you a few bucks to write over their product. Usually the claim is also to not force people to write a positive review (ignoring the fact that many of the people selling their own personal place in the web for peanuts are usually so thankful for the few bucks that the review will be at least somewhat positive), because the review itself ain't all that important, it's about getting your service linked which means more google rank which means more "importance" when it comes to searches in google.

We see this type of marketing a lot, not only by advertising companies but also by people wanting to promote their little blogs: You start a competition and force everyone to link to your blog post to participate which gives you rank and importance (and your advertising income might raise from 1 buck/month to 1.50).

Now I can see why people do it, hell, I'd love to be able to be able to live by just writing my blog (and that would bring up the posting frequency ;-) ) but there's always a cost and when it comes to your own blog the cost is high.

I have written about the importance of your feed before (pretentiously quoting myself):
Your website's RSS feed is as important as your business card, as your "real" website, actually it's replacing your real website more and more. Having a broken or nonfunctional RSS feed is probably even worse than having none: If you have none some people might not check your site regularly but at least you don't look incompetent.
But what about your own blog?

Well, there are two kinds of blogs: The commercial ones and the personal ones. It's really that simple.

The commercial ones are the "big" ones nowadays. Techcrunch, endgadget &ct. People there make a living of their blog, but they're not so much about creating really new content, they are basically about sales. They run reviews of stuff, they keep the buzz around certain companies or products going, they are completely unpersonal. Those blogs are not what I'd really call a blog anyways, they are basically just a different layout for "news" and "adverts" and "reviews" from a certain section of the market. Yes, they do have comments and sometimes use blogging software but they are dead as in lifeless.

On the other hand you have blogs by people, writing about stuff they care about, stuff they find interesting. Stuff that often no one would bother to pay for, though it can be brilliant. Or boring. It can be anything and that's exactly what makes them interesting: They can be everything the writer wants them to be. They are very human, very alive because they are not limited to some faceless, brainless, soulless market. They can show you what is cool about humans, they show every facet of human being.

As soon as you start letting people buy parts of your blog, you leave the second and enter the first realm. Your blog loses what made it interesting in the first place because you sold your integrity. Now if you just write iPhone reviews or crap like that, integrity ain't your business anyways (though the writes of those sales-campaigns would probably disagree), but if you want your blog to be yours and meaningful you just cannot have ads in them, ads of any kind.

Because how could you be trusted? If you sell posts, who tells me that the post I'm reading was not paid for? Who tells me that the post I read yesterday was "real" as in "written because the author really wanted to say this"?

It's been said many times, but advertising makes your blog look cheap. Because then it actually is. It's up for sale.

Just think about that the next time some blog starts a "competition" with a few prices in exchange for links or posts.

June 11, 2008 02:04 PM :: Germany  

Leif Biberg Kristensen

Regular expression fun in PostgreSQL

I have been doing a bit of refactoring again. This time, I’ve moved the link_expand function from PHP into Postgres. That’s the function that takes a piece of text like [p=123|John Smith] and transforms it to a fullblown internal link like <a href=”./family.php?person=123″>John Smith</a>, or the short form [p=456] which will be replaced with a link to person 456 and his/her default name. It’s very convenient to write links this way. Now, regular expressions work a bit different in Postgres than they do in eg. Perl. The Postgres regex engine is actually ported from Tcl, as explained in the documentation. So, there’s some relearning to do for an old Perl regex punk. Notably, the difference between greedy and non-greedy expressions is subtle and easy to miss. Note the expression E’\\[p=(\\d+?)\\|(.+?)\\]‘ below. In Perl syntax, you shouldn’t have to make the (\d+) atom (any old integer in plain language) non-greedy, but it’s required here.

Here’s the full link_expand function in glorious plpgsql:

CREATE OR REPLACE FUNCTION link_expand(TEXT) RETURNS TEXT AS $$
DECLARE
    str TEXT;
    tmp TEXT;
BEGIN
    -- the easy part: replace [p=xxx|yyy] with full link
    str := REGEXP_REPLACE($1, E’\\[p=(\\d+?)\\|(.+?)\\]‘,
            E’<a href=”./family.php?person=\\1″>\\2</a>’, ‘g’);
    — the hard part: replace [p=xxx] with full link
    WHILE str SIMILAR TO E’%\\[p=\\d+\\]%’ LOOP
        str := REGEXP_REPLACE(str, E’\\[p=(\\d+?)\\]‘,
                E’<a href=”./family.php?person=\\1″>#\\1#</a>’);
        tmp := SUBSTRING(str, E’#\\d+?#’);
        str := REPLACE(str, tmp, get_person_name(BTRIM(tmp, ‘#’)::INTEGER));
    END LOOP;
    RETURN str;
END
$$ LANGUAGE plpgsql STABLE;

(if you picked up an early version of this blog post, you may have noticed the subsequent “folding” of the three lines:

p := BTRIM(tmp, '#')::INTEGER;
name := get_person_name(p);
str := REPLACE(str, tmp, name);

into one:

str := REPLACE(str, tmp, get_person_name(BTRIM(tmp, '#')::INTEGER));

and, as a consequence, I’ve dropped the two superfluous vars p and name. It’s more compact, but of course also a little more obscure.)

The “hard part” still looks somewhat circumventious, but at least it works. And I do think that it’s a lot cleaner than the old PHP function with its forest of backslashes.

The main reason why I did this refactoring is not about code purity, though. There seems to be a bug in the PHP preg_replace() function that will only allow it to replace about fifty of my shortlinks in a given text. Given more shortlinks, it will just drop the entire text in the bit bucket. That may seem a lot, but, hey, do you remember the old “640K should be sufficient for everyone” meme? When you try to link up every person in a lenghty probate transcription, preg_replace() will run out of steam. It’s probably a memory allocation thing. However, I do expect the Postgres RE engine to be a lot more sturdy than the PHP one.

June 11, 2008 09:40 AM :: Norway  

Brian Carper

Westinghouse still sucks

Way back in March I sent in my L2410NM monitor for RMA to Westinghouse. This is June and I don't have it back yet. Last I heard they sent my case to their corporate office. I called again this week, call #16 or 17, I lost count, and I was told that they put in a request for a "status update", but having heard any update on it. I'm always promised a return call, but I've yet to receive even one of those. As of now they've promised to send me a new monitor and have given up hope of ever recovering my legendary lost monitor, and supposedly they even created the order in their system that will initiate the monitor-sending process, complete with a long string of letters and numbers representing my fates.

I almost wish they would say "Ha ha, just kidding, screw you customer, you're not getting anything from us" so that I'd feel justified in filing a complain with the BBB. But no, they keep the carrot dangling in front of my nose, inching closer and closer to resolving this issue. Likely I'm going to do so soon though. Not sure if it'll actually help anyways.

I've already ensured that my friends and family will never buy anything from them, nor will my place of employment, and hopefully some people reading this will also refrain. The real problem is, what company is any better? I keep a mental list of companies that have screwed me over, but that list is becoming so large that I'm running out of companies I can actually buy things from. I can at least prioritize according to the level of suckiness. Westinghouse tops the list at the moment.

June 11, 2008 02:55 AM :: Pennsylvania, USA  

Iain Buchanan

8bit paintball

This is damn funny! Especially since my state has just legalised paintball (no-one has set it up yet though - I'm waiting...)



And now for the gratuitous ad. which I nicely didn't remove:

See more funny videos at CollegeHumor

For those RSS and syndicate followers, try this link!

June 11, 2008 12:44 AM :: Australia  

Gentoo Linux Live USB key

From live CD image, to bootable USB key in only a few minutes! I didn't believe my friend when he told me how easy this is, and yet he was right!

Here's what I did, you may need to tweak it a bit for your setup (especially your usb device - it could be /dev/sd[a|b|c|...]. Firstly I used one 1Gb USB key / thumbdrive / flashdrive / whatever, because I use the live CD image. You could use the minimal CD image and use a smaller key. It appears to me as /dev/sdb.

Your PC might need to be capable of treating the USB filesystem as a CDROM, otherwise this may not work for you. Tell me about your success!

0. dd if=/dev/zero of=/dev/sdb bs=512 count=1

The reason I did this is because I had corrupted both the mbr and partition table of the usb key. fdisk simply told me "unable to seek on /dev/sdb" and wouldn't continue. Skip this step if you can fdisk ok.

1. fdisk -l; fdisk /dev/sdb; fdisk a partition!

I join these steps together, cause they're all related to creating the partition. Make one partition covering the entire device. Something like "n p 1 t 1 83 a 1 w" should do it. Note I made it bootable, and I'm not using FAT.

2. mkfs.ext2 -L liveUSB /dev/sdb

You'll notice I'm using ext2 here. Wait for the device to finish writing, then unplug and re-plug it, or mount it manually.

3. sudo mount -t iso9660 -o loop /home/iain/Desktop/livecd-i686-installer-2008.0_beta2.iso /mnt/tmp/

There are multiple ways to do this. This is the one I chose.

4. sudo rsync -avP /mnt/tmp/ /media/liveUSB

5. sudo grub-install --root-directory=/media/liveUSB --no-floppy /dev/sdb

6. reboot!


Remember to set your BIOS to boot from your USB drive. Now you have a live CD on a USB key. Much nicer than burning!

YMMV.

Edit: There are some more comprehensive and detailed howto's available with slightly different techniques:
http://www.gentoo.org/doc/en/liveusb.xml
http://gentoo-wiki.com/HOWTO_Gentoo_LiveCD_and_LiveUSB

June 11, 2008 12:06 AM :: Australia  

June 10, 2008

Daniel Kerwin

New Howoto: Using the Vodafone PCMCIA UMTS card (Qualcomm MSM6275)

Just finished a small howto explaining how to use a Vodafone PCMCIA UMTS card with (Gentoo) Linux. Works very well and will work in less than 5 minutes. If you own this nice piece of hardware give it a try.

Go directly to the Howto

Thanks to Matthias for supplying me with many information's on this topic.

June 10, 2008 09:06 PM :: Germany  

Jason Jones

LDSCompanion.org Comment

For those of you who don't know, in addition to running ILoveMyJournal.com, I also run an inspirational website called LDSCompanion.org.

Today when I arrived at work, I had an email from someone who had pressed the "contact us" button.

The message I recieved encapsulates the entire reason I created that site, and caused tears to well up, as well as a sense of gratitude for having been given the gift of being technically adept.

Here's the message as it was sent to me: (the name has been removed for privacy)

"My name is (name not published), and I live in a little island in the caribbean by name San Andres. I was baptize the 11 of october of 1997 in Bogota-Colombia; but since april of 2003 when I return home I have loss every direct contact with the church because they are no members here and it has been really hard. Now I have acces to a computer and the opportunity to can read and nurture my spirith throug the motivational stories, inspired poetry, etc of thes web-site. And I know thah our Heavenly Father cares for each a every one of us and bless us, and answer us in misterious ways, thank you for being an instrument in his hands."

Point of the story is, you never know how many people your righteous example might affect.  Do the right, do it always, and unknowingly enlighten everyone around you.

June 10, 2008 11:05 AM :: Utah, USA  

June 09, 2008

Jürgen Geuter

Thinklab



This is a picture of my "lab" which is a setup of a bunch of (old) thinkpad laptops I got from a client to try out some network stuff (working on testing skolelinux for a local school). It's like a forrest of thinkpads. Fun! Let's hope they breed :-)

June 09, 2008 09:34 PM :: Germany  

Dirty urges...

For a few days I've had the urge to write something in PHP. What the hell is wrong with me?

All jokes aside, I think I'm not a "one language" kind of person: Python is still the language I find the most elegant and pleasant to work with but sometimes you just want something else, something quick and dirty I guess and for that PHP is perfect.

June 09, 2008 07:58 PM :: Germany  

Jason Jones

Video Editing With Kdenlive

I've recently become interested in integrating video into my journal and blog.  As such, I realized that my 4-year old digial camera just wasn't gonna cut it anymore, so I went out and bought the cheapest camera I could find that would shoot 30 frames per second which happened to be the Nikon S210 digital camera.  It takes pretty good video.

Then, I began the search for any video editing software on Linux.  I had created a video using Kdenlive a couple of years back, but I remembered it being a pain to use.

Long story short, after using about 6 other obscure video editing software programs for Linux, I came right back to Kdenlive.

To begin, the most valuable piece of advice I can give you at this time about using Kdenlive is this:

SAVE YOUR WORK EVERY 10 SECONDS.

Then you'll enjoy working with it much, much more.  Kdenlive will randomly crash, losing all unsaved work.  The crashes happen from 15 seconds, to 2 hours - man, it SUCKS losing 2 hours of work, so, save your work often.  If it does crash after a save, the saved portion of my work always came back without a problem.

Besides the totally random crashes (I worked on Kdenlive straight for 3.5 hours with no crashes, once), the biggest gripe I have about this program is the total inability to configure or manually modify the video format for the project.  You are limited to what the developers think you need.

For me, this creates a bit of a frustration because my camera shoots at exactly 30 FPS, not 29.976.  Well, there's no option for me to open a project where the video will work at 30 FPS, which makes me have to re-encode all my raw footage to 29.97, in order for the A/V sync to stay spot-on.

But the first item of business is to let you know how to start the program itself.  If you just type in "kdenlive" in a terminal, or click on it on some GUI menu somewhere, the MLT framework (upon which kdenlive is built) will default to PAL standards, which for people here in the good ol' USA, is no good at all.  Use the following command to begin the program, and it'll save you loads of headaches:

MLT_NORMALISATION=NTSC kdenlive

That'll help a lot.

the next necessity for good video editing with Kdenlive is to have footage which fits one of t