One on One

One on One

The most important 1:1 meeting you can ever have, and you’re absent. We all know one-on-one meetings, I hope you do, it’s a meeting where you meet your superior at work, where they check up on you, talk to you, give you guidance, listen to you, and take your requests for consideration. The talk that grows you in your career and guides you around the challenges you’re facing at work. The talk that you feel safe having, I also hope so, because you know your superior wants what’s best for you, you trust them, you trust their experience and knowledge, and you trust that from above they see and listen a bit more than you, and can foresee things you can’t think of. ...

August 18, 2026 · 5 min · Abdullah Diab

In the celebration of 10M questions on StackOverflow

Who among us developers doesn’t know StackOverflow? If you don’t know it then there is a big chance you didn’t search for any programming related question in the last 7 years, so you either are doing a super great job, using a super old community of old school programmers, or actually didn’t practice programming for some really long time. StackOverflow reached more than 10 million questions, I won’t list those amazing numbers and statistics here, feel free to see them on StackOverflow’s 10M page, they are really great to read and to try to imagine them. I’m not going to talk about its history, the internet is full of those articles, you can read about it from Wikipedia or from its co-founder Joel Spolsky. I will talk about my story and how I see StackOverflow in this occasion, it’s my way of celebrating the success of this global platform, and the success of humanity there. ...

August 22, 2015 · 6 min · Abdullah Diab

Verifying User Input – Thinking Outside The Box

Now I’m not going to talk about user input validation, no that’s something that’s been covered a lot around the web, I’m going to talk about something else. Let’s imagine you are designing a game, where the user can create a puzzle, for example a maze, and you want to verify that what the user has input is a valid maze, that if played by another player that player will have a chance of winning it. Normally the solution that would come to your (and mine) mind is to try to solve that maze automatically – also we’re not going to talk about the different algorithms for solving mazes – but there is another way to do it that no one told us about in Algorithms 101! ...

July 31, 2015 · 5 min · Abdullah Diab

Using curl with Proxy PAC configuration files

curl is an essential tool that most developers use, it will allow you to execute a wide range of HTTP requests from your terminal, it supports using a proxy to execute your requests, but it does not support PAC configuration files. At my work I have to use a PAC file due to the large list of servers I’d interact with, and many would require me passing through specific proxies. It is a cumbersome process for me to memorize or try every URL I want to request and to identify which proxy to use, that’s why I wrote a simple perl script (yes perl not Python!) to help me with this issue. ...

March 16, 2015 · 2 min · Abdullah Diab

Joining Booking.com

After spending 3 years in Dubai and working at 2 different startups there, and after having worked at 5 different startups since I started working, I decided it’s time for me to move up and faraway from Dubai and startups, I started looking for jobs at big companies, Google, Facebook, Twitter, and got into a couple of interviews, and in the end I chose to go with Booking.com and I will be joining their team starting December 2014 as an IT Developer! ...

December 1, 2014 · 1 min · Abdullah Diab

Django Country Context

This module solves a small problem that can be found in many sites, where the website has to support multiple countries, e.g. e-commerce website with different stores for different countries, this module allows the developer to define a context per thread, this context holds all the information about the currently available country, and allows the developer to rely on the context always to get the current country instead of passing it through the different levels of code. This module is thread-safe, it defines a different context for each thread. ...

April 5, 2014 · 3 min · Abdullah Diab

How to make django management commands send errors email to admins

I usually use django’s custom management commands to do different tasks on the web application, most of the times with a cron job running those commands. The problem is that when you’re using a cron job, you won’t get the beautiful django error email when something goes wrong. ...

December 8, 2013 · 2 min · Abdullah Diab

How to make logrotate use SSMTP

A few days ago I was looking at my server logs, my website logs are more than a year old and growing, so I was reading some of them and wanted to download the old logs, truncate the logs, so that next time I read the logs I won’t have to look at very old data. So basically I wanted to rotate the logs and archive them, luckily logrotate is there to let me manage and administer log files in my system. It has a long list of features with a very easy configuration, so it was the tool I’m looking for. ...

December 8, 2013 · 3 min · Abdullah Diab

Adding a timestamp to command output in linux

This is just a quick solution to put a timestamp with each line of the output of some command in Linux (*nix). It’s a very simple thing, thought I’d write it down here so maybe it’ll help somebody some day. I have a cron job running on my server, it’s a high frequency job so I don’t want to send email reports each time, I’m logging it into a file, but I want to log the timestamp of each time it runs and logs something to this file, I didn’t want to change the code behind it to also print the timestamp with each write to the output, so I pipelined the command to a simple bash script that will append the timestamp to each line in the output then write the result to the stdout again. ...

February 13, 2013 · 1 min · Abdullah Diab

Get Pattern From an Image in PIL Python

Two days ago I needed to generate a PIL image that is made up from repeating a pattern – another PIL image – multiple times, I didn’t find a code online to do it so I just wrote this small code to do it, thought might share it to help somebody out there. ...

January 14, 2013 · 1 min · Abdullah Diab