Friday, October 21, 2011

stat usesfull tool on linux

Sometime you want to know about the informations of the file on you GNU/Linux machine, with stat command you will get information about the files. Please take a look the sample.

fatur@majoris:~> stat IBM\ SOP.odt
File: `IBM SOP.odt'
Size: 529948 Blocks: 1040 IO Block: 4096 regular file
Device: 801h/2049d Inode: 25691512 Links: 1
Access: (0744/-rwxr--r--) Uid: ( 2001/ fatur) Gid: ( 100/ users)
Access: 2011-10-21 19:58:52.762000001 +0700
Modify: 2011-10-21 19:58:52.722000002 +0700
Change: 2011-10-21 19:58:52.722000002 +0700
Birth: -
fatur@majoris:~>

So, without options you can have the following information:

File : Size in Bytes
Blocks : Number of blocks used
IO Block : Size in bytes of every block.
Device : The identifier number of your storage device (hard-drive, pen drive, etc.)
Inode : The inode number that the file or directory is linked to.
Access/Modify and change Times : Note that the timestamps also include which time zone that accesses or modifications took place in, in this example +0700 (Indonesia Time)

Thursday, October 13, 2011

Instalasi SQUID di OpenSUSE 11.4

Jika Anda sedang berselancar internet disuatu cafe, kantor, sekolah, kampus maupun tempat lain, dan merasakan kecepatan berselancar Anda di dunia maya terasa sangat cepat dan lancar. Boleh jadi tenpat dimana Anda berselancar memiliki proxy server dengan Squid. Ya, Squid jika anda masih bingung apa itu Squid silahkan bertanya pada Om Google atau simak link berikut ini Websitenya Squid.
Pada tutorial ini saya akan coba berikan tips tentang Squid yang diinstalasikan pada server IBM, dengan versi OpenSUSE 11.4. Pada waktu saya lihat script konfigurasi di OpenSUSE 11.4 ini sangat sederhana sekali, mungkin OpenSUSE mengindari orang-orang pusing dulu waktu lihat scriptnya dan tidak jadi melakukan instalasi.
Oya, maaf ya tips ini hanya berlaku bagi pencinta GNU/Linux saja, untuk produk operating system yang lain, silahkan googling.
Yang pertama pastikan anda tahu IP adress server Anda, soalnya pada tips ini ada konfigurasi dimana disisi client harus memasukkan alamat proxy server Squidnya.


Setelah Anda mengetahui ip Anda, langkah ke 2 lakukan instalasi Squid pada server GNU/Linux anda.



Tanda "i" pada gambar diatas berarti Squid sudah di instalasikan pada OS OpenSUSE 11.4.

Berikut adalah isi dari file squid.conf yang bisa anda edit dengan tool editing kesayangan Anda.

server1:/home/fatur # cat /etc/squid/squid.conf

Isianya adalah sebagai berikut ini:

-----------------------------------------------------------
#
# Recommended minimum configuration:
#
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl localnet src fc00::/7 # RFC 4193 local private network range
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines

acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT

#
# Recommended minimum Access Permission configuration:
#
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager

# Deny requests to certain unsafe ports
http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports

# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
http_access allow localnet
http_access allow localhost

# allow localhost always proxy functionality
http_access allow localhost

# And finally deny all other access to this proxy
http_access deny all

# Squid normally listens to port 3128
http_port 3128

# We recommend you to use at least the following line.
hierarchy_stoplist cgi-bin ?

# Uncomment and adjust the following to add a disk cache directory.
#cache_dir ufs /var/cache/squid 100 16 256

# Leave coredumps in the first cache dir
coredump_dir /var/cache/squid

# Add any of your own refresh_pattern entries above these.
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320
------------------------------------------------------------

Ya, sangat simpel sekali, jika Anda belum pernah melihat konfigurasi sebelumnya, selayaknya Anda harus bersyukur, karena kalau Anda melihat konfigurasinya pasti sedikit puyeng...

Berikut adalah beberapa bagian yang saya rubah.

----------------------------------------------------------------------
acl localnet src 192.168.1.0/24 # RFC1918 possible internal network
cache_dir ufs /var/cache/squid 20000 16 256
----------------------------------------------------------------------

Mungkin Anda bingung, dengan melakukan editing 2 line diatas, sudah punya server Squid?. Hehehehe.... jangan khawatir, memang hanya sesimpel itu. Akan tetapi, banyak opsi-opsi lain untuk memaksimalkan kinerja Squid server kita jika kita mau belajar tentunya. Jadi jangan pandang Linux itu susah, bayangkanlah Linux itu mudah, lalu lihat apa yang terjadi. Terkadang kita memang sering dipermaikan dengan pikiran kita, sesuatu yng sebenarnya mudah jadi sulit karena mikirnya udah sulit duluan. Jadi, hati-hati dengan pikiran Anda ya...

Walah, sampai lupa menterjemahkan arti line-line diatas ya. Yang pertama, artinya bahwa Squid anda dan semua komputer client yang memanfaatkan Squid berada di subnet yang sama, 192.168.1.1-192.168.1.254. Nah yang kedua, berapakah yang Anda alokasi dari space harddisk yang ada untuk squid Anda?, pada tips ini saya memberikan 20000 MB atau 2 GB space sebagai penampung/ cache. Arti dari 16 dan 256 diatas silahkan baca dokumentasinya ya, biar Anda jadi lebih mengerti.


Yang tak kalah pentingnya kita juga harus memperhatikan line berikut ini:
------------------------
http_port 3128
------------------------

Apalagi nich? Tenang, ini adalah port dimana Anda harus mensetting di browser client anda nantinya.

Udah dech, setelah hasil editing disimpan. Lakukan restart service Squid Anda dengan perintah berikut.

fatur@server1:~> sudo /etc/init.d/squid restart


Done. Horay........

Setting browser client anda seperti berikut ini.



Untuk membuktikan apakah benar Squid Anda berfungsi atau tidak lihat lognya. Lokasi dari log Squid berada di:

/var/log/squid/

Berikut ini adalah contoh isi dari lognya,

1318516410.238 153 192.168.1.64 TCP_MISS/200 18080 GET http://api.my.kompas.com/panel/timeline/? - DIRECT/202.61.113.15 application/javascript
1318516410.285 33 192.168.1.64 TCP_REFRESH_UNMODIFIED/304 518 GET http://stat.my.kidsklik.com/images/my_kompas/nav_down.png - DIRECT/202.61.113.16 image/png
1318516438.781 86 192.168.1.64 TCP_MISS/200 450 GET http://api.my.kompas.com/panel/notification/undefined? - DIRECT/202.61.113.15 application/javascript
1318516460.384 84 192.168.1.64 TCP_MISS/200 450 GET http://api.my.kompas.com/panel/notification/undefined? - DIRECT/202.61.113.15 application/javascript
1318516463.995 85 192.168.1.64 TCP_MISS/200 450 GET http://api.my.kompas.com/panel/notification/undefined? - DIRECT/202.61.113.15 application/javascript
1318516510.763 81 192.168.1.64 TCP_MISS/200 450 GET http://api.my.kompas.com/panel/notification/undefined? - DIRECT/202.61.113.15 application/javascript
1318516532.416 81 192.168.1.64 TCP_MISS/200 450 GET http://api.my.kompas.com/panel/notification/undefined? - DIRECT/202.61.113.15 application/javascript
1318516535.988 90 192.168.1.64 TCP_MISS/200 450 GET http://api.my.kompas.com/panel/notification/undefined? - DIRECT/202.61.113.15 application/javascript
1318516547.182 163 192.168.1.64 TCP_MISS/200 18131 GET http://api.my.kompas.com/panel/timeline/? - DIRECT/202.61.113.15 application/javascript
1318516547.252 57 192.168.1.64 TCP_REFRESH_UNMODIFIED/304 518 GET http://stat.my.kidsklik.com/images/my_kompas/nav_down.png - DIRECT/202.61.113.16 image/png
1318516552.395 290 192.168.1.64 TCP_REFRESH_MODIFIED/302 806 GET http://fxfeeds.mozilla.com/en-US/firefox/headlines.xml - DIRECT/68.232.44.119 text/html
1318516552.457 58 192.168.1.64 TCP_REFRESH_MODIFIED/302 854 GET http://fxfeeds.mozilla.com/firefox/headlines.xml - DIRECT/68.232.44.119 text/html
1318516552.756 295 192.168.1.64 TCP_MISS/301 689 GET http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml - DIRECT/118.98.42.114 text/html
1318516553.003 244 192.168.1.64 TCP_REFRESH_MODIFIED/200 11939 GET http://feeds.bbci.co.uk/news/rss.xml? - DIRECT/118.98.42.88 text/xml
1318516561.732 161 192.168.1.64 TCP_MISS/200 18131 GET http://api.my.kompas.com/panel/timeline/? - DIRECT/202.61.113.15 application/javascript
1318516563.310 161 192.168.1.64 TCP_MISS/200 18131 GET http://api.my.kompas.com/panel/timeline/? - DIRECT/202.61.113.15 application/javascript
1318516563.356 32 192.168.1.64 TCP_REFRESH_UNMODIFIED/304 518 GET http://stat.my.kidsklik.com/images/my_kompas/nav_down.png - DIRECT/202.61.113.16 image/png
1318516582.739 81 192.168.1.64 TCP_MISS/200 450 GET http://api.my.kompas.com/panel/notification/undefined? - DIRECT/202.61.113.15 application/javascript
1318516604.358 81 192.168.1.64 TCP_MISS/200 450 GET http://api.my.kompas.com/panel/notification/undefined? - DIRECT/202.61.113.15 application/javascript
1318516607.973 87 192.168.1.64 TCP_MISS/200 450 GET http://api.my.kompas.com/panel/notification/undefined? - DIRECT/202.61.113.15 application/javascript
server1:/home/fatur #


Semoga memberikan pencerahan, selamat mencoba ya, semoga berhasil.

Melakukan resize file yang besar dikompres menjadi file kecil

Video berikut ini adalah tips untuk Anda yang akan melakukan resize pada sebuah file PDF yang besar menjadi file PDF yang lebih kecil. Selamat menikmati, semoga membantu.

Menggabungkan file kecil yang telah dipecah (zoom)

Pada tutorial sebelumnya sudah saya berikan tips, yaitu cara melakukan pemecahan file besar menjadi beberapa bagian files kecil. Nah kali ini saya akan melakukan penggabungan file yang kecil-kecil tersebut menjadi satu kesatuan file, sehingga file yang akan digababungkan nanti menjadi satu kesatuan yang utuh. Berikut adalah tips yang akan saya berikan, selamat menikmati semoga bermanfaat.


Wednesday, October 12, 2011

Memecah file besar menjadi file kecil dengan Winzip

Terkadang kita mempunyai sebuah file besar yang harus kita kirimkan dengan e-mail. Seperti yang kita ketahui sendiri untuk mengirimkan file besar dengan email sangat sulit dan mempunyai batasan.
Oleh karena itulah, video ini dibuat. Intinya adalah melakukan pemecahan file besar menjadi beberapa buah file kecil agar memudahkan untuk dikirimkan melalui email.

Selamat menikmati, semoga bermanfaat.


Menyimpan alamt email di google mail

Jika Anda mempunyai email di Google, maka semua email yang masuk dapat dengan mudah kita melakukan update buku alamat ke dalam account kita. Bagaimana caranya, simak video berikut ini. Semoga bermanfaat.