Tuesday, November 08, 2011

Updates for everybody!

I'm a disaster to write a blog, sorry for the delay.
There have been lot of news in the past few months. Let's enumerate one by one:
I created a small project called mttools, and this is basically a set of tools to write good technical documentation, with formated code inside and some pretty nice features. The nice thing about this tools is that it forced me to learn Unix flex :-)
You can check out this project at: http://code.google.com/p/mttools

As some of you might have noted, Kwort 3.2 got released, this is a pretty clean and nice release that got some really nice features and improvements. If you like Kwort > 3, please, step by www.kwort.org, read the announcement and try it.
There's also some nice new features and bug fixes in kpkg, that were deployed with Kwort 3.2, if you're not using Kwort but you're using kpkg, you should step by http://code.google.com/p/kpkg
One of the cool stuff that came up with Kwort 3.2 are the ports; we are now supporting the crux ports, that you can bring to your system by:


  kpkg install httpup rsync fakeroot rsync ports


I'll blog a little on the CRUX ports latter on.

Also there's a new release of ktsuss, just baked. This release has some bug fixes in the su backend and guess what... There's a sudo backend now too!
You should get the release at http://code.google.com/p/ktsuss.
NOTE: 1.4 code has critical bugs and is completely unmaintained, so please update to the latest release. I also removed all extra repositories like the one at berlios, github, etc, so there's now only one at google code avoiding confussions.

The last few months I worked a little on LimShSQL and there's a full new re-write with a pretty shinny curses interface in limshsql-rewrite-1.0 branch, I think I should merge it soon and package a release. Check it out here: http://code.google.com/p/limshsql

Sunday, March 27, 2011

Goodbye lout... Hello troff

Five years ago I went to a dissertation on LaTeX given by Guido Macci, I left that dissertation telling myself "Yes, that's the way to go" and I liked formatting systems, by then I only knew LaTeX, but after seeing that in Slackware it was like 100mb in packages I said like "Ooook, wait a second... Is it that big?", it turned out it really was, and not only big, but a real mess under the hood, so I was kinda disappointed and desisted on the idea of using LaTex. Those who know me knows that I'm pretty minimalist, and having a formatting system of 100mb that was a mess was pretty much out of the table, but I still though it was the way to go.

So I spoke to a friend (Emiliano Gavilan) who always liked that stuff and told my "problem" with LaTeX... So Emiliano recommended me to take a look at lout.

That was in the beginning of 2006, so it's been like 5 years now with lout. Nowadays lout is kinda unmaintained, it has some bugs, the output generated is not as professional as LaTeX, and (I bet this is because I'm too lazy to learn them) there are some things that I never wasn't able to do.

So last week I gave a chance to troff, and I keep myself reading the whole weekend, and I really liked, it's stable, small, well tested (almost 40 years :-D), and it is on every Unix out there (this is a BIG plus). I had some troubles inserting with code, but after digging I found vgrind (which I heard is unmaintained so we'll have to check in the future how it goes) which does the job pretty good.

There are tons of books out there written with troff some pretty well known like "Advanced Programming in the UNIX Environment", "The C programming Language" or "The Design and Implementation of the 4.4BSD Operating System", there's a big list here

If you're interested in learning troff, you can read this book: Dale Dougherty & Tim O'Reilly - Unix Text Processing

I hope this turns out good.

Cheers.

Sunday, February 27, 2011

Something that I was waiting for...

I want to share something with you guys...
Last week (sorry for the delay) I got an email from Jørgen Thomsen telling me that gnu-pop3d was released:

Hello

I just released GNU -pop3d 0.9.13 which is a more stable release than 0.9.12

http://jth.net/virtual.html

In a short time I will release 0.9.14 which will implement IPv6 support.

So great, a new gnu-pop3d is available, so I saw the changelog and I saw this:

Bugfix: certain login methods did not work (David B. Cortarello)

Pretty happy about the merging of my patch into mainstream. Thanks Jørgen!.

Cheers!

Friday, December 17, 2010

GNU pop3d fix

Wooooo, kinda a lot without saying something here! Well, I took some sabbatical months of blogging ;-)

Recently I've been working on a mail server, and those who know me, knows that I'm pretty minimalistic. So I started with exim and gnu-pop3d (no imap for this) with stunnel to provide ssl support.
I use Unix users for authentication, but gnu-pop3d had a (pretty small) bug which made it reject any authentication whether it is right or wrong.
So I wrote a patch to provide a fix and sent it to Jørgen Thomsen. He answered me on Wednesday telling me that the patch was accepted.

Anyways, I leave the patch here: gnu-pop3d-0.9.12-fix_passwd_login.patch

Cheers!

Sunday, February 14, 2010

Hidding messages in icmp packets

Hello everybody. A new month, a new article (I wish I could do this so periodically).

Today I'm going to show you something that I've been playing with. As you probably know (if you don't, I'm just telling you now :-)), the ICMP packets provides an arbitrary data space right after the ICMP header. Normally, no one use it, since ICMP is a control protocol that has all its usage right inside of it, leaving this data space useless.

A few days ago, I saw someone connected on Cinetix (http://nomius.ath.cx) and he was just connected, but not on the IRC server and I didn't know who he or she was. So an idea started to flow around my head "What about if I could send messages with ICMP packets".

So actually this is what I did... I wrote a tool to put a message in the data space and send it using the ICMP type 7 which is unassigned (for example, ping is the type 8). The problem is that the kernel just drop type 7 (as we all assume) and the data space is also dropped in any icmp packet. So I wrote a kernel patch that print the message in the output of dmesg or /var/log/message if you have set KERN_NOTICE to be displayed (I think klogd -c 6 does).

With this, you can send to a friend a message of the kind "Hey. This is David, I'm online on irc (jabber or whatever), jump in!" and it will be displayed in the system logs as a kernel notice.

Please, take note that this is not a chat system, but an "emergency system", so don't start using it as an everyday conversation protocol. This also isn't a patch that should be in the kernel mainstream, since ICMP packets of type 7 is unassigned, and NOT a communication protocol.

What about security?
Well, you might start asking yourself this "What if someone from the outside starts flooding my logs with dumb messages?". Right, well, the answer to this is netfilter; use iptables to drop these kind of package. Something like this:
iptables -A INPUT -p icmp --icmp-type 7 -j DROP

As you might know or guess, you can also block only one IP address or accept from a certain network like this:
iptables -A INPUT -p icmp --icmp-type 7 \! -s 10.0.0.1/24 -j DROP

Use more complex rules creating policies like "if someone exceed the number of 5 ICMP type 7 packets in a minute, drop any packet from the IP address".

Enough with the talking... How do I use it?
Great, right to the point. So the steps:

1) First of all, patch and compile your kernel.
cd linux-2.6.31 && patch -p1 < patch_icmp_type_7_messages.diff

And compile and install your new kernel using the way you normally do (make config/menuconfig, etc...)

2) Then compile the icmp_send.c program:
gcc icmp_send.c -o icmp_send

3) Send a test message:
./icmp_send 127.0.0.1 "Hello world"

3) Check out the dmesg output:
./dmesg | grep "ICMP 7 Message"

Get it!
Anyways, this is a really nice thing to play with and I hope people find it useful. You can get the kernel patch and the ICMP message program from the links below.

patch_icmp_type_7_messages.diff
icmp_send.c

Have fun.

Friday, January 08, 2010

Using the ZTE MF 110 with 3g Movistar (Argentina) on Linux

Hello all,
Today I'm going to explain how to do something really simple. As some of you might already know, I got this year a EEE PC netbook (1000HA). I have to admit that this baby is going great, I'm running the latest Kwort on it and it's really resource saving if you know how to set it up correctly.
If I add this netbook a 3g connection, I can say that I'm online everywhere almost all of the time. Well, this is what happened... As most of you already know, I've been working for Accenture for over a year now and they provided me (and some of my co-workers) a 3g modem with internet connection, which is pretty nice.
So, on january 1st after all the people who came my home to celebrate the new year left I sitted on the computer to figure out how to make it work.
This is a ZTE MF 110, and I found some people who made it work (kinda) or those who plugged it in at ubuntu and said that it works OoTB. Well, this is true kind of, but I hate when you don't really know how things works. Also, I found some people who made it parcially work with wvdial, which is a nice tool also.
So, my quest was to make it work with plain pppd. And this isn't really hard to do if you know a little how to play with the AT commands.

Ok, let's put the hands in the mud, first of all, I'm one of those people who likes to have a latest kernel tuned for my device, so this implies that yeah, I compile my own kernel with almost every release... In this case we are compiling 2.6.32.2.
So, for this you'll need the usb mass storage system in order to be able to switch from it to the modem mode.
Device Drivers -> USB Support -> (Select your usb version, ehci, uhci or ohci) USB Mass Storage support

