Hello, my name is Daniel, and I make things! Join me in this exciting journey exploring the world of computers and electronics


Virtualmin: Backups to Google Cloud Storage

Virtualmin plus Google Cloud Platform

For a while I have been running a few websites using Virtualmin under CentOS. It’s a great free Web Hosting Control Panel application that helps you to manage your server without having to do it manually. It contains Apache, MySQL, proFTPD and much much more.

As I am a backup freak I have been backing up my server to Amazon S3 for a while. Amazon backups costs around $0.03 per GB, not that bad, but a few months ago I switched to Google Cloud Storage which has a technology called Nearline costing only $0.01 per GB (yes, 1/3 of the price!). The only disadvantage comparing to S3 is that the files retrieval takes a few seconds instead of milliseconds, as I am not serving this file on websites, and I really don’t mind waiting a couple secs to have the download link ready.


Script to Organize Dropbox’s Camera Upload folder

Dropbox has a great feature called Camera Upload, where you can automatically upload pictures from your phone, making life for lazy people like me easier. The problem is that I take so many pictures with my phone that the folder ends up with a huge amount of files, making the task of browsing and viewing them slow and annoying.

To fix this problem, I created a python script that will automatically organize pictures inside folders Year > Month.

DropboxCameraUpload

How to use:

In order to use the script, put the file organize.py inside the ‘Camera Upload’ folder and run it from the terminal:

python organize.py

Enjoy!

Code:

😉


Mounting a Filesystem via SSH on OSX Mavericks

fuse SSH’ing to a server and doing all the configuration through terminal is easy and very fast, but when you want to edit files and set a remote development environment on your local machine, mounting a remote filesystem over ssh and editing them as the files were in your computer is the way to go.

Right now I’m using the just released OSX Mavericks (OSX 10.9), so for mounting a remote system you will need to do some tricks and tweaks to have it working. I will try to explain step-by-step on how to do it.


Script for Organizing Bitcasa’s Upload Directory

Bitcasa is a great option for everyone who wants to backup a big chunk of files. You have unlimited space to host your files, and it also works as an external drive. I can say it works alright, but it is still a bit slow and there is still a lot of work to be done in order to be as good as its competitors, such as Dropbox.

With the last iOS update, you are now able to backup all of your phone’s pictures directly to the Bitcasa Upload folder. It’s great and works very well BUT the problem is that after a month of uploads, the folder is packed with more than a thousand pictures, which makes it extremely slow to function (because it’s all in the cloud). So I made a small python script to automatically organize the folder by the time it was uploaded, creating a folder like /Volumes/Bitcasa/Uploads/2013/Aug and it moves them to those folders.

Below you can check out the script, hope it helps!


PicPlz Python Backup Script

So long and thanks for all the fish!!!
PicPlz is going down, I guess that soon they will allow users to download their pictures before all is wiped off their data centers. While we wait, I’ve created a simple Python Script when entering the username you can download all the photo stream.

You get follow the project on GitHub


Distance of two Geo-Points in PHP & Python

I needed to calculate the distance between two Geo-Points using PHP.

Using Haversine formula you get to this function, where you enter lat1, long1, lat2, long2 and it will give the distance in Km.

In case you want to show the distance in Miles, simply change the Earth radius to 3956.

PHP:

Python

Hope it helps someone!


My new PicPlz Gallery



Yesterday I was playing with the PicPlz API and decided to build a gallery for myself, so I can simply see all my PicPlz pictures in one page, and with the coolness of FancyBox.

You can also use to create your own gallery, simply by going to http://www.danielandrade.net/picplz/?u=USERNAME, changing the USERNAME to your own. And then you have it.

Ah, take a look at my gallery here.

Hope you like it, and use it!!
Let me know what do you think of it.
🙂


Dotklok + LM35 Temperature Sensor

I got my Dotklok up and running some days ago, I am really enjoying it on my room.
But I want to do more with it. Too bad right now I don’t have much time to play with electronics and build cool things.

Anyway, today I decided to spend some time learning the Dotklok’s code and add a temperature sensor to it. The result was really cool, and now I am sharing the bit of code I added to the clock.



HowTo: CSS Refresh for Mozilla Firefox

When developing new websites, one of the worse things is that you always have to refresh the whole page to see some minimal changes made on an external .css file. Sometime ago I have found one small peace of script that forces the website to just update the CSS code.