Oct 19 2008

Creating a .deb package from a python setup.py

Tags:, , , , , , Ignace Mouzannar (-ghantoos-) @ 10:09 pm

As I worked on packaging a project I am working on (Limited Shell) I found my self reading many tutorials on how to build debian packages. But none where related to distutils setup.py. As a nice setup.py natively knows how to package RPM, I thought about a way to include setup.py in a .deb generation.

Here is a small guide to help generate a debian package from a distutils/setuptools setup.py.

The main steps of this procedure are:
1- make sure that your setup.py is functional
2- generate a GPG key to sign your package and a public key to put on your server or wherever
3- create the files that are useful for the debian packaging:
* changelog
* compat
* control
* copyright
* rules
4- write the Makefile
5- generate your debian package

Continue reading “Creating a .deb package from a python setup.py”


Sep 28 2008

YUM output parser (yum-parser.py)

Tags:, , , , , Ignace Mouzannar (-ghantoos-) @ 7:51 pm

As I needed to minimize yum’s output for a project I was working on, I thought it was just about changing the debugging level. But I found out yum’s debugging level could add information, but not minimize it. So wrote a small python script that does the job.

What I wanted to do, is replace yum’s output with a very simple progress bar showing only the different stages of a yum procedure (dependencies/download/install/remove/update).

The script is quite easy to use:

Usage:
	$ yum-parser.py (-u | --update)
	$ yum-parser.py (-i | --install) package_list
	$ yum-parser.py (-r | --remove) package_list
	$ yum-parser.py (-s | --search) 'regexp'
	$ yum-parser.py (-h | --help) package_list

For a reason I still ignore, when redirecting yum’s generic output to a file (e.g. yum -y install irssi 2>&1 > yumoutput), the “Downloading Packages” part doesn’t appear. To remedy this problem, I had to insert some threading to have a “patience bar” (i.e. back and forth [ = ]) while the downloads are processed.

You can find the source code here.

Continue reading “YUM output parser (yum-parser.py)”


Jan 29 2008

Limited Shell (lshell)

Tags:, , , , Ignace Mouzannar (-ghantoos-) @ 11:42 am

As I was wondering how I could do to relieve my wrt54gl from the huge weight of libopenssl and nsupdate, I thought.. Wouldn’t it be cool if I could set a very restricted account on my server, and just ask my wrt54gl to ssh to it and execute locally nsupdate. So I started searching for a way to restrict user ssh accounts by listing a set a allowed commands. No luck there.

So.. python came to the rescue.

Limited Shell (lshell) is an application that lets you restrict the environment of any SSH user. It provides an easily configurable shell: just choose a list of allowed commands for every limited account. No installation is required.

You can download the current version of lshell from the following link: http://sourceforge.net/project/showfiles.php?group_id=215792

If you want to contribute to this project, please do not hesitate.
Send me a patch, or just your new lshell.py so I can check it out.
You can use the interface on sourceforge.net:
http://sourceforge.net/projects/lshell/

Cheers,
Ghantoos


Sep 18 2007

NextGen Gallery SQL script (to scan folders and add them as galleries)

Tags:, , , , , , , , Ignace Mouzannar (-ghantoos-) @ 5:51 pm

This time I needed this time to provision the NextGen SQL database with all the folders I’ve put on my server.

Again, i did a little python script. I scans your NextGen gallery folder, and enters all new folders as “galleries” in the SQL DB, and creates the thumbs for the pictures.

This was usefull for me. : )

You can download the script here.
Continue reading “NextGen Gallery SQL script (to scan folders and add them as galleries)”


Sep 14 2007

Picture database recursive copier/resizer

Tags:, , , , , , , Ignace Mouzannar (-ghantoos-) @ 4:33 pm

That a little script I did yesterday because I needed to copy my 35gig picture gallery in a new directory then resize all the pictures.

Of course, this MUST not be done “à la mano”! So i did a little python script. : ) Here it is, hope you find it of any interest.

You can download the script here.
Continue reading “Picture database recursive copier/resizer”