Issues in xfce4-mount-plugin

Posted on: Dec 2006

I planed to add xfce4-mount-plugin to Kwort's panel, but there was some things to fix and to change.

The first patch fixes some issues with some file systems which shouldn't be shown, like tmpfs and root partition. I mean, those shouldn't be displayed, since the users should not mount or umount it.

http://nomius.github.io/content/patches/xfce4-mount-plugin-0.4.7-noroot-notmpfs.patch

This patch is for the same plugin, but is just for behavior. It just make the plugin to not display the device block since the user is not interested on it but where the data will be displayed.

http://nomius.github.io/content/patches/xfce4-mount-plugin-0.4.7-no-block-device.patch

I mailed Jean Baptiste Dulong to change it, but he's not maintaining the plugin anymore, so who knows who should I send the patch. :P




Has to be the Brazilian Air (GNU bc readline patch)

Posted on: Nov 2006

The same day I wrote the patch for Xdialog's extra button feature (when I was in Rio de Janeiro - Brazil) I found a little bug in the GNU bc using readline. The bug actually is very simple, there was a wrong prototype declaration of the extern function readline. The prompt argument, according to readline(3) from GNU, is a const char *, not a char *. So bc didn't even compile if you wanted to use readline (which actually is very good). I must think that eveyone uses bc without readline, so nobody saw that error. Anyways, I wrote the patch and send it to Phil Nelson (author of GNU bc), and he thank me for it.

I don't know when bc is gonna be updated so I don't know either when the patch will be included. So, for now, you'll have to download it from here and apply it manually.

http://nomius.github.io/content/patches/bc-1.06-readline-const-char.patch




Today zenity... Tomorrow who knows... Conquer the world maybe" ;)

Posted on: Oct 2006

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://nomius.github.io/content/patches/zenity-no-canvas.patch




Patch for Xdialog (Yes! Made in Brasil)

Posted on: Oct 2006

Ok, ok, ok... I know I was in vacations, but the day wasn't very pretty, and I felt like taking a coding time. :D

Some weeks ago I wrote a small plugin for Xfce to configure the network in Kwort Linux; I was going to use Zenity, but then I saw again Xdialog and surprise... GTK2 based interface!

Well... Nowadays a program which keeps being maintained using gtk1 is something very weird. So I decided to use Xdialog. The problem was when I needed an extra button... Dialog provides that feature, but Xdialog didn't and I really needed it.

So I mailed Thierry Godefroy asking him if he didn't had a patch which provides that feature... I guess he was very, very occupied, because he didn't even answered.

When I saw the code the first time some weeks ago I said "This will be hard to understand to implement it by myself", and today when I started to look at the code it wasn't that hard. So some hours latter I understanded the code and started to write some things...

So, this is what this command:

Xdialog --stdout --extra-button --extra-label "Extra Button" --inputbox "Type your input. Hit Extra Button to get 3 as return value" 0 0

will show:

Xdialog extra button

So... Here's the patch, I hope someone finds it useful like me:

http://nomius.github.io/content/patches/Xdialog-2.3.1-patch-extra-button.patch




Something interesting

Posted on: Sep 2006

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.




Here we go again with sqwebmail

Posted on: Sep 2006

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://nomius.github.io/content/patches/sqwebmail-5.1.3-vacations-mode.patch




An easy to do samba scanner

Posted on: Sep 2006

I wrote this simple script to find public samba shared resources. 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
wait

#EOF



Patch to provide features to sqwebmail

Posted on: Aug 2006

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://nomius.github.io/content/patches/sqwebmail-5.1.2-vacations-mode.patch




My keyboard

Posted on: Aug 2006

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:

My Model-M keyboard