Posts Tagged ‘C’

ascii2hex

Monday, April 9th, 2007

Last Friday i was at Metro Olografix’s “Weekend of magic II” and we were talking; during the configuration of a wireless card of a guest there’s the need to convert a string from ascii to its hexadecimal value , obviously it’s possible to do that with mind, or with pencil and paper, or with the bash printf or whatsoever but, hey, when magic is required, magic is provided!
So I’ve made this little piece of code, and of course i’ve decided to share it with the whole world (oh, what a good boy i am).

I’ve chose to use CMake also this time, so the way is, like you can imagine:

isazi@data:~$ tar xzvf ascii2hex-0.1.tar.gz
ascii2hex/main.c
isazi@data:~$ cd ascii2hex
isazi@data:~/ascii2hex$ cmake .

After some output you obtain a “ready to use” Makefile, just type make and there’ll be a nice executable named ascii2hex all for you; as you can see the tool it’s really easy to use:

isazi@data:~/ascii2hex$ ./ascii2hex -a einsturzende!
65696E737475727A656E646521
isazi@data:~/ascii2hex$ ./ascii2hex -h 65696E737475727A656E646521
einsturzende!

Download ascii2hex 0.1.

Hope you enjoy that.

RLE Compression

Friday, March 30th, 2007

I’ve made that code for an university exam called “Elaborazione delle immagini” (images elaboration), it’s a simple and dirty implementation of the Run Length Encoding (RLE) algorithm for compressing a file.
It’s also my first experiment with CMake (such a great tool!).

Download it.

After unpacking it, you must type:

cmake .

Under the project directory; after that you can simply type:

make

And the file rle_compression is ready to be executed!

MKPasswd

Thursday, April 20th, 2006

Quick and dirty code to evaluate the MD5 hash value of a string; useful for making UNIX passwords.

Compile with

gcc -o mkpasswd -lcrypt mkpasswd.c

MKPasswd.c

Password updater

Tuesday, November 8th, 2005

A simple UNIX daemon for changing users’ passwords; it’s written in C and works (without guaranties) under Linux and FreeBSD.

Here you can download source code.

Airport

Monday, November 7th, 2005

The code you can download here is an airport simulation wrote with Mauro “Maz!” Mazzei for an assignment of the “Operating system laboratory” course during our BSc in computer science.

In the code we use processes, threads and sockets.

By the way, the downlod is here :)