How to fix grunt error “Cannot find module ‘lru-cache'”

To fix this error is very simple: you just have tot clean your node modules:

$ grunt install:development
Loading "Gruntfile.js" tasks...ERROR
>> Error: Cannot find module 'lru-cache'
Warning: Task "install:development" not found. Use --force to continue.

Aborted due to warnings.

john@C370012100004 /C/projects/nodejsp(develop)
$ rm -rf node_modules && npm cache clean && npm install

How to edit the hosts file on Mac OS X

The hosts file in a computer represents a simple plain text file, where are mapped hostnames to IP addresses (wiki).

To edit this file on Mac OS X is a very simple task:

  • Open the Terminal.app 
    (using Spotlight : command + space  – and then write terminal)
  • Edit the file /private/etc/hosts
    (you can use vim or nano …. ex: sudo nano /private/etc/hosts)
  •  Add the new map:
    add at the end the new map you want : ex: 127.0.0.1         new.address.com
  • Save the hosts file
    save the file with the new map

If you want that your change to take place immediately, run the following command:

  • dscacheutil -flushcache

Now you can test the new mapping.

How to generate an openssh-key from a key generated by putty? (on Debian)

This was the problem that I faced these days; and the answer to it is very simple

First thing you have to do is to install putty tools in linux :

$app-get install putty-tools

Then, just generate the new private key, using puttygen program

$puttygen putty-generated-key.ppk -O private-openssh -o openssh-key-name

You see, everything is very simple.

Also, if you want to generate the public key, you can use the following command:

puttygen ‐L putty-generated-key.ppk >> authorized-key-location/public-key.pub