Protected: Conclusion on what was wrong

This content is password protected. To view it please enter your password below:

Get rid of the ads!

Ads in the net are getting more and more annoying. We once had banners..then came popups…then javascript ads…now we have flash ads…ads floating over webpages asking you to shut them down and misleading you to another website and many many more “styles” of ads.
What you need to get rid of them is a machine with linux running the squid proxy and this beautiful addon for squid…AdZapper!
I won’t say more…just take a look at the pics of yahoo mail with and without proxy…
Where r the ads mommy ?

There you go kiddo...

You are free to chose what you want now :)

Fixing (?) a hard disk with errors

A couple of days ago I found out that one of my 200GB JB Western Digital drives had some errors. While trying to access certain paths under linux (with reiserfs) I always got a kernel panic in the same directories/files. The disk is still under warranty since it was bought on march 2003 (WD has 3 years warranty for it’s JB model disks) but I wondered if I could do anything by myself to fix it.
Looking inside WD’s website I’ve found out a very usefull tool called DLG Diagnostic that you can use to check on the disk. So, that was the first step…to check if the disk did have errors.
I downloaded the ALWAYS usefull Ultimate Boot CD which includes the utility of WD inside and MANY MANY others. I booted with the cd..fired up the utility and started checking. The quick test told me the disk had errors and if I wanted to repair them. Sure I did…so I let it finish the quick test. It took about 9 minutes. In the main menu of the program there is an option called extended test…so I fired up that one too. While spinning the disk and going from sector to sector it hang a while at sector 151…hmmmm.
It kept going for about an hour and when finished it told me that the disk had errors. “Press R to correct them” ->> RRRRRRRRRRRRRRR
It told me it had 10 errors. But I wasn’t so sure it had fixed them so I ran the extended test again. 5 errors. And again…3 erros…And again 1 error. And again…. 0 errors. YEAH!
After the Extended test option there is a “low-level format” option that fills drive with 0s. I had already backed up my data so I fired up that option. 13 Hours to finish…wow.
Results after it finished ? No errors whatsoever…no test hanging at sector 151 and the drive is perfectly clean. At least that’s what I think…I will test today and report later. Since this disk was part of a raid array and that array is now corrupt I am planning to fiddle around with LVM.

I also feel really jealous of my friend patroklos because he is flying today to Tokyo, Japan to present a paper of his. Damn I want to go to Japan too. snif.

The world collides…

Crypto 2004 reports say that people have been able to produce collisions for hash algorithms!
Some chinese authors reported a family of collisions for hash functions. In the beggining their report had an error on md5 (and it was renamed as md5′ collision) but they corrected their report and extended the collision to the real md5 algorithm. In the same report they introduce a collision on the SHA-0 algorithm that a lot of people fear it can be extended to the industry standard SHA-1.

We know from their “architecture” that all hash functions can have collisions…the problem is that these people found the way to reproduce them in reasonable computing time.

Quoting someone else on a thread, this is what can easily happen now:

An example of what you might do with this. You could request an SSL certificate (for your real identity) from a certificate authority. After the response comes back, you can then use that response (which is based on the MD5 of your identity+key) to “authenticate” a carefully chosen different certificate, one which claims that you are LargeBankOrSoftwareCorp., but which has the same MD5 as your real identity. You can then present this to other people in order to convince them that you are someone whom you are not.

Read this to reproduce the collision yourself: http://www.tcs.hut.fi/~mjos/md5/

Read the comments on this thread:
http://www.freedom-to-tinker.com/archives/000661.html

Crypto

Last night I’ve found a very nice little game. It’s called Crypto Game! It has built in phrases encrypted with a monographic cipher and you have to decrypt the phrase. It’s more like a mind excercise than real cryptanalysis. But it’s still quite some fun :)

As my friend patroklos notes on his blog, there are rumours on the net about SHA-1 breaking and md5 collisions. Is that good news or bad news ? Is it time for some people to start feeling insecure or is it time to start implementing more secure techniques ?

2 WordPress patches (hacks)