Now, this GSM modem (as several others) needs the serial support... Well, actually, this is a serial GSM modem that you want to jack into the USB bus. So you need:
Device Drivers -> USB Support -> USB Serial Converter support

This will create the usbserial module. And now, you need the GSM modem support. So for this, you have to select:
Device Drivers -> USB Support -> USB Serial Converter support -> USB driver for GSM and CDMA modems

I would recommend you to compile them as modules (M) instead of built in, as this isn't a feature that you will be running all the time, so you can unload modules and free some memory (not too much, but everything counts nowadays).

I'm assumming that you already have the PPP support, if not, it's in the device drivers and Network Devices. But if you're reading this, you might already know.

Now, everything is ready for us to set it up.

We need usb_modeswitch, this tool will allow us to switch from the "ZeroCD" mode to the modem mode in order to allow us to call our provider. Basically we need this config (/etc/usb_modeswitch.conf):
DefaultVendor=0x19d2
DefaultProduct=0x2000

TargetVendor=0x19d2
TargetProduct=0x0031

MessageEndpoint=0x1
MessageContent="55534243b8fe6681000000000000061b000000020000000000000000000000"

This config file will make the usb_modeswtich to swtich the device 0x2000, of the vendor 0x19d2, to 0x0031 sending the message pointed by MessageContent. If the usb_storage module is loaded and you run:
usb_modeswtich -c /etc/usb_modeswitch.conf

And then you run lsusb you'll see the product id changed from 2000 to 0031.

If you got here, now it comes to nice part.
In order for us to not use wvdial, we need a call script (also called chat script). I'm going to show you you the script I wrote (/etc/ppp/peers/chats/movistar):
ABORT BUSY ABORT 'NO CARRIER'
ABORT VOICE ABORT 'NO DIALTONE'
ABORT 'NO DIAL TONE' ABORT 'NO ANSWER'
ABORT DELAYED
'' ATZ
OK ATQ0\sV1\sE1\sS0=0\s&C1\s&D2\s+FCLASS=0
OK AT+CGDCONT=1,"IP","internet"
OK-AT-OK ATX3DT*99#
CONNECT \d\c

This basically it reads like this: abort in any of the conditions above (no carrier, no dialtone, etc...), then reset the modem waiting for nothing, initialize the modem, find out the CID for an APN GPRS, dial and connect. There's information about Hayes AT commands all over the web, so if you're interested you can google it yourself. :-)

Well, now we have to set up our user and password:
echo -e "internet\t*\tinternet" >> /etc/ppp/chap-secrets

And finally, the ppp configuration itself (/etc/ppp/peers/movistar):
lock
hide-password
noauth
connect "/usr/sbin/chat -v -f /etc/ppp/peers/chats/movistar"
/dev/ttyUSB2
460800
defaultroute
noipdefault
user "internet"
mtu 1492
ipparam movistar

Most of this options are self explanatory, but the importants one are the connect line and the "/dev/ttyUSB2" one. The first one tells pppd to use the chat program to connect the other point and the chat script that will be used (/etc/ppp/peers/chats/movistar, that we created before), if, for example, you set up a pptp connection you'll see this line pointing to the pptp client program. The second one tells pppd the modem device, maybe you have to play a little bit with this one trying /dev/ttyUSB2 or /dev/ttyUSB3 (if you don't wan't to try you can use minicom to find out, good luck with that :-P).

Well, now everything is ready to connect, you just need to run:
pppd call movistar

From now one, if you restart your laptop/netbook or normal PC, all you have to do is:
usb_modeswitch
sleep 1 # Let the device sync with the switch
pppd call movistar

Monday, December 14, 2009

New Kpkg hosting

Well, the C version of kpkg is now hosted at: http://code.google.com/p/kpkg. It would be cool if people start checking it out.

Upgrade support is working partially, as only one package at the time can be upgrated, I will try to finish the whole upgrade support soon.

If any people want to use kpkg in their personal distributions (I don't think ubuntu/suse/etc... users will want to run kpkg on their systems, but who knows), it would be nice to know.

Also patches to add more functionality, fixes or any kind of power, are always welcome.

Oh, and btw, the sqlite databases structures (for mirrors and personal systems) are included in datastructs.h. If you have any questions, please ask here or mail me. :-)

Cheers!

Wednesday, December 09, 2009

The kpkg issues

Hello everybody... Today I'm going to speak about kpkg.
Well, I wrote 4 package managers before I started kpkg, there was kwt-get, kum, kget and another one I can't remember.
With every package manager I wrote things where from a very simple start, allowing to install, search and remove packages to a more complex usage allowing several mirrors, dependencies resolution out of the box, and finally the idea of third party packages (this last idea appeared in kpkg), package series, etc.
Let's analyze those 4 functionalities:
1.- More than one mirror was something asked, but once I implemented, there wasn't more than 3 or 4 mirrors out there.
2.- Dependencies resolution is a huge deal, the real thing is that under the hood it sucks, and I see why big distributions with lots of developers has package managers supporting this feature, as they have several developers who everyone takes 10 or 20 packages, build them and fill the databases with the dependency tree. The fact is that this feature is bad implemented in any distribution, it shouldn't be something that the developer has to fill (the database with its dependencies), it should be something auto generated at build time, I don't know, a file listing its dependencies generated by configure (when using autotools) or something similar. I could spend like an hour talking about this feature since I made 3 different implementations of its resolution algorithm.
3.- Well, third party packages (also known as tpp). This actually wasn't a feature it was a way to deal with an inconsistency in kpkg, the fact that packages were registered in mirror databases, if one was repeated, it has to be a "third party package", so kpkg (without any environment variable altering its normal course) treated it as a non identified package (or a package provided by a third party developer not included in any mirror). Of course someone could deal with this using environment variables (MIRROR, STANDALONE and SERIE). So installing a package from the console without having it in a mirror and keeping the database clean without tpp was a huge deal. With tpp, kpkg tried to do, with the same tool, what debian does with a separated tool (dpkg).
4.- Series was kinda one of those features that supposed to help but didn't, in fact, it complicated things. If you start looking at a package system you think "Great, series, this is a way to pre-hash every package", well, it kinda did that job, but complicated all other things, actually this feature was one of those that pushed the "third party packages" "feature".

Despite with dependency resolution (now, a few years back it was supported), kpkg support all this features. By this time you might be asking "Why god why this package manager is so complex and twisted"... Well, the fact is that even I hate kpkg nowadays.
Also, as most of you might know, kpkg is written in bash, with leave us a lot of issue. Why? Well, kpkg makes use of several console tools included in packages like coreutils (ls, rm, mktemp, md5sum, etc), findutils (find), sed, awk, grep, wget, tar, lzma, etc... Can you imagine what could happen if you try to update for example the coreutils? Well, to understand this question and being able to answer it, you need to know some of the kpkg internals, but summarizing what kpkg does is "Download the new package, remove the old package, install the new package", and almost every package managers do this (there's also some other algorithms to deal with this but you need to save more data of every file included in the package). Now, if you upgrade to a new version of, for example, the coreutils, what kpkg do is: "Download the new coreutils, remove the old coreutils, install the new coreutils", if you remove coreutils kpkg starts failing pathetically leaving your system out of use (sorry, toilet cleaning :-P) and we all have to pull the shades down and go home.
In fact this happened some weeks ago and a user came to me with insults, ranting and all the bad things you can imagine. Well, he was right about my mistake, but I'm human and I can make tons of those (and thank god we all still making mistakes, it's a proof that we still humans) and the fact is that no one is paying me for developing Kwort and all its tools, so take it easy.
Anyways, this leave us to the fact that we can't upgrade some (several) packages and with them, of course, the libc.


So, I'm dealing with all this problems re-writing kpkg in what we can call "kpkg new generation" (LOL, it even sounds cool eh? :-P). How I dealed with all this problems? Well, some of those original "features" were dropped, "dependencies resolution" was out of the table way before starting, "series" support was removed as with the new database it isn't needed anymore, and third party packages was also dropped since the new approach is more consistent. What about the fact that you can't upgrade several packages? Well, kpkg is now written in C and static compiled (so everything can be upgraded :-)).

The new kpkg use sqlite3 as database backend, libarchive for package decompressing (giving us support for tgz, tbz2, tar, lzma, xz, zip, etc) and libcurl for package retrieving which leave us support for tons of protocols. And every piece of the code is very well documented with doxygen which will help everyone who wants to read the source code.

