javier arturo rodríguez

Archive for the 'General' Category

Whitespace Matters

Friday, August 31st, 2007

Mark Jason Dominus just released SuperPython 0.91, “a Perl source filter for the SuperPython language, allowing SuperPython code to be embedded into Perl programs”.
In terms of language, it goes way beyond python itself to give proper semantics to whitespace. For instance, here is the Hello World program written in SuperPython:

#!/usr/bin/perl
use SuperPython;

Ain’t it neat? Naturally, the result is

$ ./hello.spy
Hello, world.

just as would be expected.
If you want to try this program yourself you might be surprised to find out that copy+paste won’t work, but that’s a small price to pay in exchange or the benefits of the richness of syntax and expresiveness of the language, and anyway you may download the source code for hello.spy right here.
Mark is very optimist in contributing the new features of SuperPython back to python itself, and has kindly offered to work closely with the Python community to see this happen.
Congrats Mark, and keep up the good work!

Attansic L1 Gigabit Ethernet driver for Debian

Friday, July 20th, 2007

m2v.jpegI just got a new ASUS M2V motherboard to replace a braindead server that would lock up on POST about 75% of the time. The new motherboard has a built-in Attansic L1 Gigabit Ethernet Adapter that is supported in Linux >= 2.6.21, but its driver is still missing from the daily Debian netinst CDs.

04:00.0 Ethernet controller [0200]: Attansic Technology Corp. L1 Gigabit Ethernet Adapter [1969:1048] (rev b0)
Subsystem: ASUSTeK Computer Inc. Unknown device [1043:8226]
Flags: bus master, fast devsel, latency 0, IRQ 25
Memory at fbcc0000 (64-bit, non-prefetchable) [size=256K]
Expansion ROM at fbca0000 [disabled] [size=128K]
Capabilities: [40] Power Management version 2
Capabilities: [48] Message Signalled Interrupts: Mask- 64bit+ Queue=0/0 Enable-
Capabilities: [58] Express Endpoint IRQ 0
Capabilities: [6c] Vital Product Data

I tried David Johnson’s pre-compiled driver for AMD64 but it didn’t work right away, so I compiled AtL1Linux_v1.0.41.0 for the stock 2.6.18-4-486 kernel in the official Debian 4.0 netinst CD and tested it. Although it was supposed to work right out of the box I kept getting “invalid module format” messages. So I stripped out the version information with

$ objcopy -R .modinfo atl1.ko

and it worked immediately. I completed the installation and I will upgrade the server to 2.6.21-2-amd64 over the weekend. So here is a atl1.ko for 2.6.18-4-486 that should work just fine.

By the way, I stripped the version information off David’s atl1.ko but I didn’t get a chance to test it because I was in a hurry. Here it is anyway in case someone finds it useful: atl1.ko for 2.6.18-4-amd64.
Oh, by the way, the M2V has four PCI slots but no built-in VGA adapter, and most PCI-e video cards are so thick that the first slot becomes unusable. Since I bought this motherboard precisely to maximize the number of available PCI slots in the server… well, it just sucks.

Gecko/20070601 C64/Commodore

Monday, July 9th, 2007

firefox-c64.jpegI tought this was just a SpreadFirefox stunt, but I just found the most strange User-Agent in an Apache server log

Mozilla/5.0 (X11; U; Commodore64; en-GB; rv:1.9.0.10) Gecko/20070601 C64/Commodore OS C64

*heh!* I guess it takes another Commodore fan to appreciate this kind of humor.

I’m a Dad!

Friday, June 8th, 2007

MagditaMagdalena Rodríguez Delgado was born last Tuesday, June 5th 2007, sometime around 18:05 GMT. At birth she was 49cm long and weighed 3.220Kg. Just like her mother, she has a strong, commanding voice and powerful lungs behind it.
In the strange state I’m on right now -neither asleep nor awake, with hardly any sleep on the last three days- I can barely believe that I’m a Dad. And I’m completely, absolutely, positively happy.

Tags: ,

