I was trying to make some visual scripts for Kwort Linux. I tried Xdialog but wasn't very nice. So I give a look at zenity (which I already did 2 years ago).
So the screenshots and its flexibility was amazing, there was just one thing... It needed gnome-canvas, which requiere half gnome's dependencies.
Then I started to look into the code to see if there's a way to get rid of canvas package. After few minutes I realised that canvas was only needed in about dialog; this is not a post with criticism to the zenity developers, who I think they made an excelent job with it, but add a new dependency just to draw their's about dialog wasn't the smartest thing.
I know they use it to fit the gnome's look & feel, but use canvas just for an about dialog was kind of silly, with it you only get gnome users (which unfortunally is the gnome's development idea, but I know that you guys want to do the right thing in the right way :D).
So today I wrote a patch to drop the libgnome-canvas package as dependency. Now Xfce users and everyone else not using gnome can install zenity without installing half gnome. :)
Anyways, I leave you the patch:
http://dcortarello.googlepages.com/zenity-no-canvas.patch
I hope every non-gnome user finds it useful.
Wednesday, October 11, 2006
Monday, September 25, 2006
Something interesting
This is kind of "off topic" but I see this interesting:
Start with a cage containing five monkeys. Inside the cage, hang a banana over a set of stairs. Before long, a monkey will go to the stairs and climb toward the banana. As soon as he touches the stairs, spray the other monkeys with cold water.
After a while, another monkey makes an attempt with the same result--the other monkeys are sprayed with cold water. Pretty soon, when any monkey tries to climb the stairs, the other monkeys will try to prevent it.
Now, put away the cold water. Remove one monkey from the cage and replace him with a new one. The new monkey sees the banana and wants to climb the stairs. To the monkey's surprise, all the other monkeys attack him. After another attempt and attack, he knows that if he tries to climb the stairs, he'll be assaulted.
Next, remove another of the original five monkeys and replace him with a new one. The new comer goes to the stairs and is attacked. The previous new comer takes part in the punishment with enthusiasm! Likewise, replace a third original monkey with a new one, then a fourth, then the fifth. Every time the newest monkey takes to the stairs, he is attacked.
Advertisement
Most of the monkeys that are beating him have no idea why they weren't permitted to climb the stairs or why they're participating in the beating of the newest monkey.
After replacing all the original monkeys, none of the remaining monkeys have ever been sprayed with cold water. Nevertheless, no monkey ever again approaches the stairs to try for the banana. Why not? Because as far as they know, that's the way it's always been done around here.
Wednesday, September 13, 2006
Here we go again with sqwebmail
I really hate when this happens. I released a sqwebmail vacations mode patch just two weeks ago... And guess what... Today browsing the net I found a new sqwebmail version.
Fortunally no big changes in the code so I adapted the patch in a few minutes.
I modify the this patch to make it compatible with both versions (5.1.2 and 5.1.3), I don't know if it works in older versions.
Ok, here I leave you the patch:
http://dcortarello.googlepages.com/sqwebmail-5.1.3-vacations-mode.patch
See you around.
Fortunally no big changes in the code so I adapted the patch in a few minutes.
I modify the this patch to make it compatible with both versions (5.1.2 and 5.1.3), I don't know if it works in older versions.
Ok, here I leave you the patch:
http://dcortarello.googlepages.com/sqwebmail-5.1.3-vacations-mode.patch
See you around.
Sunday, September 10, 2006
An easy to do samba scanner
If you had read the post I made some months ago called "Checking the network with bash" and you liked it, you'll probably like this new one. ;)
I used that same script I wrote to find public samba shared resources, data particulary. Windows by default leave some "open resources" that normally you can access mounting it or with some samba tools. So, the thing is: How do I find public resources in a network? This is what I did:
Again, and like always... I hope some find it useful
I used that same script I wrote to find public samba shared resources, data particulary. Windows by default leave some "open resources" that normally you can access mounting it or with some samba tools. So, the thing is: How do I find public resources in a network? This is what I did:
#!/usr/bin/env bash
function scan(){
SUBNET=${1}
LAST=${2}
PING="$(which ping) -c 1 -W 1"
${PING} ${SUBNET}.${LAST} > /dev/null 2>&1
if [ $? -eq 0 ]; then
SMBRESOURCES=$(smbclient -N -L ${SUBNET}.${LAST} 2>/dev/null | grep Disk | grep -v \\$)
if [ ! -z "${SMBRESOURCES}" ]; then
tput setaf 2
echo -e "Public samba resources in ${SUBNET}.${LAST}:"
tput setaf 1
echo "${SMBRESOURCES}"
echo -e "------------------------------------------------------\n"
tput sgr0
else
tput setaf 3
echo "${SUBNET}.${LAST} is up, but doesn't have public resources"
echo -e "------------------------------------------------------\n"
tput sgr0
fi
fi
}
if [ -z ${2} ]; then
for((x=1;x<255;x++)); do
${0} ${1} ${x} &
done
else
scan ${1} ${2}
fi
#EOF
Again, and like always... I hope some find it useful
Tuesday, August 22, 2006
Patch to provide features to sqwebmail
Recently I've been working with qmail+vpopmail+sqwebmail+courier-imap+...+a lot of things at work.
Sqwebmail has a nice code style, but unfortunally it isn't docummented at all, so for all of us that don't belong to the project itself is very painful. In addition, the way they've done some things can really piss off someone. Not to mention that it's extremely un-extensible. So adding a new feature involves understanding and modifying the whole source code.
Anyway, vacations mode is only implemented through qmailadmin, which is good, but users should use only one web interface, and that interface should be sqwebmail.
So anyways, let's cut off the story and show you some code:
http://dcortarello.googlepages.com/sqwebmail-5.1.2-vacations-mode.patch
I hope someone find it useful.
Sqwebmail has a nice code style, but unfortunally it isn't docummented at all, so for all of us that don't belong to the project itself is very painful. In addition, the way they've done some things can really piss off someone. Not to mention that it's extremely un-extensible. So adding a new feature involves understanding and modifying the whole source code.
Anyway, vacations mode is only implemented through qmailadmin, which is good, but users should use only one web interface, and that interface should be sqwebmail.
So anyways, let's cut off the story and show you some code:
http://dcortarello.googlepages.com/sqwebmail-5.1.2-vacations-mode.patch
I hope someone find it useful.
Monday, August 14, 2006
My new keyboard

