Windows 7

We got my mum a Acer ONE for Christmas and I spent one whole day trying to set it up so that it would sort of work, as it came with Windows 7. After removing all the shit that Acer seam to think you need I spent another few hours going to different web-sites and downloading flash, acrobat, etc ... and mostly waiting. As a last task I wanted to replace the background image with a picture of my family. How would you go about of doing this? I spend 30 min looking in different menu items and trying to find this one thing. After doubting my intelligence I asked Google and guess what. It is not possible, in Windows starter it is not possible to replace the background image. Hahah how about that? You spend 400 Euros on a PC and you can't even change the background image. Money well spend I would say. Now my mum will enjoy Ubuntu. What a stupid decision, I was really thinking Mic$osft was on the right way but this just blows it. Only retards would use something like that.

Do backups

I took my laptop to a very remote location to actually get some work done. As I am noticing that when I work at home the internet is to big a distraction. So while I was happily working away I wanted to save my done work. At home I normally save all files see if everything builds and then '{svn,cvs,git} commit'. As my server is in Holland and my backup server in the US I need the internet to access them. But what do I do somewhere without internet (Yes these places exist). Every normal person would just continue with his work and commit when he comes home. But let's consider this scenario for a moment. While on the car my laptop wakes up out of suspend because something has pressed the button or I didn't close the lid properly. Now the hard drive is turning but exactly now I driver over a bump => headcrash. One week of work gone. Hard drives are something so liable you should never rely on them. My friend Edd breaks about one every week. So what to do. Risk it, no way. I remembered that while at a conference last week I was given a USB drive (Thank you Microsoft Research) so I pooped it in and now save all my data on this.
$ cp -ruv uni/ /media/disk/
does the trick. Now 2 things would have to break for me to lose my work. And if everything works out OK I format the Dongle and everyone is happy. But if my laptop decides to be funny I still have all my work.
I can not stress enough how important it is to think about backups. If you want your data to be reasonably secure you should always have a backup in a different physical location and secured with a different password. Loads of my friends and lecturers (that call them selves IT specialists) do no such thing. I can only hope they don't have to learn the hard way. I think this is a really understated problem. I know loads of people that say "Ah I do regular backups. I have a external hard drive next to my pc". And how much security does that give you? A robber taking your pc will also take the drive and your data is gone. At least use a service like dropbox for your important data. Taking away all the crap (mp3, videos etc..) you can download again normally you don't have that much "really vital" data. I have about 1 GB of files I really really don't want to lose.

Professor Michael Worton thinks UCL students are stupid

As some of you may know I am a student at UCL and as you can see from my previous posts I get a lot of mail. So I get really annoyed when people think I am to stupid to see something the first time they send it to me. Especially if people just resend the same mail over and over gain. It looks like Professor Michael Worton and Claire Underwood seam to think that all students at UCL (all-postgraduates|at|ucl.ac.uk, all-undergraduates|al|ucl.ac.uk) are morons and to stupid to read their email the first time they get it. And apparently we are not able to read and respond properly (to our own judgment) the second time. Ahhh because we really haven't figured out what a email is, just send it again the third time. The same mail.
Message from Professor Michael Worton Vice Provost (Academic & International)
I agree that some student survey is really vital for my success at UCL and important but still I emailed the sender and informed here that I was already getting enough mail and that I don't want this spam. And guess what, to further insult the students at UCL they are sending out a fourth reminder. Now that makes me wonder. If we get FOUR reminders about another student survey how many do we get about something that is really going to influence my student life (Exams, etc ..). I will be expecting someone to call me personally from UCL as some people seem to think that we are to stupid to read and think.

REST vs SOAP


