Category Archives: Software

Smart Homes

I just read an article at linux journal about smart homes

now, I had no previous experience with smart homes and it sounded intriguing so I gave it a look

the story is simple, you have one master device (actually a wifi router with probably some logic) and a bunch of small devices for various things like dimming lights, turning them on/off, controlling garage door, room movement, security cameras etc.

they work just by plugging it in the socket since it uses wifi for communication

there are also some other details but read that yourself

OpenSolaris Summer School @ Belgrade, Serbia

the school is held at the Institute Of Physics, Belgrade for the month of July, two times a week

today, Uros Nedic, the guy doing the lecture, arrived a bit late but I managed to find a beautiful park behind the institute with a great view of the Danube river :)

I had a nice time today

we were learning about Sun OS processes, threads, LWM, kthreads, DTrace, Zones and ZFS

Uros was great while teaching us/giving a lecture, answered all of our questions

I learned a lot

now, here are some pictures I took with my mobile phone, sorry for the bad quality

Ubuntu Intrepid Ibex

I upgraded few days ago and ran into problems

my wireless card based on atheros chip stopped working
it seems they’ve deliberatly removed madwifi support from wpasupplicant or something so I did two things, I downgraded wpasupplicant to hardy version and compiled/installed madwifi drivers from the project website

another problem that is still unresolved is the graphics
they’ve removed the old good driver, i810 and instead put intel driver for xorg
the intel driver is twice slower
I can’t watch flash movies any more, it’s that slow
and worse, if I hibernate from the X, I get garbled screen on next startup, nothing works
so I’ve found a workaround, I hibernate from text mode ;)

anyway, I noticed kde applications have better looking interface, a new sound manager (pulseaudio), no more gaim (now it’s called pidgin)…

Achievo ATK Framework

few days ago I was writing this php/ajax application for a client and then I realized I needed a way to manipulate the tables

some tables were simple but some had two or three relationships

I thought about writing a generic class for the simple tables and doing other tables “by hand”

then I realized… maybe someone else wrote something similar

and I’ve found just that

Achievo ATK framework makes it really simple to create /admin for your client so he can manipulate his tables by himself

but that simplicity comes only after you’ve spent some time getting familiar with it

at first, atk coding seemed cryptic but now I’m into it and it feels natural

atk will make your life easier because once you understand it you can easily manufacture table interfaces

it has support for cascading deletes so you don’t have to worry about orphaned records

one thing I’d like to see is full UTF-8 support

it currently uses iso-8859-1 character set by default (english language)

I got it here

fastcgi mod_fcgid

I’ve been playing a little on my cPanel hosting trying to get maximum speed while also enforcing security at running php scripts

I first started with security running mod_suphp and while it worked fine it lacked the speed of the DSO php (mod_php)

so I read a thing or two about fastcgi and enabled it

I’m pleasantly surprised by the speed of the hosting

each user got its own persistent php application running requests (actually it’s limited to 500 php requests per php5 process by MaxRequestsPerProcess 500 directive)

I’m keeping an eye about the memory consumption but I hope I’ll be able to keep running with this setup

and while I got php running as the actuall cPanel user, apache is still running as nobody for other requests… hmmm… I’m using apache 2.2 with MPM Prefork… maybe I should try a different MPM?

Get Your Openmoko

it seems Neo Freerunner is finally beeing shipped to the distributors :)

for those who have no clue what Neo Freerunner is, it is a mobile phone running Linux

backed by FIC (First International Computer of Taiwan) it is finally going mass market

it is designed to rival the original Iphone

the phone is unlocked (works with any mobile phone network provider) and uses open standards

the hardware specs are 500MHz Samsung S3C2442 CPU, 128MB RAM, 256MB Flash, 4.3″ diagonal display in 640×480 VGA Color TFT LCD, 3D graphics, 2 3D accelerometers, audio, USB port, WiFi b/g, Bluetooth, GPS

the recommended price is 400 USD

I like it :)

read more about it at linuxdevices

C++ Hibernate Daemon

I use Fluxbox window manager on Ubuntu Linux where I don’t have all the bells and whistles of GNOME or KDE.

so I thought I’d make myself a daemon program that will automatically put my computer to hibernate when my laptop battery is almost empty

usually I take care that my battery doesn’t get to the red zone but this is for those few cases I forget

I wrote this small programm in C++

why c++

well because I don’t programm in c++ and I found it interesting to do so :)

main.cpp looks like this

so, you see the locations of the info and state file for the laptop battery, the percent at which we go to hibernation (I’ve set it to 12%), and the sleep interval before checking the battery state again (10 seconds)

I use my own hibernate script but you could use something like /usr/sbin/hibernate

you can change all of these

in the main function you can se that:

  • we work only as a root user
  • we daemonize (detach from the terminal and run in background)
  • instantiate a worker class object
  • and do our work :)

and what is our work? check out this picture

worker.cpp

well we get the battery total capacity and current capacity and then we calculate the percent

if the percent is less that what I want (12%) then I want my laptop to go to hibernaton

but I also made a security check (that you can remove if you like)

that makes sure my laptop doesn’t go twice into hibernation in succession

why did I do that?

well because I parse data from some files I have no influence over

and those files can change their format anytime

so this is just a precaution

I have a simple makefile that compiles this code, copies it to /usr/local/bin/medved (medved in my language means a bear and bears hibernate ;) ) and adds an entry to /etc/rc.local so that it starts next time you reboot your box automatically

you can also start it by hand and see how it works before the reboot

and that’s it, now I have a daemon that puts my laptop to hibernation before my battery runs dry

I’ve published the source code under GPL licence version 3

you can get source code here

KDE Ported To Windows / Mac OS X

This is good news. KDE is ported to Windows/Mac and the users of those operating systems will become more familiar with it.

Although some people think open source programmers should not waste their time on proprietary OSes such as Windows I still think this is a good thing.

The move was eased by using CMake build system. Also, it helped that Trolltech made Qt libraries GPL for non commercial projects on Windows/Mac.

Read about it here and at the KDE website Windows section.