Latest Blog Posts

Build 100% OSX 'compatible' quad core desktop with Intel i5 2500k and Gigabyte GA-Z68AP-D3

Hardware Components

How to switch between Dropbox accounts on same computer?

If you are like me and have multiple Dropbox and want to switch between them painlessly, here is a quick way.

Dropbox creates 2 folders on the location where you created your Dropbox. Eg, if you created a Dropbox folder in your home folder, you will find .dropbox and Dropbox.

Switch between Dropbox accounts

  • Quit Dropbox
  • Rename .dropbox and Dropbox folder
  • Relaunch Dropbox
  • Repeat the same for any other dropbox accounts you may have

Enjoy

Drupal6 - Programatically create new date type and date format

If you are working with code based deployments instead of using CMS to push out changes, you might have already implemented something similar.

There are 2 approches to implementing this:

1) Define and save date formats

function mymodule_custom_date() {
  $date_format_monthday = 'm-d';
 
  $format = array();
  $format['format'] = $date_format_monthday;
  $format['type'] = 'custom';
  $format['locked'] = 0;
  $format['is_new'] = 1;
  date_format_save($format);  
 
  $format_type = array();
  $format_type['title'] = 'month_day';

CodeLobster PHP IDE for Drupal development

I received an invite to review CodeLobster - A new, feature rich, PHP IDE on the scene with very good support for Drupal and Wordpress among other CMS and Frameworks.

As a Drupal developer, the focus of this short introduction will be Drupal integration (obviously).

Among standard CodeLobster IDE features (free version), it has some very interesting support for Drupal development (pro version), one of the things many find lacking in many IDEs is out of the box Drupal support for Auto complete, API integration etc.

GIT Automatic Commits using Cron

most of the time you want your commit messages to be meaningful, neat and sweet message. Sometimes you just want to commit like crazy - more as a backup process.

So, if you ever find yourself in a situation where you must commit automatically, here is how to do it with cron:

Setup Cron

crontab -e

Crontab Command

*/5 * * * * (cd /path/to/myproject && git add . && git commit -m "Automatic Commit")

Done. Happy coding.

SpiderOak - empty the upload queue from the command line

Being a fan of all things security, I recently started using SpiderOak for my secure cloud storage. The service is brilliant but I came across a few issues, one of which is quite a bug one for me.

Suppose in the heat of the moment you decided to upload/backup a large folder/file but only to change your mind. There isnt a neat GUI solution that will cancel the upload process. Hopefully SpiderOak will fix this in the next release, in the meantime here is how I managed purge upload queue it on my mac:

Pause all uploads

well, hit the 'pause all uploads' button in the status tab

Dropbox Encryption - Install EncFS on Linux to encrypt-decrypt Dropbox content realtime

If you are using Dropbox, it might be worthwhile installing some kind of encryption to secure and protect your data. It is fairly easy if you are using Linux.

Install EncFS

sudo yum install fuse-encfs

Setup the encryption and decryption paths

encfs ~/Dropbox/encfs ~/Documents/encfs
The directory "/home/janaksingh/Dropbox/encfs/" does not exist. Should it be created? (y,n) y
The directory "/home/janaksingh/Documents/encfs" does not exist. Should it be created? (y,n) y
Creating new encrypted volume.

Dropbox Encryption - Install EncFS on OSX to encrypt-decrypt Dropbox content realtime

If you have been following the recent Dropbox news, you might have some serious concerns about privacy and security of your data. If, like me you do not "trust" anyone with your data, here is a quick guide to how you can get started with EncFS for realtime -on the fly- encryption of your dropbox contents.

wait... BUT..... what is EncFS??

Rsync to OSX with foreign letters in filenames - delete copy loop

So, you have a few files with foreign letters in filenames and you back them up using rsync. All is well unless you rsync from a linux machine to OSX machine. It seems OSX handles UTF-8 characters in a custom way - using 3 bytes.. hmm.. so:

Linux -rsync-> OSX

  • First pass: rsync from linux to OSX and all files appear to be copied
  • Second pass: rsync deletes the files on remote OSX server and copies them again
  • Third pass: same as above

Rsync on OSX - Upgrade to version 3x

OK, OSX is a "good" operating system and I use it among win7 and centos BUT there are a number of things that annoy me from a geek perspective. One of them is outdated versions of various packages - in this case Rsync.

By defaut, OSX 10.6 ships with version 2.6.9 - which for most basic taks is "fine" but if you are rsyncing files with international characters in filename from a linux you need to use iconv option with rsync, more about that in this post.