For the Advanced Analysis and Design course at my university I have to compare REST with SOAP. My first reaction as I heard this was WTF. How is it possible to compare a strictly defined protocol with an approach idea like REST. I don't know if my professor doesn't understand the concepts of both or if this is the realization he wants us to get. For the people that don't know the difference here a little rundown. SOAP stands for Simple Object Access Protocol and was initially designed to call functions/methods on remote machines (basically RPC shredded through the XML buzzword machine) whereas REST stands for Representational State Transfer and describes how the resources in the internet can be arranged and talk to each other. Mainly described by the example of http. Of course you can use both methods to get data from some source (Amazon for example) but the general ideas are so fundamentally different that a real thorough comparison is not possible. Sometimes I do wonder. If you would only read http://en.wikipedia.org/wiki/SOAP and http://en.wikipedia.org/wiki/Representational_State_Transfer you would understand my point. That simple.

Flamewar commence:

How much money can I make with my domain

I just had a look at http://www.thenetinfo.com and that tells me that my domain is worth:
Ribalba.de Estimated Worth $88 USD
Wtf. Who would give me that money. Really. And all the other sites I tried it just doesn't give you any info at all. Ahh wait
Stallman.org Estimated Worth $5.8 Thousand USD
and
Microsoft.org Estimated Worth $292 USD
So really who would belive such a thing?

The problem with google analytic when you run your own server

On my website www.ribalba.de I run google analytic which lets me see how many people look at my website where they come from and what they are looking for. Not that it really matters but I am just interested in why people would want to read about me. Assuming I should only be interesting for about 50 (+/-) people in the World. But I also run some analyzers on my web server log files and it turns out that the main thing my server is doing is serving files I have outside of my wiki (which I use for my site) they are files that I just have in folders and that can be accessed through directory listing turned on. But these are never accounted for in analytics. So if I direct my browser to http://www.ribalba.de it will be saved in analytics but when I goto http://www.ribalba.de/geek it does not. So in some respect analytics is giving me a wrong picture. Further image downloads from my server are not displayed. So not really useful as you are forgetting a huge junk of data and so your analysis of your site is bound to be wrong.

wrong start data => wrong conclusion

Maybe Google should offer a method by which I can upload the log-files after logrotate has run and so the file is not used anymore. So always take with a grain of salt what google is trying to tell you.

libnice for CentOS

Some guy on the CentOS mailing list needed libnice so I built it. It can be downloaded from:

http://www.ribalba.de/geek/port/

The source package is in the src folder and the builds in the respective directories.

I hope this helped some poor sole :)

Just for your inforamtion:

GLib ICE implementation

libnice is an implementation of the IETF's draft Interactive Connectivity
Establishment standard (ICE). ICE is useful for applications that want to
establish peer-to-peer UDP data streams. It automates the process of traversing
NATs and provides security against some attacks. Existing standards that use
ICE include the Session Initiation Protocol (SIP) and Jingle, XMPP extension
for audio/video calls.

Why being nice pays off


I have lived in London for little more than a month now. My daily routine includes getting the tube to Uni and on the way I pick up my morning reading normally a Financial Times, a Guardian and a bottle of water. I do this pretty much every morning. So I spend quite a lot of money for this if you take it time 365. At my tube station I can choose between two news-agents that sell papers. As I am coming from the right I naturally always went into that one. And I never though much about it. It is owned by a family (it seams) and the people that work there are not rude but they are not friendly and helpful. After going there for a month they still didn't know what I was getting. In the morning when I am quite grumpy the last thing I really want is someone to be grumpy back at me. But I just accepted it and continued buying my stuff there. Four days ago I came from the left so I thought why not try the other shop. And what a difference, I was greeted really friendly and I had a little chat with the guy behind the counter. The next day I went to the left one agin and the same guy was friendly again. Now after just four days he already knows what time I normally go to university and of course the papers I buy. It never occurred to me that in a world where prices are pretty much fixed friendliness is one of the last selling points. Location might be important too, but these two shops only differ in the staff. They have the same stock and same prices and pretty much the same location. So the reason I choose the left one is because I am treated in a friendly way and people remember me. This might sounds stupid but I bet you have all done it. If someone treated you in an unfriendly manner you would say to yourself "I am not coming back" and if someone knew your face after entering a shop three times you felt sympatric with that guy.

