Google Chrome as default browser on Arch Linux

Hey there. It’s been a while, again, yes!

Here is something I wasted my half an hour on. I was using Chromium as default browser on my Arch Linux, and it was nice in the beginning, but then it kept forgetting my closed tabs, and also kept showing error about non properly closing, though it was. About an half an hour ago I decided to dismiss it 🙂 When I uninstalled it, some applications (like Skype) did not know which browser to use as default. Since I use Skype with my friends for sharing online material, this is really important thing to be solved. So I googled and tried various solutions without success.

Then I stumbled upon this solution:

/opt/google/chrome/xdg-settings get default-web-browser
/opt/google/chrome/xdg-settings check default-web-browser google-chrome.desktop

Here you can check which is your default browser and change it.

It worked for me, and I hope it’ll work for you too 🙂

Other solutions were:

  • Exporting system variable BROWSER with path to your browser as it’s value
  • Setting variable in your ~/.profile file (or ~/.bashrc)
Anyway, that’s it. Bye!
Advertisements

Fedora mirror at Faculty of Natural Sciences, Kragujevac, Serbia

Hey hey, I wish you all a happy new 2012. year. Do not be scared, Mayans predicted end of old and start of a new epoch(!), not armageddon (not even a bible one). How could they predict that??? All we know, is that they were a great mathematicians and astrologists. Some would say barbarians, but look at the conquistadors and their way of being civilized. Enough said. It’s time for some techy talk.

There comes a time, when every programmer wants to contribute to community somehow. Some do it often, some rarely or not at all. And if you didn’t, try it. It can be exciting. Remember, it is not the goal that is most important, but the way and the road to get there! Woah 😎 some wise words. Anyway, since I’m in the mood for wise talk, I’m gonna cut to the real deal 🙂 This is it:

Fedora mirror at the Faculty of Natural Sciences in Kragujevac, Serbia. Check it out if you are near it (geographically, I mean 🙂 ). There’s a image/link at the right side of the text.

The thing with supporting distribution by providing a mirror is that is useful, and not hard to do it at all. Well, of course if you fulfill the requirements. In this case it is some outbound bandwidth (100 MBit/s) and minimum 1 TB of storage, for all ISO and RPM packages. The procedure and all that “papers”, is not very big problem. As a matter of fact, it goes very fast. You can become a public mirror in a couple of hours. If you use a RPM distro as a system on a mirror machine, that is even simpler. In this case, Debian is used. But that is not a big problem. Downloading mirror-manager software from git repository, configuring a config file with a data you enter at Fedora Accounting System, and rsyncing all data, you can start to provide a mirroring services to all people from the world 🙂 Yey! I even installed a ganglia monitoring system, so I could watch how much it is used. Here’s a network traffic ganglia graph:

Enjoy the holidays!

EGI Training for AEGIS Site Administrators

Attending EGI training at Scientific Computing Laboratory of the Institute of Physics Belgrade.

More about it here.

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!