So far, the new implementation of kpkg (in C) has support for almost the same options (search, install, remove, provides, update and download) the actual kpkg has, and only the upgrade support is the only one missing (I hope I have time to code it this week). So I will try to upload the source to github as soon as I can, so everyone can start to find bugs in it and improve it.

See you soon guys, and if I don't before Christmas, Merry Christmas :-)

Cheers!

Monday, October 12, 2009

Vim bug using tags

Well, lot of people know that I'm a vim fan and that I use it everyday, to me is like the killer app that everyone should know how to use in Unix.
Even at work, I'm a programmer (doing C on Unix now), and some of my fellows were using Eclipse and after I show them Vim, they was like "woooo, I can use this editor as an IDE and still can use my machine for do something else while programming" (I was like, blame the one who introduced you to Eclipse :-P).

Anyways, I like using tags, allows me to browse the code really fast (for those using Eclipse, I think is like if you press F3 over a function name). But I found this weird behavior using ctags+vim. See the above code:
  1 #include <stdio.h>
2
3 int asd(int s,
4 char a);
5
6 int main(int argc, char *argv[])
7 {
8 asd(1, 's');
9 return 0;
10 }
11
12 int asd(int s,
13 char a)
14 {
15 return s;
16 }

When I press ctrl+] over asd in line 8, it takes you to the 3rd line instead to the 12th...
There's a "workaround" to this behavior, using --excmd=number while running ctags put the line numbers in the tags file (without this option ctags puts just an 'f' identifier to tell the editor that it is on that file). But it is just a visualization workaround, because you can't put any new line (or remove) in those files or your tags file will screw the tags file.

Does anyone knows a solution to this issue?

Thanks.

Tuesday, September 29, 2009

Kwort 3... The big change

Hello everybody. This is just a flashlight of what Kwort 3 will be.
Kwort 3 brings a whole new era of Kwort Linux, Kwort public might change now, I'm not focusing anymore in inexperienced users, but on intermediate-advanced users and up.
Why is that?
Well, kinda I'm forced to that. Kwort's most important problem was always the kernel, not because Linux is bad, but because some drivers are.
For example, wireless drivers tend to suck... I mean, WTH is that closed source microcode needed for most drivers? That's just plain wrong. I'm not talking here about making it free software, but open source would help everybody to make better drivers. Also there are tons of wireless cards out there unsupported (or half supported) because companies not releasing specifications, we are not even talking about open source anything here. COME ON!
I'm not going to take this to the free software vs. open source vs. closed software, people who know me, knows that I hate those topics and I leave those to politicians and software philosophers.

