It's My Life

Sesungguhnya, bahagia itu sederhana dan masalah itu ribet. Jika ingin bahagia, sederhanakan masalah yang ada

It's My Life

Jangan tanyakan apa yang bisa dilakukan seseorang untukmu. Tanyakan apa yang bisa kamu lakukan untuknya.

It's My Life

Ketika kenyataan tidak sesuai dengan harapan, berpikirlah, cari dan temukan penyebabnya, dan jangan pernah berhenti berharap.

It's My Life

Setiap ada awal pasti ada akhir, setiap masalah pasti ada solusi. Jangan pernah menyerah, percaya diri, karena bahagia telah menanti.

Kamis, 16 Januari 2014

Ini dia kumpulan perintah perintah penting di ubuntu/Linux. Lumayanlah kalo semuanya bisa di hafal :))


Tapi sebelumnya alangkah baiknya kalo buka google translate dulu buat yang tidak terlalu mahir bahasa inggrisnya karna artikel ini berisikan bahasa inggris hehe.. atau biar lebih mudah install saja paket bawaan ubuntu untuk translate seperti virtaal..cara installnya sudo apt-get install virtaal



Add a user
sudo adduser USER_NANE

Delete a user
sudo deluser USER_NAME


Change user password
sudo passwd USER_NAME

Changes user fullname, office number, office extension, and home phone number information.
sudo chfn USER_NAME

Display user information
finger USER_NAME

Temporarily prevent a user from logging in
sudo usermod -L USER_NAME

Revoke the operation above
sudo usermod -U USER_NAME

Add a user to admin group
sudo usermod -G admin -a USER_NAME

Clear Bash history
history -c

Display Linux distributor's ID
lsb_release -is

Display Linux release number
lsb_release -rs

Display Linux code name
lsb_release -cs

Display machine hardware name
uname -m

List all PCI devices, such as display card and ethernet card.
lspci

Reclaim memory which stores pagecache, dentries and inodes
echo 3 > /proc/sys/vm/drop_caches

Display a list of modules in the Linux Kernel
lsmod

List USB devices
lsusb -v

Display the status of ethernet card
sudo ethtool eth0

List hardware
sudo lshw

List harddisk partitions
sudo fdisk -l

Display SATA harddisk parameters
sudo hdparm -I /dev/sda


Display disk space usage
df -h

Display file/folder space usage
du -bsh FOLDER_NAME

Display amount of free and used memory
free

Display processes
ps -e

Display a tree of processes
pstree

Display processes dynamically
top

Terminate a process with a given process id
sudo kill -9 PROCESS_ID

Terminate all processes with a given name
sudo killall PROCESS_NAME

List files which are opened by a given process
lsof -p PROCESS_ID
lsof -c PROCESS_NAME

List processes which opened a given file
lsof FILE_NAME

List processes which are using port 80
lsof -i :80

Configure an ADSL connection
sudo pppoeconf

Starts up ADSL connections
sudo pon

Shuts down ADSL connections
sudo poff

Display MAC of a given IP address
arping IP_ADDRESS

Display NetBIOS name of a given IP address
nmblookup -A IP_ADDRESS

Display IP address and MAC
ifconfig -a

Display route
netstat -rn

Set MAC of ethernet interface
sudo ifconfig eth0 hw ether 00:11:22:33:44:55

Display information of a domain name
whois example.com

Display the network path to a given host
tracepath example.com

Request an IP address from DHCP server
sudo dhclient

Temporarily restart an init script
sudo /etc/init.d/SCRIPT_NAME restart

Temporarily stop an init script
sudo /etc/init.d/SCRIPT_NAME stop

Set the HTTP proxy
export http_proxy=http://PROXY.DOMAIN.NAME:PORT

Modify the information displayed after logging in
sudo vim /etc/motd.tail

Choose the input method for X Window
im-switch -c

Convert the file name from GBK to UTF8
convmv -r -f gbk -t utf8 --notest FILE_NAME

Convert the file content from GBK to UTF8
iconv -f gbk -t utf8 FILE_NAME

Convert tags in '*.mp3' from GBK to UTF8
find . -name '*.mp3' -execdir mid3iconv -e GBK {} \;

Read a long file
less FILE_NAME

Print lines matching a pattern
grep REG_EXP FILE_NAME

Display a list of file name. The files contain a given string.
grep -lr REG_EXP PATHNAME

Display all '.txt' file
find . -name '*.txt'

