Ubuntu Linux CLI Cheat Sheet
Ubuntu reference for beginner by FossWire, download it here. Hope will be useful.

| Subcribe via RSS
Ubuntu reference for beginner by FossWire, download it here. Hope will be useful.

Panduan ini akan terdiri dari beberapa bagian :
Uji coba dilakukan dengan mesin P3 600, RAM 128 MB dan distro Ubuntu Server 7.04. Jika uji coba ini diterapkan secara real dengan user yang cukup besar akan lebih baik jika hardware menggunakan spek yang lebih tinggi.
Asumsi :
eth0 : 10.25.10.250
eth1 : 192.168.0.250
$ sudo vim /etc/network/interfaces
auto lo
iface lo inet loopback# The primary network interface
auto eth0
iface eth0 inet static
address 10.25.10.250
netmask 255.255.255.0
network 10.25.10.0
broadcast 10.25.10.255
gateway 10.25.10.3auto eth1
iface eth1 inet static
address 192.168.0.250
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
Asumsi diatas adalah semua iface menggunakan ip lokal namun jika menggunakan ip publik langsung saja ganti iface eth0 dengan ip publik.
Bagian #1 - Manual Proxy
Instal squid, mulai dari Ubuntu 6.10 Squid 2.5 sudah digantikan dengan Squid 2.6 dan akan ada sedikit perbedaan konfigurasi khususnya pada bagian transparent proxy.
$ sudo apt-get install squid
Lakukan filter terhadap komentar yang ada di squid.conf.
$ sudo cat /etc/squid/squid.conf | sed ‘/ *#/d; /^ *$/d’ >/etc/squid/squid.conf.bak
$ sudo cat /etc/squid/squid.conf.bak > /etc/squid/squid.conf
Konfigurasi squid dengan menambahkan baris yang berhuruf tebal.
$ sudo vim /etc/squid/squid.conf
http_port 3128
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
access_log /var/log/squid/access.log squid
hosts_file /etc/hosts
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 # https
acl SSL_ports port 563 # snews
acl SSL_ports port 873 # rsync
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 Safe_ports port 631 # cups
acl Safe_ports port 873 # rsync
acl Safe_ports port 901 # SWAT
acl purge method PURGE
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
acl myLAN src 192.168.0.0/24
http_access allow myLAN
http_access deny all
http_reply_access allow all
icp_access allow all
visible_hostname www.slc.web.id
cache_effective_group proxy
coredump_dir /var/spool/squid
Jika squid sudah di konfigurasi dengan benar, maka jika service squid di restart akan tampak seperti dibawah ini.
$ sudo /etc/init.d/squid restart
* Restarting Squid HTTP proxy squid * Creating squid spool directory structure
2004/08/28 11:04:00| Creating Swap Directories
[ OK ]
Selanjutnya set proxy di browser client ke alamat 192.168.0.250 dengan port 3128, dan lakukan browsing. Kemudian cek log squid, jika terdapat log seperti dibawah ini berarti squid sudah berjalan normal.
$ sudo tail -f /var/log/squid/access.log
1188188452.488 1390 192.168.0.230 TCP_MISS/301 562 GET http://google.com/ - DIRECT/72.14.207.99 text/html
1188188454.549 2042 192.168.0.230 TCP_MISS/302 552 GET http://www.google.com/ - DIRECT/64.233.189.104 text/html
1188188456.078 1515 192.168.0.230 TCP_MISS/200 1684 GET http://www.google.co.id/ - DIRECT/64.233.189.104 text/htm
Dari log diatas dapat dilihat bahwa client dengan ip address 192.168.0.230 sedang mengakses google.com. Sampai disini setup bagian #1 setup manual proxy selesai.
Untuk dapat melakukan baca tulis partisi NTFS di Linux khususnya Ubuntu cukup hanya dengan menginstall 2 paket ; ntfs-3g dan ntfs-config.
~$ sudo apt-get install ntfs-3g ntfs-config
Kemudian jalankan ntfs-config melalui terminal atau menu Application - System Tools - NTFS Configuration Tool.



Centang kedua opsi diatas sehingga enable untuk internal dan eksternal device, restart komputer dan partisi NTFS siap digunakan.
Hari ini mencoba untuk upgrade Ubuntu ke versi 7.04, beberapa saat mencoba dist-upgrade dengan mengandalkan apt-proxy yang ada, tapi sayang seribu sayang dengan banyaknya user harus rebutan benwit dan alhasil upgrade selalu mengalami kegagalan.
Ada cara yang amat sangat hemat dan cepat untuk upgrade ke Ubuntu Feisty bagi kita yang fakir benwit. Hanya dengan berbekal 1 cd Ubuntu-Feisty-Alternate maka jadilah Ubuntu yang semula versi 6.10 menjadi 7.04.
Berikut tahapan kecil untuk upgrade :
root@nirmala:~# apt-cdrom add
root@nirmala:~# cat /etc/apt/sources.list
deb cdrom:[Ubuntu 7.04 _Feisty Fawn_ - Release i386 (20070415)]/ feisty main restricted
root@nirmala:~# apt-get update && apt-get dist-upgrade && apt-get dist-upgrade
root@nirmala:~# apt-get update && apt-get dist-upgrade
root@nirmala:~# apt-get -f install
root@nirmala:~# dpkg –configure -a
Selamat Ubuntu telah ter-upgrade.
Berikut contoh berbagi pakai file dengan hak akses read only tanpa otentikasi. Sehingga komputer yang berada dalam satu workgroup dapat mengakses tanpa diminta username dan password.
root@nirmala:~# vim /etc/samba/smb.conf
[global]
netbios name = nirmala
server string = Edubuntu
workgroup = OFFICE
announce version = 5.0
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192passdb backend = tdbsam
security = share
null password = true
username map = /etc/samba/smbusers
name resolve order = hosts wins lmhosts bcast
wins support = yesprinting = CUPS
printcap = CUPSsyslog = 1
syslog only = yes[printers]
comment = All Printers
path = /var/spool/samba
browseable = yes
writable = no
guest ok = no
public = no
printable = yes
share modes = no
locking = no[Musik]
path = /home/cp/Musik
comment = Ini Musik
public = yes
writeable = no
create mask = 0777
directory mask = 0777
force user = nobody
force group = nogroup
root@nirmala:~# /etc/init.d/samba restart
Distro yang digunakan Edubuntu 6.10, instalasi normal tanpa ada penambahan paket yang lain.
root@nirmala:~# vim /etc/ltsp/dhcpd.conf
authoritative;subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.20 192.168.0.22;
option domain-name “nirmala.slc.web.id”;
option domain-name-servers 192.168.0.1;
option broadcast-address 192.168.0.255;
option routers 192.168.0.1;
option subnet-mask 255.255.255.0;if substring( option vendor-class-identifier, 0, 9 ) = “PXEClient” {
filename “/ltsp/i386/pxelinux.0″;
}
else{
filename “/ltsp/i386/nbi.img”;
}
option root-path “/opt/ltsp/i386″;
}
root@nirmala:~# vim /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).# The loopback network interface
auto lo
iface lo inet loopback# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0
gateway 192.168.0.2
root@nirmala:~# /etc/init.d/dhcp3-server restart