Despite of that, some other things are not easy (as it should be) to support, and inexperienced users tend to not know what they want (first they want a desktop, then they want to be able to configure a web server with a GUI (that I'm not going to write) for some php scripting , then they want to create a RAID or LVM). Kwort was always meant to be for the desktop, and the desktop only, not a web server not a redundant file server, etc.
And the funny part is: If you don't provide packages for what they want, they get pissed off and I've also got insults because of this. People, what is going on here? It's not like you're paying me (and if you would, that doesn't even give you the right to insult me), you can ask for something. I develop Kwort in my free time.
So, advanced users tend to know a lot more, from the work that takes to do something like Kwort, to how to check logs and write or hack some script to do what they want (for example a network configuration script).

So... Kwort 3 is now based on CRUX which will make it more advanced. I'm not changing it to CRUX because I want it to be hard and for truly advanced users, but because Slackware has become a really multi-purpose distribution, and strip out all the "unneeded" stuff for Kwort would take me a lot of time.
Also the init system has changed and the way it is configured too. Don't worry about all this, it is already well documented in the new website (this new one is really cool, with tons of information as it always should be but never was). There's no more wizards tools like knm (Kwort network manager) and kum (Kwort user manager), but a console and the chosen editor. Despite of that kum and knm will still be maintained and developed.

Anyways, Kwort 3 is almost ready be released. There's a beta release already that everyone can test (there are some testers already doing a great job that helped me a lot).

Sorry for not having you all up to date related to Kwort, but I've been working a lot and in my free time I try to develop Kwort. For example, now, I'm in my lunch time, and I passed out lunch in order to write something for you about the new direction of this project.

Cheers.

Sunday, July 12, 2009

Thunar and hard drive partitions

Hello everybody, It's been so long since my last post here.
There's so much to talk about, but today I'm going to talk about Thunar. As some of you might know, thunar is the file manager used in Xfce, written by Benedikt Meurer, and nowadays maintained by Jannis Pohlmann.
I really like thunar, but the fact that hard drive partitions are left to the distribution itself when hal can manage them and because of that the file manager also can, isn't really nice, as you can browse your partitions in newer versions of GTK's (with Gvfs) GtkFileChooser.
An ugly workaround would be to mount them and add some gtk bookmarks, but you would like to set an emblem to differentiate them from normal bookmarks, and emblems are not part of the gtk library, so you wouldn't see emblems in a GtkFileChooser. Another issue would be that isn't dynamic, so if someone change partitions that would be a total mess.
So IMHO the best solution to this is: Hard Drive partitions managed by hal (DeviceKit in the future) and let Thunar show them in the left pane. And this is what I actually did.

So, as everybody loves screenshots and you probably want to see how this looks:



And finally, the patch: http://dcortarello.googlepages.com/Thunar-1.0.0-hd-partitions.diff

Enjoy!

Thursday, April 09, 2009

Kwort Linux 2.4.1 released

I’m happy to announce that Kwort 2.4.1 final is here!


This version took a year to develop and provides a lot of changes from 2.4 release, including a new, more cleaned up than usual, base system, whole new tool chain, new configuration tools and lots of new things.


Good things in this new version:



  • Kwort’s init system: From 2.4, the init system has evolved keeping its simplicity but providing some new features.

  • Linux 2.6.28.7: A lot of hardware support was included since the kernel included in Kwort 2.4.

  • Kpkg: The new version of kpkg include several new features as the adoption of multi-mirror support.


  • Kwort User Manager: Re-written from scratch it Provides a simple way to create and remove users with a new interface.

  • Kwort Network Manager: Also re-written from scratch, allows you to configure your network (wired and wireless), as manage your dns and hostname system. It also allows you to switch wireless drivers.

  • Xfce: This new version brings a lot of changes under the hood making the desktop more extensible.

  • Audacious: This is the default music player since Kwort 2.4.1 allowing you to play your music in a very simple way.

  • Our new Google group (http://groups.google.com/group/kwort-linux): Ok, this has nothing to do with something included in the release, but it allows the developers behind Kwort to communicate between them and also with the users (who are what Kwort is all about).


As in every old version now comes the things that I look forward to improving:




  • Thunderbird: It’s kind of sad, but thunderbird isn’t yet full “xulrunnized”, so starting firefox+thundebird brings two copies of xulrunner up to memory, which as we all know, is kinda in the chubby side.

  • Audacious: Although audacious is pretty good doing its job, I think a jukebox is more needed these days, as people needs more information while playing their music. It is known that using gstreamer would take out some of the features audacious brings, but we have a full-featured media-handling components and using those frameworks would allow the Linux desktop to improve, communicate between applications and to remain simple.


People who I would like to thank:

Andreas Schipplock as always for making and maintaining the website, mirroring the Kwort iso image, and kind of playing a role of resources manager that allows me to develop easily Kwort.

Sebastian Reisse for writing the kpkg manpage, and for taking a lot of his time testing every release candidate, if it wasn’t for him, this release would come with several bugs.

The Aircable people for their donations as they helped me to buy some hardware I was needing for develop Kwort.

The mirror providers as usual, the people from PGHosting and Ricardo Brisighelli for the package mirror in the UNR.


Finally, but not less important a very big THANKS to Patrick Volkerding for Slackware Linux, the system Kwort is based on.

The Xfce developers (core and goodies) who made 4.6 a lot more simple to configure for distributions and provided help when needed.

The people who develop every project Kwort includes. I hope I didn’t forget anyone.


As usual, if you need support, help, or you just feel like talking about Kwort (or anything else), or you just want to meet the people who is behind Kwort, you can join us on IRC or our Google group:



  • IRC: irc://irc.oftc.net/Kwort

  • Google Group: http://groups.google.com/group/kwort-linux




David B. Cortarello

Monday, February 09, 2009

Lots of stuff going on

Well, it's been 3 months since my last post, and I've been doing a lot...

Let's start with Kwort. Well we're just there from the release, lots of new improvements are being done around it, and something really interesting is the new network manager and the new user manager I wrote from scratch with a completely new design using gtkdialog.

The new network manager allows you to configure your ethernet and wireless network, supporting static and dhcp, for wireless network, support for several encryption mode are available, from wep to wpa2:



The user manager stills very simple but with a very simple and smooth interface:



So, as you can see we have almost everything, since looking at the screenshot the Xfce settings manager is in it, so Xfce is kinda there, so you might be questioning "What are you waiting for a release?" Well, Xfce 4.6 is in release candidate time, so when they release it final we'll see how's the Mozilla people going with Firefox 3.1, since it would be really cool to ship it with Kwort 2.4.1. I wouldn't matter to ship a beta 3 with 2.4.1, but we'll see, since beta 3 should be released already according to Mozilla's Firefox schedule, and their delivery meeting is schedule to the end of the month (February 25th), which is just around the corner.

Resuming, lots of improvements are going on and I'm trying to make it pretty cool and easy for the end user.

That's just for Kwort, now... Some friends saw I was migrating to git, and yeah, I did, since in the past I used git with gitorious.org which didn't convinced me, I came back to darcs. But now, I discovered GitHub which is really cool, fast and easy to use and with lots of guides around, so you can see and follow my work at: http://github.com/nomius.
I have to admit here that I was influenced at work by warlock, which is the author of the wbar, to move from darcs to git, so I found a darcs2git python script and it was like charm.

Also, I implemented lots of cool new features for kpkg, and I merged kpkg with the kwort network manager and user manager making a "big" project called kwtools. Looking right now at the master tree page, you'll see this: "Implemented kpkg search /all with csv support" and you might be asking "What the hell is this guy making with kpkg implementing stuff like this?", well, I hope this feature is just enough, but basically, it is because a friend, x-ip, and I we are writing a graphical interface for kpkg, at the moment the interface is pretty rough but does show the idea, of course, icons and all that stuff is going to be implemented with also a more eye-candy interface, so you can see a preview of the application here:



As I said before and as you can see, the interface looks pretty rough, but give us some time and you'll see how cool it looks. I doubt we get in time to include this new tool in Kwort 2.4.1, we'll try, but I really doubt it since I'm just learning python, which is the language we use to write this, and x-ip is just learning wxPython with me, which is the framework we use for this.

Please, if you have any ideas for Kwort or any of the tools/applications I write, please write me, it would be nice to hear (read) about you and your ideas, and also, I don't know... help maybe? :-)

We'll, this post is already becoming large so I'm off to bed now. Have a nice week and see you around guys.

Saturday, November 01, 2008

Updates!

Well, it's been a long time in the road since my last post here. This weblog isn't over, but I been doing a lot of things and didn't got the time to write something.

Ok, things I've been doing:
* I wrote a new network manager for Kwort 2.4.2 (I'm already working on a new Kwort version), screenshots are coming
* I also wrote a new user manager for next Kwort also. Screenshots are ON the way. :-D
* A friend of mine (Jp) is working on a new init system which is very cool, so Kwort will use it.
* Bought a pretty cool (4 cores) new computer (Desktop). I would like to thank to the aircable.net people who helped me to buy my new computer with a donation. (A BIG THANKS TO YOU GUYS)
* Working... :-)

Anyways, I want here to point to two links, the first one if from my good old friend Andreas Schipplock, he made a small list of interesting links to read and/or hear. The second one is to the "Open Unix Society" which is a cool place full of documents and books for learning.

Online video lectures
Open Unix Society



Btw, I took a position at iProgrammers and I'm working at Accenture now as a Senior Programmer.

Monday, August 11, 2008

NQqueue 0.3b

I'm just releasing NQqueue 0.3 beta.
This is just a bug fix release and it is beta because of the new spamassassin plugin; I wrote this one on sunday, but since I don't use spamassassin (I have servers running dspam), I can't test it.

This is just a release asking for people to flood my inbox with feedback on the spamassassin plugin, the configuration parameters are the same used with the dspam plugin, so only "pass" parameter is allowed, or empty.

In case you have doubts on how to configure NQqueue, you can read this:
NQqueue 0.2 + Configuring NQqueue + Configuration schemes


So, get latest NQqueue release here: http://europa.fapyd.unr.edu.ar/releases/NQqueue-0.3b.tar.gz

Enjoy!

Thursday, July 17, 2008

NQqueue 0.2

Well, I just tagged NQqueue as 0.2. Several changes has been done from 0.1. For those who doesn't know, NQqueue is a threaded queue for qmail with support for plugins. Full details of what nqqueue is can be found here: http://nomius.blogspot.com/2008/06/nqqueue-what-is-that.html

Download the latest release version here: http://europa.fapyd.unr.edu.ar/releases/NQqueue-0.2.tar.gz

Changelog can be found here: http://europa.fapyd.unr.edu.ar/darcs/NQqueue/Changelog
If you want to get nightly builds packages. Use this link: http://europa.fapyd.unr.edu.ar/darcs/NQqueue/NQqueue.tar.gz
Darcs repository: http://europa.fapyd.unr.edu.ar/darcs/NQqueue

NQqueue stills in development, it is stable enough, but there are some things that must be fixed before the next release.

Plugins included:

  1. General plugins:

    • black - Parameters:
      • user@domain - email address to put in the blacklist.

    • clamav - Parameters:
      • "pass" - will make the email pass even if it contains a virus (used to send it to a quarantine).
      • None parameter given will block a containing virus mail.

  2. User plugins:

    • dspam - Parameters:
      • "pass" - will make the email pass even if it considered spam (used to send it to a quarantine).
      • None parameter given will block a spam considered email.

    • quarantine - Parameters:
      • "all" - will send to quarantine any email that was considered spam or that contains a virus.
      • "dspam" will send to quarantine any email that was considered spam.
      • "clamav" - will send to quarantine any email that contains a virus.
      • "q=" - allow the administrator to set the quarantine type. Allowed types of quarantines are:
        • general - will put the email in /var/qmail/nqqueue/quarantine.
        • vquad(VHOME) - will put the email in your vpopmail home (ex: vquad(.Spam), will put your email in Maildir/.Spam/cur). [vpopmail support must be given in configure script]

Example of common usage:
This example shown here will block an incoming email from billgates@microsoft.com, put emails containing virus to general quarantine (in /var/qmail/nqqueue/quarantine/domain/user), and deliver spam considered emails in Maildir/.Spam/new (which is the personal user spam directory in his vpopmail home).
  • /var/qmail/control/general.cfb
:clamav=pass;black=billgates@microsoft.com
  • /var/qmail/control/mydomain.com.cfb
dspam=pass;quarantine=clamav,q=general;quarantine=dspam,q=vquad(.Spam)

I hope people start using nqqueue, since it is fast, secure, flexible and very easy to use.

Wednesday, July 02, 2008

ktsuss 1.4 released

Well, the people of wicd asked me for some modifications in ktsuss so they could support it as they do with gksu.
These modifications were made in the weekend; also bug fixes has been done, and as it looks very stable I'm writing a post release announce here. :-)

Changelog can be found here
Also, you can follow ktsuss development in my darcs server here
Latest ktsuss download link here

Bugs and feature requests are always welcome :-)

Cheers!

Tuesday, June 24, 2008

NQqueue? What is that?

As some people asked me the last few weeks what I've been doing I've decided to take some time to write this and explain what NQqueue (aka nqq) is all about.
Well, some of you maybe listened (or read) me telling that queues for qmail are bloated. We don't have several choices, there is just plain qmail-queue which is unfeatured, qmail-scanner (aka give me my CPU back) which is the bloatest one, and simscan which is kind of featured, fast, but not extensible at all, both of the last ones are buggy when getting an email with several Rcpts (they only analyze one. Which is a big bug).
So, because of all this, I've been using simscan, I actually extended it from those 2000 lines to 4000 adding features. But it became so big, that it is hard to maintain and to trace errors in it.
This situation drove me nuts the last year so I decided "Why I don't just write my own qmail queue?". Well, NQqueue is the result of this self asked question.

Let me show you and tell you some of the features of NQq:

* Modular - not like simscan with a big file with all the problem.
* Pluggable - this is what NQq is all about, it support the addition of plugins. There are some now in the darcs server.
* Threaded - this is quite a nice feature for mails with several Rcpts, nqqueue triggers a thread for every Rcpt to be analyzed.
* Fast - This is like simscan. But it improves it when analyzing more than one Rcpt because of the threads.
* Secure and reliable - I been working quite a lot on this, since simscan has several bugs, and I didn't want this on NQq.

Plugins: Well, some of you might be asking "Dude, nice, but how do I write a plugin for NQq?". Well, first of all, I have to tell you that there are two types of plugins:
1st. we have the general plugins. Those plugins are run to an email before to trigger all the threads for every rcpt. Why is this? Well, it would be dumb to call for example a clamav plugin for every user (in every thread). So for example we can write a plugin that should not care about the Rcpts and/or From, like clamav, since it depends on a general database.
2nd. besides of general plugins, there are also per user plugins. These plugins are run in every thread. This is the example of a spam plugin, since it depends on a special per user database.

So now I can show you a small general plugin to block a Sender:

/* vim: set sw=4 sts=4 : */

#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <nqqueue.h>

#define PLUGIN_VERSION "1.0"
#define PLUGIN_NAME "black"
#define REJECTED_MESSAGE "Message rejected because of black list"

char *plugin_name()
{
return strdup(PLUGIN_NAME);
}

char *plugin_version()
{
return strdup(PLUGIN_VERSION);
}

/* Parameters:
* params = a char pointer with parameters used to call the module (in this case, the email address to block).
* mail = It's a char pointer to the filename that contains the email.
* From = a char pointer with the From email address. (if it matchs the param, the mail would be blocked)
* Rcpt = an union that contains space for a char pointer (if user pluing) or a pointer to a PUStruct
* struct (if general plugin).
* general = a pointer to a RSStruct struct, which is structure with all the plugins and its return values
* already runned by general plugins
* peruser = a pointer to a RSStruct struct, which is structure with all the plugins and its return values
* already runned by per user plugins
*/
struct ModReturn *plugin_init(char *params, const char *mail, const char *From, const union Tos Rcpt, \
struct RSStruct *general, struct RSStruct *peruser)
{
struct ModReturn *ret = malloc(sizeof(struct ModReturn));

ret->NewFile = NULL;
if (!strcmp(params, From)) {
ret->ret = 1;
ret->rejected = 1;
ret->message = strdup(REJECTED_MESSAGE);
}
else {
ret->ret = 0;
ret->rejected = 0;
ret->message = NULL;
}
return ret;
}


Looks easy don't you think? So, how do we make NQqueue to load our plugin? Simple: in /var/qmail/control/general.cfb put a line like this:
:black=billgates@microsoft.com

That will set the sender billgates@microsoft.com as a blocked server. In fact, this plugin acts just like a black list.
Now your question might be: And how can I block more? Well, you can call the plugin several times, like this:

:black=billgates@microsoft.com;black=steveballmer@microsoft.com

Or you can modify the plugin_init function to allow more than one email (like black=billgates@microsoft.com,steveballmer@microsoft.com) and do some simple parsing with strtok.


As you can see it is very easy to write plugins for NQqueue. I know it stills need a lot of documentation, since at it is now, it's very poor in this aspect. The only documentation in NQqueue so far is a configuration scheme in the NQqueue darcs in case you want to know how to configure it right (it's very easy).

So, those are some of the features in NQqueue there are more of course, but those are enough to mention.
NQqueue needs a lot of testing, so I'm counting with all of you to run tests. Also documentation is needed, and it will take some time to me to write it, so people wanting to write documentation are welcome. Also people writing plugins, I wrote some which are already in my darcs server (a dspam, clamav, blacklist and quarantine) modules.


You can follow NQqueue's development in my darcs server at: http://europa.fapyd.unr.edu.ar/cgi-bin/darcsweb.cgi

Sunday, May 04, 2008

My darcs repository

So, on friday after some times I set up myself to finish the nqqueue. But then I started to see where to version the project.
In the last couple of years I been using berlios, which is great, and I really like it, but there was this issue: "svn/cvs only". So, I started to take a look again at subversion, and found it even more annoying than before (LOL).
I made a request to the berlios team 2 years ago asking for darcs support, but none of the admin team answered. Actually, berlios is kind of abandoned, as nobody takes care of answering to bugs, issues, and features requests... Kind of sad.

A friend of mine gave me this hint about using git so I said "Why not?", let's try it. I spent the whole saturday trying and testing it, and fortunately lots of features absent in subversion existed in git. But stills very complex, specially setting it up was kind of annoying.

By the end of saturday I was kind of dissapointed because of this, so I asked to the people in irc.freeonde.net/#darcs if there was any projects repository outhere using darcs... As expected, the answer was a "NO".

Then I saw the light when "Why don't I create a darcs server?" came to my mind. So, I created a darcs server at europa.fapyd.unr.edu.ar (static IP). But only with ftp access since it was the only thing installed on it. So for example someone could get or pull kpkg like this:

darcs get http://europa.fapyd.unr.edu.ar/darcs/kpkg

When that worked, I decided that there was something missing, and it was the hability to get from http and the web interface. So finally, I installed a simple and small webserver (shttpd) and brought darcsweb to it. Now, it is working and people can follow the development very easily. I even made a modification to the cgi (a python script) to allow people to get a release from the darcs cgi web inteface.

You can see my darcs server up and running here: http://europa.fapyd.unr.edu.ar/cgi-bin/darcsweb.cgi

One thing to look forward is the upload patch cgi (http://europa.fapyd.unr.edu.ar/cgi-bin/upload.cgi), which is a perl script that accept patches from post in the format message/rfc822 (mail format) and deliver those to a Maildir in the server, so then I can apply those. Fancy, don't you think? :)

Ohhh, one last thing... If you follow the links, you'll see the NQqueue (You shouldn't even know about this unless I told you. Eventually I'll drop a comment on this) in the repo, please, don't try it unless you feel very adventured, since there is no release so far, and it has some nasty bugs to be fixed, features to be implemented before to schedule for a release, and the modules API is not yet stable. It is only there so you can check it out (and maybe help if you want?). When NQqueue gets stable, I will drop a release with drums and cymbals. But so far, the code is very unstable!

Wednesday, April 09, 2008

Hanging up switches and bridges

This issue came up today with some people and I did affirmed that you can hang up your switch with some funny code...
How this come? Well, very simple, switches and bridges has a small stack (10 bytes per host connected to it) where they save IP and MAC addresses to know where to send a package once the sender and the receiver are known. So, once the first package is sent, a new entry in the stack was made. So now you know the "theory" I'll leave you to think how could this help you to hang it (Let me give you a hint: OVERFLOW).

Anyways, get the code you'll need to produce this overflow from here: http://dcortarello.googlepages.com/pkinject

Keep in mind that you'll need the pktgen kernel module to run this.
See also that I did this 3 years ago with bash, not even C code, so it shows how easy is to generate network packages to produce this effect, which isn't a big deal when it comes to reproduce it, but to create a security policy to avoid it.

Have fun.

Saturday, March 29, 2008

Kwort 2.4 released

I'm proud to announce that Kwort 2.4 final version has been released after a very long time (more than a year). The system is very stable and very usable.

The core system is based on Slackware and provides a rock solid system, and it's also a great place to start making a full featured and usable desktop environment using Xfce.
This version includes several changes from 2.2 from a new toolchain to a completely new base system. The inclusion of hal provides a great way to communicate the hardware with the desktop making the system a lot more user friendly.

Good things in this new version:
  • Hal: As I said before provides a lot of new features giving the desktop some kind of control of the hardware.
  • New init system: Kwort 2.4 includes a new init system written mostly from scratch. Also it puts all the work together with the new service command.
  • Linux 2.6.24.3: The latest stable version of the linux kernel.
  • Kpkg: The new version of kpkg was re-written from scratch.
  • Kwort User Manager: Provides a simple way to create and remove users with default Kwort templates.
  • Xfce: This new version integrate great with hal.
  • Ristretto: The image viewer of the Xfce project.
  • Mplayer: The most famous video player on Linux is now included in the iso.
  • Pidgin: The latest version of the best multiprotocol IM.
  • Mpd+Gmpc: This is the new combo to play media files in Kwort. Just put your media files in ~/Music, go to gmpc, give update and play.

As in every old version now comes the things that I look forward to improving:
  • Better support for wireless devices: This is not part of Kwort itself, but the kernel, but finally affects Kwort users.
  • Amule: Once again amule is giving the hebbe-jeebes. There is no stable version of amule that works well enough with Kwort. The latest version is dated from middle of 2006 wich is very old and buggy with newer versions of wxGTK.
Screenshots available here: http://kwort.org/?page=ScreenshotView

People who I would like to thank:
Andreas Schipplock for making and maintaining the website, mirroring the iso, working in Kwort core (he made most part of the job with Core) and bring lzma support to Kwort.
Stijn Seger for working in some packages like openntpd and the pm support. And writing the Kwort user manager.
I would like to give a special thanks to the users who ran tests specially to David Luskovec and Juan Martin Villanueva, if it wasn't for you guys, this iso would take even longer to come out.
Manuel Naranjo for reporting bugs, submiting patches for the new init system, hosting the iso and run test all along Kwort core.
Also, I would like to thank all the mirror providers: Ricardo Brisighelli for the development mirror in the UNR, Alberto Ferrer for the mirror in Emanon Linux and the AIRcable people for the mirror at aircable.net.
Finally, but not less important a very big THANKS to Patrick Volkerding for Slackware Linux, the system kwort is based on. I hope I didn't forget anyone.

As usual, if you need support, help, or you just feel like talking about Kwort (or anything else), or you just want to meet the people who is behind Kwort, you can join us on IRC: irc://irc.oftc.net/Kwort

Tuesday, March 04, 2008

Nice picture

Well, not much to say these days...




Sometimes we have to find a reason to laugh, even a little bit... I found this picture very funny. :)


nobody:nogroup

Monday, February 25, 2008

Why ktsuss use setuid?

Well, this was the question made by one of the debian packagers. I see a good thing the fact that they ask this, since including a program setuid without asking the reasons would be kind of dumb. They ask why not using pam or su in the way gksu does, so I will try to answer these questions.

Using pam would requiere setuid too (since pam_unix2 doesn't have it's own wrapper), which doesn't bother me as long as I program in a secure way... What really does, is that not every distribution out there use pam, slackware is the most important it comes to my mind now.
Using su, well, there might be a problem there, gksu does it in a very unportable way waiting for the string " Authentication failure" which is a very bad idea, look this example:

Fedora "su" command:
-sh-3.1$ su
Password:
su: incorrect password
-sh-3.1$
Slackware (Kwort) "su" command:
nomius@Neptune:~$ su
Password:
Sorry.
nomius@Neptune:~$

As you can see in gksu, different versions of su would really break things up.
None of above shown implementations gives " Authentication failure". I guess that message is given by pam with strerror(), so once again, it's not portable.

The actual ktsuss code is very clean and simple (which is the whole idea behind ktsuss), I always gave security with the authentication backend, maybe a feature bug (like the PATH thing in 1.1), but not security issues.

There might be a way using su better than what gksu does, something like doing "su -c exit" (pepping the password of course) getting the exit status with WEXITSTATUS(), waiting for 0 (password ok and then run su command with the same password) or 1 (wrong password). But would be kind of messy...
I should see that like something in a long distant future... But I think it could be a way to avoid the paranoid.

So since ktsuss have its own implementation of authentication backend, that's why it needs setuid.

Monday, February 11, 2008

ktsuss 1.3... Finally

Well, today I'm releasing the new ktsuss.
It toke quite some time, not because it was too much work, but because I didn't the enough time to finish it.
This new version includes the new authentication backend, and the new interface, which I have to say it's quite better than the old one. The main setuid program has a better comand line parser, not for the user, but if someone wants to understand it, is quite easy.

I would like to thank Christian Dywan for putting so much work in the graphical interface, he made an excellent job with it. I would like to thank too to all the people who reported bugs to make this release the best one.

Summary: https://developer.berlios.de/projects/ktsuss
Changelog: here
Download link: here

Cheers!

Wednesday, January 02, 2008

MPD: What's missing?

I been using mpd+gmpc now for a while, I really like the combination, but what I missed on it was the ability to modify tags, which normally all players can do.
Well, I started working on gmpc to add support for tag editing when I stopped with the following issue: The fact that mpd doesn't support tag editing was the reason for gmpc to not support it (which makes sense), because mpd is run on a different machine so gmpc does not have access to these files.
Some of you will tell me "Dude! Sonata supports tag editing even when mpd doesn't", and I know, but what sonata does is actually a very like a "half done work" with that, as you can only edit tags if mpd runs on the same machine sonata is running, which normally doesn't happen (that's the idea of a client-server structure).
So, now, my approach to resolve the problem was completely different as I had to include a new command in the mpd protocol so I could add tag editing support.
Well, I did include the command, I did gave support to tag edition and I even gave a command to check if the file can be edited or not. Finally, I gave support to libmpd and gmpc, so now, gmpc can "full edit" tags. :-)

