Compile Nodejs Code Using Bytenode

Bytenode is a library you can use to compile your Nodejs source code into V8 Bytecode. The steps are fairly simple.

Step 1: Install Bytenode globally

sudo npm install bytenode -g

Step 2: compile your js file

bytenode --compile app.js

It’ll produce an output file app.jsc

Step 3: Install bytenode inside your project

npm install bytenode --save

Step 4: create a launcher file launcher.js and require bytenode inside it.

require('bytenode')

Step 5: Require the app.jsc file inside launcher.js

require('./app.jsc');

That’s it, now run launcher.js and it will work just like before. Deploy it wherever you want without worrying about the source code.

Batch rename files in Nautilus

Nautilus offers an easy way to batch rename files. I used to do this using some bash script, until I’ve recently discovered this. It’s pretty straightforward.

Go to the folder which contains the files you want to rename, and select  those files. Then right click and select rename, as you would do for a single file.

‘Rename using a template’ is the default option. Add an optional prefix, and then click Add button next to the text box. Select a pattern here, for example 1,2,3,4.

Now click rename. Your files are now renamed to n1, n2, etc.

Now, in this example, the extensions are ‘JPG’. I want to change it to ‘jpg’ for all the files. For this, use the ‘Find and replace¬† text’ option.