Planet Larry

June 24, 2008

Johannes Gilger

The GitHub

GitHubOk, I hinted that I would do a more thorough review of GitHub, the new and easy-to-use git repository hosting site. Although I’m still no power-user I’ve come to know the features that make GitHub worth using and so far unique.
The “Fork” feature is probably the most important one. Instead of just cloning a repository and working on it locally, you can fork it on GitHub. When you fork a project everyone can see you did, and has a nice flashy graph-view so they can see where you branched and what commits you made that are not (yet) in the upstream. GitHub forkAnd if you have introduced changes that you think would benefit the project you can send people (e.g. the original project owner) a “pull-request”. The recipient can then easily fetch/merge your changes into his project. It really doesn’t get much easier to contribute to (open-source) projects. I certainly did for the first time ;)

GitHub forks

Then there are feeds. You can watch projects, which means that your feed includes any commits/comments on the watched projects. It goes without saying that this can be quickly overwhelming for active projects. GitHubComments can be made on specific lines in a commit (or on the whole commit), which is a great feature (think of it as the equivalent to patches being discussed line-by-line in mailing-lists). I still prefer mails though ;)
The syntax-highlighting looks pretty good. I’ve already mentioned the very pale interface (as in low-contrast) and it still has not changed. But I think that most people really browse the commit history in their local clones anyway.
Each project has an attached Wiki too, so you can add a few pages (or a lot if you wish).
To conclude I can say that GitHub is a great service, since it has a free plan for public projects. I would not need it for my personal projects, but to run a or contribute to a open-source project it’s perfect. The amount you use its features is up to you. If you already have a Wiki, already have an active mailing-list and discuss patches there too then you can just use GitHub as the central source code repository (plus the forks of course). The real work is done on your local repository with git anyway, but y’already knew that I guess ;)

June 24, 2008 08:46 PM :: Germany  

Martin Matusiak

emacs that firefox!

So the other day I was thinking what a pain it is to handle text in input boxes on web pages, especially when you’re writing something longer. Since I started using vim for coding I’ve become aware of how much more efficient it is to edit when you have keyboard shortcuts to accelerate common input operations.

I discovered a while back that bash has input modes for both vi and emacs and ever since then editing earlier commands is so much easier. And not only does it work in bash, but just as well in anything else, like ipython, irb, whatever. :cap:

So now only Firefox remains of my most used applications that still has the problem of stoneage editing, and I’m stuck using the mouse way too much. It bugs me that I can’t do Ctrl+w to kill a word. Thus I went hunting for an emacs extensions and what do you know, of course there is one: Firemacs. Turns out it works well, and it also has keyboard shortcuts for navigation. > gets you to the bottom of the page, no more having to hold down <space>. :thumbup:

June 24, 2008 08:20 PM :: Utrecht, Netherlands  

Jürgen Geuter

NVIDIA: Fuck you.

(Imagine the headline being sung to the melody of the "America: Fuck yeah!" song from the "Team America - World Police" soundtrack).

After a bunch of kernel developers issued a statement concerning closed source kernel drivers arguing that closed source kernel drivers are pretty much bad for everyone (the reasons are obviuously that binary modules have a hard time to keep up with kernel development, them crashing makes the kernel look bad and the community cannot fix issues within those blobs, in addition to the fact that many consider them to be illegal) NVIDIA replied:
Nvidia reiterated that it won’t provide open source drivers for Linux because the company claims there is no need for it.


So there is no need for it? What about all the problems people are having getting your blob to run because it takes ages for you to support new Xserver functionality or because it takes you quite some time to modify your blob to work with recent kernels? What about the problems many people with your graphics cards have with suspending their machines? What about the need to hack around so your graphics cards don't start with the fan pretending to be a helicopter? What about your "we write our own aiglx implementation that works a little differently than the default one just because we like to do that kind of stunt"?

If there's no need for free drivers, why does the nouveau project exist? Why do people keep on asking your for open drivers?

NVIDIA will probably stay strong on the Windows side of things where people don't care that the NVIDIA driver crashes their Windows all the time but I hope that the people using free operating systems will make their wallets do the talking. It might not mean a lot to NVIDIA but the extra business the competition gets is a good sign to support their effords to create open and free drivers.