So here are the patches (descriptions on how to use the commads can be found in mpd's patch, and descriptions on how to use the new functions libraries can be found in libmpd's patch):
MPD (stable version, by now 0.13.0): mpd-0.13.0-tag_edit_support.patch
LIBMPD (stable version, by now 0.15.0): libmpd-0.15.0-tag_edit_support.patch
GMPC (stable version, by now 0.15.0): gmpc-0.15.5.0-tag_edit_support.patch

Now, the main problem wasn't the code itself, I mean, I had to spend some time investigating the code to finally hint the right keys. But the problem is now in what mpd developers want to do with this patch. Some developers like it (specially client's developers and users, like Qball Cow and Scott Horowitz), but others disagree. I really understand both sides (I have to admit I like more mine's, that's why I developed this patch).
Some argues that the patch will add more code to maintain, but actually, the mpd's patch is not more than 300 lines (so that excuse looks more like a joke), others say that mpd is just a music player with a client-server architecture, and not a tag editing software, and I really understand this philosophy. But IMHO I think that if mpd wants to take care of the music this is like "a must have".

Since this made very people a little
uncomfortably, I see this like something good, not because of the internal fight/war, but because it helps to discuss the development. The fact that is being considered means the project is still alive and defining issues while the time is going on.
People say that if this doesn't get in trunk tag editing is off the table. Well guys, if that happens, bad luck.