Yesterday I got this new "old keyboard". Believe or not, this treasure was going to the trash, and my little brother save it because I told him I was looking for one. He came to me with it at 1:30 in the morning.
I been looking for one of this since 5 years ago. This is a IBM Model M keyboard (latin american) model 1391506. Produced in 1988 is an old school keyboard for people who can appreciate the sound and tact of a real keyboard, this is one of the best (If I don't say the best) keyboard ever made. If IBM knows how to do something is keyboards.
This is real shit, not for those kiddies with multimedia keyboards, this keyboards if for mans, so kids... Stay out, or I'll punch you with it (real, it weight is 2.5kg :D).
How this keyboards works? See this animation:

For those who doesn't know how this keyboard sounds like, you can listen at this: model_m_sound.mp3
Tuesday, August 08, 2006
Modification to "Beginners Guide To Creating A Live CD With LFS 6.0"
Above all I would like to say thanks to Michael Hernandez, who wrote that guide. On may I had to do a job that needed a liveCD, I used Kwort and with that guide it was very easy to do.
My problem was that all the computers that were going to use that CD were very old, and had few ram...
So far so good... But two ramdisks of the same size? There was a ram limitation, so I couldn't use two.
So I had to find a solution. This is what I did to fix it:
The trick is this: What I do is to mount the same ramdisk in two places and then umount the old location. And because one is already mounted when you mount it again in the other location you don't have data lost.
My problem was that all the computers that were going to use that CD were very old, and had few ram...
So far so good... But two ramdisks of the same size? There was a ram limitation, so I couldn't use two.
So I had to find a solution. This is what I did to fix it:
dev_ram="/dev/ram1"
dir_ramdisk="/fake/ramdisk"
dir_needwrite="/fake/needwrite"
echo "Creating ext2fs on $dev_ram..."
/sbin/mke2fs -m 0 -i 1024 -q $dev_ram > /dev/null 2>&1
# MOUNT THE RAM DISK
echo "Mounting ramdisk on $dir_ramdisk..."
mount -n $dev_ram $dir_ramdisk -t ext2
# COPY FILES TO THE RAM DISK
echo "Copying files to ramdisk..."
cp -a $dir_needwrite/* $dir_ramdisk > /dev/null 2>&1
mount -n $dev_ram $dir_needwrite
umount -n $dir_ramdisk
The trick is this: What I do is to mount the same ramdisk in two places and then umount the old location. And because one is already mounted when you mount it again in the other location you don't have data lost.
Tuesday, August 01, 2006
Some updates
We are in updates periods.
Kwort 2.2 is gonna be released by the end of this month or beginning of the next one.
Lots of people has mailed me with comments about the actual site of Kwort, telling me that is hard to navigate, complex, etc. So a new developer has take control of the site and he's moving the forums from punbb to usebb, which I have to say that are nicier, the site is being redesigned to be more simple to navigate and more understandable.
Today, Ricardo Brisighelli (admin the architecture university, where Kwort's main mirror is set up) told me that the ftp mirror will be moved in this week to a new server, which will be great. The next week, I hope to have some time to upgrade to a new Kwort version that mirror and configure more things to developers.
Kwort 2.2 is gonna be released by the end of this month or beginning of the next one.
Lots of people has mailed me with comments about the actual site of Kwort, telling me that is hard to navigate, complex, etc. So a new developer has take control of the site and he's moving the forums from punbb to usebb, which I have to say that are nicier, the site is being redesigned to be more simple to navigate and more understandable.
Today, Ricardo Brisighelli (admin the architecture university, where Kwort's main mirror is set up) told me that the ftp mirror will be moved in this week to a new server, which will be great. The next week, I hope to have some time to upgrade to a new Kwort version that mirror and configure more things to developers.
Sunday, July 02, 2006
Ralink usb driver and driver utility patch
Who was going to think that I would release two driver patches for two different wireless cards in a week? Not me, that you can be sure of ;)
Anyways, today a friend asked me for help to make his wireless card (A ralink usb) work... He could "compile" the driver, but he commented out some things in the code that he needed. Then the system got slow and the story kept going from bad to worse.
Ok, enough of the story... Let's go to the facts. Things that I changed and fixed with this patch:
Download the patch from here:
http://dcortarello.googlepages.com/RT25USB-SRC-V2.0.7.0-nomius.diff
Remember to set QTDIR to compile the driver utility.
A version of the driver with the patch applied can be found here:
http://dcortarello.googlepages.com/RT25USB-SRC-V2.0.7.1.tar.gz
Anyways, today a friend asked me for help to make his wireless card (A ralink usb) work... He could "compile" the driver, but he commented out some things in the code that he needed. Then the system got slow and the story kept going from bad to worse.
Ok, enough of the story... Let's go to the facts. Things that I changed and fixed with this patch:
- Fixed: _WIN32_WINNT warnings (Let's use WIN32_LEAN_AND_MEAN before)
- Fixed: DBG warning (ok, an ifdef before usage is not a bad idea ;) )
- Changed verify_area for access_ok (Come on! that's pretty old! The driver doesn't even see that old function)
- Added a compilation time debug system (This is why my friend came to me in the first place, then I realised the verify_area issue. The logs were huge!). To activate or deactivate it see config.h, DEBUG_NOMIUS 0 means no debuging, a number different than 0 will enable it.
- Added stdlib.h to qhexvalidator.h in the driver utility (without it, it doesn't even compile)
- Fix the thread issue like in the ralink pcmcia Utility driver (just like the post below this one ;) )
Download the patch from here:
http://dcortarello.googlepages.com/RT25USB-SRC-V2.0.7.0-nomius.diff
Remember to set QTDIR to compile the driver utility.
A version of the driver with the patch applied can be found here:
http://dcortarello.googlepages.com/RT25USB-SRC-V2.0.7.1.tar.gz
Tuesday, June 27, 2006
Ralink driver utility patch
Recently the rt2500 driver has been released. You can download it from here:
Download at sourceforge
The utility included with the driver will not compile unless you have the QTDIR set (normally most distros does not do it in bash_profile, bashrc or whatever they use ;) ) and that your QT library says it is threaded. This patch that I wrote fix the thread issue:
http://dcortarello.googlepages.com/ralink-1.1.0-b4.diff
So now. The compilation process will change. To be in this way (In the Utility directory):
Download at sourceforge
The utility included with the driver will not compile unless you have the QTDIR set (normally most distros does not do it in bash_profile, bashrc or whatever they use ;) ) and that your QT library says it is threaded. This patch that I wrote fix the thread issue:
http://dcortarello.googlepages.com/ralink-1.1.0-b4.diff
So now. The compilation process will change. To be in this way (In the Utility directory):
patch -p0 < ralink-1.1.0-b4.diff
qmake -o Makefile raconfig2500.pro
QTDIR=/usr/lib/qt make # Or wherever your qt is installed
Thursday, June 22, 2006
Configuración de 2.6.17
Como comenté en la entrada anterior, los cambios en 2.6.17 fueron bastantes, aquí les dejo la configuración de este kernel que creé para mi laptop:
config-2.6.17.gz
config-2.6.17.gz
Monday, June 19, 2006
Salió Linux 2.6.17
Bueno... Ayer a la noche salió Linux 2.6.17. Con una cantidad de cambios impresionantes (Más de 3mb el changelog).
Venía esperando la liberación de este release hace más de 2 meses, porque junto con él se venía la estabilización del nuevo stack 802.11. Pero nunca pensé que tardaría tanto. Navegando ayer a las 2AM le di reload a kernel.org en el firefox y salió el release final. Inmediatamente me puse a bajarla y mientras miraba el changelog.
Pero una vez que empecé no paré, tardé dos horas leyendo el changelog (mejor hubiese sido haber esperado a que saliera el resumen en kernelnewbies :D). A las 4AM me digné a adaptar mi configuración de 2.6.16.1 a el nuevo kernel (make oldconfig en cristiano :D). Cuando terminó , checkeé el make menuconfig para ver cambios y cosas que por ahí me había salteado en la adaptación.
Lo compilé en 15' aproximadamente, y lo agregé a lilo como Kwort-Test (Hoy ya está como kernel único además del openbsd, 2.6.16.1 fue borrado :D).
Los cambios son verdaderamente impresionantes como dije antes. Desde luego, para muchos el cambio más importante es la inclusión del driver para las placas wireless broadcom, que debo acotar que anda bárbaro. Además se han agregado nuevas llamadas a sistema. Ahhh, una cosa importante que me olvidaba para los usuarios de sistemas x86, se agregó el soporte para la autodetección SMP al momento de booteo, que podríamos decir que era una feature que estaba bastante requerida.
Entre otros cambios hubieron mejoras de performance en ext3 para poder asignar y controlar más de un bloque a la vez.
Otro cambio, si bien no tan importante, pero si para tener en cuenta es que se bajó en softmac la velocidad por defecto de 54Mbps a 11Mbps dado que la primera aun no es del todo confiable (se pierden paquetes de vez en cuando en el camino).
También se modificó la libata, por defecto ahora arranca en ATAPI. Para los desarrolladores también se agregó el miembro max_sectors a la estructura per-devices, con esto ahora podemos saber el máximo de sectores sin tener que hacer más ap->host->max_sectors y cambiar ATA_DFLAG_LOCK_SECTORS para que le diga ata_scsi_slave_config que no pase el límite, que no solo era molesto, sino que incorrecto para hosts que tenían más de un dispositivo por puerto. Por defecto per-devices->max_sectors, por lo que no será necesario modificar módulos existentes.
Entre otros podemos ver mejoras para el framebuffer en placas de video nvidia y nuevo soporte para "algunas" placas ati. También se incluyó soporte para dispositivos braile y la nueva interfaz de leds (para permitir el seteo de leds en userspace (no solo de teclado como antes con setleds), sino para los leds como por ejemplo del disco rígido, de pladas pcmcia, etc) ya es estable. Se mejoraron también las llamadas poll() y select(), para monitorear descriptores de archvios que desde 2.0 no se actualizaban, ahora usan pequeños vectores para sets chicos en vez de kmalloc.
Cuando empecé a seguir el desarrollo del driver bcm43xx no se tenía decidido que licencia usar, si gpl, bsd, si una licencia doble, etc. Para desgracia para algunos (como yo), podemos corroborar que el driver se licenció bajo GPL solamente:
Bueno, esto es un resumen pequeño de los cambios. Si hay interesados en ver mejor y otros cambios les recomiendo ver el changelog en kernel.org y seguir kernelnewbies.org (formato más liviano :D) , para los que quieran empezar a dar sus primeros pasos en la programación del kernel, kernel-labs.org tiene una buena introducción (No es muy complicado para los que quieran aprender. Y vamos que se necesitan siempre desarrolladores más que charlatanes :D).
Venía esperando la liberación de este release hace más de 2 meses, porque junto con él se venía la estabilización del nuevo stack 802.11. Pero nunca pensé que tardaría tanto. Navegando ayer a las 2AM le di reload a kernel.org en el firefox y salió el release final. Inmediatamente me puse a bajarla y mientras miraba el changelog.
Pero una vez que empecé no paré, tardé dos horas leyendo el changelog (mejor hubiese sido haber esperado a que saliera el resumen en kernelnewbies :D). A las 4AM me digné a adaptar mi configuración de 2.6.16.1 a el nuevo kernel (make oldconfig en cristiano :D). Cuando terminó , checkeé el make menuconfig para ver cambios y cosas que por ahí me había salteado en la adaptación.
Lo compilé en 15' aproximadamente, y lo agregé a lilo como Kwort-Test (Hoy ya está como kernel único además del openbsd, 2.6.16.1 fue borrado :D).
Los cambios son verdaderamente impresionantes como dije antes. Desde luego, para muchos el cambio más importante es la inclusión del driver para las placas wireless broadcom, que debo acotar que anda bárbaro. Además se han agregado nuevas llamadas a sistema. Ahhh, una cosa importante que me olvidaba para los usuarios de sistemas x86, se agregó el soporte para la autodetección SMP al momento de booteo, que podríamos decir que era una feature que estaba bastante requerida.
Entre otros cambios hubieron mejoras de performance en ext3 para poder asignar y controlar más de un bloque a la vez.
Otro cambio, si bien no tan importante, pero si para tener en cuenta es que se bajó en softmac la velocidad por defecto de 54Mbps a 11Mbps dado que la primera aun no es del todo confiable (se pierden paquetes de vez en cuando en el camino).
También se modificó la libata, por defecto ahora arranca en ATAPI. Para los desarrolladores también se agregó el miembro max_sectors a la estructura per-devices, con esto ahora podemos saber el máximo de sectores sin tener que hacer más ap->host->max_sectors y cambiar ATA_DFLAG_LOCK_SECTORS para que le diga ata_scsi_slave_config que no pase el límite, que no solo era molesto, sino que incorrecto para hosts que tenían más de un dispositivo por puerto. Por defecto per-devices->max_sectors, por lo que no será necesario modificar módulos existentes.
Entre otros podemos ver mejoras para el framebuffer en placas de video nvidia y nuevo soporte para "algunas" placas ati. También se incluyó soporte para dispositivos braile y la nueva interfaz de leds (para permitir el seteo de leds en userspace (no solo de teclado como antes con setleds), sino para los leds como por ejemplo del disco rígido, de pladas pcmcia, etc) ya es estable. Se mejoraron también las llamadas poll() y select(), para monitorear descriptores de archvios que desde 2.0 no se actualizaban, ahora usan pequeños vectores para sets chicos en vez de kmalloc.
Cuando empecé a seguir el desarrollo del driver bcm43xx no se tenía decidido que licencia usar, si gpl, bsd, si una licencia doble, etc. Para desgracia para algunos (como yo), podemos corroborar que el driver se licenció bajo GPL solamente:
nomius@Neptune:~/Code$ grep MODULE_LICENSE /usr/src/linux-2.6.17/drivers/net/wireless/bcm43xx/bcm43xx_main.c
MODULE_LICENSE("GPL");
nomius@Neptune:~/Code$
Bueno, esto es un resumen pequeño de los cambios. Si hay interesados en ver mejor y otros cambios les recomiendo ver el changelog en kernel.org y seguir kernelnewbies.org (formato más liviano :D) , para los que quieran empezar a dar sus primeros pasos en la programación del kernel, kernel-labs.org tiene una buena introducción (No es muy complicado para los que quieran aprender. Y vamos que se necesitan siempre desarrolladores más que charlatanes :D).
Checking the network with bash
Some bash coding
Ok, I posted this somewhere, but I can't remember where :)
I made a bash script for scanning a sub-network to know which computers are up. I know that nping and anothers programs do this, but I wanted to do it by myself using a shell script, and this is how I did it in the first place:
When I ran that script, it worked fine, but very slowly... so I modified it to be this way:
I hope this will be useful for someone to use it as learning material (this is not the right thing to do because there are applications availble for this)
Ok, I posted this somewhere, but I can't remember where :)
I made a bash script for scanning a sub-network to know which computers are up. I know that nping and anothers programs do this, but I wanted to do it by myself using a shell script, and this is how I did it in the first place:
#!/usr/bin/env bash
PING="$(which ping) -c 1 -W 1"
for((i=1;i<255;i++)); do
${PING} ${1}.${i}
if [ $? -eq 0 ]; then
echo -e "${1}.${i} is up"
fi
done
When I ran that script, it worked fine, but very slowly... so I modified it to be this way:
#!/usr/bin/env bash
function pinging(){
SUBNET=${1}
LAST=${2}
PING="$(which ping) -c 1 -W 1"
${PING} ${SUBNET}.${LAST} > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo -e "${SUBNET}.${LAST} is up"
fi
}
if [ -z ${2} ]; then
for((x=1;x<255;x++)); do
${0} ${1} ${x} &
done
else
pinging ${1} ${2}
fi
I hope this will be useful for someone to use it as learning material (this is not the right thing to do because there are applications availble for this)
Subscribe to:
Posts (Atom)