Monday, February 18, 2013

Belon Dan gas Helium

Deposit tong gas: RM 1000.00
Xkira size tong.

Tong besar. Rm750/500 bijik belon
Tong kecik. Rm 250/200 bijik.

Belon Rm23/100pcs

GALAXY BALLOON INDUSTRIES
Address : No. 47, Jalan Jintan Manis, Taman Supreme, Batu 5, Cheras, 56100 Kuala Lumpur, Malaysia.
Telephone : (603) 9131 2168 Fax : (603) 9132 8362
Email : galaxyballoon@yahoo.com
Website : http://www.galaxyballoon.com.my
Related Keywords : party novelties supply balloon decoration balloon printing confetti cannons helium gas supply

Friday, February 15, 2013

HTC Phone: Internet passthrough on Ubuntu

When I connect my phone and choose internet passthrough, the phone chooses ip address in the 192.168.99.0/24. If yours creates a different subnet you will have to change below accordingly.

I hope this solves your problem.

Edit /etc/rc.local sudo nano /etc/rc.local and add the following:

echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward > /dev/null
iptables -P FORWARD ACCEPT
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.99.0/24
iptables -A FORWARD -i eth0 -o usb0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i usb0 -o eth0 -j ACCEPT
#forward all dns queries from usb0 to google's dns server
iptables -t nat -I PREROUTING -i usb0 -p udp --dport 53 -j DNAT --to 8.8.8.8


then at terminal type:
sudo /etc/rc.local

that will get you connectivity, but it will be short lived because htc is stupid and will disconnect if it doesn't detect the winblows htc software crap.
So you will need to fake it out. Turns out the phone is listening for htc software on port 6000 for 00 02 00 00 hex.