Create two empty files
touch file_name_1 file_name_2

Create directory. Create parent directories as needed.
mkdir -p /tmp/a/b/c/d/e

Change working directory to the home folder
cd

Change working directory to the previous working directory
cd -

Display hidden files
ls -a

Copy directory. Preserve links, file mode, ownership, timestamps.
cp -a SOURCE_DIRECTORY DEST_DIRECTORY

Determine file type
file FILE_NAME

Output the last 6 lines
tail -n 6 FILE_NAME

Copy files via SSH
scp -rp FILE_NAME USERNAME@HOST:DEST_PATH

Rename '*.rm' files to '*.rmvb' files
rename 's/.rm$/.rmvb/' *

Change the file name to lowercase
rename 'tr/A-Z/a-z/' *

Display subdirectories in current directory
ls -d */.

Display file number in current directory
ls . | wc -w

Extract "*.gz" file
gunzip FILE_NAME.gz

Extract "*.tar.gz" file
tar zxf FILE_NAME.tar.gz

Extract "*.tar.bz2" file
tar jxf FILE_NAME.tar.bz2

Do compression
tar czf FILE_NAME.tar.gz FILE1 FILE2 FILE3
tar cjf FILE_NAME.tar.bz2 FILE1 FILE2 FILE3

Displays a calendar
cal
cal MONTH YEAR

Set the date and time via NTP
sudo ntpdate ntp.ubuntu.com

Poweroff your computer
sudo halt
sudo shutdown -h now

Poweroff your computer in 23:00
sudo shutdown -h 23:00

Poweroff your computer after 60 minutes
sudo shutdown -h +60

Reboot your computer
sudo reboot
sudo shutdown -r now

If you want some program to start up automatically, please put '.desktop' files into '~/.config/autostart'

You can configure "preferred applications" by this file "~/.local/share/applications/mimeapps.list"

Continuously monitor the memory usage
watch -d free

Display HTTP HEAD response
w3m -dump_head http://example.com

Display file content with line number
nl FILE_NAME

Eliminate Rootkit
sudo rkhunter --checkall

Change hostname
sudo hostname new_name


"Tasksel" group software packages into "task"s. You can select a "task" and then install all necessary software packages. It is easy to set up LAMP servers or cloud computing servers.
Show all tasks
tasksel --list

Display the extended description of a task
tasksel --task-desc lamp-server

List the packages which are parts of a task
tasksel --task-packages lamp-server

Install/remove a task
gksudo tasksel


Change Process priority
renice NEW_PRIORITY `pgrep NAME_OF_PROCESS`
example: renice 5 `pgrep firefox`
renice -5 `pgrep wine-server`
high <------------------> low
NEW_PRIORITY = -19, -18, -17 [...] 18, 19, 20


~/.thumbnails/ directory is a cache dir GNOME makes when you browse through your folders in nautilus.
It contains thumbnail pictures of picture files you've previously looked at.You can get its total size by
du -bs ~/.thumbnails/

You can delete the files in the .thumbnails directory that haven't been accessed for seven days, to free disk space.
find ~/.thumbnails/ -type f -atime +7 -exec rm {} \;


Capture screen after 10 seconds
gnome-screenshot -d 10

Capture current window after 10 seconds
gnome-screenshot -wd 10


Start GConf editor:
Press Alt+F2, type 'gconf-editor'.

Set apt source
sudo software-properties-gtk
sudo software-properties-kde

Display the packages which are not installed but have remained residual config
dpkg -l | awk '/^rc/ {print $2}'


Add a PPA repository:
sudo add-apt-repository ppa:PPA-REPOSITORY-NAME

Display a list of files. The files are installed from a given package.
dpkg -L PACKAGE_NAME

Display a list of packages. The packages installed a given file.
dpkg -S FILE_NAME

Display a list of packages. The name of packages matches given regex pattern.
apt-cache search REG_EXPRESSION

Display a list of packages. The packages provide a given file.
apt-file search FILE_NAME

Display a list of packages. The given package depends on the list of packages.
apt-cache depends PACKAGE_NAME

Display a list of packages. These packages depend on the given package.
apt-cache rdepends PACKAGE_NAME

Prompt for a disk to be inserted and then add the disc to the source list.
sudo apt-cdrom add

Install the newest versions of all packages currently installed on the system.
sudo apt-get upgrade

Delete residual package configuration files.
dpkg -l | grep ^rc | awk '{print $2}' | sudo xargs dpkg -P