So what can we learn out of this for IT. In the IT ecosystem prices are quite fixed too and location is becoming even more irrelevant. So maybe friendliness is a major point. Maybe your costumer will chose you the next time because you remembered him, like I take the little hassle of walking one minute more every morning just to be treated nicely. If you are a freelancer this is really important, in my opinion, as at the end of the day you are not much more than the news agent competing at a train station. Just you are competing with 100000 other shops and not one.

CentOS Pulse #0906 - The CentOS Newsletter

Hi all,

With a little delay, issue #0906 of the CentOS Pulse newsletter has
been released. It covers topics like the CentOS 5.4 release, a very
funny featured article and a interesting event review and much much
more.

You can read the newsletter at:

http://wiki.centos.org/Newsletter/0906

More information about the newsletter and how you can contribute is
available from:

http://wiki.centos.org/Newsletter

Enjoy Reading!

Didi

And another email address


I am collecting email addresses. I have 8 different locations emails goto and then 25 different forwards to one of the 8. But one of the coolest address I have so far is:
which of course is just a forward but still quite funky

The problem in how I read mail


So I get quite a lot of mail every day, like a lot of us do. But there is no way that I can read all of them at once or even start answering them. I normally filter out the really vital stuff every morning and evening and then when I get time I read the rest. When I need to answer something and I don't have the time to do this I flag the mail with a little star. Now when I get time I start answering the mails that I have put a little star on. I further use my mail as a TODO list. So I send myself a mail with what I have to do and add a star. So I end up with a list of stuff I have to answer or do. Now there is a flaw with doing it this way. Think about it. .....


Ok the problem is that GMail orders the newest message first. So you see the latest message on the top. Now when you start working of your TODO list you start with the newest item. As you never manage to answer all messages you are always left with some at the bottom. You are answering mails like a stack. Which results in that you will have mails at the bottom that are really old. And as long as you don't work of the stack to the bottom they will age continuously. So there is really important stuff in my TODO list I just forgot about and never did. I should have really just checked the dates once :)

Howto send mail through Gmail using your UCL address

Following my previous post on how to receive UCL mail with Gmail now here is how to send mail using Gmail but with your UCL address. You have to go to settings (top right) and Accounts and Imports and then click on the button with "Send mail from another address" So here is the data you need.

Email address: yourlogin@live.ucl.ac.uk

Then you have to click on send trough SMTP server and enter the details

SMTP Server: pod51002.outlook.com
Port: 25
Username: yourlogin@live.ucl.ac.uk
Password: you should know this

And you don't click on enable SSL. I am sure you can do this with SSL somehow but I don't have time to figure it out :)

Then Google will send you a confirmation code which you have to enter. Please check in your spam folder as this is where my confirmation went. But after that you can just send mail like you are using outlook.com

Getting your UCL email into Gmail


I really don't like outlook.com or this web interface to live.ucl.ac.uk So I though why don't I collect all the mail in my Gmail account so I can read it in alpine. It is quite easy to set up.
  • You first sign into Gmail and then click on "settings" (top right) then you select "Accounts and Import"
  • Then you need to click on the "Add pop account"
  • Enter your UCL address and click next step
  • This will fail and you will be asked to add your data manually
Following data is important:
  • Email address: yourlogin@live.ucl.ac.uk
  • Username: yourlogin@live.ucl.ac.uk
  • Password:
  • POP Server: outlook.com
  • Port: 995
  • And use SSL
This is pretty much all you need to receive mail. I further add a tag so I can search for uni mail quicker and leave the messages on the server in the case Gmail goes down.
But that's it. Quite simple actually.

To see how to send mail trough Gmail using your UCL address see my other post: Howto send mail through Gmail using your UCL address

Need money

I have been accepted to the

2nd IEEE International Conference on
Adaptive Science & Technology

