30 October 2013

Digital Ocean: Snapshot dan Backup

1) Buat Snapshot.
2) Delete Droplet.
3) Bila nak pakai, create droplet, jgn cipta baru, tapi 'Select Image' --->    
4) Jimat...

Harga:
The pricing for backups is 20% of the cost of the virtual server. So if you want to enable backups for a $5/mo virtual server, the cost for backups will be $1/mo.

The price for snapshots will be $0.02 per GB of snapshot storage per month.


ref:
https://www.digitalocean.com/community/articles/digitalocean-backups-and-snapshots-explained

27 October 2013

python virtual thread

gevent

greenlet -> virtual thread instance



gevent.pool.Pool(3)                       # limit concurrent thread to 3,
                                                 #habis satu baru run satu lagi
pool.spawn(function_name)

url picasa


download:
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_DSGalZhpqGehh_BlolM3RBvodFFGvSaZb6TXqGVMqXAVF3AJ_WaTYLhaPiJD_6L3Ft7UVbBvx7FmsevbDN2tVI_p39-gye9GhSOekwPeKOnAkTFeuXNsT17tZnGiSs8yjh3DPcpfhnl1/s404-d/.facebook_1724220696.jpg


segiempat:
/_D-AQvdOCYc/s404-c/.facebook_1724220696.jpg


default:
/_D-AQvdOCYc/.facebook_1724220696.jpg


12 October 2013

masuk subtitle dalam video

mencoder tazkiah13.avi -sub tazkiah13.ass -o tazkiah13.hardsubs.avi -oac copy -ovc lavc -lavcopts vbitrate=1200


subtitle:
   subtitle_file.ass
   subtitle_file.srt

download streaming video



Next you need to download the realplayer feed you want to convert. First of all download the realvideo file you want and then view it to see the realtime streaming protocol (RTSP) url inside:
 
wget http://www.bbc.co.uk/england/realmedia/politicsshow/south/bb/politicsshow_16x9_bb.ram
 

cat politicsshow_16x9_bb.ram // displays something like rtsp://rm-acl.bbc.co.uk/england/politicsshow/south/bb/politicsshow_16x9_bb.rm



ref:
http://www.pyrosoft.co.uk/blog/2007/11/25/converting-realplayer-rm-files-to-mpeg-or-mp4-with-ubuntu-gutsy/

convert realMedia ke avi

ke Avi

mencoder input.rm -o output.avi -ovc xvid -xvidencopts bitrate=128 -oac mp3lame

 


ke Xvid
mencoder stream.dump -o bbc-10oclocknews.avi -ovc xvid -xvidencopts bitrate=128 -oac mp3lame


senaraikan codec :
   mencoder -ovc help



ref:
http://www.pyrosoft.co.uk/blog/2007/11/25/converting-realplayer-rm-files-to-mpeg-or-mp4-with-ubuntu-gutsy/

03 October 2013

transparent proxy

squid dan iptable(REDIRECT(same host) atau DNAT(different ip))



squid config
http_port 3128 transparent
http_port 80 vhost
ref http://www.cyberciti.biz/tips/linux-setup-transparent-proxy-squid-howto.html




IPTABLES
  /sbin/iptables -t nat -A PREROUTING  -p tcp --dport 80 -j DNAT --to $squid_server:$squid_port

  # nat perlu jika gw dan squid berlainan host.
  /sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

*maklumat tambahan*
DNAT akan tukar dst ip dari gw ke squid, tapi src ip tetap dari client(browser). 
Jadi masalah, kerana bila squid reply sync ack, alamat packet adalah kepada client. 
Client tak tahu menahu, so tcp handshake tak berjaya.

vSphere, ESXi, vCenter

vSphere adalah suite(kombinasi pelbagai software). Macam Microsoft Suite, yg dalamnya ada word, excel, powerpoint etc.

ESX adalah server utk virtualization, boleh store vmImage

vSphere Client adalah console utk connect dan control ESX

vCenter server is similar to vSphere client but it’s a server with more power.
(contohnya nak cloning image)


ref:

02 October 2013

vpn with .ovpn file

sudo openvpn --config vpn-config.ovpn 




converting .p12 -> seperate cert

Ok, it seems that we have to update network-manager-openvpn package to the latest version so it can understand p12 files. But there is a fairly simple way to generate the 3 .pem files needed at the old version using the original .p12 file:

openssl pkcs12 -nocerts -in file.p12 -out priv_key.pem

openssl pkcs12 -nokeys -clcerts -in file.p12 -out user_cert.pem

openssl pkcs12 -nokeys -cacerts -in file.p12 -out ca_cert.pem


Then use these 3 files at the OpenVPN configuration, mine is working fine now. I do not know if openssl is installed by default at Lucid, but it is in the repositories.

otrs erd