Run NodeJS with non-root / user permission using Runit in Ubuntu 12.04 Precise

After leaving NodeJS about 6 month, I still hard to find articles who explain how to running NodeJS services in production mode. This is mean, running NodeJS services by user permission (not by root) and can automatically restart if crashed. Well, this is not only for NodeJS cases, but you can also implement this solution for running Twisted services.

I use Ubuntu 12.04 Precise Pangolin at this guide. Don’t worry, it’s doesn’t have a big difference step with previous Ubuntu version. So, let start!
Continue reading

How to solve problem HFSplus OS X partition sharing as home partition in Ubuntu

I have dual-OS in my Macbook Pro, OS X Leopard and Ubuntu Oneiric. I want to share partition between OS X and Ubuntu. I use hfplus partition (without journaled) as user home in Ubuntu Oneiric. Then the problem begin.

When I adding launcher in Desktop (Ubuntu), it can’t be executed and throw error :


the application launcher ".desktop" has not been marked as trusted. if you do not know the source of this file, launching it may be unsafe.

After finding several articles, I try to change UID in this partition (/dev/sda3) into 501 :
http://ubuntuforums.org/showthread.php?t=1751009.

But it still doesn’t works. Using “chmod a+x” on *.desktop, chown ubuntu:ubuntu, allow permission in properties and another tricks giving no results.
Continue reading

Copy Youtube FLV from Firefox in Ubuntu 12.04 Precise Pangolin

Here is simple bash script to copy FLV Youtube into your folder in Ubuntu 12.04 Precise Pangolin. At this example, I put this script on home folder and create “Youtube” folder :


cd ~/
mkdir Youtube
vim u2tube.sh
chmod a+x u2tube.sh

u2tube.sh

#! /bin/sh
lsof -n -P | grep FlashXX | awk '{ print "/proc/" $2 "/fd/" substr($4, 1, length($4)-1) }' | while read f
do
echo $f
cp $f /home/ubuntu/Youtube/`basename $f`-`date +%H:%s-%d-%m-%y`
done

How to change font bold style of php HTML in Aptana Studio

When opening HTML, CTP or another PHP-HTML files in Aptana Studio 3, i found that all using bold which is annoying for me. So, to make it to be normal fonts :

1. Go to Aptana Studio menu -> “Window Menu”

2. Type “Themes” on left search box.

3. Find element “text.html.basic” and change it “Bold” style by click it.

4. Problem solved!

How to enable TOR open for remote access with Polipo on Ubuntu

Tor usually installed and running on 127.0.0.1 port 9050 which it’s can’t be accessed from outside. We can open this local listen address TOR signed into IP network and run as HTTP Proxy with Polipo. FYI, I use Vagrant and running Ubuntu Oneiric on Guest. I install TOR in Vagrant guest and accessed it remote from Host (Ubuntu). Let we start with installing tor and polipo on Ubuntu :


sudo apt-get install tor polipo nmap

After this installation, TOR should be running on localhost 9050. You can check it by scan using :
Continue reading

How to login into HPCloud Instance and edit Security Group using Hybridfox

Hybridfox is great tools for connecting with our cloud server. When you configure HPCloud server, then you should have this for manage your security groups and allowing several ports to be open. Because default group in HPCloud only allowing SSH port only.

I use the latest Firefox (10 and always updated through update-manager). Then you should download add-on for hybridfox and remember to pick the correct version ” hybridfox-1.6.000112.xpi ” on http://code.google.com/p/hybridfox/downloads/list. Using another version may give error results.

Download and use “Open file” in Firefox to install this add-on. You should restart your Firefox and on “Tools” menu, you should see “HybridFox”. Don’t open it yet, because it will show pop-up. If you have, then you should cancel all confirmation box pop-up by Hybridfox.

Go to your HPCloud, Go to “Account” and select API Keys. I have two region here, but I pick the first one for example. Show access key and secret key “EC2 Compability” :

You should copy this both key into your text editor. Because when you open HybridFox, you can’t switch window.

Then open you Hybridfox, click on Region to add AZ-.

For instance, I add :

https://az-1.region-a.geo-1.ec2-compute.hpcloudsvc.com/services/Cloud/

Now, you can add your instance by click on Credentials :

You can insert your access key and secret key.

After connecting, go to Security Group
Go to “Group permission” and click on check(V). Then you can fill it with what kind of port you will open for.

Solve double minibufexplorer opened in VIM

When using Minibufexplorer in VIM, I usually use Fuzzfinder for opening files. But, somehow, I see double minibufexplorer window every open more than 2 files. To solve this issue :


let g:miniBufExplorerMoreThanOne = 0

This will for miniBufExplorer into single window only. Another VIM configuration that may useful, taken from http://dotfiles.org/~joaoTrindade/.vimrc
Continue reading

Switch off ATI VGA in dual VGA with Intel on Ubuntu to solve overheat problem

I have AMD Radeon HD 6470M which sometimes it make my laptop overheat until 90 C. Usually, it’s run on 70 C. This is because ATI Radeon run together with Intel VGA. By switch off VGA AMD Radeon, it decrease overheat from 70 C into 58 C. And my laptop not overheat anymore. Basically, turn off ATI VGA will decrease heat problem in Ubuntu.

UPDATE: Try upgrade your BIOS. Several people have said they reduce heat by upgrading the BIOS.
http://h20000.www2.hp.com/bizsupport/TechSupport/SoftwareIndex.jsp?lang=en&cc=th&prodNameId=5086746&prodTypeId=321957&prodSeriesId=5086745&swLang=13&taskId=135&swEnvOID=4061#93211

First, check your dual VGA by :


lspci -vnnn | grep VGA

Continue reading

How to setup VNC server for remote desktop in Ubuntu 11.10 Oneiric

Install VNC server in Ubuntu 11.10 Oneiric for remote-desktop is very easy. Here are the steps to install :


sudo apt-get install x11vnc
sudo x11vnc -storepasswd yourpasswordhere /etc/x11vnc.pass
sudo chmod 744 /etc/x11vnc.pass

Now you should edit your lightdm :

sudo vim /etc/lightdm/lightdm.conf


greeter-setup-script=/usr/bin/x11vnc -auth /var/run/lightdm/root/:0 -noxrecord -noxfixes -noxdamage -rfbauth /etc/x11vnc.pass -forever -bg -rfbport 5900 -o /tmp/x11vnc.log

To run manually :

sudo x11vnc -rfbauth /etc/x11vnc.pass -o /var/log/x11vnc.log -forever -bg -rfbport 5900 -nomodtweak

or


sudo x11vnc -auth /var/run/lightdm/root/:0 -noxrecord -noxfixes -noxdamage -rfbauth /etc/x11vnc.pass -forever -bg -rfbport 5900 -o /tmp/x11vnc.log

Happy remote desktop! :)