Guy Rutenberg

Keeping track of what I do

Archive for the ‘Projects’ tag

radio.py-0.5 – An Easy Interface for Listening to Radio under Linux

with 11 comments

This new release of radio.py brings more predefined stations and the much wanted recording feature. radio.py is a python wrapper for mplayer, designed to provide an easy-to-use interface for listening to radio from the command line. And indeed using radio.py is very easy, just pass the station name.

radio.py Classic FM

To read more about radio.py and the existing features go to radio.py – a Wrapper Script for Listening to Radio in Linux.

New stations in this release include Ram FM, Classic FM, Radio Caroline and update to all the radioIO stations. So overall this version of radio.py comes with 81 predefined stations. To see the full list of recognized station run radio.py --list. If your favorite station is still missing you can add via configuration files, ans described in here. If you will send a comment with the name of the stations and its website, I’ll add it to the next release.

The other important new feature is the ability to record radio streams to mp3 directly from radio.py. This is done using the --radio command-line switch. For example the following

radio.py CNN --record cnn.mp3

will record the radio stream of CNN to a file called cnn.mp3. To stop recording just press ‘q’. This option also be used with the --sleep and --wake-up to time your recordings. For example if you want to record a show that start in 30 minutes and is 60 minutes long you should do

radio.py BBC1 --record bbc1.mp3 --wake-up 30 --sleep 60

You can download the new version from here. Installation is pretty straight forward, just untar the archive and put the radio.py some where in your path (e.g. /usr/local/bin/) and the package is installed.

As always if you want new stations added to the next release, send a comment with the station details (at least name and website).

UPDATE 14/12/2008: I’ve changed the download link to point to radio.py’s SourceForge project page.

Written by Guy

May 17th, 2008 at 1:42 pm

Posted in Projects, radio.py

Tagged with ,

spass 1.1 – Secure Password Generator

with 2 comments

This is a new version of my /dev/random based secure password generator – spass. The new version doesn’t have new features, it’s mainly a bug-fix release. The package now uses autotools, which means it has the standard configure script and makefile. I also fixed some typos in the help message. Overall the new version doesn’t offer anything new compared to the old one, except for easier installation.
Read the rest of this entry »

Written by Guy

May 4th, 2008 at 11:14 pm

Posted in C/C++, Projects, spass

Tagged with ,

mctext 0.2 – A Markov Chain Text Generator

with 4 comments

This is the second release of my Markov Chain text generator – mctext. This text generator takes existing sample text, and generates a new text using Markov Chains.

The main new thing in the version in that it allows the users to specify via the command line how many words should be considered when generating the next one. The bigger the step number the closer the generated text is to the original one. The value used in mctext-0.1 was 2, and this is also the default in this one. The number of steps can be set using the --steps command line switch.
Read the rest of this entry »

Written by Guy

April 30th, 2008 at 8:41 pm

Posted in C/C++, Projects, mctext

Tagged with ,

Scanning Documents Written in Blue Ink – biscan

without comments

After writing the post on converting PNMs to DjVu I’ve ran into some trouble scanning documents written in blue ink. The problem: XSane didn’t allow me to set the threshold for converting the scanned image to line-art (B&W). So, I tried scanning the document in grayscale and in color and convert it afterwards to bitonal using imagemagick. This ended up with two results. When I used the -monochrome command line switch, the conversion looked good, but it used halftones (dithering), when I tried to convert it to DjVu it resulted in a document size twice as large as normal B&W would. The other thing that I tried is using the -threshold switch. The DjVu compressed document size was much better now, but the document was awful looking, either it was too dark, or some of the text disappeared. After giving it some thought I knew I can find a better solution.
Read the rest of this entry »

Written by Guy

March 19th, 2008 at 1:08 am

Posted in Projects, biscan

Tagged with , , ,

mctext – Using Markov Chains to Generate Text

with one comment

mctext is a new project of mine, focusing on text generation using Markov Chains. This little utility reads a sample text file, preferably a large one, and generates new text based on the semantics given in the sample text.
Read the rest of this entry »

Written by Guy

January 29th, 2008 at 10:37 am

Posted in Projects, mctext

Tagged with ,

Convert CSS layout to RTL – cssrtl.py

with 15 comments

This is a re-release of a script of mine that helps convert CSS layouts to RTL. I originally released it about a year ago but it was lost when I moved to the new blog. The script, cssrtl.py, utilizes a bunch of regular expressions to translate a given CSS layout to RTL.

Read the rest of this entry »

Written by Guy

December 28th, 2007 at 11:28 am

Posted in Projects, Python

Tagged with , ,

spass – A Secure Password Generator Utility

with one comment

spass is a secure password generation tool. spass was designed under the assumption that a password generator is as good as its random number generator, so spass uses the Random class, a /dev/random based cryptographically strong random number generator class. As always, I tried to make the command-line interface as user-friendly as possible (as much as a command-line interface can be friendly).
Read the rest of this entry »

Written by Guy

October 20th, 2007 at 9:22 pm

Posted in Linux, Projects, spass

Tagged with ,

Random – A Random Number Generator Class

with 7 comments

After dealing with the seeding of srand(), I’ve realized that rand() just doesn’t give strong enough random numbers for some of my needs (e.g. strong password generator), so I decided to find a better solution. The solution came in the form of Random, a cryptography strong pseudo-random number generator class.
Read the rest of this entry »

Written by Guy

September 15th, 2007 at 10:51 pm

Posted in C/C++, Projects

Tagged with

radio.py – a Wrapper Script for Listening to Radio in Linux

with 5 comments

Download radio-0.3.tar.gz.

Update: radio.py-0.4 is now available.

I like listening to music and radio while working, and fortunately there are numerous ways to do that. Unfortunately, most ways that allow you to listen to radio are very resource consuming/memory hogs (such as listening to streaming-media via web-browsers) or very unfriendly to users (listening via mplayer for example). So, I set out to find a way that will use as little system resources as possible while keeping it user-friendly. One other requirement that I had, that I will be able to do all that from the command-line, so it will work great with GNU Screen and won’t require an X server (if I work without one).

I used for some time mplayer for listening to radio. I had a file with a list of web-radio streams URLs which I would copy and pass to mplayer -playlist. This method answered two of the requirements (minimal resources and command-line interface), but wasn’t really user friendly. So, I wrote a little wrapper script in python around mplayer – radio.py. After quick installation (download and extract the tar archive and copy radio.py to somewhere in you PATH), radio.py will allow you to listen to stations easily, and it will also do couple more things for you.

To listen to a station just call radio.py with the station’s name, e.g. in the command-line enter radio.py BBC1 to listen for BBC radio channel 1. To view a list of know stations run radio.py --list. Currently there aren’t many stations (just stations I thought that are needed or I listen to). You can easily edit radio.py to add new stations (the script is documented and very clear). If you do so, please write a comment or email me so I will be able to add those stations to next release by default.

So, as you seen radio.py allows you to easily listen to radio, as easy as writing the station’s name. But, as I said, it can do more things that I thought should be in a radio script. It has both a sleep feature (that turns off the radio after specified amount of time) and a wake-up feature (that starts the radio after a specified amount of time). This two features can be used together, and practically allow you to use radio.py as an alarm clock.

You can find more information about radio.py options by calling radio.py --help. I hope you will find this script useful as I do.

Download:
radio-0.3.tar.gz.

Written by Guy

August 17th, 2007 at 1:44 pm

Posted in Projects, Python, radio.py

Tagged with , ,