My Octopress Blog

A blogging framework for hackers.

Build Base Box Vagrant Ubuntu Oneiric 11.10 Server

Virtual Machine (VM) is good solution to handle several different environment of applications. All my server working on Ubuntu Server with different version. At this point, virtualenv and RVM still doesn’t enough for me.

So I use Virtualbox and install several Ubuntu Server version. Then I hear about Vagrant which a great tools for managing Virtualbox VM. Using Vagrant, we can run VM without execute Virtualbox because it running on background. This is what i want!

I will explain my steps bundling Ubuntu 11.10 into Vagrant box and run it.

1. Create Ubuntu 11.10 VM on Virtualbox

Create new VM with name “vagrant-oneiric” and start install Ubuntu Server 11.10. In this steps, I disable USB and Audio which not used in Server. Also, I set Video size to 4MB only which server doesn’t run GUI.

2. Installing Ubuntu 11.10

Because we will use Vagrant, then we should follow standard convention here. Make sure you setup this :

hostname : vagrant
username : vagrant
password : vagrant

Also, you must install OpenSSH-Server packages.

Github Custom Domain With Octopress in Ubuntu Oneiric 11.10

In previous, I have posted about Octopress installation in that only works in Ubuntu Natty 11.04. Use my previous post on Ubuntu 11.10 Oneiric will make several problem. This is because rake and liquid version that little buggy.

Here are the steps to build Octopress on Ubuntu 11.10 :

1. Create github repository


As described on Pages github, if we want host our sites then we should make repository username.github.com.

So, i log into my Github account and create repository yodiaditya.github.com

2. Know how it works


Github will detecting and create pages automatically after we create username.github.com repository (take several minutes). To make it’s works, we should have conditions :

1. Pointing Our Domain into Github
2. Using CNAME files for set our domain name into github
3. Creating .nojekyll files for telling Github we use another engine

Top Javascript Checker Tools That Must Used by Front-end Developer

Many front-developer (like me too) always create & editing many Javascript codes everyday. Maybe we not Mr. Crockford who knows Javascript deeply and make several mistakes on development. Actually, we can increase our Javascript knowledges by using this several useful tools.

I will introduce several tools and their installation on Ubuntu 11.04. Several of them working with VIM (my favourite editor) and have plugin. All of this tools can execute from commandline.

Run Nodejs & Nowjs as Sub-domain Port 80 With Haproxy Websocket Ubuntu

Running NowJS on port 80 in sub-domain is the best way to make our chat application works in every environment. We know some “draconian office” only open port 80 & 443 for internet access. By using HAProxy, we can redirect NowJs apps on port 8003 to 80 on Sub-domain.

In this example, i have NGINX run on port 81 and nowJS on port 8003. My chat homepage located in http://www.obrool.com which rely on NGINX port 81. My nowjs apps (8003) will pointed into http://chat.obrool.com on port 80.

Run NodeJS in Ubuntu 11.04 EC2 With User Permission and Run as Service

