soledad penadés
repeat 4[fd 100 rt 90]

Archive for the ‘linux’ Category

20061007 Sundown 06 - Oldskool graphics compo (and brief today's summary)

Hmmm … finally managed to get internet working. They have just shown the graphics for the oldskool compo, using the original machines!

There have been three entries, which is pretty amazing for nowadays standards :P

I loved the one called Water of wild agony, the title is amazing, and even if it's 128 colours it has some reminiscences of EGA color palette, don't know why…

This midday the founder of Ubuntu, Mark (!), came to the party and proposed a new demo category: creating a short intro for being shown while the system is booting, for promoting the demoscene at the same time than we stop boring the user with a plain progress bar. Reactions to this have been mixed, and people are still shocked and doubtful about it.
Smash and Navis are discussing about experiments and generating data. Meanwhile trace is modelling very weird objects with a program whose name I still don't know - and then applies weird materials to it. Experimental is the word of this demo compo, I presume.

More to come later… I have to upload my mp3 entry!

20061003 Becoming a sudoer again

Some weeks ago I was doing some stuff with our ubuntu machine and I don't know how I did manage to do it but I kicked our one and only user out of the sudoers list. But I didn't really notice until trace told me that the Administration menu was quite empty and most of the options didn't appear anymore :O
But there's still hope!
I found a general indication in the forum thread "Add an account to the sudoers list". I'll detail it a bit so that next time I break it I can fix it even quicker than today :D

Boot ubuntu, using ubuntu's live cd (you'll need to be physically in front of the computer, no VNC or ssh connections will work, so you need a keyboard and mouse connected to the computer).

Then once it's booted, open up a terminal and do:

sudo mkdir /myhd

sudo mount -t ext3 /dev/hda1 /myhd

That's for mounting the harddisk on the filesystem. As we need a place where to mount it, I create /myhd and then link my first hard disk (which is where the linux partition is, you should change it depending on your configuration) to it. Man mount for more info ;)

Don't worry about /myhd, it's in the virtual filesystem which gets created when the livecd is executed, and it will dissappear when you close the session.

Sudoers in ubuntu seem to be the ones which are in the admin group. So, for example, when you run the package manager and it asks you for the password, it does it so that it can run sudo and effectively give you root privileges temporarily. It also seems that the Admin menu is built depending on the actual privileges of the user, and as it was not in the admin group, he wasn't shown admin options anymore. Pretty logical/obvious!
Now we need to edit the /etc/group file to add us back to the admin group:

sudo gedit /etc/group

There was a line which said

admin: x:112:

So I added my user to that line, like

admin: x:112:myuser

If there had been more users, the way to add more several users to a group is simply to separate their names with commas:

admin: x:112:myuser,anotheruser

Then I saved the file, crossed the fingers and rebooted the computer - and it worked :) :)

Let's set aside the security of this solution (i.e. allowing a user to add himself to the admin group just by running a livecd) and celebrate that we're back in the sudoers list!

Find out the full referrer (with the shell)

Are you fed up with Google Analytics not showing the full referrer url and just showing something like http://www.example.com/forum/viewtopic.php? I also do, I love to know who's linking me (yeah I'm curious!).

My hosting compresses access_logs which reach a certain size, so when I downloaded the access logs files I get a bunch of .gz files which I'm not going to manually uncompress… So I went to the terminal and once in the folder where the log files are, I type

find . -name "*.gz" -exec gunzip {} \;

Now I have lots of files like access_log.20060929, access_log.20060930, etc. For searching let's say a referrer called example.com which I see in GA, I do:

cat * | grep example.com

and that will return you the apache log lines where the term appears.

For example:

81.39.91.97 - - [26/Sep/2006:11:27:47 +0000] "GET /index.php HTTP/1.1" 200 9562 "http://example.com/viewtopic.php?t=747" "Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7"

It's a bit of brute force approach as it's searching in all the files (now that I realize it's even searching in the compressed files since I didn't remove they yet, haha!). But it's very fast even though!

With a bit more of love this could be a rudimentary stats script but I'm not that much into shell scripting (and I'm trying to force myself into really learning regular expressions to do that stats script with ruby instead).
Oh and I forgot to say this works for any decent shell - linux, mac… I think I also could do it with a windows box with unxutils installed (so that you get the funky stuff like grep, find, cat, etc).

20060923 You must be a linux expert

Yesterday after work was quite funny. Following british habits, almost everybody in the office went to a near pub for some drinks. That's quite interesting since that way you can learn what everybody else in the office is doing, or what do they do outside office hours, etc.

