Tampilkan postingan dengan label Linux. Tampilkan semua postingan
Tampilkan postingan dengan label Linux. Tampilkan semua postingan

Clean Up Script On Ubuntu

Many applications in Ubuntu such as clean up one of his BleachBit. We can make your own clean-up script, if you want to try it, will you follow this step by step manner.
Open your text editor application, I use gedit and then copy the script below and paste it in your text editor, then save with clean.sh name and file type .sh, put the directory in the directory / home / user
#!/bin/bash
#
# currently this simple maintenance script performs the following functions:
#   > apt-get clean
#   > apt-get autoclean
#   > apt-get autoremove
#   > apt-get purge
#   > delete orphaned packages
#   > delete residual config files
#   > delete thumbnails (current user)
#   > delete thumbnails (root)
#   > delete mozilla cache (current user)
#   > delete mozilla cache (root)
#   > delete trash (current user)
#   > delete trash (root)
#
# requires the following packages in addition to those provided by a default Ubuntu installation:
#   > deborphan (for identifying orphaned packages) - to install, type: sudo apt-get install deborphan
#   > wajig (for purging residual config files) - to install, type: sudo apt-get install wajig
#
# NOTES:
#
# 1) This script assumes that certain files/folders are in their default Ubuntu locations. If you are
#    getting 'No such file or directory' errors then look through the script below to see if your
#    files/folders are located where the script is expecting them and edit as necessary.
# 2) The goal of this script was to do a system cleanup as quickly and efficiently as possible. Some
#    functions do require confirmation but some run without user input. Because of this and the fact
#    that this script's primary purpose is to delete data from your hard drive, it should be used with
#    caution. THE ACTIONS OF THIS SCRIPT CAN NOT BE UNDONE. If you do not understand all of the
#    functions listed above, it is suggested that you gain a passing knowledge of each. The Ubuntu man
#    pages, Google search, and openubuntu.com will provide more than enough information.
# 3) The reason for deleting some files in /root may not be obvious. Picture this scenario. You open a
#    nautilus session as administrator where you send some image files to the trash and look something
#    up on the internet. Now you have created thumbnail files and mozilla cache files saved under /root
#    and the files that you trashed are sitting in /root/.local/share/Trash/files/. All of these files
#    are easily forgotten and require root access to delete when doing a manual cleanup.
# 4) This script requires a one-time setup which is as easy editing three lines listed immediately
#    below to provide information to enable the script to find your files/folders. After editing and
#    saving the file make sure that the file is executable by setting the permissions in nautilus or
#    by typing: sudo chmod +x /path/to/file/cleanup.sh
#
# ======================================================================================================
#
# CONFIGURATION:
#
#   change "tgeer" in the following line to reflect your username (leave the double-quotes intact):
username="tgeer"
#
# change xxxxxxxx in the following line to your mozilla profile name. You can find this information by
#   looking in /home/username/.mozilla/firefox for a folder with a name in the format xxxxxxxx.default
#   where xxxxxxxx is an eight character random alphanumeric string. The eight character string is your
#   mozilla profile name. ie. if the folder is named te3n7ssp.default then your profile name is: te3n7ssp.
userprofile="vkuuxfit"
#
#   change yyyyyyyy in the following line to root's mozilla profile name. Use the same method as above to
#   find it but look in /root/.mozilla/firefox instead.
rootprofile="etjkoe2b"
#
#
homepath="/home/"$username"/"
#
# =======================================================================================================
#
printf "\nThis script will clean up your Ubuntu installation by removing packages and files which are no longer needed. The actions performed will delete data from your drive and CANNOT BE UNDONE. Proceed with caution and only if you know what you are doing.\n\n"
read -p "Run the system cleanup script? (y/N): " confirm
[ "$confirm" != "y" ] && printf "\nAborted\n\n" && exit 1
printf "\n-------------------------------------------\n"
sudo apt-get clean
printf "## apt-get clean - Done ###\n"
sudo apt-get autoclean
printf "### apt-get autoclean - Done ###\n"
sudo apt-get autoremove
printf "### apt-get autoremove - Done ##\n"
sudo apt-get purge
printf "### apt-get purge - Done ##\n"
sudo deborphan | xargs sudo apt-get -y remove --purge
printf "### remove ophaned packages - Done ###\n"
for pkg in `grep -B1 config-files /var/lib/dpkg/status | grep -v -- '--' | grep -v 'Status:' | awk '{ print $2 }' `; do
wajig purge $pkg
done
printf "### remove residual config files - Done ###\n"
rm -rf $homepath.thumbnails/normal/*
sudo sh -c "rm -rf /root/.thumbnails/normal/*"
printf "### delete thumbnails - Done ##\n"
rm -rf $homepath.mozilla/firefox/$userprofile.default/Cache/*
sudo sh -c "rm -rf /root/.mozilla/firefox/$rootprofile.default/Cache/*"
printf "### delete mozilla cache - Done ###\n"
sudo rm -rf /var/cache/apt/archives/*.deb
printf "### delete package archives - Done ###\n"
sh -c "rm -rf $homepath.local/share/Trash/*"
sudo sh -c "rm -rf /root/.local/share/Trash/*"
printf "### delete trash - Done ###\n"
printf "\a----------------------------------------------------\n"
printf "Maintenance script finished\n\n"
exit 0
Open a terminal typing
Change into executable
    chmod + x clean.sh
create an alias in the script
    alias cleanup = "~ / Scripts / clean.sh"
run script
    cleanup

Untuk Download Artikel Klik Gambar

Mengatasi error mysql “ Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock “

Ketika saya ingin membuat database mysql dari xampp ubuntu saya mendapati eror seperti ini Can't connect to local MySQL server through socket.   '/var/run/mysqld/mysqld.sock. Eror ini datang ketika mysql akan di jalankan (start), padalah xampp nya sudah jalan. Akhirnya googling masuk ke ubuntuforums.org ketemu cara nya dan berhasil juga mengatasi eror tersebut.

Berikut cara mengatasi error 

“Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock” 

1.Pertama membuat direktory mysqld di /var/run, cara nya ketikan perintah di terminal :
sudo mkdir /var/run/mysqld
2.Membuat symlink dari /opt/lampp/var/mysql/mysql.sock ke direktory yang kita buat tadi, perintah nya :
sudo ln -s /opt/lampp/var/mysql/mysql.sock /var/run/mysqld/mysqld.sock
3.Sekarang mysql sudah bisa di jalankan, ketikkan
sudo mysql
Setiap menjalankan mysql jangan lupa jalankan dulu xampp servernya, dan jalankan mysql sebagai root atau super user.
Best regards,


Untuk Download Artikel Klik Gambar

Migrasi Server : 1. Memilih Distro

Mulai hari ini hingga beberapa hari ke depan, saya akan menurunkan seri pertama migrasi sistem, berupa tutorial migrasi server. Tahapan ini akan terdiri dari :

1. Memilih distro untuk Server
2. Persiapan Migrasi
3. Instalasi Dasar
4. Setting DNS
5. Setting Samba Server
6. Setting Email Server
7. Setting Database Server
8. Setting Squid
9. Setting Web Server
10. Setting Printer CUPS
11. Setting DHCP
12. Setting NFS dan NIS
13. Setting FTP dan Firewall
14. Setting LDAP

Memilih distro untuk server bisa dilakukan dengan mudah, bisa juga dilakukan dengan sulit, tergantung cara kita melihatnya. pada prinsipnya, memilih distro untuk server dapat ditentukan dengan beberapa langkah singkat sebagai berikut :

1. Tipe Distro apa yang diinginkan, Komersil atau Free.

 Komersil memiliki dukungan profesional, Free menggunakan dukungan komunitas.
Distro khusus untuk server versi komersil terdiri dari :
Distro khusus untuk server versi free terdiri dari :
  • Centos, bisa dikatakan RHEL versi free. Similar hingga 99% dengan RHEL.
  • OpenSuSE, kelengkapan paket membuat OpenSuSE dapat dengan mudah dijadikan versi Server
  • Ubuntu Server, distro Ubuntu khusus Server
  • Debian
  • Slackware
  • Fedora versi Server [dalam tahap pengembangan]
Selain distro diatas, ada beberapa distro khusus untuk server namun secara frekwensi popularitas, distro diatas cukup mewakili.

2. Varian Distro & Paket Aplikasi

Secara umum, distro Linux mengambil 3 jenis tipe paket Aplikasi, yaitu :
  • RPM, Red Hat Package Manager. Distro server yang secara native menggunakan RPM terdiri dari : RHEL, SLES, Mandriva, Centos, OpenSuSE dan Fedora. Xandros dan Ubuntu memiliki kemampuan instalasi paket RPM, namun secara native keduanya menggunakan paket .deb.
  • DEB, Debian Type. Generasi Debian terdiri dari Xandros, Ubuntu dan Debian
  • Tar.gz, Standar Paket. Semua distro Linux mendukung paket aplikasi standar ini. Proses instalasi sedikit lebih panjang [3 berbanding 1 :-D ] dibandingkan kedua paket olahan diatas.
Untuk tutorial ini saya akan menggunakan tipe OpenSuSE 10.2, mengingat basis server yang saya gunakan adalah SuSE Linux Enterprise Server. Beberapa tahap dapat digunakan menggunakan distro lain secara langsung, namun ada tahap-tahap yang perlu disesuaikan-misalnya nama folder dan lokasi folder-jika ingin menjalankan tutorial pada distro lain. Pada prinsipnya, hampir sebagian besar distro Linux dapat dijadikan model server, mengingat paket-paket server umumnya tersedia pada setiap distro, kecuali distro yang sifatnya dikhususkan pada kemampuan tertentu.

Instalasi Webmin [SuSE Linux]

Mau administrasi server linux via web ? Webmin bisa menjadi jawabannya. Webmin menyediakan berbagai macam tools untuk konfigurasi Linux, jadi nggak ada salahnya dicoba.

Mari kita mulai,

1. Download Webmin
 (bisa ambil yang tarball atau RPM. Saya ambil yang RPM, webmin-1.270-1.noarch.rpm [updated : pada saat tulisan ini diupdate, webmin versi terbaru adalah versi 1.330]. Versi terbaru bisa diambil dari Website Webmin)
2. Copy ke lokasi install.
 Terserah kamu mau copy kemana, asal ingat lokasi tempat copy :-P . Saya sih biasa install dari folder /opt.
3. Install Webmin
Versi RPM :
- Buka Konsole / Terminal
- Masuk ke lokasi install

cd /opt
rpm -ivh webmin-1.270-1.noarch.rpm


That’s it. Kita bisa buka webmin via web dengan cara mengetikkan :
URL : http://NamaKomputer:port (10000 adalah port default. Jika kita ubah saat instalasi, sesuaikan portnya). Bisa juga dengan
URL http://IPAddress:port.
Versi Tarball
- Untar versi tarball

tar zxvf webmin-1.270-1.tar.gz

- Masyuk ke folder hasil tar

cd webmin-1.270-1 (atau cd /opt/webmin-1.270-1)

- Jalankan file setup (jika tidak ada file .sh, gunakan file .pl)

./setup.sh
- Isi semua konfigurasi sesuai pertanyaan installer webmin

4. Pasca Instalasi
Untuk melindungi konfigurasi webmin, kita bisa mengaktifkan modus ssl, dengan cara :
- Install modul perl untuk ssl (perl-Net_SSLeay). CD / DVD SUSE 10.1 atau diatasnya sudah mengikutsertakannya. Install saja via YAST.
- Buka file /etc/webmin/miniserv.conf
- Ganti ssl = 0 menjadi ssl = 1
- Restart webmin (bisa melalui menu di webmin)
- buka webmin menggunakan browser dengan mengganti protokol URL http menjadi https (https://namakomputer:port atau https://ipaddress:port).
5. Siap menggunakan webmin.
Konfigurasi Squid, Samba, DNS, Email Server Postfix dll should be easy with webmin.

Tambahan, jika module webmin kurang, bisa didownload dari DISINI.