Recovering MondoDB from an unclean shutdown

If MongoDB is refusing to start up and you see this message:

**************
 old lock file: \data\db\mongod.lock.  probably means unclean shutdown,
 but there are no journal files to recover.
 this is likely human error or filesystem corruption.
 found 1 dbs.
 see: http://dochub.mongodb.org/core/repair for more information
 *************

… see the instructions pointed to by the suggested URL.

Try starting up with the –repair option. When it completes, restart the server process as normal.

If you have the ‘probably means unclean shutdown’ message, remove the mongod.lock file by hand and then restart with –repair

SSLProtocolException in SE7 & SE8: “handshake alert: unrecognized_name”

Caused by: com.sun.jersey.api.client.ClientHandlerException: 
javax.net.ssl.SSLProtocolException: handshake alert:  
unrecognized_name at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle (URLConnectionClientHandler.java:151) 
at com.sun.jersey.api.client.Client.handle(Client.java:648) 
at com.sun.jersey.api.client.WebResource.handle(WebResource.java:680) 
at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74) 
at com.sun.jersey.api.client.WebResource$Builder.post(WebResource.java:5 68) 

This exception is from an SSL check in SE7 and above that checks that your SSL certificate matches your domain name. For development, if you’re using a self-signed SSL certificate for testing which does not match your domain name, you can turn off the check and ignore the error with:

-Djsse.enableSNIExtension=false

WordPress Permalink formats

Having just moved my WordPress blog to OpenShift, it’s amazing how many settings apparently I had tweaked and customized on my previous site. I just followed a Google search link to one of my own posts and got a 404, and realized that the link format to my posts had changed.

I used to have links like /year/month/day/postname and now only URLs that looked like ?p=number. The first format is one of the Permalink formats. You can customize this in Settings/Permalinks. More info here.

Useful Photoshop Elements shortcuts and tips

Cmd-T : resize current selection

Cmd-I : inverse mask selection

Copy mask to another layer: Cmd-click a mask to select (the mask outline in the layer view). Copy, select other layer, paste.

x – toggles foreground and background colors.

b – select brush

[ ] – increase / decrease brush size

This series of tutorial videos is probably the best I’ve come across so far, very clearly explained.

The best tip ever for layer masks! : “White reveals, Black Conceals”