Ganglia HDD plugin

Hey hey,

Like I said, it was lot going on. One of things was my first ganglia plugin. Let’s cut to the meat! 🙂

Plugin is developed for Debian like and Red Hat like systems (deb and rpm package). It is for personal use on grid cluster. Private in sense I did not write all documentation for packages, like for example man pages.

How I did this? I have used gmetric ganglia set tool, for making my custom metrics. Main tool is of course binary made by HD Sentinel, for listing hard disk info, like temperature, health, hours of work etc. Part of the package is script that is extracting basic data from HD Sentinel output and sending it to gmetad by gmetric script. To be precise, I used extended gmetric script written in Python. Reason was I needed grouping option, which default gmetric tool doesn’t have. GmetricP (P from Python) does grouping and sends it to gmetad daemon on main node with ganglia web page, displaying it under custom metrics.

Ganglia HDD Plugin

This is not very clean and pretty way of doing it, but it does the job. Better way would be to write ganglia plugin in Python, like described in ganglia documentation.

Bye!

Where are Chrome’s flash temporary files [UBUNTU]

I had the same question! Where are the files? They used to be in /tmp named with Flash… What happened? Is something changed in google chrome, or in Ubuntu?

I have read a lot of papers, and the most of them is pointing to the ~/.cache/google-chrome folder. It’s the folder where you should find google chrome’s cache files. But there are no big flash video files, just small ones. Suppouse you watch some youtube video, and you like it so much you want to keep it in your home folder for some time. Let’s say it is 100MB big. That file wont be stored in google chrome cache folder. Where will it be stored then? I don’t know and I’m not sure where to look, but I did some tricks and found them. Let’s explain the tools.

First, I have opened youtube file and let it stream from internet. In the meantime I used df command to see what part of my file system is receving data. It was not my /home folder. It was / file system.So, place to look for file was better located, but searching through / would take “millions” of years. I tried to use du command for folders in / , except /home , to see which folder is having his size changed. But calculating folder size was very time consuming and if folder is big enough, you will have to wait quite some time for calculating difference between sizes of same folder in 2 particular moments. So, that kind of solving the problem was not very good. Then, I asked google for advice. I wanted to see which process on my system is using which file. The command for it was lsof.You should read next two references before going any further, because what I’m about to do is going to have explanation only for this specific problem.

http://superuser.com/questions/235535/in-google-chrome-on-linux-where-is-the-flv-if-not-in-tmp

http://www.ibm.com/developerworks/aix/library/au-lsof.html

From now on, we’re going to concentrate on finding those flash files!

First, you should get PID of chrome. You can use various commands, but ps or top will do just fine.When you get the PID, you should use

lsof -a -p [PID] -u [USERNAME]

This is going to list all files that are used by process with PID, which is executed under user USERNAME. Flag -a is for logical AND so list will contain results which fulfil both contidions. Somewhere in the list are files called Flash…. (deleted), right? Yes, we are looking for them. It should list something like this:

chrome  17621 [USERNAME]   23u   REG        8,8 12764804   394927 /tmp/FlashXXmR06LN (deleted)

Ok, as you can see, we have chrome with 17621(PID), having opened regular(REG) file for read/write(u), under [USERNAME] with size 12764804, 8,8 device and 394927 node. Of course last part is file name. Now, I’m not going to explain all these things because you should already know them if you have read those references back up there.

Here comes the nasty part. You need root privilege to view processes information. Go in /proc/[PID]/fd and do ls -l . This is going to list file descriptors with links to the files, among which are our Flash…(deleted). You should copy them anywhere on the system, and change owning of file, because you have copied it as root. Now, you can view the file with your favourite player.

That’s it ppl. After all this, I ask myself, is it worth doing all this for video, and why is place for temporary videos changed from /tmp folder???

Bye

Gnome terminal scroll doesn’t work

Hey hey, it’s me and I’m here to get you few hints on this problem.
So let us begin.
As serious Linux user, I always use terminal. Since I’m Gnome user, I use default terminal called gnome-terminal. Using it for administration and programming, makes me want to change it’s profile, to make it look relaxing for my eyes. So I did some changes and also removed scroll function from terminal when I’m in vim or viewing man pages. That was big mistake, and I did not realize what I’ve done that moment. So after a while, I was stuck in vim or man pages using keyboard up and down keys. Pain in the aaaday 🙂 I tried to find some answers on google knowing that someone was also having the same problem. But I guess not. Or I did not have patience to look for it long enough.
Then I realized I have to do some searching through options in gconf-editor. Handy little thing. After searching scroll, mouse, terminal I have found that Gnome keeps the default profile of terminal with a lot of options, and profiles that you make has few options. First of them is alternate screen scroll. That is our problem. If it is unchecked, then you can’t scroll when you are in VIM or viewing MAN pages. After you check it, you will be able to do that.
Now I can relax in chair scrolling up and down through my code in C never bothering to do up down navigation by keyboard. Yey!

Transmission or torrentflux-b4rt|torrent-flux

Huh, finally my wordpress is functional again.

I took some freedom and time, experimenting with torrent flux. For those who are not well informed, torrent flux is a PHP torrent client. Translated better, it is a web torrent client. Ok, if you still don’t get it, you can have it installed on some server, without any window manager (Gnome, KDE,…) and still download files using torrent. Wow, you say! Yes! Isn’t that great. You may ask, could it be installed on Windows? Yes, why not?  But, let me ask YOU a question! Do you want to make your life more complicated than it really should be? 😎 Anyway, all you need is LAMP installed on your server. I used Ubuntu 10.04 LTS server distribution. Installing LAMP is a piece of cake. Installing torrent flux is piece of another, smaller cake! 😀 I’m not going to take you through installation process, although you can ask me any question about it.

Torrent flux GUI is nice. You have everything you would want, when running torrent client. Weeeeell, not everything! Of course, if you are using it once a month, you wont need any neat things you might need if you are using it everyday. Since I upgraded my 8.04 LTS to 10.04, torrent-flux is not functional. I’d have to install it again, but I’m not going to. As I can remember, there was no way you could stop or start more than a one torrent in torrent-flux. It lack some group functions. But hey, it was a great thing when it was made. Anyway, then people made torrent-b4rt. It was upgraded torrent-flux with more options, like those group functions. There were also great thins like general info about upload, download, space on hard disk etc. from the first page torrent-b4rt opened, when you logged in. Nice. Now, I’m not going to talk about advanced properties, but there are many. Lots of thing could be set up in admin panel. From the basic things, which tell torrent-flux how to work, to flux daemon. You can use fluxd (flux daemon) to automate the process of adding new torrents, setting them up and scheduling them. Great! It was the only option for me.

Well it was, until I have found out that Transmission’s web gui is great. It is like, its not the web app at all. To be honest, I haven’t been using torrent on local machine for quit some time! Why not??? Well, since I have dual boot, switching between my OSs would interrupt download 🙂 couldn’t be more simple. When I did use torrent clients, I used kTorrent, deluge, Vuze and even uTorrent with wine! You would be surprised that I left them, but since I have web server, dedicated to web apps development and other stuff, I don’t need them. Where was I…. ah yeas! Transmission’s Web GUI! It is called Clutch. It is written in PHP, HTML and JavaScript. Ajax is so good implemented, that you wont even notice that it is web application. Great! Huh, torrent flux(b4rt) is allso, yeah? Well yeah, but the enjoying in it is little bit more slower. You have to refresh pages, turn on Ajax refresh, and it is still doing reloading page and so on.

You can see that there is a lot of plugins for transmission, but I did not find any use of them for now. You might! So visit http://www.transmissionbt.com/ and feel free to tell me how did you tweak it.

Bye bye! 🙂

Doin’ some OpenLdap research

“All of the books in the world contain no more information than is broadcast as video in a single large American city in a single year. Not all bits have equal value.” – Carl Sagan

Wise saying, wise man. Go watch a movie, maybe that will be less confusing than this box you are staring at! 😀

Anyway, I have been researching Ldap lately. Of course, in my spare time, coz all obligations about faculty have started once more. Reason of research is centralizing the database of  student users at faculty. The whole idea is part of a bigger picture, which I think I’m still not aware of, but nevertheless I’m still climbing that hill :). Since there is a lot of good books about the subject I’m not going to start a lecture, and get you all bored 🙂 but I’m going to tell you about it in a few words. Again, I’m going to talk about problems I had (or the problem :)).

