error when running glances

if your found error like this after install glances monitoring tools, don’t be panic i have been thru this before

awan@awan-local-server:~$ glances
Traceback (most recent call last):
File “/usr/local/bin/glances”, line 5, in
from pkg_resources import load_entry_point
File “/usr/lib/python2.7/dist-packages/”, line 2707, in
File “/usr/lib/python2.7/dist-packages/”, line 686, in require
needed = self.resolve(parse_requirements(requirements))
File “/usr/lib/python2.7/dist-packages/”, line 584, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: psutil>=0.5.1

the solution just execute this command

:~$ sudo pip install psutil

if you don’t have pip, install pip using command

sudo apt-get install pyhton-pip python-dev

glances is quite advance and detail like atop, but it’s more easy to understanding. i prefer glances rather than htop.

Install java in debian / ubuntu server

echo “deb precise main” | tee -a /etc/apt/sources.list
echo “deb-src precise main” | tee -a /etc/apt/sources.list
apt-key adv –keyserver hkp:// –recv-keys EEA14886
apt-get update
apt-get install oracle-java7-installer

or the “always works way in google chrome ubuntu”

1. download java to your server or computer

2. create java folder in your server / pc and create plugin folder to chrome

#sudo mkdir -p /usr/java
#sudo mkdir -p /opt/google/chrome/plugins

3. cp jre-7u45-linux-x64.tar.gz to /usr/java
#sudo cp jre-7u45-linux-x64.tar.gz /usr/java

4. ekstrak file tar gz
#cd /usr/java
#sudo tar zxvf jre-7u45-linux-x64.tar.gz

5. sym link java ke plugin

#sudo ln -s /usr/java/jre1.7.0_45/lib/amd64/ /opt/google/chrome/plugins/

this is only sample you may change it or replace the java version with yours

Forward your ssh key to your server

so here’s the deal

1. you already setup a server act as bastion host
2. you want to connect to all you server (which only have private ip) from bastion host

normally people will use ssh-key, and registered the public key to server using chef… but wait which key ? your bastion host server key or your laptop key ?

oh no it’s my bastion host key. what happen if my bastion host got hack ?


1. put a vpn server which is need an extra knowledge route the vpn traffic accross all you local ip server farm
2. or using ssh-key agent to register your laptop ssh key to all server but you ssh in to it via bastion host here’s you can implement this

execute this command
#vim /etc/ssh/ssh_config

edit that file find “ForwardAgent” make sure the value is “yes”

#sudo service ssh restart
#eval `ssh-agent`

there you go what you need to do next is make sure you bastion host server also have ForwardAgent value ‘yes’ and you can enter all you server via ssh without have to register you bastion ssh key in each machine, because that command will forward your laptop ssh key.

Mobile Apps Development For Enterprise #1

How Do You Keep Transactional Mobile Apps Fully Functional When They’re Offline?

a. Offline Implies Transactional – Offline apps must do more than just provide the ability to read data while out of coverage.

b. Back-End Data Access – Transactional apps that run offline, by nature, imply that access to back-end data sources will be required.

c. Sync Infrastructure – Offline apps require data synchronization infrastructure, which can be difficult to build. This includes mechanisms to retrieve data from a central data source, massage the results, etc.

d. Offline Security – Enterprise apps that run offline carry with them an overwhelming security burden. Mobile developers will need to find ways to ensure data is safe, users see only the data to which they’re entitled, and corporate policies remain enforced.

e. Operations – Offline apps may require specific types of controls in order to keep them running smoothly. For example, an incremental sync

single stupid line command to check your mysql is run or not

Ini adalah cara bodoh untuk check your mysql running atau ngak, lucu tapi it’s work somehow. metode dan cara ini dapat di pakai untuk aplikasi lain bukan hanya mysql

mysqladmin -hlocalhost -uroot -ppower32 status;if [ $? -eq 0 ]; then echo ok; else echo "lets hit mysql";`/etc/init.d/mysql restart`; fi

ok simplenya command diatas akan check apakah mysql hidup atau tidak, kalau hidup dia akan bilang ‘ok’ kalau mati mysql nya di restart. this is only sample, you can do much more like this;if [ $? -eq 0 ]; then echo ok; else echo "you application not run, do something here"; fi

ok just put all off your single line command to crontab and you’re set and ready to sleep and smile

Monitoring Your Total Monthly Bandwidth Usage

This is how you can monitoring your bandwith, tidak ada cara yang lebih mudah memonitoring bandwith total secara keseluruhan pada sebuah interface kecuali pakai ifconfig dan vnstat

this is how you can have clear view how to answer this question

“How much bandwith my server consume each month ?”

“How much bandwith this eth0 interface consume every month / monthly ?”

“Ini server makan bandwith sebulan di interface eth1 sebenarnya berapa banyak ?”

install vnstat

#sudo apt-get install vnstat
#sudo yum install vnstat

after you install vnstat you must initiate the db for store your statistic interface

mari kita buatkan database interfacenya yoooo

#vnstat -u -i eth0
#vnstat -u -i eth1

change eth0 or eth1 with your interface, kalau kamu ngak tahu cukup ketik ifconfig nnti terlihat id interface kamu

sampai sini kamu cukup letakkan cron job di /etc/cron.d atau di crontab -e

#crontab -e
*/5 * * * * /usr/bin/vnstat -u > /dev/null 2>&1


google:/etc/cron.d# cat /etc/cron.d/vnstat
# cron-jobs for munin-node


# This is Vnstat cronjobs
*/5 * * * * root /usr/bin/vnstat -u > /dev/null 2>&1

to check you monthly bandwidth

#vnstat --months

to check you hours bandwidth

#vnstat --hours

.htaccess lighttpd font-face

herewith how you can enable .htaccess for lighttpd to solve issue @font-face in mozilla firefox

issue :

I am serving truetype (ttf) fonts as font/truetype and opentype (otf) as font/opentype, but I cannot find the correct format for WOFF fonts.

I have tried font/woff, font/webopen, and font/webopentype, but Chrome still complains:

“Resource interpreted as font but transferred with MIME type application/octet-stream.”

Anybody know?

for apache and nginx

for lighttpd

#vim /etc/lighttpd/lighttpd.conf

add this line

$HTTP["url"] =~ "\.(ttf|otf|eot|woff)$" {
setenv.add-response-header = ( "Access-Control-Allow-Origin" => "*" )

save it and restart your lighttpd, should be done,