Posts

Showing posts from October, 2010

This is what you get when you donate to Wikipedia

I donated one USD to Wikipedia a few days ago. It really made me feel worthy :) This is the body of the email they sent me, I am adding only two CRs [carriage returns] just for the blog to look better: Dear Angie, Thank you for your gift of USD 1.00 to the Wikimedia Foundation, received on October 20, 2010. I’m very grateful for your support. Your donation celebrates everything Wikipedia stands for: the power of information to help people live better lives, and the importance of sharing, freedom, learning and discovery. Thank you so much for helping to keep Wikipedia freely available for its 380 million readers around the world. These funds support technology and people. The Wikimedia Foundation develops and improves the technology behind Wikipedia, and sustains the infrastructure that keeps it up and running. The foundation has a staff of about fifty, which provides technical, administrative, legal and outreach support for the global community of volunteers who write and edit...

Probably a joke .. ?

While walking, an engineer, a system administrator and their boss found a lamp. They rubbed it, and lo and behold; a genie appeared. "You can have three wishes, but since there are three of you, I'm going to give each one of you one wish," spoke the genie in a large, booming voice. The engineer said, "I wish to be working for NASA in making the first spaceship to transport astronauts to Mars." With that, the engineer disappeared in a puff of smoke. The system administrator said, "I wish to be in an island filled with machines that never crash so I could study from them and learn". The administrator smiles as he vanish in a puff of smoke. The boss said "I want both of them back in the office by Monday." -- Unfortunately I can not recall where I found it online, but it spent a good long time on my HDD.

Protecting against SSH attacks

On some servers you are obliged not to run a firewall nor use VPN. As a result your sshd will be the direct attack target for many amateurs and professionals alike. To protect against ssh attacks, I run the following script in crontab: #! /bin/bash # # A script to automatically counter ssh attacks # # # vars RETVAL=0 secure='/var/log/secure' file='/tmp/counter-ssh' deny='/etc/hosts.deny' # # logic # # get unique attacking IPs grep "Did not" $secure | awk '{print $12}' | uniq -u > $file # # if IP is in /etc/hosts.deny do nothing, if IP is NOT in /etc/hosts.deny, add it there! for ip in $(cat $file); do grep --silent $ip $deny; if [ $? -ne 0 ]; then echo "sshd:$ip" >> $deny; fi; done # # exit as learnt RETVAL=$? echo "we have exited $RETVAL"; exit $RETVAL Sometimes you may encounter a line in /etc/hosts.deny like: sshd:UNKNOWN It may be blocking you! Be aware, I have warned you beforehand...

Arabic URLs in Varnish

Varnish is a powerful caching, reverse proxy server. At Al Masry Al Youm, we use it to speed up page loading times for anonymous users. A few months ago I managed to get it parsing Arabic URLs. Take a look: req.url ~ "^/ar/%25D8%25AA%25A3%25A9" The secret lies within the 25%! Try to guess the word in Arabic ;)