Solve Vagrant “The guest additions do not match the install version of VirtualBox”

After upgrading my Virtualbox, I try build my base box and got this errors :


[ff] The guest additions on this VM do not match the install version of
VirtualBox! This may cause things such as forwarded ports, shared
folders, and more to not work properly. If any of those things fail on
this machine, please update the guest additions and repackage the
box.

Guest Additions Version: 4.1.6
VirtualBox Version: 4.1.8

Yeap, this is happen because I have Ubuntu Oneiric on base box with old Guest Additions Version. Then, let go to the solution. First, remember your Virtualbox Version and download VBoxGuestAdditions with related version. For instance :


wget -c http://download.virtualbox.org/virtualbox/4.1.8/VBoxGuestAdditions_4.1.8.iso

Then we will mount and install VboxGuestAddition by :


sudo umount /mnt
sudo mount VBoxGuestAdditions_4.1.8.iso -o loop /mnt
sudo sh /mnt/VBoxLinuxAdditions.run

Now try to “vagrant halt” and “vagrant up” again to see if this works! :)

Running WordPressure NodeJS in EC2

Today I see Dchud release WordPressure, NodeJS + Python apps which aggregate new post in WordPress.com Real-time. Curious how it would be, then I put my unused domain ani-rss.org as my experiments. I use Amazon EC2 with Ubuntu 11.10 64bit (Oneiric). So, here are the steps.

1. Install base packages
sudo apt-get install git redis-server

2. Install NodeJS

cd ~/
sudo apt-get install git-core curl build-essential openssl libssl-dev pkg-config
mkdir ~/local
wget -c http://nodejs.org/dist/v0.6.6/node-v0.6.6.tar.gz
tar -xvvf node-v0.6.5.tar.gz
cd node-v0.6.5
export JOBS=2
./configure --prefix=$HOME/local/node
make
make install
echo 'export PATH=$HOME/local/node/bin:$PATH' >> ~/.profile
echo 'export NODE_PATH=$HOME/local/node:$HOME/local/node/lib/node_modules' >> ~/.profile
source ~/.profile

Configure /etc/environment to run NodeJS every boot startup:


NODE="/home/ubuntu/local/node"
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:$NODE/bin:$NODE/lib/node_modules"
#PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"

3. Download repository

git clone https://github.com/dchud/wordpressure.git && cd wordpressure
npm install -g

4. Install Python Dependencies
sudo pip install -r requirements.pip

Solving could should increase server_names_hash_bucket_size: 32 NGINX Ubuntu

After I configure several sites that have a long names in NGINX virtualhost, I restart my NGINX and got this error :


sudo service nginx restart
Restarting nginx: nginx: [emerg] could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32
nginx: configuration file /etc/nginx/nginx.conf test failed

Well this is because my NGINX conf only limit server_name into 32 chars. We need to extend it by uncomment “server_names_hash_bucket_size 64;” in nginx.conf :

/etc/nginx/nginx.conf :

http {
....
server_names_hash_bucket_size 64;
# server_name_in_redirect off;

....
}

Problem solved! :D

How to receive reset password hpcloud by whitelist email in gmail account

Yesterday, I wanna login into my hpcloud account and accidentally forgot my password. Then I go to forgot password page and put my email there. Waiting for more than 3 hours, there no confirmation email yet from HPCloud in my Gmail inbox. Try with three times and no result yet. Event spambox still empty. Then I contact HPCloud through their twitter account and contact pages.. Continue reading

Run latest PhantomJS with shell_exec PHP on Ubuntu 11.10 Oneiric

Running PhantomJS with exec() or shell_exec PHP and grab it results may lead you into several headache problems. Several web that talking how to run phantomjs in PHP just send me into fail results. I will show you several pitfalls for instance, here a small scripts to run PhantomJS :

test.php :

< ?php
$result = shell_exec('phantomjs --version');
echo $result;
?>

Continue reading

Review how to build Ubuntu Oneiric 11.10 instance on HPCloud

Today I got invitation from HPCloud to test cloud services for free. I want to see if HP Cloud can surpass over Amazon EC2 and Rackspace which I have server on both of them. First, I signup with invitation code and set my payment method with credit card. If you have the invitation code like me, don’t worry about billing, HPCloud does not charge in private beta and will give notification if it does. After register my payment method, then I go through with “create server” on Compute — US West 2 – AZ1. You should “activate now” before create cloud server.

It’s pretty simple to create server instance in HPCloud panel. There are several options in create server panel like Size, Security Group, Public IP, Install Image, Key Pair and Instances. I set my Install image into Ubuntu oneiric and default for the other. Only one step taken and your server already build. It’s more simple than EC2 or Rackspace which need a few steps. Continue reading

How to install wikistream on Ubuntu 11.10 with NodeJS 0.6

Wikistream is great applications and publish on HackerNews. Today, I want to install and run Wikistream on My Ubuntu 11.10 Oneric. I have NodeJS 0.6.5 installed and run properly on my Ubuntu. If you don’t have, then you should install it. In case you need how to install NodeJS on Ubuntu 11.10, open your console and follow this steps :

1. Installing NodeJS


cd ~/
sudo apt-get install git-core curl build-essential openssl libssl-dev pkg-config
mkdir ~/local
wget -c http://nodejs.org/dist/v0.6.6/node-v0.6.6.tar.gz
tar -xvvf node-v0.6.5.tar.gz
cd node-v0.6.5
export JOBS=2
./configure --prefix=$HOME/local/node
make
make install
echo 'export PATH=$HOME/local/node/bin:$PATH' >> ~/.profile
echo 'export NODE_PATH=$HOME/local/node:$HOME/local/node/lib/node_modules' >> ~/.profile
source ~/.profile

Continue reading

How to disable master password in Eclipse

Master password in Eclipse is a bit annoying. We can disable this feature completely. Firstly, you should exit your Eclipse applications. Then follow this steps:

1. Delete equinox security

rm -rf ~/.eclipse/org.eclipse.equinox.security

If you use Zend PHP Eclipse or some other, this step will solve the problem.
But, if you still get annoying Master password, then go to next steps :

2. Set text file you master password
For example, I use “nopass” as my master password. So i just echo “nopass” into eclipse master :

echo "nopass" > ~/.eclipse/master

Continue reading

Problem with VIM tabnew or new buffer which reset all changes

When using VIM, usually I use new buffer or newtab for opening several files. There some anomally where everytime I open another files, my Python indentation going wrong! I don’t know what happen and try spend several hours to find the problem.

Finally, I got the problem ! See this :


setlocal tabstop=4
setlocal softtabstop=4
setlocal shiftwidth=4
setlocal textwidth=80
setlocal smarttab
setlocal expandtab

Continue reading