Anyways, Kwort 2.4 will use mpd+libmpd+gmpc with tag editing support. :-)

Wednesday, November 21, 2007

The children of my children are my enemies... What about their children

I had to deal with this problem related to process sincronization some months ago, and since Kwort 2.4 core edition is waiting for Linux 2.6.24, I will show you what my problem was and how I dealed with it.

I was trying to run a process, this process forks itself and ran some bash scripts. So far there's nothing bad on it, the problem is that those shell scripts create some childs, and it is more than sure that the parent (the main script) die before the childs, so I'll get some orphans process. And the main C program shouldn't die before all the childs die.

So, let's take for example the code in the first post in this blog "Checking the network with bash". In this case a wait in the end would fix the problem, but let's just think that we can't modify this script:
#!/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

So, this was the first attempt to control this mess but unfortunately didn't work as expected because this process was in another Process Group ID (avoid comments about controlling the return value of fork and such, since this is an example of something that didn't work):
int main(int argc, char *argv[]){
int status;
if(fork())
waitpid(-1*getpgrp(), &status, 0);
else
execlp(argv[1], argv[1], argv+1, NULL);
return 0;
}

So, basically, the idea was that the main C program shown above shouldn't die until all the childrens of the scripts die (that's why I was using using getpgrp(), which didn't work as expected for what I explained above).
On Linux, running ps axfj, showed me that the small childrens (those one generated by the script) are in the same group, but I couldn't wait for them, as they are not my childrens, but then child of my child process children's.

After dealing a little of time I came up whit this program that control all the childrens, grandchildrens and rest of the "family". The code is very simple to understand and explains on itself:
int main(int argc, char *argv[]){
int status;
pid_t pid;
if((pid=fork()) != 0) {
sleep(2);
waitpid(pid, &status, 0);
while(killpg(pid, 0) != -1)
usleep(0.1);
}
else if(pid==0){
setpgid(getpid(), getpid());
execv(argv[1], argv+1);
}
return 0;
}


Thanks to Marcel, who actually helped me a lot with some concepts and ideas to find a workaround to this.

Sunday, September 02, 2007

ktsuss 1.2 released

I just released ktsuss 1.2. There's not much to say about this new version. The most important changes were made to the GUI which now uses a native gtk dialog instead of a custom window. (Thanks to Christian Dywan for the patch).
Ktsuss now allows running applications as any user instead of root only. The code was in the authentication backend, now it is used in the GUI.
Added to the main launcher are options -v, --version, -h, and --help.You can read the full changelog and download the new version here: http://developer.berlios.de/projects/ktsuss

Screenshot as usual:

Finishing... You guys know, report bugs and all that kind of stuff. ;)

Monday, August 20, 2007

Some flashlights of Kwort 2.4

Well, me and the rest of the team are working in Kwort 2.4 (2.2.2? I dunno, but I think 2.4 will be alright).

Andreas Schipplock (aka Avarus) is working on the core system and as far as I know he is making a remarkable work on it.
One of the most important parts is the lzma compression for the packages, so the final iso will be smaller than the Kwort 2.2 one. He is now working on the installation system, so when he gets done I'll put Kwort desktop on it.



Stijn Segers is working on the new interface for the users admin system (as my mockup looked very bad :-P), so once he finishes with it I will make a Xfce plugin of it and include it in the mcs settings manager.
He will also take care of the kernel. So this time, getting kernel source to compile drivers won't be needed and as he told me we will include some drivers by default like those free ralink ones. But kernel work stopped until 2.6.23 come out, as that one will be the one for Kwort 2.4.