Automatically install necessary files for './configure ; make ; make install'
sudo auto-apt run ./configure

Save the list of packages currently installed on your system.
dpkg --get-selections | grep -v deinstall > SOME_FILE
Then use the file to restore packages.
dpkg --set-selections < SOME_FILE ; sudo dselect


After running "sudo apt-get install", "*.deb" files are stored in "/var/cache/apt/archives"
You can clean this directory by:
sudo apt-get clean

Display URL for a given package
apt-get -qq --print-uris install PACKAGE_NAME

Display some statistics about the apt cache
apt-cache stats

Display all package name
apt-cache pkgnames

Display some information of a given package
apt-cache show PACKAGE_NAME

Swap merupakan sebuah Virtual Memori (memory bayangan), yang mempunyai fungsi sebagai memori tambahan untuk memori fisik (RAM) dikomputer kita. Di semua sistem operasi (termasuk Linux) memori mempunyai fungsi sebagai tempat untuk penyimpanan sementara berbagai macam modul dan driver-driver yang dibutuhkan untuk menjalankan suatu sistem operasi, yang sekaligus juga digunakan untuk menjalankan aplikasi-aplikasi yang kita jalankan, kekurangan dari memori fisik adalah kapasitasnya yang relatif kecil, sehingga terkadang system terasa lambat dikarenakan penggunaan memori fisik di system telah penuh terpakai, untuk mengatasi hal tersebut maka digunakanlah suatu metode yang dikenal dengan Virtual Memori, di sistem Linux memori bayangan ini biasanya merupakan suatu partisi di hardisk yang mempunyai tipe file sistem Linux Swap, akan tetapi sebenarnya di Linux kita bisa membuat ataupun menambahkan Virtual Memori tanpa mengubah partisi di hardisk yaitu dengan menggunakan file yang mempunyai ekstensi (jenis file) misalnya contoh.swp yang akan kita gunakan sebagai Virtual Memory.
Linux Swap merupakan file sistem yang dikembangkan oleh Linux untuk dimanfaatkan pada file swap OS Linux. File swap merupakan file yang berfungsi sebagai ruang penyimpanan sementara data memori. Dengan adanya file swap, maka sistem operasi dapat melakukan penyimpanan bit-bit data dari program yang sedang tidak digunakan pada hard disk. Pemakaian file swap akan membantu kecepatan pengeksekusian program pada sistem operasi Linux.
Swap banyak membantu saat akan menginstall sistem operasi lain dalam komputer (multi-OS) swap menyediakan tempat yang dapat dipakai bersama-sama jika kita menginstall Linux lebih dari satu. Jika kita akan menggunakan multi sistem operasi pada komputer, maka perlu diketahui salah satu perbedaan mendasar antara sistem operasi Windows dan sistem operasi Linux terletak pada cara pengidentifikasian partisi. Windows mengalokasikan label huruf pada drive berdasarkan susunan partisi yang dikenalinya dan tidak menamai disk secara spesifik, sedangkan Linux memakai posisi disk berdasarkan pada interface dan pada susunan partisi setiap disk.
Diposkan oleh Nink Ellyza di 00:05 0 komentar
CARA PEMBUATAN SWAP
Disini kita akan mencoba untuk membuat Swap tambahan dengan menggunakan file yang berfungsi sebagai Virtual Memory tambahan, dan berikut marupakan langkah-langkahnya:
~$su
~$password: (kemudian masukan password root anda)
Diasumsikan kita telah login sebagai pengguna biasa (user), kemudian perintah su (substitute user) digunakan untuk masuk sebagai super user (Administrator), langkah selanjutnya adalah membuat file kosong dengan nama contoh.swp, Letakan saja dibawah direktori root ( / ), disini kita akan membuat sebuah file dengan ukuran 300M (sesuaikan saja dengan kebutuhan kita). bs menunjukkan satuan ukuran dan count menunjukkan jumlah pengalinya.