It's simple (especially for those who don't know a lot about linux but who wanna use it): Buy a card with free drivers (Intel or AMD) and things work out of the box. My laptop has the intel graphics chip which has free drivers and I have 3D accelleration on a liveCD without any setup. I install a system and everything is as fancy as it can be (though I don't use desktop effects cause they are more of an annoyance than a nice addition). With binary drivers you have to dig through howtos and forums and whatnot. With free drivers linux takes all that work away from you and you can focus on what you really want to do. Easy choice.

June 24, 2008 09:46 AM :: Germany  

Dan Ballard

Work around I probably shouldn’t need

I had to install amsn just so could video chat with a friend on MSN. Really? On the plus side, at least I could do it :)

Also, figured out how to use skype on Ubuntu. Skype really want /dev/dsp. And Ubuntu now uses pulseaudio. So basically if you've done anything with sound, Skype won't be able to get the sound. Which sucks. However, pulse audio ships with this handy utility 'pasuspender' which temporarily suspends pulse audio and it's lock on /dev/dsp. So to actually use skype

pasuspender skype

And skype can then seize and monopolize the sound card. So you can use it, but no other sound till you shut Skype down. So it's 2008 and we still can't share the sound card :/.

June 24, 2008 08:39 AM :: British Columbia, Canada  

John Alberts

Turbotail and multitail

I just found a couple cool programs called turbotail and multitail while searching for rbot using eix.

Turbotail is just like tail, but it uses dnotify instead of auto refreshing a defined number of seconds.  I always thought it was kind of silly to keep refreshing the screen searching for new content with tail.  Turbotail just sits there until the kernel notifies of a change in the file that you are tail’ing and then it updates what you see.

Multitail looks like a VERY robust way of viewing multiple files.  It can tail any number of files and supports text filtering and even syntax highlighting.

Turbotail works great, but unfortunately multitail crashes when I try to run it from my Yakuake console.  I get this:

--*- multitail 5.2.0 (C) 2003-2007 by folkert@vanheusden.com -*--
 
A problem occured at line 511 in function mynewwin (from file term.c):
 
Failed to create window with dimensions 55x9 at offset -27,-4 (terminal size: 167,19)

Seems to work just fine from a regular console though.  It will take me a while to actually learn all of the features of multitail.

June 24, 2008 02:32 AM :: Indiana, USA  

New Job!

After a while of looking for a new job, I finally got a new job. Well, actually, I’ve been working my new job for about 3 months now. So… I guess it’s not really a new job anymore.

I’m now a full time Linux administrator with ExLibris. Unfortunately, Red Hat is the preferred distribution. That’s to be expected. Most business want to make sure they use something that’s proven and has a clear line of support.

The new job is in Des Plaines, Il, which means I’ll have to sell my house and move a little closer. So far, the job seems pretty good. It’s doing something I like and the people are nice, and most of them seem pretty smart.

June 24, 2008 02:17 AM :: Indiana, USA  

June 23, 2008

Jürgen Geuter

Platform independence

You'll probably know this phrase either from some company trying to sell you their JAVA stuff or from some university students trying to look competent: "Our software is platform independent because we use technologyX which is platform independent."

Now this does not only look right, it also looks smart: The people chose a development platform that allows them to deploy their software on different operating systems and hardware architectures, which offers them the benefit of possibly bigger markets and target audiences. It also reduces the amount of code dealing with target platform details. Smart.

And wrong. Your code has to be platform independent or your choice of development environment means absolutely nothing.

If you wire your paths in your application like this: ..\..\directory your code is completely dependent on the platform below because you actively worked around the possible platform independence.

Almost any amount of interesting and non-trivial will include some things that can mess up your program on some platform. The most common ones are paths (because there are basically two ways to separate paths, the UNIX and the Windows way) but there are other things:

Some people coming from a Windows background don't seem to know that for a UNIX system "Abcd" and "abdc" are different files. So if you write to the first variant but try reading from the latter, it might work under Windows but not under other systems.

If you look at your programming language's documentation you might probably see that some function or API does not properly work under one or another operating system or architecture. Some might return "dumb" or at least irritating values (because the low level call that they wrap does not actually work on that operating system for example).

Another thing is that in a 64bit environment your types might behave somewhat different that what you are used to in your 32bit world.

