Thursday, December 22, 2011

HED | Hacker Evolution Duality

Hacker Evolution Duality demo always segfaults even when you hit ESC and press `yes' to exit!

I had to start the game with strace to find out what the hell is wrong!

The game is totally inconsistent. Once it can not find the text file that should be displayed as your first message. Another time it does find it.  In addition, the game throws lots of error messages claiming that it can not run certain MP3 files. I do a $ gnome-open /path/to/mentioned/file.mp3 and it works like a charm.

The game also looks for many device files like:
 ...
/dev/js13
/dev/js14
/dev/js15
/dev/js16
...

  Honestly, I found the demo  not worthy of debugging a hell of segfaults. If you intend to build a good game for Linux, please consider those guys / girls who rely on x86_64 systems!

Enjoy the map and the grid, I didn't even bother to make a score.


Wednesday, December 21, 2011

Azza Helal

If you have never been to Egypt in the last 10 years, please do not judge it from behind your PC and please do not generalize your views.

If you have never been to Tahrir Square, again please do not judge it from your TV screen nor generalize your views.

This said, now let's get to the core.


80+ million people concentrated in around 3% of their country with poor majority, a relatively small number of well educated people and the elites whom you can easily classify with the tags: power, money, corruption.

Now the elites to keep and grow their power and money have to work in a few directions (First Person):

- keep the poor as they are or drive them poorer so that they have no opportunity (mind / health / time) to find out our crimes,
- shut the educated up by any means in order not to enlighten the poor about how bad, evil and corrupted we are,
- make allies with whomever supports, protects, grows / can support, protect, grow our interests,
- hide our crimes, if not possible claim they never took place, if not possible allege that others committed them, if not possible claim that these crimes are necessary for the protection and the well being of the regular Egyptian,  
- keep everyone else busy,
- make more money, if not remain rich, gain more power, if not stay in power,
- make sure we are doing good in the items above.


As any other country in the world, when something major happens by or to the people of a given country, authorities of other countries are usually either:
* Friends to the people
* Enemies to the people
* Neutral
* Claiming to be friends to the people but they are actual enemies.

To put it short, most of the poor majority knows by heart that the authorities of both Israel and America are enemies to the Egyptian people. Despite they do not know that they are friends to the Egyptian elites!

Meanwhile, the problem lies in the facts that:

 - The elites are killing the educated,
 - The elites are making use of the poverty of the majority to turn them against the educated,
 - The educated are somehow tired,
 - There is more to steal from Egypt,
 - It takes good time, money and efforts to re-structure the Egyptian Media, Police, Judiciary, Parliament, Health and Education sectors. 
 
This said, we may succeed or fail to produce a better Egypt but at least we have the honour of attempt.

This post is dedicated to all the Egyptians who were jailed, beaten and killed by the Egyptian authorities including but not limited to Alaa Abdel Fattah, Azza Helal, Khaled Saeed and Mohamed Mostafa.

PS. Not dear American authorities, if you lose Egypt, you lose the world and we are keen you lose us and we mutually lose you. 

PS1. The genocide committed by SCAF against the Egyptian people (poor and educated alike) is a crime against Humanity that will be far remembered in history.
 
PS2. Of course I am not using the word `elites' for a positive meaning, this is just what popped up in my mind to classify the criminals.
 
#NoSCAF

Thursday, November 24, 2011

Corporations with red logos

I now genuinely believe that corporations with red logos suck the blood of their customers and their employees alike. On top of my list are Oracle, Vodafone, RedHat and HSBC.

That's from where they get the red colour!

Monday, October 17, 2011

Talented thinking and open minds

I was going to write about how these August, September and October are overwhelming in IT through:
- Google's purchase of Motorola Mobility,
- Compromising kernel.org,
- Steve Jobs' death,
- Dennis Ritchie's death...
But I found that I won't be adding any thing new nor useful to the internet nor to my readers. So, I decided to change the topic.

What usually attracts me right after humans' morals is their minds. The more open, welcoming and optimistic is a person's mind the more my respect towards that person.

After all, it blows me out of my mind how many young people I find reading and willing to share and positively discuss ideas and how sadly our country has become. May be because of the under estimation of our capabilities that was instilled in us during childhood? Why most of us succeeds at something good, innovative and useful only after studying or working abroad for a while?

For me, Egypt is one of the most rich countries in the whole world... and since You are anticipating the last sentence of this post, I will let it be a choice of your mind :) 

I wanted to show you a brain in shackles but a cage would do.
Any how we don't want these any more. Original image is here
 
  

     

Tuesday, August 23, 2011

Samsung Galaxy Tab | iRead

Honestly, I am so grateful to Allah that he (SWT) allowed me to get a nice tablet. (P.S. I am not into a geeky review of my latest toy, but it does well except for automatically shortening dotted file names and turning Arabic ones into underscores)