Fix Adobe Acrobat Reader’s “expr: syntax error” message

Friday, June 1st, 2007

After I upgraded a few system libraries Adobe Acrobat stopped working and started to print an endless lethany of “expr: syntax error” messages. A quick google search later I found the fix detailed in at least a couple of places: Find acroread (it’s a shell script, probably in /usr/local/bin or under whichever-directoy-you-specified-during-installation/bin) and apply this patch:

— acroread.old        2007-06-01 18:18:49.000000000 -0500
+++ acroread    2007-06-01 18:20:57.000000000 -0500
@@ -415,7 +415,7 @@
            return 1
         fi

-               echo $mfile| sed ’s/libgtk-x11-\([0-9]*\).0.so.0.\([0-9]\)00.\([0-9]*\)\|\(.*\)/\1\2\3/g’
+               echo $mfile| sed ’s/libgtk-x11-\([0-9]*\).0.so.0.\([0-9]*\)00.\([0-9]*\)\|\(.*\)/\1\2\3/g’
         return 0
     fi

Or just fire up vi(1) and add an asterisk after the second [0-9] block in line 418.
Even tough the problem has been solved, now this is kind of moot. See, I’d rather use acroread than xpdf any day because its navigation is a lot more natural than xpdf’s, and just to be honest xpdf is showing its age and is just plain ugly. However Adobe is starting to piss me off with its inclusion of the Yahoo toolbar in Acrobat Reader and its pitiful insistence to install n upgrades every single freaking time I open a PDF file. So I’ve started to use kpdf instead which feels a bit slower but starts up in a blink, looks a lot cleaner, doesn’t include spyware and displays the PDFs I’ve fed to it with decent antialiasing.

$ echo “alias acroread=kpdf” >> $HOME/.bashrc

So -just to be clear- in my opinion the best way to fix this problem is to stop using acroread and just use something else. Adobe: thank you for screwing up one of your nicer products, and see you never.

Hello, Planeta Linux!

Saturday, May 19th, 2007

planetalinux-small.pngAnd now for something completely different: This site is now syndicated in Planeta Linux Mexico.
If you haven’t heard about Planets, they are sites that publish aggregated news feeds around certaint themes in the now all-too-familiar reverse chronologic order. Planets are a great way to feel the pulse and hear the buzz of a community without having to maintain individual subscriptions manually. Throught the years I’ve become reliant in several Planet feeds, most notably Planet Perl, Planet Python and Planet Debian.
A few weeks ago Beco introduced me to Planeta Linux -now I’m an avid reader- and kindly offered to talk to Damog and get this blog’s RSS feed into the site.
If you are one of my three regular readers, go visit Planeta Linux, I’m sure you’ll find it as enjoyable as I do. And if you are a Planeta Linux reader, well… Hello!

09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0

Tuesday, May 1st, 2007

What’s so special about this number? How is it different from -say- 0×09F911029D74E35BD84156C5635688BF or from 0×09F911029D74E35BD84156C5635688C1? More importantly: can someone copyright a freaking number? Read rudd-o’s Spread this number post and find out why 0×09F911029D74E35BD84156C5635688C0 is so important.

Moving from MyISAM to InnoDB: bulk table conversion

Tuesday, May 1st, 2007

A couple of years ago Ludovico Magnocavallo tackled the issue of bulk conversion of MySQL tables from MyISAM to InnoDB with an elegant bash snippet.

for t in $(mysql –batch –column-names=false -e “show tables” mydbname); do
mysql -e “alter table $t type=InnoDB” mydbname;
done

The original post also suggests using grep to limit the scope of the conversion to just a few tables.
(It seems that now Google *does* yield practical answers to this question ;-)

Tags: , ,

μHOWTO: Beryl on Debian

Saturday, April 21st, 2007

Last week Jordi Fernández gave me a quick hands-on tutorial for a working Beryl setup on Debian. He owns a Dell Latitude D620 running Debian GNU/Linux just like mine, so leeching his setup was even easier for me. What sold me immediately into Beryl is that you don’t need to install Xgl.
Basically I edited /etc/X11/xorg.conf and added these lines to the Device section:

