domingo, 1 de marzo de 2009

Vector linux 6.0 in my Acer Aspire One

I recently bought an AAO, that came with linpus (a very visual distro without much features, but I suppose nice for people that doesn't expect much from their AAO).

Last week, when I got a bootable usb to repartition my AAO hd I installed arch in one partition and from arch, I could install vectorlinux from arch partition doing a hosted install. I'm going to explain how to do a hosted install. Very easy:

First you should have a working linux (with 2.6.x kernel, forget DSL) and a free unmounted partition. Vl installer will be able to recognize unmounted partitions.

- Get an vl iso (wget http://vectorlinux.osuosl.org/veclinux-6.0/iso-release/VL6.0-STD-Gold.iso will do)

- When its done, mount it in a temporary directory somewhere

mount -o loop VL6.0-STD-Gold.iso tmpdir
- Copy vinstall-iso file to anywhere outside the tmpdir

cp tmpdir/install/vinstall-iso .

- unmount tmpdir

umount tmpdir
- as root, execute vinstall-iso with vl iso as a parameter

./vinstall-iso VL6.0-STD-Gold.iso
- Install starts normally (text installer)
1) choose the correct screen resolution (for 8.9" screens)
2) lilo didn't see archlinux, so I decided not installing lilo, and just modify archlinux's grub menu.lst file

After installing vl normally, you can reboot, and start using vl.

Warning:

Wifi led is software controlled, and won't tell you if wifi is on/off. vl can use wireless out of the box. If it does not work, push the wifi switch until it works (you won't need more than 2 tries)

Some more comments on http://forum.vectorlinux.com/index.php?topic=7330.0

Have fun with a fully working vector linux installed on your aspire one.

Wireless -> ok
Webcam -> ok
Sound -> ok

lunes, 23 de febrero de 2009

Vectorlinux 6.0 is out!

After much efford, vl 6.0 is now a reality. Here is the release announcement. Usual Vl goodies: java,flash,mp3. everything out of the box. It's great to install and go hacking away instantly.

We've put perl 5.10 with some common modules preinstaled.

Give it a try and see how fast is your hardware :D .

martes, 10 de febrero de 2009

Better dumps with Data::Dumper::Perltidy

I recently discovered a new module that subclasses Data::Dumper . It outputs the same as D::D but more compressed to fit more data in a screen, and followng perltidy recommendations.

great for my huge debug dumps of arrays of hashes of arrays...
Here's a sample of what it outputs with a not-so-trivial structure.

$VAR1 = [
[ '183', '8', [ '0', '0', '0', '0', '0', '0', '0', '0', '0', '0' ] ],
[ '184', '7', [ '0', '1', '0', '0', '0', '0', '0', '0', '0', '0' ] ],
[ '185', '7', [ '0', '0', '0', '1', '0', '0', '0', '0', '0', '0' ] ]
];
Here's the cpan page

It's usage is as simple as including it and use Dumper as if you were using Data::Dumper, but instead it will use Data::Dumper::Perltidy.

Byez!

viernes, 6 de febrero de 2009

php, el lenguaje freelance?

Rebuscando en la web ofertas de trabajos puntuales, para llenar mis fines de semana, y tardes-noches, y ganarme cuatro perras extras, encuentro que sólo se piden freelances de php.

¿Por qué será? Php es el lenguaje de todos, el que es fácil de manejar, y el que muchas veces lo aprenden no-profesionales , para compaginarlo con su trabajo oficial. Por qué razón no se encuentran trabajos de c++, perl, smalltalk (vale, vale, se me ha ido un poco ahí) no lo sé, pero estoy seguro que hay un mercado para ello.

Proyectos relativamente pequeños, que pueda empezar y acabar una sola persona, los que en java no los puede abarcar una sola persona pero en perl sí. En españa vamos retrasados? Seguramente, pero tampoco no encuentro la forma de entrar en el trapo, haciendo lo que me gusta (que no es php).

Programadoraratos .com sería una buena iniciativa? no lo sé. pero más informaticos de los que os creéis trabajarían más barato y más eficientemente en casa (siempre en caso de no estar en un equipo interdisciplinario, donde la sinergia es importante).

Lo dicho, alguien necesita un programador_a_ratos? aquí estoy.

lunes, 2 de febrero de 2009

configurations hosted @ github

After some years carrying my configs everywhere, or sending them to myself on the email, I decided to put all them in a git repo at my github.

I'll place there last versions of my usual configurations (vim, emacs, zsh, xpdf, urxvt,vimperator...)

Little background on git on http://es.youtube.com/watch?v=8dhZ9BXQgc4 explained by the perl & smallalk guru Randal L. Schwartz.

Have fun!

miércoles, 28 de enero de 2009

Net simulator toy problem in Io

Another little test in Io language.

Packets are generated in a node with a content and a destination. Nodes are linked in a ring and passOn packages unless the package is for themselves.

Next versions to come, with subclassed nodes and more tests.

Syntax highlighted version in http://pastie.org/373095

Packet := Object clone do(
content := nil
destinatary := nil
)

Node := Object clone do (
id ::= nil
next ::= nil
generate := method(content, dest,
a := Packet clone
a content = content
a destinatary = dest
#a destinatary println
passOn(a)
)

receive := method(packet,
("I'm ".. self id .. ". The packet goes to".. packet destinatary .. "") println
if(packet destinatary == self id,
("I've received a package with the message:".. packet content .. "") println ,
#if (packet content asString containsSeq("sleep") and self id == 4, wait(2)) #nonblocking? anyone?
passOn(packet)))

passOn := method(packet,
#self id asString println
if(self next != nil, r:= self next receive(packet), "WTF?! I've no next node!" println))
)

lista := List clone
lista append (Node clone do (setId(0)))

for(i,100,1,-1,
lista append(Node clone do(setId(i) setNext(lista at(lista size -1)))))

lista at(0) next = lista at(lista size-1)
l1 := lista at(0) generate("matat1",45)
#l2 := lista at(0) generate("matatsleep",65)
#l3 := lista at(0) generate("matat3",20)
Future Work is Handling packages in a thread (and learning how to use futures), to be able to block some packages in certain nodes but be able to continue passing nodes along while processing (blocking) a given package.

That would allow having many packages navigating the 'net'.

miércoles, 21 de enero de 2009

a couple of perl gotchas

Yesterday I spent long time trying to catch 2 bugs in my code. It's not that perl is bad documented but me keeping forgetting things, so I'll put how did I solve them.

First one: perlvar are GLOBAL

Being used to use $_, you always find it has the correct value, so rarely localize it (only in nested loops for me). But I was setting $/ line separator to paragraph mode ($/="";) in a function, and though when I exited that block it would be set to the $/ value of returning blog.

FALSE: you should localize $/ in order not to interfere other parts of the module, nor other modules using $/.

local $/="";


Other one is looks_like_number from Scalar::Util.

I was using the flip-flop operator in scalar constant, and somewhat remembered something of returning an 'E' on the last line that matched. I used looks_like_number to check that, but.. omg! "23E0" looks like a number! It makes sense, but I didn't thought of it at first.

while(<>){
  $range = /foo/ .. /bar/;
  if(looks_like_number($range) && $range !~ /E/ && $range>2 ){
   #do things
   }
}