I have used to thrive on reading while a teenager, but unfortunately I abandoned my best hobby since high school. The good news is that, I am about to be back in shaa Allah:

* Recently, in less than a week I have finished:
- The Alchemist, and
- Randy Pausch's Last Lecture (transcript)

* I have also finished 1/3 of each of:
- Act like a lady, think like a man
- Men are from Mars, women are from Venus
But I am not willing to complete any of them soon :D

* Currently, I am reading:
- عبقرية محمد
- لا تحزن

I would also like to thank both `Giuseppe Maxia' a.k.a. @datacharmer and `Linus Torvalds' for inspiring me to get back to reading despite they might have not meant to :)

“"Tell me what you read and I'll tell you who you are" is true enough, but I'd know you better if you told me what you reread.” -- Francois Muriac

Sunday, July 17, 2011

SSH attacks, again!

I am too lazy to install fail2ban to protect my ssh daemon against bad boys. In, addition, I have been raised to minimize reliability on applications when a one-liner or a few-lines script would do all or part of the work.

Yesterday, I decided to turn on my home's sshd and make it accessible from outside, so that whenever I need something while at work I would ask some one just to turn on my laptop. I did, and the bad Chinese boys were too quick that they started attacking my poor daemon. They were trying users like: root, oracle, backup, postgres, www, test, kylix, info. So far, there is only one attacking IP which is: 58.68.150.174

So, I hopped for:
1- denying remote root login (Yes, I am a lazy sysadmin! Should have done this earlier) and
2- updating my counter-ssh-attacks script as follows (P.S. I have removed explanatory comments):
 #! /bin/bash
RETVAL=0
secure='/var/log/secure'
file='/tmp/counter-ssh'
deny='/etc/hosts.deny'
#grep "Did not" $secure | awk '{print $12}' | uniq -u > $file
grep "Failed password" $secure | tr -d [:alpha:] | awk '{print $4}' | uniq > $file
for ip in $(cat $file); do grep --silent $ip $deny; if [ $? -ne 0 ]; then echo "sshd:$ip" >> $deny; fi; done
RETVAL=$?
exit $RETVAL

Tuesday, July 12, 2011

The coconut

IMHO, a coconut is an example how amazing beauty can be hidden under ugly covers. Just to remain protected...
Photo: By Martyn Kimberley on flickr.com

Friday, May 20, 2011

Who needs audio/video Internet services when there is ffmpeg on Linux ?

So I joined ITWorx for eighteen days now, including weekends, and for the past two days I felt like I should have a special ringtone for my team lead. My mobile's ringtone is a builtin that is as old as the handset itself and I am not keen to do effort extracting it but it can be found on:
http://www.4shared.com/get/F97ZE-pN/Sooth.html

A few friends already liked it and asked me to send it to them but I always responded it is a builtin and I don't know how to extract it. Just now, a quick search on google using 'Sooth.aac' brought me to the link above.

Any how, let's get to the point. I usually watch NatGeo AbuDhabi and I wanted to have <NatGeo's Wild 2010 Preview> as a ringtone. Our TV set has horrible audio speakers, so I couldn't make head or tails of the preview except for the line saying "see what I see in the tree". With almost nothing from the lyrics, an English-language search on Google didn't help. So I searched in Arabic for موسيقى مملكة الغابة and I knew from Google's Ejabat that is a special recording by Viki Nova for Discovery Channel. With the artist's name at hand, things became really easier. Another search on Google using the string 'download viki nova discovery channel song' came with the comments on the preview as a youtube first result: http://www.youtube.com/all_comments?v=dr8DvDmzA6w

Watching the preview on a Linux means the .FLV file is saved to /tmp/FlashBlahBlah. Yes! all videos you watch on YouTube itself, not on another website embedding from YouTube, are saved to /tmp/FlashSomething with uppercase 'F' in Flash. All what I needed then was to convert the video into .MP3, rather than .OGG, so that my mobile can handle it. A final search on google using 'convert video to mp3' displayed free internet services. It took me two websites when I realized that such services are lame. Both clogged with ads and failing to render the .MP3 in standard or high quality I knew I had to resort to my OS.

Fortunately Al Hamdu Lellah, I had ffmpeg already installed. Fired:
 # ffmpeg -i InputFile -vn -ab 256 OutputFile.mp3

I then changed ownership of the file to a regular user and sent it via bluetooth to my handset. If you are so lazy to install ffmpeg and check the manual pages, then I am glad to tell you that:
-vn ==> disable video recording
-ab ==> audio bitrate

Now my team lead has a special tone on my handset. That's all folks...

Thursday, March 31, 2011

Tethering Nokia E51 to CentOS 5.5 on HP 6730s

According to Wikipedia, tethering is a method to share the Internet connection of an Internet-capable mobile phone. This sharing can be via cable, or wirelessly over Bluetooth or Wi-Fi — if Wi-Fi, the tethering feature is often branded as a mobile hotspot and can typically service several devices.