in Ghana to present my paper on Objects in the Cloud. Now I have been looking at flights and etc and on the bottom line I can't afford it. I find this quite sad that in the conference atmosphere you always need someone behind you that can sponsor you (University, Company, etc). I mean I do get expenses for many conferences when I talk but a few don't even think about setting up a grant for poor students like me. I think they are missing out and creating a rich elite which is never good. Sorry for this rant but I am quite sad that I can not go :)

Trac with lighttpd on CentOS

I spent a few hours today trying to figure out how to get trac working with lighttpd on CentOS with the standard packages from rpmforge. Like always this seams to be quite easy but then you spend ages on the little things.

First of all you need to install trac via yum which is quite easy: yum install trac
This is assuming you have lighttpd already installed


So here is the section you have to put in your /etc/lighttpd/lighttpd.conf you will also have to enable a few modules at the start most notably mod_fastcgi but please always check that you have all the modules enabled.

$HTTP["host"] == "trac.mypage.org" {

url.rewrite = ( "^/$" => "/root")

server.document-root = "/var/www/trac"
alias.url = (
"/trac_prefix/chrome/common/" => "/usr/lib/python2.4/site-packages/trac/htdocs/",
)

# rewrite for multiple svn project
url.rewrite-final = (
"^/trac_prefix/[^/]+/chrome/common/(.*)" => "/chrome/common/$1",
)

$HTTP["url"] =~ "^/trac_prefix/chrome/" {
}
else $HTTP["url"] =~ "^/root" {
fastcgi.server = (
"/root" => ( # if trac_prefix is empty, use "/"
(
# options needed to have lighty spawn trac
"bin-path" => "/usr/lib/python2.4/site-packages/trac/web/fcgi_frontend.py",
"min-procs" => 1,
"max-procs" => 1,
"bin-environment" => (
"TRAC_ENV_PARENT_DIR" => "/var/trac/",
),

# options needed in all cases
"socket" => "/tmp/trac.sock",
"check-local" => "disable",

# optional
"disable-time" => 1,

# needed if trac_prefix is empty; and you need >= 1.4.23
"fix-root-scriptname" => "enable",
),
),
)
}
}


There is nothing special with the paths and the rest if quite standard. The one thing to note is that I couldn't get trac to live properly in the root directory. As soon as you select a project it will error => So we rewrite the url to add "root" to the end. The rest should be pretty straight forward. There is no authentication in this example but this will follow in a further post.

Rar on Mac OSX

I just downloaded a .rar file onto my Mac and of course it didn't understand it. So off I went to google and looked for something that could extract it. I found a lot of proprietary stuff but nothing really I liked. If you are looking for a funky GUI what you probably are if you are using a Mac you should have a look at http://wakaba.c3.cx/s/apps/unarchiver.html which seams to be a good choice. But I didn't want another program that would integrate itself everywhere and in the end might cause my computer to crash every 25 min. (The Windows application syndrome). But all this looking around took me about 15 minutes till I had the feeling to have looked at all the options. Then I fired up a good old shell and had a look what fink had to offer. And after 1 line I could unrar my file
$ fink install unrar
That was it. I still love the command line, even if I have a funky desktop.

CentOS Pulse #0905 - The CentOS Newsletter

Hi all,

With a little delay, issue #0905 of the CentOS Pulse newsletter has
been released. It covers topics like the CentOS 4.8 release, the
Spanish CentOS community, wireless networking and contains an
interesting interview with Tru Huynh.

You can read the newsletter at:

http://wiki.centos.org/Newsletter/0905

The project team considers the CentOS Newsletter an important tool to
communicate directly with the community. It is run by the community to
collect interesting bits from the wiki, mailing list, forums, SIGs and
other sources, and put them into the spotlight.

More information about the newsletter and how you can contribute is
available from:

http://wiki.centos.org/Newsletter

Happy Reading!
Marcus + Didi

I will not be going to LA

I applied for a ticket for Michael Jackson's funeral. But today I got
Thank you for your registration.

Sorry, we regret to inform you that your registration to attend the Public Memorial Service for Michael Jackson was not selected.

Hundreds of thousands registered, but only a few can be in attendance.
TV it is

A webOS that seams to work