first you have to find the ip address of your phone (if arp doesn't work or you get command not found, you probably need to sudo arp):
phoneip=$(arp -n | grep usb0 | awk 'BEGIN {FS=" "} {print $1}')

then you tell the phone that htc software is listening:
echo -n -e "\x00\x02\x00\x00" | nc $phoneip 6000 > /dev/null

To make that automagic each time us a script. Call it htcfaker or whatever:

#!/bin/bash

while :; do
phoneip=$(arp -n | grep usb0 | awk 'BEGIN {FS=" "} {print $1}')
while [ -z $phoneip ]; do
sleep 15
phoneip=$(arp -n | grep usb0 | awk 'BEGIN {FS=" "} {print $1}')

done
echo -n -e "\x00\x02\x00\x00" | nc $phoneip 6000 > /dev/null

while [ "$phoneip" != "" ]; do
sleep 15
phoneip=$(arp -n | grep usb0 | awk 'BEGIN {FS=" "} {print $1}')
done
done


Then in your startup applications, point to that script.

Hope it helps!

Rails faye. Push messaging

Head up 
http://railscasts.com/episodes/260-messaging-with-faye?view=asciicast

Development: Ruby Rails using RVM

sudo yum install -y libxml2-devel libxslt-devel
curl -L https://get.rvm.io | bash -s stable

source /home/ec2-user/.rvm/scripts/rvm

rvm pkg install zlib
    rvm pkg install openssl
export rvm_path=/home/ec2-user/.rvm
rvm install 1.9.3 --with-openssl-dir=$rvm_path/usr
gem install bundler
    gem install rake

active_support/dependencies.rb:251:in `require': cannot load such file -- celluloid (LoadError)

Getting this error? ... Scroll down to my solution.

/var/lib/gems/1.9.1/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- celluloid (LoadError)
from /var/lib/gems/1.9.1/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `block in require'
from /var/lib/gems/1.9.1/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:236:in `load_dependency'
from /var/lib/gems/1.9.1/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `require'
from /var/lib/gems/1.9.1/gems/activemessaging-0.12.1/lib/activemessaging/threaded_poller.rb:7:in `<top (required)>'
from /var/lib/gems/1.9.1/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `require'
from /var/lib/gems/1.9.1/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `block in require'
from /var/lib/gems/1.9.1/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:236:in `load_dependency'
from /var/lib/gems/1.9.1/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `require'
from /var/lib/gems/1.9.1/gems/activemessaging-0.12.1/lib/activemessaging.rb:49:in `load_extensions'
from /var/lib/gems/1.9.1/gems/activemessaging-0.12.1/lib/activemessaging.rb:99:in `load_activemessaging'
from /var/lib/gems/1.9.1/gems/activemessaging-0.12.1/lib/activemessaging/railtie.rb:10:in `block in <class:Railtie>'
from /var/lib/gems/1.9.1/gems/railties-3.2.12/lib/rails/initializable.rb:30:in `instance_exec'
from /var/lib/gems/1.9.1/gems/railties-3.2.12/lib/rails/initializable.rb:30:in `run'
from /var/lib/gems/1.9.1/gems/railties-3.2.12/lib/rails/initializable.rb:55:in `block in run_initializers'
from /var/lib/gems/1.9.1/gems/railties-3.2.12/lib/rails/initializable.rb:54:in `each'
from /var/lib/gems/1.9.1/gems/railties-3.2.12/lib/rails/initializable.rb:54:in `run_initializers'
from /var/lib/gems/1.9.1/gems/railties-3.2.12/lib/rails/application.rb:136:in `initialize!'
from /var/lib/gems/1.9.1/gems/railties-3.2.12/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/razimi/Documents/PROJEK/RUBY/messages/config/environment.rb:5:in `<top (required)>'
from /var/lib/gems/1.9.1/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `require'
from /var/lib/gems/1.9.1/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `block in require'
from /var/lib/gems/1.9.1/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:236:in `load_dependency'
from /var/lib/gems/1.9.1/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `require'
from /var/lib/gems/1.9.1/gems/railties-3.2.12/lib/rails/application.rb:103:in `require_environment!'
from /var/lib/gems/1.9.1/gems/railties-3.2.12/lib/rails/commands.rb:25:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
#> gem install bundler
Fetching: bundler-1.2.4.gem (100%)
Fetching: bundler-1.2.4.gem (100%)
Successfully installed bundler-1.2.4
1 gem installed
Installing ri documentation for bundler-1.2.4...
Installing RDoc documentation for bundler-1.2.4...

Limit Internet Bandwidth Usage (internet speed) in Ubuntu

#> sudo apt-get install wondershaper
#> sudo wondershaper eth0 1024 256

this will limit the download speed to 1024 Kbps and upload to 256 Kbps. Remember that this limit is for all internet traffic i.e torrent, ftp, browsing and any thing else.

If you want to remove these limits use

#> sudo wondershaper clear eth0

again replacing eth0 with your interface name


Friday, February 1, 2013

How to clone git repo from existing Hero app

1- Make sure you have Heroku account.
2- Install the Heroku toolbelt. Google it yourself!...
3- Open a terminal, and to login to heroku
#> heroku login
4- Generate you key
#>; ssh-keygen -t rsa 
5- Add the key to your heroku 
#> heroku keys:add
6- Clone your existing repo.
#> git clone git@heroku.com:.git

Clone git repo from Heroku

1- Make sure you have Heroku account.
2- Install the Heroku toolbelt. Google it yourself!...
3- Open a terminal, and to login to heroku
<code>
#> heroku login
</code>
4- Generate you key
<code>
#> ssh-keygen -t rsa 
</code>
5- Add the key to your heroku 
<code>
heroku keys:add
</code>
6- Clone your existing repo.
<code>
git clone git@heroku.com:<YOUR-APPNAME>.git
</code>

Centos 7 reset root/ any user lost password / lockout due to cant remember password

1. Need to be in front of the terminal. (Physically if not vm). 2. Reboot the server 3. Press 'e' in the GRUB2 boot screen. 3. bunch...