Coding Problem - Phone List

Given a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. Let’s say the phone catalogue listed these numbers:

Emergency 911
Alice 97 625 999
Bob 91 12 54 26

In this case, it’s not possible to call Bob, because the central would direct your call to the emergency line as soon as you had dialled the first three digits of Bob’s phone number. So this list would not be consistent.

Amazon Glacier Interface

Amazon Glacier is an archive/backup service with very low storage price. However with some caveats in usage and archive retrieval prices. Read more about Amazon Glacier

I used a couple of utilities on linux and windows in the past for uploading data to Amazon Glacier servers, though I haven’t tested this on Windows, I don’t see any reason for this not to work on Windows.

I needed a tool that will make this easier to do so from the command line, that should work on Linux/Windows, and support some of the metadata from other tools. Also the tools I was using were good but none of them meet all my needs so I decided to write my own.

So I want to introduce a glacier interface for Linux a command line tool to interface with glacier.

It’s a multithreaded application, that supports multipart uploads to Amazon Glacier servers, you can specify concurrency, to speed up the upload.

Git delete a remote/local branch or tag

A lot of people keep asking me on Skype or chat how to delete a remote branch/tag in git, so I decided to put it in a nice little article, so I can refer it to them. If you want to delete a local tag then you would do git tag -d <tag name> But if you want to delete remote tag, then the syntax is a little different

fail2ban for Wordpress and Plesk

I’m hosting quite a bit of pages that run WordPress, and one of the biggest problem that I ran into is that people don’t keep their WordPress or plugin installations updated.

I gave up on having everyone upgrade, because they all use different plugins, customized plugins, and a lot of other stuff that will break if they upgrade.

So here comes fail2ban to the rescue, we can use it to go through the logs, to configure the system to ban the users when they fail to log in, or do some bad stuff, or try to brute force their way into the wordpress installation, either through the login form or through xmlrpc.

Interview question - About arrays

I had an interview for a job, and one question they asked was how to do something in a language I’m comfortable with.

So I told them what language would they like for me to give them a solution, I said I can do it in Java, PHP, C/C++, …, and they said that it’s not a problem, they understand everything, doesn’t mater which language it is written in, if you want to know the difference read bellow in the PHP section.

Getting started with gradle and java

I always used ant with Apache Ivy or maven to build java applications, so I thought there has to be something better and easier to build the application instead of using them. So I decided to give gradle a go.