Archive for the ‘developement’ Category

Pymaze: generate and solve mazes with python

Wednesday, March 3rd, 2010

In the last week end I decided to spend a couple of days writing a simple library for both maze generation and resolution.

At the moment the library is composed by three modules: the first one, maze, contains the base classes used to implement a general maze; the others, generators and solvers, implement some algorithms used to generate and solve respectively a maze.

There is also a test script, which will be soon moved to the bin directory, which can be used to test the above modules: in particular it consists of a gui written in gtk which let the user decide the size of the maze, the generator and solver algorithms, and finally watch the maze evolution.

You can find the library here. Feedback is welcome!

gstream – simple internet radio player

Friday, February 26th, 2010

Hi folks, today I’m here showing you my last simple creation, an application for those of you, like me, prefer listen to internet radio stations while standing in front of their monitors rather than playing mp3s files.

Gstream is basically a system tray application which let you play/stop one of the radio stations stored inside a configuration file; obviously you’ll also be able to add and remove the radios with a couple of clicks.

It’s written in python w/ gtk (interface) and gstreamer (http audio playback).

I have also decided to give github a try, so you can source the application from here: enjoy!

Eclipse: update sites.

Sunday, December 6th, 2009

Default

http://download.eclipse.org/releases/galileo

Pydev (Python)

http://pydev.org/updates

JGit (Git)

http://www.jgit.org/updates/

Subclipse (Subversion)

http://subclipse.tigris.org/update_1.6.x

Vrapper (Vim)

http://vrapper.sourceforge.net/update-site/stable

AnyEdit (Editor features)

http://andrei.gmxhome.de/eclipse/

hacks repository

Thursday, July 9th, 2009

I decided to create a repository containing the stuff i published without being part of a standalone repository; so this would be the shelter for scripts like pmv, rotating-cube, word-challenge-hacked ecc. ecc.

The name of the repository is hacks.

Led-matrix programmer

Sunday, May 31st, 2009

Suppose you have a led-matrix and you want to control it via RS232.
Suppose that the microcontroller between the matrix and the pc is able to receive informations regarding how to light up the leds of the current column.
Imagine that you need a driver that take as input a file containing “well-formatted” text, and write to the serial port the informations for the microcontroller.
Imagine that you need a gui which let you create formatted files to send to the driver above.
Stop imagine, it is real!

Try the gui here.
Follow the public repository under the name: led-matrix.

3dscene

Saturday, May 9th, 2009

Inspired by the script of the rotating cube, i decided to go on with the work. The result? Well, i added face filling, and some 3d effects such as face-culling and color shading depending on the distance/orientation of the light. At the moment it’s written using python + gtk, but my intention is to port it on a programming language such as c.

You can access the sources from the repository; the name of the project is 3dscene, and remember: the trunk section contains the files for the c-port, instead if you want to play with the python version of the code, then you have to browse the tags/1.0 directory from the repo.

Switch Host – local/remote hostname lookup

Monday, April 27th, 2009

Switch_host is a tool that let you handle and configure a hostname lookup. Configuring the makefile, you tell switch_host what is the IP address to work with.
Switch_host is useful when you have a local server, and you want to use it either when you are at home or when you are out. Instead of modifing /etc/hosts by hand, switch_host will do it for you.

Usage: switch_host [options]

Options:
-a | --actual      Show current setting
-d | --dynamic     Set dynamic host
-h | --help        Print this message
-s | --static      Set static host

Check out the README file for any helps.

Follow the project in the repository under the name: switch_host.

Hotkeysd – hotkeys daemon

Monday, April 27th, 2009

Running dwm, i needed a piece of code for the management of fn-keys. So i ended with a client/daemon application capable of doing stuff such as disabling wifi, toggle the lvds backlight, increase/decrease volume ecc ecc. The communication method is always the same: a shared fifo placed in /tmp.
Because of the need of running commands with root privileges, i added a small c launcher (hotkeys_launcher), which makes use of the ’s’ bit for invoking the daemon as super-user.
In order to use the scripts you need these programs: xrandr, amixer, xbacklight, system_info (previous post), osdc/osdd (previous post), hibernate, hibernate-ram.
Just for taste, here is the help message displayed with the client-side app:

usage: hotkeysc [option]

option:
B+	increase brightness
B-	decrease brightness
Bt	turn off/on brightness
G	change cpu governor
H	hybernate
h	print this message
I	displays general informations (cpu-load, temperature..)
M	switch to external monitor
R	restart the daemon
S	suspend
Td	disable trackpad
Te	enable trackpad
V+	increase volume level
V-	decrease volume level
Wt	enable/disable wifi interface

Before using the launcher inside your .xinitrc file, try the daemon in a shell in order to debug errors due to programs not found ecc ecc.
Here is my .xbindkeysrc file configured for hotkeysc/d:

# Brightness Up
"hotkeysc B+"
	m:0x0 + c:233
	XF86MonBrightnessUp

# Brightness Down
"hotkeysc B-"
	m:0x0 + c:232
	XF86MonBrightnessDown

# Brightness Toggle
"hotkeysc Bt"
	m:0x0 + c:156
	XF86Launch1

# Governor
(xbindkey "hotkeysc G")
	m:0x0 + c:210
	XF86Launch3

# Info
(xbindkey "hotkeysc I")
	m:0x0 + c:244
	NoSymbol

# Monitor switch
(xbindkey "hotkeysc M")
	m:0x0 + c:235
	XF86Display

#--------------------------------------------------
# # Suspend
# (xbindkey "hotkeysc S")
# m:0x0 + c:223
#--------------------------------------------------

# Trackpad toggle
xbindkey "hotkeysc Tt")
	m:0x0 + c:200
	NoSymbol

# Volume Up
"hotkeysc V+"
	m:0x0 + c:123
	XF86AudioRaiseVolume

# Volume Down
"hotkeysc V-"
	m:0x0 + c:122
	XF86AudioLowerVolume

# Volume Toggle
"hotkeysc Vt"
	m:0x0 + c:121
	XF86AudioMute

# Wifi toggle
(xbindkey "hotkeysc Wt")
	m:0x0 + c:246
	NoSymbol

You can grab the source from the repository under the project name hotkeysd.

OSDD – on screen display daemon

Sunday, April 26th, 2009

While working with minimal windows manager (awesome, dwm), i created a simple client/daemon system useful for showing text on screen; i used it for temperature, cpu-usage, battery life remaining and stuff like that.
The communication system is based on a fifo placed by default in /tmp directory.
The daemon (osdd) could be invoked with some options that let you configure the appeal of the window.
The client is invoked considering that each argument will be printed on screen as a new line, i mean:

$ osdc "first line" "second line" foo3 foo4

has as effect an osd message composed by 4 lines.

You can get the sources from the repository: project name osdd.

System info from command-line

Sunday, April 26th, 2009

I often had come into the need of knowing informations from the running system (i.e. cpu load, memory usage or temperature).
One for all, i wrote down a script that collects few fuctions for grabbing these infos from the linux proc/sys file-system.
Remember to edit the script before the installation, in order to match your needs.

Usage: /usr/bin/system_info [-bdhlmnt]
    -b    prints battery info
    -d    prints date
    -h    prints this help
    -l    prints system load
    -m    prints memory usage
    -n    prints network stats
    -t    prints temperature

Take it from the svn repository: the project name is system_info.