Report inadequate content

Tricks in Harecoded

7/05/2016

How to backup Flickr into Amazon S3/Dropbox/Google Cloud/Drive...

The following recipe is an easy way to get your full Flickr account backed up in Amazon S3 or similar cloud storage.

Unless you have a really good Internet connection at home or you are doing a backup of a small library the first thing to do would be to create a machine in the cloud, such as Digital Ocean or Amazon EC2 so you can have a high throughput. Once the process is...

18/10/2014

OS X renaming using parameter expansion

When it comes to rename files via command line there is no rename utility under OS X without installing Homebrew. But I still never needed to install it since there is a lot you can do by just making use of the shell parameter expansion.

The parameter expansion allows you to manipulate variables in a very convenient way and when mixed with the mv command you have an...

10/12/2013

Organizing git branches in logical folders

It is easier to find things when they are well organized. If you are a git user a good practice to name the branches would be to use descriptive names including slashes "/" (as in paths) where everything before the slash is the folder you want to use and then the logical name after it.

If you use the fantastic git graphical interface SourceTree (free for Windows and Mac)...

23/11/2013

Kill processes using string search

A lot of Linux distributions (and Mac) come with a handy command named pkill installed by default. This command is very useful to kill processes in a more natural way.

Instead of doing a kill/killall based on the ID of the process or the binary name, you can just pass a string that appears in any part of the process list, including the parameters you used to start a...

16/09/2013

Force kill of processes in Windows

Sometimes Windows Tasks Manager is not able to kill an in-memory process. We try to close it several times with no luck :(

For these frustration moments we can make use of a console command named TaskKill

With TaskKill the pain ends simply with:

taskkill /IM filename.exe /F

More info about taskkill: http://technet.microsoft.com/en-us/library/cc725602.aspx

25/06/2013

Finding abusers. List of most frequent IPs in Apache log

Internet is full of malware and people with leisure time who will hammer your server with no good intentions, most of them will try to access well-known URLs looking for exploits of software like Wordpress (/wp-admin.php, /edit, etc...).

If you monitor for a while your access_log it's easy to find out unwanted behaviour. If you want to get a list of the most frequent IPs in...

7/06/2013

Converting a CSV to SQL using 1 line in bash

The command line is very powerful and can do amazing stuff in one single line by pipelining a series of commands. This post is inspired after creating a line that mixed sed and awk, but with just only awk I'll show you an example on how to convert a CSV file to an SQL insert

Let's take an input CSV named events-2013-06-06.csv with 16 columns per line. It looks like...

25/02/2013

Mails perdidos en Gmail por redireccionamiento [Solucionado]

El problema

Seguro que no soy el único que tiene más de una dirección de correo electrónico. En muchas ocasiones, por orden o por practicidad, configuramos nuestras múltiples direcciones de correo electrónico para que podamos recibirlo en un mismo buzón.

Cuando alguna de esas direcciones está configurada en Gmail, en ocasiones, podemos experimenter pérdida de...

2/02/2013

Apache RewriteCond -f check file exists solution

If your Apache virtualhost or htaccess configuration uses a rewrite condition (RewriteCond) in order to allow nice URLs, you should be aware that since Apache 2.2 the "check if file or exists" works a little bit different. Any of the following examples might have stopped working for you:

   RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
       ...