And it's time to tell what I'm doing... Well, until Andreas and Stijn doesn't finish I'm still maintaining 2.2 serie including and upgrading packages (http://www.kwort.org/?page=MorePackages).
But until that happens I'm checking projects and taking decisions for the desktop and in core (helping Andreas and Stijn). Today I did some user custom actions for kwort packages:


For those paranoids (I know you guys are right about this), ktsuss will be included and all those sudo commands will be removed (sudo will still be included, but not used for anything else but xfsm-shutdown-helper). So this custom action showed above use ktsuss in case you ask.


Oh, another interesting things are the fact that kwort is listed in www.xfce.org/download/distros as a Xfce distribution and Kwort being used in school (COBAEH - Cuautepec de Hinojosa - Hidalgo - México) with old machines (Pentium MMX 200Mhz with 32MB ram).

Well, that's all for now folks, I will keep bringing Kwort newsflash :)

Friday, July 27, 2007

Knowing the network speed at a given moment

Well, a friend of mine asked me for this, and it was very interesting to understand what was in /proc/net/dev.

#!/usr/bin/env bash

if [ -z "${1}" ]; then
echo "Give a network interface"
exit 1
fi
DEV=${1}
/sbin/ifconfig ${DEV} >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Please, do man 8 ifconfig to know what a network interface is"
exit 1
fi
LINE_OLD=$(cat /proc/net/dev | grep ${DEV})
sleep 1
LINE_NEW=$(cat /proc/net/dev | grep ${DEV})
while [ "${LINE_OLD}" = "${LINE_NEW}" ]; do
sleep 0.1
LINE_NEW=$(cat /proc/net/dev | grep ${DEV})
done
OLD_DOWN=$(echo ${LINE_OLD/*:/} | awk -F " " '{ print $1 }')
OLD_UP=$(echo ${LINE_OLD/*:/} | awk -F " " '{ print $9 }')
NEW_DOWN=$(echo ${LINE_NEW/*:/} | awk -F " " '{ print $1 }')
NEW_UP=$(echo ${LINE_NEW/*:/} | awk -F " " '{ print $9 }')
REST_DOWN=$((${NEW_DOWN} - ${OLD_DOWN}))
REST_UP=$((${NEW_UP} - ${OLD_UP}))
if [ ${REST_DOWN} -gt 1024 ]; then
echo "DOWNLOAD: $(echo "scale=2;${REST_DOWN}/1024" | bc -lq)k/s"
else
echo "DOWNLOAD: ${REST_DOWN}b/s"
fi
if [ ${REST_UP} -gt 1024 ]; then
echo "UPLOAD: $(echo "scale=2;${REST_UP}/1024" | bc -lq)k/s"
else
echo "UPLOAD: ${REST_UP}b/s"
fi

You can run it this way for example:
while true; do ./netspeed eth0; done


See you guys in the next few days to tell you something new :)

Monday, July 09, 2007

The IT Crowd for download

The last week I started to see a tv serie called "The IT Crowd" on Sony, it's a funny geek serie about an IT team in a british company. Anyways, a friend of mine (Manu) wanted to download all the chapters from a site, so I wrote this simple script for him:


#!/usr/bin/env bash

wget http://stage6.divx.com/The-IT-Crowd---Spanish-Subtitled/videos/
i=1
for x in $(egrep -i "The-IT-Crowd---1x0*" index.html | awk -F '/' '{ print $4}' | sort -m -u); do
tput setaf 1
echo "Downloading chapter ${i} (Link: http://divx-226.vo.llnwd.net/stage6vid/${x}.divx)"
tput sgr0
wget http://divx-226.vo.llnwd.net/stage6vid/${x}.divx --output-file="${i}.avi"
i=$((i+1))
done


I hope someone find it useful.

EDIT: Unfortunately, this doesn't work anymore, since stage6 was closed.

Friday, June 22, 2007

Here we go again with margins in openbox

I wrote a patch for openbox 3.3.1 at the very beginning of the year which was rejected by the openbox leader (to me the reasons wasn't right, but it is his project :-P).
So a new release of openbox was released some weeks ago and yes, as you guess, that patch isn't compatible with the new version (3.4), so I re-wrote the patch to work.

The configuration is made in the same way as before in the rc.xml:

<margin>
<top>px</top>
<bottom>px</bottom>
<left>px</left>
<right>px</right>
</margin>

So, here it is, patch supporting margins in openbox 3.4: http://dcortarello.googlepages.com/openbox-3.4.0-margins.patch

Thanks to all the people asking me for this, as it inspiring.

This entry is dedicated to someone very important... You read this from time to time, so you know who you are. :)

Sunday, June 17, 2007

Firefox freshmeat.net search plugin

A long time since my last post, looks like that was from the caves times. :-P
Anyways, I was boring in this almost winter afternoon, so I started to see what I could do in a short amount of time. So I wrote a small search plugin for Firefox, so I can search for projects in freshmeat.net, you can get it from here:

http://dcortarello.googlepages.com/freshmeat.xml


Cheers! :)

Saturday, April 21, 2007

My new tool: ktsuss... A simple graphic su.

I know I had to write something about the wake on lan software I was writing. I think it is done, but couldn't test it yet, so I don't wanna rush me and write about it and show it in case it doesn't work, so please stay tunned and wait a bit longer.

So, today I will show and talk you about a new thing I was doing these days.
I started working on a replacement for gksu. gksu is like a graphical su. I was trying to understand it and make it work well enough, but I don't know what was in the mind of the gksu's developers, because what they did was a really wrong approach, I don't know why they wrote first a library and then the application (maybe for plugins, I'm just paraphrasing) , but anyways, together they are more than 500k, which is extremely too much.
So I wrote my version of gksu, which is called ktsuss (keep the su simple, stupid). My version is only the setuid wrapper (as GTK doesn't permit setuid programs) and program itself which is less than 3k.
As I know you guys love screenshots, this is how the program looks like:



Anyways, I would like to get feedback on this, so please, let me know if it fails or anything is or goes wrong on it.

Get the program from here: http://dcortarello.googlepages.com/ktsuss-1.0.tar.gz

Sunday, April 08, 2007

As I said, knm 2.3 released

After some times, a new version of knm was released. This release is just a bug fix release (thanks for all the feedback I got from everyone).

Changelog here: Changelog
Download here: Download

Package for Kwort 2.2: Here

Kwort users, please upgrade to this version, as it is very important.

Sunday, April 01, 2007

A month latter... Finally, patch for wavemon

It's been quite a while since my last post here...

Some things happened like the release of Kwort 2.2 (not as great as I would like, but still good). New knm will be released in the next few days, this will be just a bug fix release (too many thanks to the people from tuxmachines, who thanks to them I saw some bugs).

I've been developing on clip at work, which is an interesting and exciting thing, since this is my first time working on compilers (I started last year when I wrote some patches for compatibilities and bug fixes).

Well, now on to businesses and the important stuff. As I said like a month ago I was working on a patch for wavemon, which is a software that I consider very good, with a nice and clean code. I would have released it before, but I was studying and working a lot, so I only have the weekends, and as I been working on Kwort I couldn't work on this before.

So, as it says in the patch, the following bug fixes and features:
* Fixed errors compilation in gcc 3.x due to default label missing
* Fixed some warnings due to the lvalue casts deprecated on gcc 3.x
* Changed ap list functions, so now it use the new iw api (this is the most important thing).

The last change is the most important, as it made the code simpler, now it works with all cards because the new wireless tools extensions are up to date.

Get the patch from here: http://dcortarello.googlepages.com/wavemon-0.4.0b-comp-fix-new-ap.patch

And for those that don't know wavemon, you can get the source code from here: http://www.janmorgenstern.de/wavemon-current.tar.gz

I hope you guys find it useful like I do. :)

Saturday, March 10, 2007

Kwort Linux (to be released) and Kpkg (released)

Kpkg 2.4 was released some minutes ago, you can download it from here: http://prdownload.berlios.de/kpkg/kpkg-2.4.tar.gz

This version is a bug fix release, now PKG_GOOD and PKG_FAIL works with upgrade as it should and I fixed a weird issue due to a scope problem in bash functions.

As usual, release notes and Changelog can be found here

That's about Kpkg. Now, let's go to the important business. Kwort 2.2 final version will be released in the next couple of hours as some bugs (I hope no more appear) were fixed. The most important upgrades of this final version are kpkg and dialog. Not important upgrades were aaa_base and freedesktop packages that were modified to avoid annoying messages during the install.

Monday, February 26, 2007

Kwort network manager 2.0 released

Has been like a lifetime since I wrote something here, sorry folks, I been studying and working a lot.

I just released knm 2.0, I tried to do this for the last two weeks, but there was some problems with releases at berlios (unless that happened when I tried to release this new version of knm).
No many improvements made, several bug fixes and some information dialogs.

You can see the release notes with the changelog here: Changelog and release notes

And you can download this new release at here: Download

In other news, Kwort 2.2rc2 have been released, check Kwort site at my right or here (Thanks to Josep Subils Rigau who keep both the domains (.com and .org) registered). Please, if you're gonna download the iso, use Andreas's (aka avarus) mirror, as it is faster.

Finally, I'm working in a patch for wavemon (http://www.janmorgenstern.de/projects-software.html), I already fixed any gcc incompatibilities but I'm still working trying to fix the ap list feature, because as it says in the source code it should be changed to the new 2.6 kernel api.

That's all for today... Stay tuned. ;)

Sunday, February 11, 2007

Kwort Linux new logo

Not really programming, unix and/or math, this is like *off-topic* for this weblog, but Kwort's related, so for transition, Unix related. :D

I'm happy to announce that Kwort Linux has now a new logo.
Some weeks ago, Julio Cesar Puigpinos wrote to a mailing list the idea of create a new logo for Kwort.
Only one person sent me some sketches, and this was Fabricio Caiazza. He made two logos and sent those to me, the first one looked like a friendly ghost and the second one (a weird penguin) who was the one who won.
I would have liked to have more logos from which to choose, not because Fabricio's logo isn't nice (it is actually great btw), but the fact of having more logos means that the community wants to help. I'm not making a judgment here, maybe the community doesn't like arts, but it would be nice to get some help sometimes...

Anyways, no more talking, the logo:



In other news, Andreas Schipplock is making a new site with several languages support (I'm not sure, but I think he finished the languages support code today) for those who instead of help come with criticism and complainings about this issue (you guys know who you are, and I only feel shame for you).

Monday, January 15, 2007

What would programmers do when they are bored?

Well, nothing much to do these days since I spent all my vacation doing other things.
I actually started to code a C API for kpkg, which will be finished in an unknown future. :P
As I have also fixed some bugs in kpg I released a new version "2.3" which is a bug fix release.

See the release notes here: Releas notes
And get the package here: Download kpkg 2.3 at berlios.de

To come back to the original question... Well, this is very tricky, since we should do things normal people normally do. In this case "no computer related things". But, ok, people know, programmers are very weird, so when we are boring we do the opposite, which in this case would be "computer related things". :P

So... What have I done? I improved my "IDE", and it is quoted because it's actually vim only. So, how can someone improve vim? Simple! By just reading some of these books: http://iccf-holland.org/click5.html
Or if you don't want to spend your money on that, you can actually learn vim with :help inside of vim.
So, this is my new vimrc file, there's nothing very weird on it, only a set of templates, some options and options to compile simple projects and full autotools projects.

I hope you enjoy it and of course, take whatever you need from it:

I hope you enjoy it and of course, take whatever you need from it:
http://dcortarello.googlepages.com/vimrc

Saturday, January 06, 2007

Margins in Openbox

Last month I started using openbox to create an easy to use desktop for programmers. Everything was nice, but I wanted to use yabb with adesklets, and then ipager... Everything was nice when I launched those applications/applets, but when I maximize a window, it was over the applet.
There are some applets where that is ok, like the weather applet, but that wasn't right for a panel (like yabb) or a pager like ipager (this last one should set struts).
The solution was margins, Xfwm4 has it and other several wm (like metacity and sawfish) has it too. So I wrote a small patch to give to openbox margins.
I was very happy with it, and gave it to other users to try it (thanks gregf in irc://irc.oftc.net/slackware who tested it for a while, and who stills using it), so I made the submition in openbox's bugzilla. But guess what... The patch was rejected, and the bugzilla entry closed and deleted.
The answer of the developer was:
It's up to the pager/panel to set properties called struts. Openbox properly
respects those and doesn't maximize over them.

Which is great... I mean... Follow standards, that's good... But applets does not set struts, and sometimes the users just wants margins.
So anyways, the patch is here for everyone who wants to use it. Just has to apply it and set the margins in the configuration file like this:
<margin>
<top>px</top>
<bottom>px</bottom>
<left>px</left>
<right>px</right>
</margin>


So here's the patch: http://dcortarello.googlepages.com/openbox-3.3.1-margins.patch

Sunday, December 31, 2006

Issues in xfce4-mount-plugin

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://dcortarello.googlepages.com/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://dcortarello.googlepages.com/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


Btw... Happy 2k7 to all of you :)

Saturday, December 23, 2006

Ttysnoop fixes

I started using ttysnoop (it's like a vnc for consoles) at work but there was so troubles while compiling, so this patch fixes errors, warnings and adds things to Makefile to make it more flexible and able to compile the program itself, read the comments in the patch for a more detailed information.
And please, if someone finds Carl Declerck's email (another than carl[@]miskatonic[.]inbe[.]net), send this patch to him or drop a comment here reporting me his real mail, since I couldn't send him the patch because his email address doesn't exists anymore.

If you want to start using it you'll probably want to apply this patch.

I leave you the link here:

http://dcortarello.googlepages.com/ttysnoop-0.12c-fixes.patch

Sunday, December 17, 2006

Vista stealing Mac OS X ideas? Nahhh, they are too different

I had another thing to post tonight, but I just wanted someone to note this:

Sunday, December 03, 2006

Kpkg and some other things

I know I haven't make a post since 2 weeks ago and I'm sorry for those who enjoy reading this things (Who's the crazy one who does it! :P), but for some reasons, people keeps comming here. Cool! :)

Ok, I just released kpkg 2.2 final version (I think it is stable enough, like always, bug reports are welcome), I've added support for more than one mirror in configuration file and of course in kpkg itself. I've removed some ugly messages (I would like to say thanks to Julio Cesar Puigpinos for pointing me out on this), also fixed some bugs in search functionality and and pkg_parse internal function when using local packages, so now it has the same behavior as installing from mirrors.
For more information you can read the Changelog included in the tarfile.

Download it from here: http://dcortarello.googlepages.com/kpkg-2.2.tar.gz

I've stop using svn from berlios, since I hate svn syntax, so I'm still using berlios, but I've installed darcs in my ~ at that server so I'm using it to record all the kpkg changes to my berlios shell account. So, for now (I hope berlios install darcs as I asked) no more changes in berlios svn.

And that's all I have to say about that. :P

After two months Linux 2.6.19 has been released, so Kwort 2.2 will include it as the default kernel if no one report bugs in the package I've done. So far everyone reports it is going very stable, so excellent and good for the kernel developers.
Looks like Xfce 4.4 will be out in December 15th, so maybe we can all see Kwort 2.2 for christmas. See more about this and stay connected http://www.kwort.org

I know there wasn't be too much about math around here (Actually, nothing at all :D). So, for people who speaks spanish I bring a nice weblog with lots of weirds and crazy math demostration (like 0^0=1 or 0!=1 for example) and nice methods: http://gaussianos.com. For those who not speaks spanish... Sorry folks, I owe you one.

Thursday, November 16, 2006

Kwort and Slackware Xfce network manager

I started this plugin as a standalone network manager for Kwort Linux. But after looking a plugin template I finally ended writing a plugin for Xfce based on Benny Meurer's example. This plugin works as a Xfce mcs plugin or as a standalone program (script).
Thanks to dialog and Xdialog with the extra button patch I wrote before, this works as a simple bash script that anyone can read. Since Kwort is based on Slackware, this plugin is compatible with both distribution as well and with any other slackware compatible distribution.

http://dcortarello.googlepages.com/kwort-network-plugin-1.0.tar.gz

I couldn't release it before for three reasons:
1) I couldn't finish it since the Xdialog extra button patch didn't exists until I made it two weeks ago
2) I been very busy working in my job and working in Kwort since dbus and hal is really driving me crazy around Thunar.
3) I had several problems with libxfcegui with icons, since, for some weird reason, it couldn't find the themed network icon... Finally, I fixed it using pure gtk code just with icons.

Dependencies:
bash
Xdialog (with extra button patch) and/or Dialog
Xfce (to use it as a plugin)


As someone asked in the comments, this is how the application looks like:

Friday, November 03, 2006

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

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://dcortarello.googlepages.com/bc-1.06-readline-const-char.patch

Tuesday, October 31, 2006

Patch for Xdialog (Yes! Made in Brasil)

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:


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

http://dcortarello.googlepages.com/Xdialog-2.3.1-patch-extra-button.patch

Wednesday, October 11, 2006

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

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.