So, what is OpenLdap? OpenLdap is a open source solution for making active directories using Ldap protocol. In the beginning, it was only a protocol, but during the time it grew up to be the client-server aplication. So, to get it all straight, Ldap is a protocol, OpenLdap is a open source solution for building active directories using Ldap. OpenLdap consists of slapd and slurpd deamons, couple of tools for making entries in active directory, like ldapadd, ldapmodify, ldapdelete, slappasswd, and more. Now, I’m not going to get all “ldap dirty”, and that is the reason why I’m suggesting you to read the book called, “Mastering OpenLdap” from Matt Butcher. In a few words, it uses hierarchical database (hdb, bdb), to store entries if a way that schemes describe, can index fields for fast search and so on.

When you are all done with adding entries in your new Ldap directory, you will now and then have to erase some entries. I had to do that too, so don’t cry or do something silly, like punch monitor 😀 (Wait, what???  I’m not going to punch it, naaah, I don’t want to get my hands dirty, instead I’m gonna get an axe, and split it in half!! :):):)) Anyway, I had a problem when having my administrator password set, I couldn’t delete particular entry.  The error was: Invalid credentials (49). I figured out that it was not the problem in DN of the entry. So, it was something with credentials, maybe password. That was the problem, for those who can’t wait the end of this mysterious story :D. To change pass you can preform couple of steps, that can be different. One of the ways is to use slappasswd, and generate SHA password, and insert it in /etc/ldap/slapd.conf, in the next form:

rootpw {SSHA}blablabla

Then, I guess all will be settled, and you could delete your entries as much as you can 🙂 If this doesn’t fix your problem, than I have to say, you are all alone in this world of misery. Aaam just kidding… but you are 😀 Seriously, if you have any problems, feel free to comment, and I’ll try to help, if I find spare time. Bye!

Symfony Headache pt.1

Ok since I had a very frustrating day with symfony, I have decided to make a Symfony Headache series. In these series, I’ll point some problems in Symfony and give my solution.

What made me do this? I have spent a WHOLE DAY trying to solve Forbidden problem accessing one of symfony applications. I can’t explain how furious I was, after I found the explanation to my problem.

I’m using /home/user/public_html folder for web sites, and then map them into virtual hosts. Somehow, I did not know that my flags for other users are unusual, or at least different from flags on my other computer, and did not check them. Apparently, my /home directory, didn’t have right permissions, so Apache could not ‘read’ my web sites.

So, if there is any possibility that you did not check /home permissions, check it! You need to have at least rx flags for other users, on your web directory, for Apache to read it.

😦 bye

PHP Symfony Editor ?

Hey hey! Fresh stuff again! 🙂 This time it is symfony again!

Lets cut the chatting and get straight to the point!

What IDE are you using? Is it fast, is it comfortable, does it have plugins for Symfony?

You are saying, yeess, NetBeans has it, though it is not very fast 😦 All that Java is eating my memory…

If you have it a lot, that that is not a prob, but what if you are short with that resource??? Lets say you have, oh I don’t know, a virtual machine, which you use for developing. You don’t want all that projects, files and junk to be in your sweet home and to look it every day in your spare time :D. So you make virtual machine and use it to do all the work, then shut it down, and the nightmare is forgotten. YEY! But in case you do not have a resource monster computer, or some kinda super computer, virtual machine will have less RAM than host on which you are running it. That is the main part, where you might have the problems with NetBeans or Eclipse. They are sooo sloow on virtual machines… Or I am not well informed, and I do not know some hints to make them faster. If you do, please inform me below 🙂

CUT THE RAMBLING 🙂 GET TO THE POINT!!! silly me 😀

I went some googling about php editor which has support for symfony. There were NetBeans (newest version), Eclipse (with its plugins), PHPEdit (which is shareware, and being a student, I don’t have too much money to spare on software), Komodo IDE (shareware), but WAIT! Komodo Editor!?

That is free, as in speech, dynamic languages editor. Mmmm nice? PHP, Python, Shell, Perl etc. Mmm nice!!! Built in C++!? Weeell, it is based on Mozzila Framework, which among all includes C++ libraries. Faster than NetBeans or Eclipse, which are Java based… Has some plugins for symfony… WOW! You must be dying from wish to try it! 🙂

Here you go http://www.openkomodo.com/ Komodo Edit

So you download it, and what? How, to use if for developing Symfony projects??? That is the right question! And, since this post took me some time, I’ll describe basic project generation in this post.

I’d be very interested in reading your comments, because I see some interest in symfony… Bye 🙂