Saturday, June 29, 2013

Redis client in C

I made a simple redis client in C based on the hiredis example (redis-2.6.14/deps/hiredis/example.c) to demonstrate how to use hiredis. You can compile it with cc -o redisclient redisclient.c libhiredis.a command or run makefile. If you want to specify the host from terminal, run ./redisclient 127.0.0.1:6379. If you don't define, it will use the adress and port in this example. Type exit to quit. Supported commands: get, set, del, incr, decr.

PING: PONG
redis: get key
> value
redis: incr key
> ERR value is not an integer or out of range
redis: set key value 2
> SET: OK
redis: get key
> value 2
redis: set age 21
> SET: OK
redis: decr age
> 20
redis: incr age
> 21
redis: del age
> (null)

Tuesday, June 25, 2013

Compiling syslog-ng OSE 3.4/3.5 on ubuntu

Download the latest version of syslog-ng OSE from the BalaBit website or from GitHub.

You will need build-essential, dpkg-dev, gcc, glib-dev, flex and bison, libnet, libffi packages.
You can install them with apt-get install command or with synaptic.
Hint: You should increase the terminal buffer up to 1000 lines.

Then download the latest version of syslog-ng (if you want to download from github through terminal, git must be installed on your system; you can install it with: )
sudo apt-get install git
then
git clone https://github.com/balabit/syslog-ng-3.4.git

However, in some descriptions you can read: "Download and install the latest version of eventlog", it's enough to install libevtlog-dev and libevtlog0.

Then cd to your syslog-ng-3.4 directory and run
dpkg-checkbuilddeps
to check build dependencies and conflicts.

I needed to install the following packages on ubuntu 13.04:
libtool, debhelper, libevtlog-dev, libevtlog0,  libevtlog0-dbg, libnet1-dev, libglib2.0-dev, libdbi0-dev, libssl-dev.

I got an error message during compiling, so you should install xsltproc before next step.

Type to compile syslog-ng with debug option (you can find more options in syslog-ng ose 3.4 admin guide):
./autogen.sh && ./configure --prefix <install dir> --enable-debug && make && make install
where <install dir> is the destination folder.

Note: If you get permission denied messages, you need to change the user ownership.
chown -R <user> syslog-ng-3.4

Sources:
    Syslog-ng OSE 3.4 admin guide

Wednesday, June 12, 2013

Short introduction and first steps

Hi,

I'm tichy and I participate in gsoc 2013 with project name syslog-ng: redis destination.
It's about to develop a new syslog-ng destination plugin, one that can add or change data in redis and have a reliably database with the function of getting real-time counters, statistics or in other cases caching.
I started the zero phase of the project:
  • I read tutorials and documentation about redis, syslog-ng
  • compiled the syslog-ng 3.4 on ubuntu
  • made a github account for code hosting
Some thoughts about me
I provided the hungarian translation of pigeonplanner and I think this project is a very good opportunity to get involved in open source development.
I got programming experience (c based languages) at university level which is a solid base to start the project, learn and develop something new on a higher level and get experience, which would be a good reference after graduating the university.
I decided to write a blog post for each milestone or when I just find a problem, that's worth to write some thoughts about.
I have exams at the university, but I will be free from next week so I can focus all of my power on this project.