I am always looking for a good WebOS that I could use from a few thin clients. Listing to Stallman talk about Cloud computing I had a look at eyeos which is definatelly worth a look. It seams to work but still quite slow but definatelly moving into the right direcion.

Horrible ad

I was just watching the news and then I saw this ad:

http://www.bsa.org/flash/leads/leads.swf

A rough translation is:
Man: "You know, overtime is a part of your job"
Woman: "But you could at least say thank you"

Man: "You didn't work THAT good"
Woman "what, 20% more trade is nothing?"

Man: "In this economic downturn you should be happy that you still have a job"

Woman: "You too, the software is not even legal"

Person: "There are good reasons to report illegal software"

How can people air this? So basically, if you are not happy with your boss tell on him. That will really make you keep your job. Because if your company is doing bad, because it has to pay a massive settlement you will really get that raise. FFS did those people not go to school. But I suppose the people from the BSA are too stupid to realise what they are doing. But of course the software companies might go out of business if they don't get any money, but don't do it like this. I would really like to talk to one of these people.

Mailing list error

For the last day I was complaining about that I could not post on the libdbook mailing list. I could not figure out why. But this morning it became clear to me. I had changed the default send-to in my gmail. The libdbook mailing list didn't know that mail and didn't let me post. DAAAAAA. It didn't help that the list didn't reply with "unknown email", it send a "list not found" error. So it is not that easy to change your email.

Benchmarking


I just did some benchmarks on objic (objects in the cloud) my final year dissertation. The result was not very pleasing, it doesn't seam to scale too well. It becomes quite clear that the more loop iterations there are the longer it will take. Not even linear execution like python, looks more like exponential. I will have to investigate why this is but I think it might be the garbage collection algorithm. This was just a for loop done 10, 100, 1000 and 10000 times.

FFS more work

Talking at HAR2009

My Paper for HAR just got accepted. For those who don't know HAR stands for Hacking at Random.
On August 13-16, 2009 the 20th anniversary edition of the four-yearly Dutch outdoor technology-conference will take place near Vierhouten, NL.
And if you are a technological enthusiast like me you should really go. Here is the abstract
Cloud computing is rapidly gaining the interest of service providers, programmers and the public as no one wants to miss the new hype. While there are many theories on how the cloud will evolve no real discussion on the programmability has yet taken place. In this talk a programing language named objic is described, that enables programs to run in a distributed manner in the cloud. This is done by creating an object orientated syntax and interpretation environment that can create objects on various distributed locations throughout a network and address them in a scalable, fault tolerant and transparent way. This is followed by a discussion of the problems faced and an outlook into the future.
Cu @ HAR

Adding an at '@' symbol to LaTeX

I love Tex but sometimes you just bang your head against a wall because it just doesn't work. Here a little tip, if you need an "at" symbol in your file just adding @ will not work neither will \@. Some people say you have to \makeatletter @ \makeatother what seams stupid to me. There is a simple solution go into math mode
$@$
should do the trick.

Ulrich Drepper about Stallman

I knew that Ulrich and Stallman didn't get along but this email is a must read: http://sources.redhat.com/ml/libc-announce/2001/msg00000.html

My personal favorites are:
The only difference is that Stallman now has no right to complain anymore since the SC he wanted acknowledged the status quo. I hope he will now shut up forever.

The morale of this is that people will hopefully realize what a
control freak and raging manic Stallman is. Don't trust him. As soon
as something isn't in line with his view he'll stab you in the back.
*NEVER* voluntarily put a project you work on under the GNU umbrella
since this means in Stallman's opinion that he has the right to make
decisions for the project.

When I started porting glibc 1.09 to Linux (which
eventually became glibc 2.0) Stallman threatened me and tried to force
me to contribute rather to the work on the Hurd. Work on Linux would
be counter-productive to the Free Software course.

This part has a morale, too, and it is almost the same: don't trust
this person. Read the licenses carefully and rip out parts which give
Stallman any possibility to influence your future.

