Rolly Maulana Awangga :: Catatan Ngoprek IT

Pakar dan Awam sama saja, sama sama belajar

Setting OpenVPN Client Using VPNGate on Raspberry Pi

Its just simple to use openvpn on raspbian, just take a simple step :

1. instaling openvpn : apt-get install openvpn

2. download vpngate config file with extension .ovpn and place it to /etc/openvpn 

3. [optional] to connect automatically at startup just change extension .ovpn to .conf.

4. create user.txt file filled with user and password in two rows exactly like below and change permision to 700 :

vpn

vpn

5. in the .ovpn or .conf file add a line like this

auth-user-pass user.txt

6. Connect with command:

openvpn –daemon –cd /etc/openvpn –config vpngate.conf

 

Reference :

https://forums.openvpn.net/topic12666.html

http://www.ibvpn.com/billing/knowledgebase/133/OpenVPN-configuration-for-Raspberry-PI.html

 

Debian Wheezy Sources.list

now im using this repos

 

deb http://ftp.hk.debian.org/debian/ wheezy main
deb-src http://ftp.hk.debian.org/debian/ wheezy main

#deb http://security.debian.org/ wheezy/updates main
#deb-src http://security.debian.org/ wheezy/updates main

# wheezy-updates, previously known as ‘volatile’
deb http://ftp.hk.debian.org/debian/ wheezy-updates main
deb-src http://ftp.hk.debian.org/debian/ wheezy-updates main

# Proposed updates
deb http://ftp.es.debian.org/debian/ wheezy-proposed-updates main contrib non-free

# Oficiales
deb http://ftp.es.debian.org/debian/ wheezy main contrib non-free
deb-src http://ftp.es.debian.org/debian/ wheezy main contrib non-free

# Seguridad
deb http://security.debian.org/ wheezy/updates main contrib non-free
deb-src http://security.debian.org/ wheezy/updates main contrib non-free

# Multimedia
deb http://deb-multimedia.org/ wheezy main non-free
deb-src http://deb-multimedia.org/ wheezy main non-free

# Backports
deb http://ftp.debian.org/debian/ wheezy-backports main contrib non-free
deb-src http://ftp.debian.org/debian/ wheezy-backports main contrib non-free

# Mozilla
deb http://mozilla.debian.net/ wheezy-backports iceweasel-release
deb-src http://mozilla.debian.net/ wheezy-backports iceweasel-release

# VirtualBox
deb http://download.virtualbox.org/virtualbox/debian wheezy contrib

deb http://download.webmin.com/download/repository sarge contrib
deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib

 

 

dont forget to add the signature

 

wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -

wget -q http://mozilla.debian.net/archive.asc -O- | apt-key add -

Making Debian Installer on USB Stick

heres the screenshot i was tried

Screen Shot 2014-03-01 at 9.35.19 PM

Fixing Debian Broken Package

I have trouble with my debian instalation after removing xfce and migrating to gnome. the terminal appeard like this :
dpkg: warning: files list file for package ‘libc6:i386′ missing; assuming package has no files currently installed
dpkg: warning: files list file for package ‘libslang2:i386′ missing; assuming package has no files currently installed

so i found tutorial in here:

http://serverfault.com/questions/430682/dpkg-warning-files-list-file-for-package-x-missing

and here

https://blog.srvbox.com/aptitude-dist-upgrade-or-howto-resolve-dpkg-warning-files-list-file-for-package/

