Riak backup and restore using defaults

To back up:
riak-admin backup riak@ riak /tmp/rbak.dat

To restore:
riak-admin restore riak@ riak /tmp/rbak.dat

If yo run into the following error, make sure riak user has the right permissions. Or just use a tmp directory.

{“init terminating in do_boot”,{{badmatch,{error,{file_error,”/root/rb/rbak.dat”,eacces}}}


Riak – CentOS 6 – Cannot connect remotely even after opening firewall

Just update riak.conf and change listener to from

Windows ICS with Router as AP

Two ways to do this. You can connect your router’s internet / wan port to your PC lan port. Make sure router gets its IP by DHCP (from ICS), which is the default for a router. Then enable ICS on the Wifi adapter. Only issue with this approach is it creates double NAT. That should not be an issue for most. Anything that connects to router will have an IP like 192.168.1.X, which will be assigned by the router’s DHCP service, not ICS’s DHCP. ICS’s DHCP will give an IP address to the router, not to the router’s clients.

If you don’t like double NAT, just set your router to a static IP like and disable router’s DHCP. Then connect a lan port from router to the ICS PC. Now anything that connects to router will get an IP assigned by ICS and will be able to access internet via ICS.  Anything that connects to router will have an IP like 192.168.137.X.

If you don’t like ICS due the need for a PC running all the time, you can use two routers. One router will bridge to a Wifi using dd-wrt. The other router will connect its internet port to lan port of the bridge router.

You can use either Client or Client-bridge mode with dd-wrt. Client mode is better since you get a firewall with it.

Mac OS X “/usr/local must be writable!” – Brew Update failed

Just do a chown.

sudo chown yourUserName:admin /usr/local

Target.com script to open your gift card history

Target.com gift card page in your account lists the individual gift cards. You can’t open them in a new window by right clicking since the url is generated on the click of a link. Use the following script to open all your gift card details in new windows.


Target.com Giftcard Autocomplete script

I often get a bunch of gift cards from Target.com but it needs me to enter the name and email for every on them. That is a pain and takes lot of time. You can open your browser console and execute the following scripts to auto complete the gift card fields:


If I get some free time, I will create a Chrome extension to make this even easier.


Free SSL Cert from StartCom for Google App Engine

You can get a free domain level (DV) cert from startssl.com and then use it to secure your Google app engine site. For details, go here: https://cloud.google.com/appengine/docs/java/console/using-custom-domains-and-ssl

Google App Engine deploy error: Error when loading application configuration:Unable to assign value ‘1.9.31’ to attribute ‘version’:Value ‘1.9.31’ for version does not match expression ‘^(?:^(?!-)[a-z\d\-]{0,62}[a-z\d]$)$’

This is a bug in app engine maven plugin. In your pom.xml, rename appengine.version to appengine.sdk.version. More on that here:


IntelliJ and Maven- Auto deploy static files

Doing a deploy just to refresh the static files is a time consuming process, which is usually the case if you have a maven WAR project running from IntelliJ. Every time you update a static file like ‘.js’ or ‘.css’ file, you have to do a deploy for the changes to reflect in browser. A quick work around would be to ‘Make’ the project (Ctrl+F9 in Windows) and enable the ‘build on make’ checkbox for ‘exploded war artifact’ in project structure settings.

Google App Engine – Eclipse plugin issues

When you start with a maven project and import that into Eclipse, you might run into issues while importing. You might get An internal error occurred during: “Updating Maven Project”. java.lang.NullPointerException right after you do a maven import. If that is the issue, make sure you have installed the “appengine m2e plugin” and the App Engine SDK. Then delete your .metadata directory and .project file. And redo the import. This time it should take more than a minute as Maven starts downloading all the required dependencies.

Then you should be able to import the project without errors and run the project by right clicking and selecting ‘run on server’ -> ‘Google App Engine’. If the project didn’t import correctly, you might get Error: Could not find or load main class com.google.appengine.tools.development.DevAppServerMain error. More on that here. Just repeat the above steps to fix the error.