~#dd if=/dev/zero of=/swap.swp bs=1M count=300
Perintah dd mempunyai fungsi memerintahkan sistem untuk melakukan copy image dari suatu file, bs digunakan untuk menunjukan ukuran file, dan count akan menunjukan jumlah pengalinya
~#mkswap /swap.swp
Perintah mkswap digunakan untuk menjadikan file yang baru saja kita buat menjadi sebuah swap (Virtual Memory)
~$vi /etc/fstab
Supaya swap tersebut aktif setiap kali komputer booting maka kita perlu melakukan sedikit perubahan file /etc/fstab dan kemudiankita tambahkan baris berikut :
/swap.swp none swap sw 0 0
Dan kemudian jalankan perintah berikut :
~$swapon -a
Perintah swapon digunakan untuk mengktifkan semua swap di system Linux kita, sedangkan option –a mempunyai arti all (semua)
~$free
Dan untuk melihat hasilnya kita dapat menggunakan perintah free yang mempunyai fungsi untuk melihat memory kosong (termasuk swap) di komputer kita.
Diposkan oleh Nink Ellyza di 00:04 0 komentar
PARTISI HARDISK DI GNU/LINUX
Partisi adalah space/ruang dalam hardisk yang dibagi-bagi dengan kapasitas tertentu dengan file system tertentu.Pada dasarnya, hardisk dapat dibagi menjadi maksimal 4 partisi primer. Salah satu partisi primer tersebut bisa digunakan sebagai partisi primer extended yang dapat di bagi menjadi partisi-patisi sekunder/logical partition.
Partisi logika ini tidak memiliki batasan jumlah. Kita bisa membuatnya sebanyak mungkin asal kapasitas hardisk memadai. Partisi adalah bagian yang amat esensial dalam GNU/Linux. Umumnya, Linux hanya memerlukan dua partisi saja. Partisi Swap dan root (/). Secara rinci, kita bisa saja membuat lebih dari dua partisi untuk GNU/Linux. Misalnya, partisi khusus untuk direktori /boot, /home, /usr, /bin, /var, /etc atau partisi tambahan lainnya. Tapi, bagi pemula, cukup membagi-nya menjadi 3 partisi saja. Partisi swap (2x RAM komputer saya), partisi root (/) untuk bernaungnya direktori lain, dan partisi /home untuk menyimpan data-data.
Partisi khusus untuk direktori /home diperlukan untuk menghindari kehilangan data saat sistem crash dan perlu di-reinstalasi. Setiap partisi memiliki kebutuhan file sistem (fs) tersendiri. Partisi swap ber-fs swap. Partisi root (/) dengan kapasitas minimal 2 Gb, ber-fs pilih saja) ext2, ext3 atau Reiserfs.

Rabu, 15 Januari 2014




ls-al: Melihat di directory mana atau Aliases kita berada 
ls-ALF / etc / vdomainaliases: Melihat atau mencari user dan domains yg ada di shell 
ls-ALF / etc / vmail: Melihat Vmail yg ada di shell 
rm-fr / rm - rf: Menghapus directory atau file yg ada di shell 
: exp: rm-rf file.php 
chmod: Change permition atau mengganti permition file atau directory 
: exp: chmod 777 file.php atau chmod 777 includes 
touch: Membuat file kosong 
: exp: touch file.php 
mkdir: Membuat directory 
: exp: mkdir images 
rmdir: Menghapus directory 
: exp: rmdir images 
mv: Move atau rename file 
: exp: mv file.php file.html atau mv file.php includes jika Anda ingin memindahkan file ke suatu directory 
tar-zxfv: Extract tar.gz file 
: exp: tar-zxfv psybnc.tar.gz 
lwp-download: Download file dari URL 
: exp: lwp-download http://site.com/script/injek.txt 
wget: Download file dari URL 
: exp: wget http://site.com/script/injek.txt 
who: Melihat dengan siapa kita login 
whoami: Melihat sebagai apakah kita login 
uname-a: Melihat info lengkap tentang versi dari shell kita 
find / - type d-perm 777: Mencari Directory dengan permition 777 
find | grep config: Mencari seluruh configurasi di shell 
perl: Run perl 
: exp: perl feelcomz_rfi_scan.pl 
killall perl: Menghentikan semua perl 
history-c: Clear history 
cd: Change directory atau mengganti directory 
: exp: cd includes 
passwd: Mengganti password 
cat: Melihat isi sebuah file 
: exp: cat file.php 
cat / etc / userdomains: Melihat domain yg ada di dalam shell 
/ sbin / ifconfig / | grep inet: Melihat jumlah ip yg ada di dalam shell 
whereis: Mencari suatu file berdasarkan file name 
cat / etc / hosts: Melihat host dari shell

Popular Posts

Blogger news

Blog Archive

Diberdayakan oleh Blogger.

Wikipedia

Hasil penelusuran

About

Recent Posts

Blogroll

Purple Fire Pointer