Ill try the solution with this script :
for package in $(apt-get upgrade 2>&1 | grep “warning: files list file” | sed “s/.*’//; s/://”); do apt-get install –reinstall “$package”; done

and then this script :
for pp in `awk ‘/files list file for package/ {p=$8; if ($8 !~ /47/) p=$11; gsub(/47|:.*/,””,p); if (!packages[p]) packages[p]=p;} END {for (i in packages) print i; }’ /var/log/apt/term.log`; do
aptitude reinstall “$pp”;
done

and maybe this last try to update per package by command :
dpkg-deb -c /var/cache/apt/archives/libc6_2.13-38_i386.deb | awk {‘sub(/^\./,””,$6);sub(/^\/$/,”/.”,$6); sub(/\/$/,””,$6); print $6′} > /var/lib/dpkg/info/libc6:i386.list

Demo Multimedia Home(Saung) Center di acara Broadband Festival Bandung dengan Android dan Raspberry Pi

Demo Multimedia Home(Saung) Center di acara Broadband Festival Bandung dengan Android dan Raspberry Pi

Hari ini saya mendemokan sesuai dengan judul diatas di acara Broadband Festifal Telkomsel untuk wilayah bandung. Baik singkat cerita begini.
Pertama Aplikasi Android yang dibutuhkan antara lain :
- Let’s Print Droid (untuk printing)

https://play.google.com/store/apps/details?id=com.blackspruce.lpd

- SaneDroid (untuk scanning)

https://play.google.com/store/apps/details?id=com.sane.droid

- Raspberry pi remote (untuk pemutar video)

https://play.google.com/store/apps/details?id=com.raspberry.remote

- MPdroid (untuk pemutar musik

https://play.google.com/store/apps/details?id=com.namelessdev.mpdroid

Sementara aplikasi yang digunakan di raspberry pi adalah:
- Sane
- mpd

http://www.raspberrypi-spy.co.uk/2013/06/raspberry-pi-command-line-audio/

tambahan konfigurasi jack local
sudo amixer cset numid=3 1
- cups
- omxplayer
dengan konfigurasi tambahan agar layar belakang hitam
sudo sh -c “TERM=linux setterm -foreground black -clear >/dev/tty0″
mengembalikan lagi
sudo sh -c “TERM=linux setterm -foreground white -clear >/dev/tty0″

Transparent Proxy on Raspbery Pi

I just follow the instruction here

With little modification, like in this post. just set

 http_port 3128 transparent

and now iptables works :

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 
3128

 

Load Balancing Internet Conection

Rules Table

 

Here some command to get load balancing server as a router two, by joining two interface with internet connection based on this article.

ip link set lo up
ip link set eth0 up
ip link set eth0:0 up
#ip link set usb0 up
ip route flush table rt_dev1
ip route flush table rt_dev2
ip route flush table internet

ip addr add 127.0.0.1/8 brd 127.0.0.255 dev lo
ip addr add 192.168.42.83/24 brd 192.168.42.255 dev usb0
ip addr add 192.168.1.1/24 brd 192.168.1.255 dev eth0
ip addr add 192.168.1.2/24 brd 192.168.1.255 dev eth0:0

ip rule add prio 10 table main
ip rule add prio 20 table rt_dev1
ip rule add prio 30 table rt_dev2
ip rule add prio 40 table internet

ip route del default table main
ip route del default table rt_dev1
ip route del default table rt_dev2
ip route del default table internet

ip rule add prio 20 from 192.168.42.0/24 table rt_dev1
ip route add default via 192.168.42.129 dev usb0 src 192.168.42.83 proto static table rt_dev1
ip route append prohibit default table rt_dev1 metric 1 proto static

ip rule add prio 30 from 192.168.1.0/24 table rt_dev2
ip route add default via 192.168.1.3 dev eth0:0 src 192.168.1.2 proto static table rt_dev2
ip route append prohibit default table rt_dev2 metric 5 proto static

ip rule add prio 40 table internet
ip route add default proto static table internet nexthop via 192.168.42.129 dev usb0 weight 1 nexthop via 192.168.1.3 dev eth0:0 weight 1

iptables -F
iptables -P INPUT DROP
iptables -A INPUT -i eth0 -j ACCEPT
iptables -A INPUT -i usb0 -p tcp -s 0/0 –dport 25 -j ACCEPT
iptables -A INPUT -i eth0:0 -p tcp -s 0/0 –dport 25 -j ACCEPT
iptables -A INPUT -m state –state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p tcp -i usb0 -j REJECT –reject-with tcp-reset
iptables -A INPUT -p tcp -i eth0:0 -j REJECT –reject-with tcp-reset
iptables -A INPUT -p udp -i usb0 -j REJECT –reject-with icmp-port-unreachable
iptables -A INPUT -p udp -i eth0:0 -j REJECT –reject-with icmp-port-unreachable
iptables -t nat -A POSTROUTING -o eth0:0 -j SNAT –to-source 192.168.1.2
iptables -t nat -A POSTROUTING -o usb0 -j SNAT –to-source 192.168.42.83

Sending json post via curl

here is example of using curl to send json using method post

 

 

curl -X POST -H “Content-Type: application/json” -d ‘{
“fee”: “$3,562.00″,
“id_user”: 0,
“phone”: “(925) 470-3826″,
“pic”: “Felecia Luna”,
“nomor”: “PROP/212/2233″,
“deliverables”: [
"quis",
"occaecat",
"magna",
"labore",
"quis",
"culpa",
"officia"
],
“objective”: [
"reprehenderit",
"eu",
"qui"
],
“program”: “Tanpa kotak excepton”,
“kepada”: “Dir. SDM Elsie Wheeler 210 Taylor Street, Clay, Indiana, 6282″,
“perusahaan”: “PT.Comtrek”,
“email”: “felecialuna@comtrek.com”,
“tgl”: “Bandung, 07.03.03″
}’ http://www.vas.web.id/

Syncronizing Database Between Two Server or More

I has searching for syncronizing database between servers. There is a lot of propietary solution, so you can just buy it without worrying anymore. But sometimes for me, just have curiosity to make syncronizing database mysql tools myself. I found a open source mysql database syncronizer its called it maatkit and you can found they documentation to. But, according their website, they make it commercial release of freeware as percona-toolkit.

 

Backup Restore Mysql database via shell

Backup Restore Mysql database via shell

i found it very simple thinks, in this url

http://www.thegeekstuff.com/2008/09/backup-and-restore-mysql-database-using-mysqldump/

and im running it on my crontab every 2 hours
0 */2 * * * mysql -u

Ikuti

Get every new post delivered to your Inbox.

Bergabunglah dengan 325 pengikut lainnya.

%d bloggers like this: