cat /var/log/auth.log

Couple of days ago I was discussing with one of my coworkers whether we should expose SSH for our local development machines on default port (22) or pick another random port. Why pick another port? Theoretically it could help staying a bit away from open port scanners bots, those who only look for most common ports, but it can’t help if a bot decided to brute force check for open ports. I have an always on Raspberry Pi hooked to my home network and exposes ssh default port publicly, so I thought I would take a look on ssh logs to see what I can expect.

Quick look through logs I found couple of failed login attempts, and though I had already disabled password logins and went for using keys, I freaked out a bit. I greped all successful logins from public IPs and made sure they all made sense. Once I was sure that everything was ok, I started analysing failed logins. I found 3298 failed login attempts since I brought up the pi – which was about a month ago – and was curious what can I get out of this data.



Looking at this chart, bots seemed to try for a day or two then take a rest in the other and so on.

I was also interested in when the scans peaked, and there seems to be some correlation between my internet usage times – especially my torrent download times – and scans peak. I would guess some websites and torrent trackers scan the IPs that reach them.


Then here comes the time for pointing fingers. I grabbed countries free GeoIP database from maxmind, and analysed which countries have most bots. Mother Russia took the first place, followed by Murica then China China China.


But what were they trying to do to get in? Some bots tried to get in with popular usernames couple of times, probably with different passwords, others would only try every username once or twice, and some would mix between the two methods. Looking at what usernames they were trying, admin seems to take the first place, followed by user and test. I was expecting to find root at the top, but surprisingly no bot tried it, but at least ubuntu took some credit.

What to learn?

I must never ever expose ssh or any other port without making sure it’s well secured. Also probably I will stay away from using admin, user and test. I should also rate-limit connections to throttle the brute force scans from the same IP. Though still not sure if changing the port would be useful or not.


P.S. If you’re interested in having a look on logs data, you can view it here.

TODO Internship Cover 2016

TODO: Get An Internship – The Session

Here is to another year, another internship and a whole new awesome adventure. This summer I was interning in Google too, but guess what? This time was in Google’s headquarters in Mountain View in the heart of Silicon Valley. Now I can add North America to the list of continents I’ve been too, in addition to Europe last year. And fortunately I was blessed again by meeting awesome new friends in my journey, and also meeting some of my awesome friends from my last internship in Krakow.

Realizing how important internships are, both on technical and personal levels, We are trying our best to spread this idea and do what we can to get more people to apply for internships and hopefully nailing one. So this year, in collaboration with two of my best geeky friends (Ahmed Kamal and Ahmed Mohsen) and acmASCIS student chapter, we prepared a session that made my last year blog post come to life and we tried to reach more students and encourage them to apply.

Ahmed Kamal, Ali Essam, Ahmed Mohsen

Ahmed Kamal, Ali Essam, and Ahmed Mohsen. TODO Get An Internship Session Presenters.

This post is going to be a follow up on my last year blog post and the session, so if you didn’t read that post before, make sure you do before continuing on.

Continue reading - Online Compiler and IDE    C C++, Java, PHP, Python, Perl and 40+ other compilers and interpreters (1)

TODO: Get An Internship.

I’ve just finished my internship with Google as a STEP intern few weeks ago and I thought I’d like to share this experience. I worked for 3 months in the beautiful city Krakow, and I guess this summer was the best in my life, both on the technical and non-technical side. It was my first internship, my first time in Europe, my first time to meet such cool people from different countries, and I had the best group of friends there (Google Krakow Interns).

On the technical side, I got to work with Google engineers, learnt a lot from them, and I got the chance to experience the powerfulness of Google’s infrastructure. You get treated as a real engineer, maybe with less responsibilities, but you get to use the same tools, work on the same code base, see your changes go alive in Google’s products…., you just get to live the life of a Google engineer for three months plus the extra fun for being an intern. I might not be the best to talk about internships, since I only got only one internship till now, but I thought I’d like to share my experience with you. Continue reading

Start using TopCoder Arena (Practice Problems and SRMs) + KawigiEdit Plugin

In this quick guide i’ll try to explain the following :

  1. Setting up the Arena
  2. Setting up KawigiEdit Plugin (Very Useful)
  3. Practice Problems in previous SRMs
  4. Joining Active SRMs

Setting up the Arena :

  • First you have to have JRE (Java Runtime Environment).
    you can Download the latest version from here
  • Download the TopCoder Arena from here
  • It’s preferred that you move the downloaded file to a folder of its own.
    lets call it “TopCoder Arena”.
  • Click on the file to Launch The Arena.
  • Enter your TopCoder Handle (username) and Password.
  • You should see the following Screen if you logged in correctly
  • We’ll get back to how to use the arena.

Continue reading

Registering on TopCoder (Step by Step)


In this guide, i’ll explain a step by step how to Register on TopCoder for Algorithm Competition Specifically.
(click on images to view larger version)

  • First : Open topcoder website
  • Click on the Register button at the top right.
  • Check on TopCoder
  • Fill the form like in the image
    (fields without star is not necessary, you might leave it blank)
    for the zip/postal code , you might write any 5 number digit if you don’t know yours🙂
    Click Submit and continue to next form
  • Fill in the next form like in the image below
    Check ACM from the clubs section
    To select school click Choose School
    in the new form write your school name (“FCIS – ASU” for example)
    click on select and return to the previous form, and click submit after filling all the information
  • Now there will be a form that shows you your data for confirmation, click submit and continue.
  • Now, you’re almost finished.
    TopCoder will send you email with the Activation link
    Click on it.
  • Login to your account with your username and password.
  • Congratulation , you’re done.


I’ll try to make another tutorial ASAP on how to submit problems on TopCoder and how to use the arena.

Cout (Print) Special Unicode Characters in C++ Console


Sometimes you need to print some special characters in c++ console ,mostly in games.

You can easily print special characters using simple cout statment

cout << “\u2658”;

this prints the white horse symbol ♘ .

all you have to do is to change the code after \u with the unicode character code.

you can find a list of unicode characters codes here

or here

you can test a live example here on ideone

References :

Fix UVA too many redirects on chrome

Uva Online judge sometimes results into too many redirects on chrome browser because of some problems with cookies.


To solve this you need to delete any cookies related to the online judge.


  • from the top right menu open Settings.
  • Scroll down and click on “Show advanced settings…”
  • Privacy > Content Settings.
  • All Cookies and Site data.
  • Search for “judge”.
  • Delete any Cookies related shown in the results from the x button right to the cookies.

and now you are done, Open UVA and log in and continue your UVA life normally.


Ubuntu LogoAlthough I use Mozilla Firefox more than I use Google Chrome, the latter does come in handy when testing how websites display on a different browser or when there is need to diagnose internet connectivity problems. On Windows, Google Chrome is fast; perhaps even faster than Mozilla Firefox. However, on Ubuntu 9.10, I have noticed that it can be a little slow to initiate or even load a simple web page. In an effort to find a solution to this problem I stumbled across quite a few user-submitted posts that described a simple fix. After applying the fix, there was a significant improvement. Read on to find out how you can speed up Google Chrome on Ubuntu.

Apparently, the slow response of Google Chrome on Ubuntu has to do with the slow DNS lookup of this browser. These instructions should not be limited to Chrome on Ubuntu 9.10 alone…

View original post 96 more words

Fix Keyboard freeze after Suspend on Ubuntu

The keyboard freezes after waking of the suspend on Ubuntu.

This problem happened to my Vaio VGN-CS118E.

Solution Steps :

  1. Open the Terminal
  2. Install GRUB Customaizer
    sudo add-apt-repository ppa:danielrichter2007/grub-customizer
    sudo apt-get update
    sudo apt-get install grub-customizer
  3. Run it through “grub-customizer
  4. It will show you all the grub entries on you system. Right click on the latest kernel (Ubuntu, with Linux 3.2.0-38-generic-pae ex.) -> Edit -> Source
  5. add ” i8042.nopnp noacpi nolapic atkbd.reset ” to the end of the line that starts with “linux”, just after “quiet splash ” and before ” $vt_handoff” .
  6. it should look like something like this “ linux /boot/vmlinuz-3.2.0-38-generic-pae root=UUID=82f1583d-9f71-442d-a72b-cbff510da779 ro quiet splash i8042.nopnp noacpi nolapic atkbd.reset $vt_handoff
  7. Press OK and Save
  8. Restart your laptop

Now try the keyboard after suspend.

This solution worked for me ,hope it works for you to.

Solution provided by : Ahmed Toulan

References :