Latest Blog Posts

Move Hibernate File on OSX to free up some SSD or HDD space

Another space saving tip for those of you who are running out of space on your Mac SSD or HDD.

For this to work you need 2 drives (ideally internal ones). I have a MacBookPro 15 and removed the DVD bay to fit in SSD + 1TB HDD.

What is this "Hibernate File" and why would you move it?

Without going into too much boring details, it is a file where your Mac will dump the memory contents when the battery completely runs out. The contents of this file are restored back into memory when you re-plug your charger.

Disable Time Machine Local Backups in Mac OS X Lion & Mountain Lion

OSX Lion introduced "Local Backups" or "Snapshots". This feature happens to kick in when the TimeMachine drive is an external one. This is great because TimeMachine can still maintain a backup whilst the external drive is unplugged. However, for those of us with 128GB (or smaller) SSDs it eats up the precious free space.

If you happen to be running out of space, here is how you can disable this feature (without disabling TimeMachine completely)

Disable Local Backup on Lion and Mountain Lion

Postbox forcing discreet GPU (GeForce GT 650M) usage on MacBookPro - fix

Postbox is a great mail client based on Thunderbird. I switched to it a few months ago, but I soon realised that it has a nasty habit of forcing the Discreet GPU on my MacBookPro (which eats up more battery power).

Does a mail client NEED more than HD4000 GPU? If so, WHY??

Apple documentation provide a detailed technical article into "Allowing OpenGL applications to utilize the integrated GPU" here: http://developer.apple.com/library/mac/#qa/qa1734/_index.html#//apple_ref/doc/uid/DTS40010791.

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.