Then somebody asked me: You must be a linux expert, no?

Me? God, I wish I was! It seems that Ubuntu it's so easy that you look like an expert, hehe, that's really funny. Then I was asked why I was using it, if I wasn't really an expert on it, instead of using windows, and I must recognize it's quite complicated to explain.

In my previous jobs I could just use windows. It wasn't really a problem until I got my powerbook. Then I started feeling windows more and more clumsy - and annoying. But I still had to stick with it, since there was no opportunity to switch to mac or linux. One day I asked about installing ubuntu in one of the computers and there were two answers:

  1. linux is just for servers (and only red hat enterprise linux)
  2. how can someone install a linux distribution with such an ugly name? (ubuntu)

Obviously I got discouraged and just thought: ok, but you don't know what you're losing. Some time after we replaced a pirate copy of windows XP with ubuntu at our home server, and I quite liked that new version. I thought: if it wasn't because I have MacOsX… I would install linux in my powerbook!
And somehow on the other hand I got aware of the goodness of using open source products. Now this is really hard to explain, as it may sound like a divine message or something, but the main reason is the data:

One day you don't care about open source or anything and consider the same freeware and open source. Next day (after the message came) you realise that you want to keep your data with you - and for that, you need to use programs which only use standard file formats, or open source software. So that if you change your program, your data keeps being usable.

I somehow got the final nudge when I switched from Apple's Mail.app to Thunderbird. I don't know why, I started feeling bad about using Apple's Mail. I thought: and what if I bought another computer and it's not a mac and I want to copy my email data, what am I going to do? The horror!

I discovered that although Mail.app used an standard mbox format at the beginning, they changed it so that the files could be indexed by the Spotlight. So what happened? It was not standard anymore, and I was quite lucky that some good soul had written an script for converting between Mail 2 format and the standard mbox one.
Since then I got more and more interested in this kind of software. I know it may sound a bit ridiculous if you come from the commercial background that most of us live in, but the ubuntu philosophy -providing software freely- really hit me. The idea of not being tied to any company may sound quite utopical but I believe it's good to have utopies in mind.

And then (coming back to the topic) when new computers came to the office, they had a preinstalled windows XP. I asked if I could install linux on my computer and when they told of course! I was like W-O-H-!

Since then I've been using it continuously, and can't stop being surprised every day with the good achievements and goals it has reached. I also have become aware of how many money do companies spend stupidly in things like Microsoft Office, Microsoft Windows and all of that. I mean, companies could save lots of money if they could just buy bare computers with no operating system installed at all, and install only whatever they needed. Specially, computers for developers: I have a fully equipped computer for the price of 0. Just do some maths!

There are also other aspects even more complicated to explain, mainly that using free software is like making an payment to the developers. Paying with recognition, honours, and even bug reports, to be honest. I believe any decent programmer should be happy with people contributing to the software in any manner, as it means that they care about the product. So somehow there's like an spontaneous collaboration, which I personally find very interesting. (Let alone project donations, that I also have made, but that's another topic)

As you can see, the reasons for using linux are many and subjective, and most of them fall quite quickly in the personal beliefs area, being very easy to start evangelising and trying to force everybody to go linux. I do not think that it is the way, since as I said once, I got very dissapointed with linux zealots in the past. So when I have the opportunity to explain my opinions I do it happily, with the hope that it serves more people to understand this personal attitude (and maybe join it as well).

20060904 Internet explorer in linux

IES4linux logo

IES4Linux is an script which configures wine and downloads and installs IE in your linux box. I know this is an aberration but it can also serve for making more people switch to linux while still being able to test the sites in the Cancer (i.e. Internet explorer), because of those clients which love to remain in the Paleozoic era of browsers.

You just need Wine and Cabextract which can be obtained with simple apt-gets or with the fantastic ubuntu's Synaptic package manager. Although this is better explained in IES4linux page!
I'm still very impressed with the performance of this… Last time I tried wine (like 4 years ago) it was horribly slow, and was unable of open the simplest program. Now I am able to start the browser and have a complete view of everything, even run javascript properly - everything works fine. I think it's even more stable than the windows environment :D
There's another advantage over windows: you can install different versions of IE: 6, 5.5 or 5, all at the same time. Each one is isolated from the others so it's the perfect test environment - something you can't get in windows, where it's very complicated to keep different iexplorer versions coexisting peacefully in the same partition.