Tuesday, May 15, 2018

Belajar Program


Program / codec yang dibutuhkan antara lain :

wget http://www3.mplayerhq.hu/MPlayer/releas ... 22.tar.bz2
wget http://rubyforge.org/frs/download.php/9 ... .5_rc6.tgz
wget http://easynews.dl.sourceforge.net/sour ... .97.tar.gz
wget http://superb-west.dl.sourceforge.net/s ... 0.5.0.tbz2
wget http://downloads.xiph.org/releases/ogg/ ... 1.3.tar.gz
wget http://downloads.xiph.org/releases/vorb ... 1.2.tar.gz

Setelah itu diekstrak.
bunzip2 essential-20061022.tar.bz2; tar xvf essential-20061022.tar
tar zxvf flvtool2_1.0.5_rc6.tgz
tar zxvf lame-3.97.tar.gz
bunzip2 ffmpeg-php-0.5.0.tbz2; tar xvf ffmpeg-php-0.5.0.tar
tar zxvf libogg-1.1.3.tar.gz
tar zxvf libvorbis-1.1.2.tar.gz

Kemudian kita membuat beberapa direktori tambahan
mkdir /usr/local/lib/codecs/
mv essential-20061022/* /usr/local/lib/codecs/
chmod -R 755 /usr/local/lib/codecs/

Kita juga membutuhkan SVN Ruby
yum install subversion
yum install ruby
yum install ncurses-devel

Dapatkan ffmpeg dan mcodec terbaru
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer

Masukan baris berikut kedalam /etc/ld.so.conf

Code: Select all
/usr/local/lib



kemudian jalankan
ldconfig -v

Compile LAME
cd /usr/local/src/lame-3.97
./configure
make
make install


Compile libOGG
cd /usr/local/src/libogg-1.1.3
./configure
make
make install


Compile libVorbis
cd /usr/local/src/libvorbis-1.1.2
./configure
make
make install


Compile flvtool2
cd /usr/local/src/flvtool2_1.0.5_rc6
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install


Compile MPlayer
cd /usr/local/src/mplayer
./configure
make
make install


Compile FFMPEG
cd /usr/local/src/ffmpeg
./configure --enable-libmp3lame --enable-libogg --enable-libvorbis --disable-mmx --enable-shared
echo '#define HAVE_LRINTF 1' >> config.h
make
make install

Create sh tambahan lagi
ln -s /usr/local/lib/libavformat.so.50 /usr/lib/libavformat.so.50
ln -s /usr/local/lib/libavcodec.so.51 /usr/lib/libavcodec.so.51
ln -s /usr/local/lib/libavutil.so.49 /usr/lib/libavutil.so.49
ln -s /usr/local/lib/libmp3lame.so.0 /usr/lib/libmp3lame.so.0
ln -s /usr/local/lib/libavformat.so.51 /usr/lib/libavformat.so.51

Lakukan sebelum mengcompile ffmpeg php
yum install automake
yum install autoconf
yum install libtool

Lakukan Compile FFMPEG-PHP
cd /usr/local/src/ffmpeg-php-0.5.0
phpize
./configure
make
make install

Masukan FFMPEG-PHP sebagai extention PHP
masukan baris ini ke php.ini file

extension=ffmpeg.so

Restart Apache dan jalankan FFMPEG-PHP
/etc/init.d/apache2 restart


cek apakah ffmpeg-php telah aktif pada php

php -r 'phpinfo();' | grep ffmpeg

kalo ada berarti muncul.....

Sunday, May 22, 2011

My Cisco Configuration

Sekedar share to reader.. di Kantorku kebutuhan akan bandwidth terus meningkat dari awal 2MB untuk main link internet, sekarang sudah 8 MB, dan kebutuhan itu terus meningkat seiring user dikantor terus bertambah dan haus akan informasi lewat internet. Maka itu saya membuat bandwidth limit untuk mengatur ip public di router gateway.

Fungsi pengaturan bandwidth (QoS) yang saya terapkan yaitu untuk menjaga supaya server-server operasional yang menggunakan ip public tidak tersedot bandwidthnya oleh yg laen terutama oleh proxy server yang digunakan untuk browsing, sehingga perlu dikelompokkan dalam 4 class untuk membatasi b/w hal ini. Berikut konfigurasi yang saya tambahkan di router gateway.

# Pasang Access-list untuk membatasi tiap host yang akan di shapping

access-list 102 permit ip any host 114.4.14.244
access-list 103 permit ip any host 114.4.14.245
access-list 104 permit ip any host 114.4.14.248
access-list 105 permit ip any host 114.4.14.242

access-list diatas dibagi dalam 4 untuk masing-masing host yang akan di filter/limit



#Pasang Class yang akan di shapping

class-map match-any SERVER-1
description SERVER-1
match access-group 102
class-map match-any SERVER-2
description SERVER-2
match access-group 103
class-map match-any SERVER-3
description SERVER-3
match access-group 104
class-map match-any SERVER-4
description SERVER-4
match access-group 105

#Pasang Policy Global shapping berikut:

policy-map BW-SHAPPING
class SERVER-1
police 3000000 35000 35000 conform-action transmit exceed-action drop violate-action drop
class SERVER-2
police 3000000 35000 35000 conform-action transmit exceed-action drop violate-action drop
class SERVER-3
police 1000000 35000 35000 conform-action transmit exceed-action drop violate-action drop
class SERVER-4
police 1000000 35000 35000 conform-action transmit exceed-action drop violate-action drop

Penjelasan diatas SERVER-1 dan SERVER-2 akan dibatasi download dan upload sebesar 3MB sedangkan untuk SERVER-3 dan SERVER-4 akan dibatasi maksimal 1MB.

#Pasang service policy di interface outside to provider

interface FastEthernet0/0
service-policy input BW-SHAPPING
service-policy output BW-SHAPPING
!

Untuk melihat input class bandwith yang sudah di shapping lakukan perintah berikut

show policy-map interface Fa0/0 input class SERVER-1

command diatas untuk melihat shapping class SERVER-1.

done



ENGLISH VERSION :


The following example polices the inside interface to 30Mbps. It also utilizes a fair queue mechanism so that all subnets are queued equally yet can use the entire purchased rate in the absence of competing traffic.



example.png


access-list 101 permit ip any a.a.a.a w.w.w.w ## Subnet A

access-list 102 permit ip any b.b.b.b w.w.w.w ## Subnet B

access-list 103 permit ip any c.c.c.c w.w.w.w ## Subnet C

class-map subnet-a
match access-group 101

class-map subnet-b
match access-group 102

class-map subnet-c
match access-group 103

policy-map subnets
class-map subnet-a
bandwidth percent 33
class-map subnet-b
bandwidth percent 33
class-map subnet-c
bandwidth percent 33
exit

policy-map physical
class class-default
police 30000000 conform-action transmit exceed-action drop
service-policy subnets
exit

int fa0/1
service-policy output physical
exit