There are many many traps that you can fall into when writing code that aims to be platform independent, the most important thing to realize is that your chosen development environment, whether it is JAVA or Python or whatever else you might choose can help you but it does not do everything magically.

When writing platform independent code, use the programming language's facilities to abstract away from the operating system. In Python for example use os.path.join to build a path, don't try guessing whether "/" or "\" is the right delimiter.

While today's programming platforms make it quite easy to get something starting on pretty much any system under the sun there are still many bugs that are hiding in the shadows. They can all be worked around but that requires awareness.

Don't be a platform dummy and claim that the technology you use makes your code something that it ain't, you might look less smart than you actually are ;-)

June 23, 2008 08:04 PM :: Germany  

George Kargiotakis

Euro 2008 open source tour

451 CAOS Theory has a mini review of what’s going on with open source among the countries that compete in Euro 2008. It’s quite interesting. Here’s the link about Greece. It has quite a point…Things don’t look very promising…

June 23, 2008 03:04 PM :: Greece  

Daniel de Oliveira

Crossover office 7 to support Microsoft Office 2007 and more


The following is the release announcemnet from Jeremy White of CodeWeavers (CrossOver):

Hi Folks,

I am pleased to announce that we have shipped CrossOver 7 for both Macintosh and Linux. New in Version 7 is support for Microsoft Office 2007, dramatically improved support for Outlook 2003 and Internet Explorer 6, and a broad range of improvements that should bring improvements to all Windows applications.

For our Linux customers, it also brings expanded support for most Adobe programs, with Photoshop CS and CS2 working particularly well.

For our Macintosh customers, this release also brings a change in our product mix. We are now providing “CrossOver Mac Standard” and “CrossOver Mac Professional”. The new Standard product will mirror

the Linux Standard product, in that it will be a lower priced product with more basic support and no multiple user support. The new CrossOver Mac Professional product replaces the existing CrossOver Mac product. It continues to have our best support, support for multiple users, and, CrossOver Mac Pro continues to come with a complimentary copy of CrossOver Games. If you have purchased CrossOver Mac in the past, you have been automatically upgraded to a CrossOver Mac Pro license.

Finally, another major benefit of 7.0 is that it includes many of the elements of Wine 1.0, which was also released today. This is a major milestone for us, and for the Wine project. Our many years of work, and your many years of supporting our work, have enabled us to help bring Wine to this milestone. I am very proud to have been part of this, and very grateful for all the support of our customers, advocates, and fellow Wine developers.

If you are an existing CrossOver customer with an active support entitlement, you can visit our web site to download this latest version: www.codeweavers.com
You will need to log in with the email and password that you used when
purchasing CrossOver. Please write to info@codeweavers.com if you need help with this process.

Thanks again for all your support, and I hope that you enjoy CrossOver 7!

Cheers,

Jeremy White
CEO
CodeWeavers


Version 7.0 Changelog:

New application support:

  • Office 2007 (Including Word, Excel, PowerPoint, and Outlook)
  • Adobe Photoshop CS and CS2
  • Added support for the “Compatibility Pack for the 2007 Office system” so that Office 2003 can open Office 2007 documents

Bug fixes:

  • Greatly improved online banking integration in Quicken 2007 and 2008
  • Greatly improved Outlook behavior, particularly with Exchange servers
  • Fixed service pack support for several versions of Office
  • Improved IE support in win2000 and winxp bottles (though win98 is still better)
  • Improved support for modern Linux distributions (especially Ubuntu)
  • Fixed a seriously horrible interaction with the Logitech Control Center documents from Office 2007
  • This version also includes countless Wine fixes and synchronizes with Wine 1.0.
  • Many small bugs should be fixed, and unsupported application behavior should be greatly improved.

Source: Wine Reviews

June 23, 2008 01:36 PM :: São Paulo, Brazil  

Leif Biberg Kristensen

Code prettification

Inevitably, as you’re learning a new skill, such as a programming language, you may want to revisit your old work and see if you can do it better. I had this pair of functions to fetch the previous and the next “page” of a source collection, based on the sort order of the source. In plain text, in order to get to the previous “page” I want the source with the maximum sort order smaller than the present one, and with the same parent id. Here is my brute-force approach from a couple of years ago:

CREATE OR REPLACE FUNCTION get_prev_page(INTEGER) RETURNS INTEGER AS $$
DECLARE
    self_page INTEGER;
    prev_page INTEGER;
    prev_src INTEGER;
    par_id INTEGER;
BEGIN
    SELECT parent_id FROM sources INTO par_id WHERE source_id = $1;
    SELECT sort_order FROM sources INTO self_page
        WHERE source_id = $1;
    SELECT MAX(sort_order) FROM sources INTO prev_page
        WHERE parent_id = par_id AND sort_order < self_page;
    SELECT source_id FROM sources INTO prev_src
        WHERE parent_id = par_id AND sort_order = prev_page;
    RETURN COALESCE(prev_src,0);
END;
$$ LANGUAGE plpgsql STABLE;

Ugly, ugly, ugly. I remember what was the main stumbling block here: You can’t use an aggregate function such as MAX() in a WHERE clause. The thing is that you don’t need all those assignments. A little code folding, replacing variables with sub-selects, takes you a long way:

CREATE OR REPLACE FUNCTION get_prev_page(INTEGER) RETURNS INTEGER AS $$
DECLARE
    pp INTEGER;
BEGIN
    SELECT source_id INTO pp FROM sources
        WHERE parent_id = (SELECT parent_id FROM sources WHERE source_id = $1)
        AND sort_order < (SELECT sort_order FROM sources WHERE source_id = $1)
        ORDER BY sort_order DESC LIMIT 1;
    RETURN COALESCE(pp, 0);
END
$$ LANGUAGE plpgsql STABLE;

The “ORDER BY sort_order DESC LIMIT 1″ is a great idiom whenever you need to use an extreme value as part of a WHERE clause.

Even if the two versions of the code above are functionally equivalent, and the PostgreSQL planner probably will rewrite the query to something like version 1, most programmers would prefer version 2. Why? I think there’s a lot to the concept that “coding is poetry”. Version 2 is more esthetically pleasing, because it conveys its inner meaning in a much more succinct way, as in the Merriam-Webster definition of the word succinct: “marked by compact precise expression without wasted words”. At least to me it does. And that’s probably some of the essence of poetry.

June 23, 2008 11:51 AM :: Norway  

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

Jason Jones

Toilets and Servers

This past Thursday, we finally decided to rip it up.  I mean, literally - rip it up.

Then, we decided to take it out the backyard to see what the heck was clogging it all up.

It was just as we suspected.  Collin had flushed a freaking toy cell-phone down our toilet!

and yes, we took the toilet out in the backyard, twisted it, turned it, sprayed it, and finally fished out the darned thing so the toilet could work again.

Aren't two-year-olds the bomb?  Thank heavens, no, or we'd all be dead, but they do occasionally provide many hours of otherwise well-spent time into nothing but headaches.  Headaches well worth the while, for sure. :)

So... Yeah, the video above is just about our wonderful toilet experience, and also about the fact that the Gigabyte ga-m55sli-s4 does not have a working driver in Linux for the digital-out audio feature.

Yeah, my server died a week ago today (last Sunday), and I've been running everything from my back-up server since then.  The culprit is either the motherboard or the CPU because the darned thing won't even POST - at all.  No beeps, no video, nothing but fans spinning.  So, anyway...

I spent a good 8 hours working on the darned thing, just to make sure I wasn't crazy, because the motherboard I chose as a replacement did everything perfectly except the aforementioned audio digital-out.  I've got myth-tv on the server, and use it to provide my family's home theater media.  So, after 8 hours of pounding keys, I verified that I'm not crazy, because I have two of those motherboards here, and neither of them worked, while providing the exact same symptoms.

So, I got my hands on a Gigabyte GA-MA790FX-DS5 which proved to work completely perfectly.  Everything now is back to full working order, except that my server is faster and newer now.

Also, we can now watch the 1080p content coming out of channels 2,4, and 5 through our Comcast connection with the PCHDTV 5500 cards, without stuttering.  Evidently the old computer just couldn't keep up with the HD content, because now - it flows like a cool crisp mountain stream of digital goodness.  Holy cow, it's beautiful.

Anyway...  That's about it for now.

Toilets and Servers.

June 23, 2008 12:09 AM :: Utah, USA  

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