I cannot see this repeating, though. Despite what Stallman believes,
maintaining a GNU project is *NOT* a privilege. It's a burden, and
the bigger the project the bigger the burden.

Something I got in the mail ;)

hi xxx

Lets have a and then i will , which will make u . i will give u many than we can make love in the position. I can lick ur and u can massage my .
I am sure u will be like this and not gonna think of your , or for some timeFor me honey u are like , , and in .

Your are simply my and i u

GNU coreutils funny

Just had a look at the basename man page and found this:
AUTHOR
Written by FIXME unknown.
But they still claim to have the Copyright. Funny maybe the original author didn't approve with this.

Importance of dates

When browsing the web I don't want to look at old data, so when reading I try to find out when the page was last updated. Now blogging and wikis have become so popular there is normally a date associated with the post but otherwise you are normally left to guess based on version numbers of programs people used.
So if you are a web developer please never forget the date something was created.
Further I was looking for a tool which detects changes and dispays the last changed date. Google somtimes can display this but for about 80% of the pages this information is not available. Why has nobody written a tool that wgets pages and md5sums them to see it they have changed and displays this date. I know it is not always that easy, but a tool like that would be soo usefull. Maybe a firefox plugin could help.

A useful little bashrc addition

I really like checking if commands have executed successfully. This is something quite important if you are administering a machine. Normally I just echo $? but now I have added a new line to my .bashrc that will show me this in colour.

export PS1='\[\033[0;32m\]\u@\h \[\033[0;33m\]\w\[\033[${?/[^0]/31}m\]\$ \[\033[0;38m\]'

This will make the prompt green if everything went OK and red if the process didn't return 0. Nice little helper :)

CentOS help

Something people have asked me about is what to do when yum gives you the error
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
This is very simple

$ yum install yum-utils
$ /usr/sbin/yum-complete-transaction

Finished ;) Just a little cleanup of the completed transactions file

Howto reset your Windows Vista password

On my laptop I had forgotten my password because I always use the finger print reader. And I never really needed it because windows, once you are logged in, never really prompts you for it. But today I needed it and I didn't know it. So what do you do? Here are some simple steps.
  1. Create another user account with Admin rights
  2. Log in as that user
  3. Change your `real` user password
  4. Log in as your `real` user and delete the other account
Viola, password reset without knowing it. Thank you to Paul for this tip. Quite simple but I would have never thought about it.

detex for CentOS

So another little porting effort. This time it is detex
DeTeX is a filter program that removes the LaTeX (or TeX) control sequences from the input so that the real content can be passed to a spell or diction checker.
I am using this for my dissertation to count the words used
detex dissertation.tex | wc
Quite a useful little tool. When I get time I might rewrite it in perl to make it more portable.

Download the [RPM]

[SRPM] and spec file:

Summary: Strips Tex and LaTex commands from a file
Name: detex
Version: 2.8
Release: 1
License: BSD
Group: Applications/Text
URL: http://www.cs.purdue.edu/homes/trinkle/detex/

Source: http://www.cs.purdue.edu/homes/trinkle/detex/%{name}-%{version}.tar
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root

Patch0: mallocandtroff.patch

BuildRequires: flex
BuildRequires: groff

%description
DeTeX is a filter program that removes the LaTeX (or TeX)
control sequences from the input so that the real content can be
passed to a spell or diction checker


%prep
%setup
%patch -p0

%build
%{__make} detex man-page prefix="%{_prefix}" CFLAGS="%{optflags} -DNO_MALLOC_DECL"

%install
%{__rm} -rf %{buildroot}
#%{__make} install DESTDIR="%{buildroot}"
%{__install} -Dp -m0755 detex %{buildroot}%{_bindir}/detex
%{__install} -Dp -m0644 detex.1 %{buildroot}%{_mandir}/man1/detex.1

%clean
%{__rm} -rf %{buildroot}

%files
%defattr(-, root, root, 0755)
%doc %{_mandir}/man1/detex.1*
%{_bindir}/detex

%changelog
* Tue Apr 21 2009 Hoffmann Geerd-Dietger - 2.8-1
- Initial package.


You will also need the little patch file
--- Makefile.orig 2009-04-21 01:50:44.735919044 +0100
+++ Makefile 2009-04-21 01:51:18.237692007 +0100
@@ -49,7 +49,7 @@
# Compile time flags, just uncomment the necessary lines
# Some say GNU make does not correctly handle += -- you may have to use :=
#
-DEFS =
+DEFS += -DNO_MALLOC_DECL
#
# Add -traditional for GNU cc on ISC 386/ix system and possibly others
# (reported by pinard@iro.umontreal.ca)
@@ -116,7 +116,7 @@
mv detex.c lexout.c

man-page:
- troff -man detex.1l
+ nroff -man detex.1l > detex.1

# If you want detex available as delatex, uncomment the last two lines of
# this target

My word was accepted

When talking about c (as in programming) you normally hear happyland for undefined memory. So I decided to submit one of my favorite terms to the urban dictionary.

Some people claim I came up with this term. Patent pending ;)

Using eval to use a string as comparison

I am just writing a little compiler and interpreter and I have a method to check if 2 values are equal, not equal greater and so on. My code looked something like this

if typeOfCompare == "==":
return firstVal == secondVal

elif typeOfCompare == "!=":
return firstVal != secondVal

elif typeOfCompare == "<=":
return firstVal <= secondVal

....
But this was quite inflexible and I didn't like all the returns. As the type of the comparison was already checked by the parser I came up with a simpler method
return eval(str(firstVal) + typeOfCompare  + str(secondVal))
This might be a performance hit and not as clear but its easier to code and more extensible. You got to love python enabling something like this using a string as comparison operator.

Some research into what other people have done

So I thought I might have a look at what other people on my course have done in previous years as a final year project and how they structured it. So I though quite a few people must have put their projects online as a pdf. So I wrote a little scrip that would query the online list and then Google search for the topic. Here is the script:
#!/usr/bin/ruby
require "open-uri"
require 'rubygems'
require 'hpricot'

page = open("cit0708.html")
doc = Hpricot.parse(page)

(doc/"table.body_showcase").each do |link|
a = (link/"p")
puts "firefox \'http://www.google.co.uk/search?q=\"" + a.first.inner_html + "\"\'"
end

And off I went to look at Google. But only one guy had put his dissertation online. Some people would conclude some stuff about Bournemouth uni students but I will restrain from this. But I still think the projects should be uploaded to somewhere. I know other Universities print books with all the projects in them so their students get publications.
On anther note: I really like the hpricot library, makes parsing HTML really easy. Even if you are not a big fan of ruby you might want to have a look at it.

Jonathan is runnig Mac

Have a look at this http://blogs.sun.com/jonathan/entry/unified_computing what do you notice?
I am sure this is a picture of a Mac window. So are you telling me the CEO of Sun which actually produce two desktop operating systems has a Mac. No wonder they are going down hill. How can a CEO even post something like this. I wish someone would get rid of this idiot.

Some speedup

I started using pmwiki for www.ribalba.de a few weeks ago. I put pmwiki in a folder on my server and then needed a solution to redirect from the index page to that folder. Edd suggested a php secipt that would change the header.
<?php
header( 'Location: http://www.ribalba.de/pmwiki/' ) ;
?>
and this worked fine, but it took ages for the page to load. So I did some benchmarking
Static HTML
real 0m39.731s
user 0m0.206s
sys 0m0.659s

PmWiki with php redirect
real 4m16.862s
user 0m0.260s
sys 0m0.717s

Just PmWiki
real 4m7.132s
user 0m0.259s
sys 0m0.743s
So what can we conclude? pmwiki is not a fast wiki and that the redirect took just a little time.
So now I have the start page as static html and if someone want's more information he has to wait.

Update: Of course the time is the average of 100 Queries

Little cal dashboard app


I am to lazy to remember which month is which number in the year and how many days the month has. Normally I just fire up my dashboard on my mac and use the calendar there, but today I was playing about with Xcode and so I decided to write a little dash app that will show me the calendar information. And so I wrote my first mac app in HTML, what is the world coming too. 

Maybe if I get more time I will add a few more features but for now it does everything I need. Show me the number of months in a Year :P

Howto have a long itemize or enumerate split over many pages

I think it is time I start blogging about all the LaTex stuff I discover all the time. This one was a little tricky. I had a 3 page long enumeration that was bound to a table. So in latex:
\begin{longtable}{|p{\textwidth}|} \hline
\begin{enumerate}
\item ....
\repeat 500 times
...
But of course the enumeration could not be split so it just went off the bottom. What to do? After some thinking I came up with this bodge. If you know a nicer way of doing this please tell me. 
I defined a new command \breaktable
\newcommand{\breaktable}{%
\setcounter{enumi_saved}{\value{enumi}}
\end{enumerate}\\
\begin{enumerate}
\setcounter{enumi}{\value{enumi_saved}}
}
which I now enter every time I see a sort of logic end to the enumeration. This saves the current counter stops the enumeration adds a new cell and starts the enumeration with the correct value again. You have to define
\newcounter{enumi_saved}
somewhere. Works quite nicely.

Redtube title analyzer

If you are part of my family, a lecturer or a future employee do not continue to read !!!
The following contents is for amusement purposes only and I am not responsible for anything. Do NOT take serious !!!


So after this warning I can assume you are a freak like me and the people I live with. I live in a geek house with 5 men and obviously we sometimes talk about porn. One of our favorite sites here is redtube.com (setting it as start page and so on)  At some stage we had a discussion on what would be the most used term in the titles of this fine video material. Sitting down I though that my computer can easily find this out for me. So I wrote a little script
 1 #!/usr/bin/ruby
2 require "open-uri"
3 require 'rubygems'
4 require 'hpricot'
5
6 counter = 1
7 begin
8 page = open("http://www.redtube.com/?page=#{counter}")
9 if (page.kind_of? Tempfile)
10 ps = page.read
11 else
12 ps = page.string
13 end
14
15 doc = Hpricot.parse(ps)
16
17 (doc/"a.s").each do |link|
18 link.inner_html.downcase.split.each do |word|
19 puts word
20 end21 end
22 counter=counter +1
23 end while (ps.index('No Videos found') == nil)

This will just scan through all the pages and return the single words of every title and exit if there are no pages left. I know you can optimize this and you could write a shell script to do it but bear with me.  So this returned a list of 39665 words out of 490 pages of titles. But this is not really interesting we want to count the words and here are the top 10 words. The first column is the repetition the second the word.
574 2
596 gets
615 with
620 the
641 fucked
726 girl
762 and
798 her
877 hot
1059 in
Who would have guest hat 'in' would be the most used word and that '2' is so often used. Everyone I asked assumed it would be some rude word.
Here is a little graph of all the words by repetition. 

You can clearly see that there are loads of words that only show up once and then their are a few words that are repeated quite a lot of times. I suppose you can analyze this far more and find out why exactly these words are repeated so many times. 

P.S. if someone can offer me hosting space I am more than happy to publish all the files I just don't want to upload them to google or my uni server as they contain quite rude words ;)

change ssh port

The server I mainly work on has been the target of many port scan attacks. Further as soon as these script kiddies notice that the SSH port is open they try all sorts of username and password combos. This is quite annoying as it clogs up the log files and if something serious happens you might not see it due to all the clutter. So we (the server users) decided to put SSH on some weird port. Now I had the problem that all my scripts and my svn repositories where relying on SSH to be the standard port. Changing this in all my machines would have been a massive pain. So I remembered that you can specify some information in ~/.ssh/config 
And here we go. This is all you need to change the port. As my home directory is synced between all my machines this change made the server available over the weird port but it still looks as if it would be the standard one to all the programs.
$ cat ~/.ssh/config
host mysnvserver.net
Hostname mysvnserver.net
Port 54321