Install java in debian / ubuntu server

echo “deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main” | tee -a /etc/apt/sources.list
echo “deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main” | tee -a /etc/apt/sources.list
apt-key adv –keyserver hkp://keyserver.ubuntu.com:80 –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

https://java.com/en/download/index.jsp

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/libnpjp2.so /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 ?

solution

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`
#ssh-add

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


awan.bash.keren.sh;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
or
#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

#cron.d

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

MAILTO=root

# 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