Option “RenderAccel” “true”
Option “backingstore” “true”
Option “XAANoOffsetScreenPixmaps” “true”
Option “AddRGBGLXVisuals” “On”

and added a new section to the very end:

Section “Extensions”
Option “Composite” “Enable”
EndSection

My updated xorg.conf is available right here.
After restarting X (ctrl-alt-Backspace for lazy users like me) you can type this on a terminal:

$ beryl-manager &
$ beryl

I have the official nvidia drivers (1.0-8776) installed via module-assistant and a Beryl version that is kind of old (0.2.0+svn20070205-r3687+imudebian0, rather ancient in Internet Time). This worked immediately for me but Your Mileage May Vary.
There you have it. A working beryl setup in a few minutes. Thanks to Jordi for this tutorial and the rather impressive demo that followed, and to the Compiz and Beryl developers for their hard work.

μHOWTO: Convert and display Flash video

Tuesday, April 10th, 2007

So you want to publish that nice family video in your page/blog/intranet without forcing your visitors to download, install and activate some obscure browser plugin and *then* wait for a 200MB download… Well.. That’s easy as cake!
First, let’s use ffmpeg to convert the video from avi, mpg or mov to something that we can stream to a nice Flash video player:

$ sudo aptitude install ffmpeg
$ ffmpeg -i video.mpg -ar 11025 -s 320×240 video.flv

Then we extract the first frame of the video to use it as a thumbnail:

$ ffmpeg -y -i video.mpg -f image2 -ss 5 -vframes 1 -s 320×240 -an video.jpg

Of course, real men brew their own Flash video players using Ming. The rest of us have to settle for one that has been pre-made, like Jeroen Wijering’s most excellent Flash Video Player. To insert the video in a web page you just have to write

<object type=“application/x-shockwave-flash” width=“320″ height=“260″ wmode=“transparent” data=“flvplayer.swf?file=video.flv&image=video.jpg&autoStart=false”>
<param name=“movie” value=“flvplayer.swf?file=video.flv&image=video.jpg&autoStart=false” />
<param name=“wmode” value=“transparent” />
</object>

You know, there’s even a neat wordpress plugin that allows a much simpler syntax:

[flv:/path/to/video.flv 320 240]

Cool, eh? Now you are ready to take over YouTube!

μHOWTO: Recover an empty kcontrol tree

Saturday, April 7th, 2007

empty kcontrolLast night I opened KDE control center to change my desktop settings and I was shocked when I found that kcontrol was empty but for the OBEX Devices panel. Alll the modules that were supposed to be inside kcontrol where inside the KDE “Lost and Found” folder instead. A superficial search in the KDE mailing lists returned a few matches about this problem on KDE4 (did you know that kcontrol is currently unmaintained and that it’s gonna die real soon now?) but I’m currently in KDE 3.5.5 so that doesn’t apply to me.
Tonight Google came to the rescue: after digging a bit more I found this post in the debian forums which mentions that this might be a bug in a debian package and spells out the answer to my problem:

$ sudo ln -s /etc/xdg/menus/applications-merged/kde-essential.menu /etc/xdg/menus/kde-applications-merged/kde-essential.menu

recovered kcontrolVoilá! Now my kcontrol is fully populated again.

Orpie: a RPN calculator

Tuesday, February 13th, 2007

Orpie is a Reverse Polish Notation calculator for the console. If you’ve ever used an HP calculator you’ll feel right at home. if you haven’t… well, go back to your windows box and launch that buggy calculator desk accessory. In my case orpie let me stop worrying about writing “10 k” every time I ran dc(1).
Orpie was written in OCaml by Paul Pelzl and it there’s a Debian package maintained by Uwe Steinmann.
Go ahead and write:

$ sudo aptitude install orpie
$ echo “alias dc=orpie” >> $HOME/.bashrc
$ . $HOME/.bashrc