As a result of a sometimes slow ADSL connection, I decided to have my own mobile hotspot as a backup.

Indeed, mobinil offers a relatively acceptable plan of 110 MB / month for 20 EGP. Exceed your quota during the 30 day limit, and the speed drops AFAIK from 1.2 mbps to 64 kbps. After all, for me this is a good backup plan to accomplish quick logins and short browsing.

So, I went straight to Ovi store and downloaded Joikuspot Light edition 3.1. To have free apps downloaded to your PC, just click the app, then click `send to a friend` button. The address bar changes to something like `http://store.ovi.com/content/12345/send-to-friend`. Simply replace the in the address bar from `send-to-friend` to `download`. Anyhow, Joikuspot light edition was cool enough to get the job done and let my HP 6730s browse the Internet using my Nokia E51 as a hotspot. But I had one problem irritating me, the light edition provides no security at all. Your hotspot can not be renamed, you can not change the 802.11 channel, you can not use encryption and of course you can not choose encryption method accordingly.

Due to all these limitations and lack of hotspot and connection security, I decided to opt for the paid version of the application, Joikuspot Premium. Actually, the paid version is placed at suitable price, EGP 13 only. A combo meal from cookdoor costs more than the double of this figure :D .. Any how, the premium version had no limitations and provided 64-bit and 128-bit encryption. Trying to use either, the connection always failed. I was at odds of what is going wrong, despite providing the right key, the connection always timed out at stage 4 of 5 as mentioned in /var/log/messages.

Doing a somehow prolonged search on Google, I figured out it was my aging wireless Intel card driver causing the issue. Joikuspot creates the connection in ad-hoc mode and my driver fails to authenticate in this mode. I updated my driver from `iwl5000-firmware-5.4.A.11-2` to `iwl5000-firmware-8.24.2.12-1` and everything ran smoothly since then thanks to Allah.

To update the driver, I did the following:

1- Made sure I have the old driver package at hand, of course rpmforge repo was enabled at this moment:
# yumdownloader iwl5000-firmware-5.4.A.11-2.nodist.rf.noarch.rpm

2- Got the new driver package from elRepo:
$ wget http://elrepo.org/linux/elrepo/el5/x86_64/RPMS/iwl5000-firmware-8.24.2.12-1.elrepo.noarch.rpm

3- Removed the old driver:
# yum remove iwl5000-firmware

4- Rebooted, for that I was too lazy to find out what is a much less step to do. I speculate I could have just restrated the network, but no prblem. I am not so much into my laptop's uptime :D

5- Installed the new driver package:
# rpm -ivh iwl5000-firmware-8.24.2.12-1.elrepo.noarch.rpm

6- Restarted the network:
# /etc/init.d/ network restart && /etc/init.d/NetworkManager restart

Voila! A working backup, tethered, encrypted connection between:
A- Laptop:
H/W: HP 6730s with Intel Corporation PRO/Wireless 5100 AGN [Shiloh]
S/W: Centos 5.5 and NetworkManager-0.7.0-10

B- Mobile:
H/W: Nokia E51
S/W: Symbian S60v3 and Joikuspot Premium 3.1

Monday, March 28, 2011

Conditional Thinking

It has been long since I last wrote here, but I believe the idea I am about to discuss is worth highlighting.

After Jan 25 Revolution, I am having a new state of mind. It is refusing the conditional thinking. For many years, I have been doing many things without questioning `is it necessarily?`. I mean, for a very basic example, whenever you turn on both hot water and cold water taps, warm water should flow, right ?  ... Not necessarily! Many scenarios can take place. One of the taps may be broken, both may be broken, the heater may not be working, the water may be warm but carrying rust, water may be already cut off or indeed warm water may come out.. You name it.

My point here, these are two things interacting with each other based upon our action, yet the results are not guaranteed. What would you think of human beings interacting with each other, again, at a very basic level ?

If you scold me, there are many scenarios, I may ask you why you are scolding me, I may wait till you calm down, I may listen to your reasons, I may laugh, I may smile, I may scold you back, I may shout at you, I may cry, I may remain silent, I may ask people to witness your scolding, I may complain to other/s, I may officially escalate you, I may kill you, etc ...

Why stay limited to one option when there are many ?!?!

The next time you do a daily routine or interact with a beloved or someone you dislike, free your mind from memories of similar situations and become like a newly born, a vanilla-mind. Trust me, If (A), it is not necessarily (B). You will do better :) 

Tuesday, January 4, 2011

Download Now, Install Later

A quick hack to just download yum updates for a later install:


for i in $(yum list updates | awk '{print $1}' | grep -v ^* | sed -e '1,3d'); do yumdownloader $i; sleep 1; done

Of course you can put them all in one file and download without using for loop, but I didn't want to write any files to the hard disk. Also, you could have used $ yum check-update but I am more used to $ yum list updates.

Keep the system up to date ;)