In this post, i show you how to install & run NodeJS in Production Mode without ROOT permission. I make this runing and tested on Amazon EC2 on Ubuntu Natty 11.04. I user user permission NodeJS installation on [my NodeJS how to installation] (http://yoodey.com/how-install-nodejs-ubuntu-natty-1104-and-start-learning)

Set environment

Our node is installed on ~/local/node. We will make this also can be accessed in GLOBAL environment. My home path is /home/ubuntu.

Easy Steps Migrate Wordpress Contents Into Markdown - Jekyll

Here are straight-foward steps for migrate contents Wordpress into Markdown :

1. Installing dependencies

Liquid error: undefined method `join’ for #<String:0x000000017063a8>

2. Installing GEM dependencies

Liquid error: undefined method `join’ for #<String:0x00000001704df0>

3. Running

Liquid error: undefined method `join’ for #<String:0x00000001703ef0>

Inspired from this article

Install Octopress and Use Custom Domain Hosting on Github.com

Updated!

I post [Octopress Installation on Oneiric 11.10 due to several problems] (http://www.yodi.me/blog/2011/10/24/github-custom-domain-with-octopress-in-ubuntu-oneiric-11-dot-10/)

Hearing developers using Jeykll and Github for hosting their site, i spent a day to learn how to make it. So, finally i make my site host on Github.com & using Octopress (Jeykll based Framework). Why i use Octopress ? Because i don’t want too much code from scratch.

In this example, you just rename username with your github username. Let’s play!

1. Create github repository

As described on Pages github, if we want host our sites then we should make repository username.github.com. So, i log into my Github account and create repository ”yodiaditya.github.com

On my localhost / laptop i create my repository folder. For example, i create my repository on ~/htdocs/.

2. Know how it works

Github will detecting and create pages automatically after we create username.github.com repository (take several minutes). To make it’s works, we should have conditions :

  1. Pointing Our Domain into Github
  2. Using CNAME files for set our domain name into github
  3. Creating .nojekyll files for telling Github we use another engine

Using PIP for Installing Python Modules From Github Repository

Pip is great tools and we should use it rather than easy_install ( which i know it can be best solution in some situation ). When i use pyflakes with PIP to integrate with pyflakes-vim, it give me error. So, i use latest version from pyflakes github and using PIP to install it.

Here are to install python modules using PIP - Github :

sudo pip install git+git://<some repository github />

For example :

sudo pip install git+git://github.com/kevinw/pyflakes.git

Now i solve my problem using pyflakes :)

Checkout my Vim-Netbeans github here : https://github.com/yodiaditya/vim-netbeans

How to Solve Error Cannot Find Module Less CSS in Node.js 0.5.5

Installing Less.js (fresh from cloudhead’s github) probably making some error with your nodeJS application if you install it not in global mode.

Here are several thing that could be happen :

1. Error: require.paths is removed. Use node_modules folders, or the NODE_PATH environment

Error: require.paths is removed. Use node_modules folders, or the NODE_PATH environment variable instead.    
at Function.<anonymous> (module.js:360:11)  
at Object.<anonymous> (/home/ubuntu/www/js/nodejs/node_modules/less/lib/less/index.js:5:8)
at Module._compile (module.js:416:26)  
at Object..js (module.js:434:10)   
at Module.load (module.js:335:31) 
at Function._load (module.js:294:12) 
at Module.require (module.js:341:17)  
at require (module.js:352:17)  
at Object.<anonymous> (/home/ubuntu/www/js/nodejs/myapp.js:29:12)
at Module._compile (module.js:416:26)

2. Can’t find module ‘less/parser’

Error: Cannot find module 'less/parser'  
at Function._resolveFilename (module.js:318:11)   
at Function._load (module.js:263:25)  
at Module.require (module.js:341:17)   
at require (module.js:352:17)   
at Object.<anonymous> (/home/ubuntu/local/node/lib/node_modules/less/lib/less/index.js:9:13) 
at Module._compile (module.js:416:26) 
at Object..js (module.js:434:10) 
at Module.load (module.js:335:31)
at Function._load (module.js:294:12)  
at Module.require (module.js:341:17)

So how to make this LessJS working with NodeJS ?

Actually problem is comming from inside Less.js code.

    require.paths.unshift(path.join(__dirname, '..'));

So, let fix it!Let make some parameters here.

  1. I using npm (without global) when installing less.js. I put it on /home/ubuntu/www/nodejs/

  2. I installing nodejs without sudo and install it on ~/local. In case you don’t get it, check out my Node.JS Installation.

So, first thing to do is editing 2 less files :

  1. index.js in node_modules folder vim less.js/lib/less/index.js and comment line number 5 :

      //require.paths.unshift(path.join(__dirname, '..'));
    
  2. Do as number 1 on “less.js/bin/lessc” by commenting line number 7 :

     //require.paths.unshift(path.join(__dirname, '..', 'lib'));
    
  3. Build ~/.profile to pointing into your LessJS module

     Create this on your ~/.profile:
     export PATH=$HOME/local/node/bin:$PATH
     export NODE_PATH=/home/ubuntu/node/lib/node_modules:$NODE_PATH
     export NODE_PATH=/home/ubuntu/www/nodejs/obrool/node_modules:$NODE_PATH
     export NODE_PATH=/home/ubuntu/www/nodejs/obrool/node_modules/less.js/lib:$NODE_PATH
    

In this example, my less.js located in “/home/ubuntu/www/nodejs/obrool/node_modules”. You can change it depend in your installation method and folder structure.

Last step “source ~/.profile” to load it NODE_PATH.

Start your node server!

Solution was tested and taken from here.

If youre install Less in Global mode, then you should do point number 3 which pointing into you global node_modules folder.

Thanks folks!