You won’t regret it.

PodsBlitz: the cure for your iPod backup woes

Tuesday, January 30th, 2007

When my iPod died I complained -ranted, actually- about the lack of a decent backup program for it. Well, I finally found a program that does just what I need. PodsBlitz will display the songs in your iPod, and moreover, it will merrily dump them to your hard disk. For backup purposes, I repeat. This will backup all MP3 files with their corresponding tag information, but you’ll still have to backup ratings and all other metainformation the old, manual, XML-based way.
PodsBlitz is written in Java and is distributed as a single .jar file that will execute under Windows, MacOS X and most Linux desktops with a fairly recent Java Runtime Environment. The best part is that it doesn’t need to install drivers or do any kind of fancy USB magic to find your iPod. You just dump it into the root directory of your iPod and it just works! Kudos to Alexander Dietrich for this nice software utility!

Dealing with a Demon-Haunted world

Wednesday, December 20th, 2006

candle

“Science is more than a body of knowledge; it is a way of thinking. I have a foreboding of an America in my children’s or grandchildren’s time … when awesome technological powers are in the hands of a very few, and no one representing the public interest can even grasp the issues; when the people have lost the ability to set their own agendas or knowledgeably question those in authority; when clutching our crystals and nervously consulting our horoscopes, our critical faculties in decline, unable to distinguish between what feels good and what’s true, we slide, almost without noticing, back into superstitions and darkness.”

-Carl Sagan, “The Demon-Haunted World. Science as a candle in the dark.”

Carl Sagan died 10 years ago today. Blogathon or not, it is as good a time as any to remember the scientist that hrough his TV show, though his essays, through his novels (Contact is my favorite novel), and even through his bare scientific accomplishments has reinforced in me the desire to know and that childlike capacity for wonder and amazement that we humans lose so easily when we grow up.
To Carl’s life. Cheers!

Death to MSIE!

Wednesday, December 13th, 2006

Death to MSIECarlos de la Guardia writes in his blog about his most recent misadventures with Internet Explorer and his post proves once again that confusion, frustration and anger are the emotions most commonly associated with MSIE.
I say let’s just put that damn browser to sleep.
No, seriously. What would happen if we developers just revolted and refused to support MSIE with all kinds of crude JS, CSS and pseudo-HTML hacks that will break anyway when Microsoft starts pushing a new MSIE flavor? Imagine a world in which digg, slashdot, Google, and even Amazon received people with broken browsers with a nice “optimized for Mozilla Firefox” button or -better yet- with a full-page “go get a real browser” error page listing 40 alternative browsers. Considering that Firefox already has some serious market share and is heading for more we may be able to pull it off. Heck, I bet that MSIE would be standards compliant within a week. Or they could just take Gecko and wrap a nice Vista skin around it and call it MSIE 7.1 for all I care. The point is that most of us could be back home in time for dinner for a change.
Hardly original, I know. But this may be worth the effort of fighting a war.

Sorry I haven’t posted in a while…

Thursday, October 19th, 2006

I’m gonna go with “I’ve been in a state of flux”. You may pick an apology for yourself from The F Blog.
Oh! The nice Dust Puppy graphic was shamelessly ripped from UserFriendly.
(via Boing Boing).

I’m an Uncle! (again)

Wednesday, September 27th, 2006

Meet Mauricio Rodolfo Hans Constantini Gutiérrez.

Tags:

μHOWTO: Enable the SATA CD-ROM Drive in the Dell Latitude D620

Thursday, September 21st, 2006

After a few weeks using the auxiliary battery instead of the CD-ROM drive, I needed to read a DVD. Surprise! It didn’t work. Reboot. Still no luck.
dmesg didn’t show anything about IDE, and /proc/ide was empty. It was like the CD-ROM didn’t exists at all.
The explanation might be that the CD-ROM is a SATA drive, not PATA. Graham William’s GNU/Linux Desktop Survival Guide holds the key to enable the drive. In short:

# echo “libata atapi_enabled=1″ >> /etc/mkinitrd/modules
# cp /boot/initrd.img-`uname -r` /boot/initrd.img-`uname -r`.bak
# mkinitrd -o /boot/initrd.img-`uname -r`
# reboot

Voilá.
(Part of the ongoing Debian GNU/Linux on Dell D620 saga.

μHOWTO: Run VMware Player under Debian GNU/Linux

Saturday, September 16th, 2006

VMware PlayerVMware has made available VMware Player for free for a few months now. I had been having problems making it run under the latest kernels in Debian GNU/Linux until I found out about the Czech University vmware-any-any patch. Of course, this is unsupported, so YMMV.

A typical installation run would go like this:

$ cd /tmp
$ wget http://download3.vmware.com/software/vmplayer/VMware-player-1.0.2-29634.tar.gz
$ tar -zxvf VMware-player-1.0.2-29634.tar.gz
$ cd vmware-player-distrib
$ sudo ./vmware-install.pl

Answer the questions about installation directories, initscript dirs and such, but *do not configure VMware yet*. I repeat: do not configure VMware yet.

Now we’ll patch the source with vmware-any-any

$ cd /tmp
$ wget http://ftp.cvut.cz/vmware/vmware-any-any-update104.tar.gz
$ tar -zxvf vmware-any-any-update104.tar.gz
$ cd vmware-any-any-update104
$ sudo ./runme.pl

This will patch the vmware-config.pl script, the kernel modules source code and the VMware binary itself if necessary. Now you may run vmware-config.pl when prompted. Please note that for this you must install the linux-tree-2.6.xx package for your current kernel version, and the source must be unpacked under /usr/src/linux. This is supposed to work fine when you have installed just the kernel headers instead, but I always go for the full kernel because -as you may have noticed- I compile a bunch of stuff into my kernel anyway.
After module compilation vmware-config.pl will prompt for network configuration and prompt to enable the Google searchbar (!). The last lines in the configuration should be something like this:

The configuration of VMware Player 1.0.2 build-29634 for Linux for this running
kernel completed successfully.

You can now run VMware Player by invoking the following command:
“/opt/vmware-player-1.0.2-29634/vmplayer”.

Enjoy,

–the VMware team

Now you may head back to VMWare’s site to download a pre-configured appliance to run in your brand-new VMware player installation. Or go to EasyVMX to build your very own virtual machine. In any case, remember to drop a line to thank VMware for releasing this kick-ass product for free!

xorg.conf configuration for nVidia TwinView on the Dell D620

Friday, September 8th, 2006

I managed to get TwinView working on the Dell Latitude D620 under Debian GNU/Linux and I’ve been using it for a few weeks now without any problem whatsoever.

The key section in /etc/X11/xorg.conf is this:

Section “Device”
Identifier “Generic Video Card”
Driver “nvidia”
BusID “PCI:1:0:0″
Option “TwinView”
Option “MetaModes” “1280×1024, 1440×900; NULL, 1440×900″
EndSection

Section “Monitor”
Identifier “Generic Monitor”
Option “DPMS”
HorizSync 28-72
VertRefresh 43-60
EndSection

Section “Monitor”
Identifier “External Monitor”
Option “DPMS”
HorizSync 28-72
VertRefresh 43-60
EndSection

I’m using an external 1280×1024 LCD, and I use the KDE control center (Peripherals/Display) to switch between metamodes. The nice thing is that whenever the X server starts and it doesn’t sense the external display it automagically defaults to using only the built-in display. Moreover, TwinView handles gracefully the “hole” below the 1440×900 display. Now what I’d really like to do is to specify that the primary monitor is the built-in display instead of the external LCD, but that can wait a bit longer.

Of course, you can download the complete xorg.conf I’m using, with my finely-tuned (right) TrackPoint and TouchPad configuration.

28 queries. 1.426s  $Revision: 1.6 $
Use Any Browser! Valid XHTML 1.0   Powered by WordPress Powered by Apache Web Server Hacker Emblem