I am using wordpress for this blog and I am quite happy with it. But I had some special requests and I couldn’t find any hacks for what exactly I had been looking for.
What I wanted was the ability in password protected entries to protect the title name from the spying eyes of evil people (or search engines). I didn’t want people to be able to see the title of the entries they weren’t supposed to read.
I also wanted to stop the sometimes annoying auto-completion of tags when creating a new entry. I sometimes wanted to post fractions of code that were not complete and sometimes the results were different from what I had originally entered.

That’s why I asked the help of Angelos since I am a VERY lousy php coder.
He made these patches true. And here they are:
wordpress.passwdtitle.plus.noautocomplete.patch.tar.gz

Vedic Maths

Reading a yesterdays article on Wired about indian students learning Vedic maths to crack the university exams I was intrigued (as a math student myself) to find out what these maths are about.
Googling a bit brought me to this page: http://www.vedamu.org/Mathematics/course.asp
It’s an explanation of the sutras (formulas) vedic maths use to make various calculations with your own mind a LOT faster. After reading a bit I was able to calculate multiplications of 2 2digit numbers in under 2 seconds without any paper writing with ŨRDHVA TIRYAGBHYĀM (e.g 43*33=1419).

There are various other formulas inside there and it’s really worth reading if you are a math student of you need maths for your work. It’s a time saviour!

Olympics

Yesterday was the opening ceremony for the 28th Olympics, in Athens Greece (I live in Greece, for the few that don’t know it already). Was the show good ? Yes it was. In fact it’s the best that I can remember. I can hardly recollect any memories from 1988 (Seoul) , but I remember 1992 (Barcelona) , 1996 (Atlanta) and 2000 (Sydney). I think this ceremony was the best I’ve seen…and it SHOULD be for a million reasons.

If you don’t come from Greece then you probably won’t know that our country is living it’s biggest democratic period for the last 500++ years…and how long this period is ? 30 years! During these years this country has improved dramatically with the efforts of so many working people. And now on the 30th year comes this “great” event that costs our economy about 6-10 Billion Dollars!!
The supporters of the olympic games say that the revenue will be bigger than we can imagine (mostly from tourism) and that our country will be more respected and so on. That can be true…but you have to define when that will take place, counting and adding how many years in the future will still be under the effect of the olympics. Because we pay the money now…we have to know when we will take them back…if there’s such a chance.

Another great issue is to whom these games appeal. Do they appeal to the hard working labour man ? To the business man or to the millionaires ? The answer is probably the ones that profit from these games because they are the mostly interested in them. Who can go and watch the great opening ceremony when the cheapest ticket costs 100E (then goes to 350E,750E and 950E). There are people living with under 500E pensions in Greece…and these people were invited to go buy a ticket. Are these people that yell about cheap tickets and so on playing with us ? Playing with our nerves or just playing with the future of this country ? I’m sure there are funny stories to be told by many about ticket experiences,…but there’s one coming straight from the political scene of Greece. The president of the second biggest party in Greece, PASOK, which is supposed to be a socialist party, denied being given a ticket for the VIP seats…and bought one to go sit with “the people who vote for him”. The funny thing is his ticket costed 950E for each person of his family. So for him, his wife and his daughter he needs 2×950=2850E for a 3 hour spectacular show. Now that’s a socialist move!

What’s also very funny is the fact that most stadiums were built by foreign workers living in Greece “almost illegally”. Some of them were given the famous “green cards” but the state has the right to kick them out or not renew their cards for the following year. What’s that got to do with olympics ? The answer is really straightforward. When these people had accidents they were forced to lie about the accident, by telling that they’ve had it before entering the olympic workspaces, else they were to be thrown out of the country. So most of these people were practically working without any chance of getting some money if the had an accident. The whole matter was of course not covered by major newspapers/media because they wouldn’t be given the infamous “olympic advertisments”, and we all know how the media depends on the advertisting companies.

Money, money, money…that’s all about the olympics. Nothing more. We had the opportunity as Greeks to show the rest of the world what the true olympics are. But there wasn’t any chance that we were left alone to do it. A country that organizes olympic games without big sponsors is doomed. It’s funny to even speak about “Coca-Cola Torch Relay”. This is our way of showing to the world the olympic spirit ? By having a sponsor for the torch relay ? When in the past did someone have to pay to be a part of the relay ? Aren’t only the ones who deserve it, supposed to hold the torch ? Do I deserve to hold it because I can afford to pay 300E and a labour man that works all day and builts these magnificent stadiums isn’t ?

Just some pins here:

  • What’s the relation of Juan Antonio Samarank to Santiago Calatrava ? Was the second offered the work of the roof of the Olympic Stadium (and the money of course) as an exchange for Mr. Samarank’s support for Athens when he was president of the IOC back in 1997?
  • What’s Mrs. Angelopoulou (the president of the Athens 2004 comittee) husband doing as a living ? Where did he find the money to rebuild his ruining industrial businness ?
  • Will we ever see again acts like the ones from Tommie Smith and John Carlos in the olympics ?
  • I am really ashamed as a Greek for all that. That’s trully not like our past and I wouldn’t like it to be our future…

    P.S. Maybe I’ll write some more as the games go on. There are a lot of things to be said.

    Linux in Europe vs Greece

    While reading the news you can see that more and more European Governments/municipalities are planning to switch from Windows to Linux. As a recent example you can take Vienna and Munich (http://www.eweek.com/article2/0,1759,1635246,00.asp)
    In contrast to what’s happening in Europe and ignoring all the efforts of the local community( http://www.open-source.gr/, http://www.knoppel.org/) trying to convince the Greek government even for some “tests”, the greek Government signed last year a major contract with Microsoft for supporting it’s ministries with “windows servers” (tell me if it’s even rational to talk about windows “servers”..). What the prestigious greek government would earn from that ? hmmm, probably some highly rated officers/ministers got a great ammount of money in exchange for the “deal” they made…and secondly …the Greek Government (Ministry of Development) was given the right to see parts of the code of windows xp/2003. And here comes the big question…WHO will see that code? what will a minister (this link is the Ministry of Transportations and Communications.It doesn’t even have an english translation for foreign visitors and these people decide the technological future of us…damn) do with that code…what will he understand…and how much more secure does that make him feel ? It’s rhetorical…we all know the answer.

    There are times I feel pity for myself for being a greek at these “modern” times.

    P.S. Here is the link with the original announcement of the agreement.

    *Edit: California Government “Explore Open Source Alternatives”, omg…Arnie can think more than our politics…

    Protected: Some days are B A D

    This content is password protected. To view it please enter your password below:

    Simple Port Accounting

    Say you’ve got a server with various services running on multiple ports and you want to monitor how much traffic each port recieves or sends. I’ve written 2 small scripts to easily accomplish this task.
    The whole process is based on iptables rules & MRTG . You have to make some rules first on iptables according to what you want to monitor.
    As an example we will monitor web-server traffic on port 80 (HTTP) and port 443 (HTTPS).
    First come the iptables rules.
    iptables.sh


    #!/bin/bash
    ME="XXX.YYY.ZZZ.WWW"
    IPTABLES=/usr/sbin/iptables
    $IPTABLES -A INPUT -p tcp -d $ME --dport 80
    $IPTABLES -A INPUT -p tcp -d $ME --dport 443
    $IPTABLES -I INPUT -i eth0
    $IPTABLES -A OUTPUT -p tcp -s $ME --sport 80
    $IPTABLES -A OUTPUT -p tcp -s $ME --sport 443
    $IPTABLES -I OUTPUT -o eth0

    change the ME variable and add your ip inside the quotes. Then put this script someplace where you put scripts…I use /opt/scripts or /root/scripts, and make an entry to your rc.local (or any other script runs on boot time) to run this script on boot (I hope I won’t get any comments on how to do that…)
    Then comes the scripts that will take the stats gathered in iptables rules (you can see them by typing iptables -nvxL).
    First script is: port.sh


    #!/bin/bash
    HOSTNAME="/bin/hostname"
    IPTABLES="/usr/sbin/iptables"
    UPTIME="/usr/bin/uptime"
    $IPTABLES -nvxL | grep -w $1 | awk '{ print $2 }'
    $UPTIME | awk '{ print $3, $4, $5 }'
    $HOSTNAME

    Second script is: inout.sh


    #!/bin/bash
    HOSTNAME="/bin/hostname"
    IPTABLES="/usr/sbin/iptables"
    UPTIME="/usr/bin/uptime"
    if [ "$1" == "packet" ]; then
    $IPTABLES -nvxL | grep -w eth0 | awk '{ print $1 }'
    else
    $IPTABLES -nvxL | grep -w eth0 | awk '{ print $2}'
    fi
    $UPTIME | awk '{ print $3, $4, $5 }'
    $HOSTNAME

    You can give them a try by typing ./port.sh 80:


    1963705
    19120562
    58 days, 22:07,

    or ./inout.sh


    29086377134
    70585824723
    58 days, 22:16,

    or even: ./inout.sh packet


    514425312
    549647125
    58 days, 22:17,

    The inout script can take the word “packet” as a command line parameter to show you total packet information.

    What you need to do next is configure your mrtg to read these stats.
    mrtg.cfg


    WorkDir: /foo/bar/change/me
    Target[80]: `/opt/scripts/port.sh 80`
    MaxBytes[80]: 200000
    Title[80]: Port 80
    PageTop[80]: <h1>Port 80 Stats</h1>

    Target[443]: `/opt/scripts/port.sh 443`
    MaxBytes[443]: 200000
    Title[443]: Port 443
    PageTop[443]: <h1>Port 443 Stats</h1>

    Target[inout]: `/opt/scripts/inout.sh`
    MaxBytes[inout]: 2000000
    Title[inout]: Total Traffic
    PageTop[inout]: <h1>Total Traffic Stats</h1>

    Target[inoutp]: `/opt/scripts/inout.sh packet`
    MaxBytes[inoutp]: 2000000
    Title[inoutp]: Total Packets
    PageTop[inoutp]: <h1>Total Packet Stats</h1>

    Where workdir is a directory inside your web server served documents. For example…if your DocumentRoot is /var/www/mydomain/ make Workdir: /var/www/mydomain/mrtgstats
    Now fire up mrtg to read the specified .cfg file and you are done!
    # /foo/bar/mrtg/install/dir/mrtg /cfg/file/dir/mrtg.cfg

    and you will see some files being created inside “WorkDir: /foo/bar/change/me”.
    Add this line to your crontab
    */5 * * * * /foo/bar/mrtg/install/dir/mrtg /cfg/file/dir/mrtg.cfg
    And you will have automated results every five minutes.

    If you want to create a nice index.html to have all stats in one dir just do this:
    # /foo/bar/mrtg/install/dir/indexmaker –output=/foo/bar/change/me/index.html –title=”MY Port Stats” –enumerate –columns=1 /cfg/file/dir/mrtg.cfg

    Now go to http://yourhost/foo/bar/change/me and enjoy

    Searching the web…

    I woke up early today and because I have nothing to do…or there’s nothing I can do now…I started searching the web. I came up with a very strange tool.
    AboutYou.
    There’s a ton of information this tools provides you about your connection/browser/tcpip headers…even your dns servers. I am really curious to find out how this thing with the dns servers works, the rest is really easy to implement.Using dig ? If so why does it sometimes show some wrong entries ?I’d really like to have that source :)

    Protected: Any ideas ?

    This content is password protected. To view it please enter your password below:

    Keyboard/mouse shortcuts make our lives easier

    Isn’t it boring to search with your mouse/keyboard all these menus insinde an application just to find something very simple ?
    Mozilla Firefox and Thunderbird are by default packed with keyboard shortcuts. What’s even better are the mouse gesture extensions…for people that are stuck using their mouse.

    Check these pages for more info (comparison with other applications included).
    http://texturizer.net/firefox/keyboard.html
    http://texturizer.net/thunderbird/keyboard.html

    Protected: WTF is wrong with phoenix ?

    This content is password protected. To view it please enter your password below: