Nagios is software monitoring. It can monitor server uptime, service, and so on. For more details, you can go here.
To install nagios, follow step below:
Wednesday, December 31, 2014
Install Nagios from Sources in CentOS 6.X
Wednesday, December 24, 2014
Set and Remove Proxy for Git
To set Proxy into git, do this step
- Open git console
- Type this
git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:8080Where:
git config --global https.proxy https://proxyuser:proxypwd@proxy.server.com:8080
- proxyuser is username for proxy
- proxypwd is proxy password for the username
- proxy.server.com is address of the proxy. It can be IP address.
- 8080 is proxy port. You can change it based on your proxy configuration
git config --global http.proxy http://proxy.server.com:8080If you want to unset proxy, just do this:
git config --global https.proxy https://proxy.server.com:8080
git config --global --unset http.proxy
git config --global --unset https.proxy
Saturday, December 13, 2014
Import Mysql Dump into PostgreSQL Ubuntu
First, you must dump mysql with command below
After that, you need to convert sql into psql. You can go github repository here.
After you get psql format, than you can import with
mysqldump --compatible=postgresql --default-character-set=utf8 -r nama_file.sql -u root -p db_nameIf you don't need mysql password, please remove "-p"
After that, you need to convert sql into psql. You can go github repository here.
After you get psql format, than you can import with
psql -U postgres -h localhost -d database_name -f nama_file.psql
Friday, November 14, 2014
Check File With High Disk Usage On Debian / Ubuntu
In server with limited disk space, high size file is very annoying if we can not find what file it is. So this command will show you what file that has high size
Source:
http://www.cyberciti.biz/faq/find-large-files-linux/
find / -type f -size +10000k -exec ls -lh {} \"/" show that it will search in the root directory and 10000k means that the file must have > 10.000k (10MB) in size. You can change it based on your need.
Source:
http://www.cyberciti.biz/faq/find-large-files-linux/
Saturday, October 25, 2014
Change Hostname Permanently CentOS 6.5
To change hostname permanently, you need to do this
Source: http://unix.stackexchange.com/questions/145019/how-to-change-hostname-on-centos-6-5
- nano /etc/sysconfig/network
- Change "HOSTNAME=yourNewDesiredHostname"
- nano /etc/hosts
- Change "127.0.0.1 yourDesiredHostname.com"
Source: http://unix.stackexchange.com/questions/145019/how-to-change-hostname-on-centos-6-5
Tuesday, September 23, 2014
Resize Multiple Image Ubuntu
If you have many big size image and want to resize into smaller size, you can resize all image with just 1 command in terminal. This tutorial take example if you have many image with .JPG extension and you want to resize 25% of the original dimension
Sunday, September 21, 2014
Create Virtual Host Apache Ubuntu
Virtual host make a server can handle many domain on it. To make virtual host on apache, follow steps below. This tutorial needs prerequisite an apache installed.
Saturday, September 20, 2014
How To Check TUN/TAP or PPP is Enabled
To check if TUN/TAP is enabled on your server, type this
To check if PPP is enabled, do this
Source:
http://forum.host1plus.com/vps-support/428-how-check-if-tun-tap-ppp-enabled-your-vps.html
cat /dev/net/tunIf the result is
cat: /dev/net/tun: File descriptor in bad stateyour module has been enabled on your server.
To check if PPP is enabled, do this
cat /dev/pppif you receive message
cat: /dev/ppp: No such device or addressthe module has been enabled successfully.
Source:
http://forum.host1plus.com/vps-support/428-how-check-if-tun-tap-ppp-enabled-your-vps.html
Friday, September 19, 2014
Fix Owncloud High CPU Usage Ubuntu
Owncloud is the best free cloud storage software that can be installed on your server for now. But there are some bugs. The most annoying bug is owncloud client use about 50% of your cpu usage. To fix this, I just use a little tricky step, using little program named cpulimit. That program can limit cpu usage used by background program
Install squid33 in FreeBSD 9.2
- Add package squid33
- Masuk ke directory squid
- Compile and choose some option that fit with your requirement
- You can edit your squid configuration in /usr/local/etc/squid/squid.conf
- Make squid cache
- Insert squid to system boot. Open /etc/rc.conf and add squid_enable="YES"
- Start your squid
pkg_add -r squid33
cd /usr/ports/www/squid33
make install clean
squid -z
service squid start
Source:
http://wiki.squid-cache.org/KnowledgeBase/FreeBSD
Force Using https Instead of http Ubuntu 14.04
The main idea for this forcing is redirect your http://yourdomain.com to https://yourdomain.com. This tutorial use apache web server. To do this, follow this step:
Sumber:
https://wiki.apache.org/httpd/RedirectSSL
- Open your web server configuration
nano /etc/apache2/sites-available/000-default.conf
- Add this line before </VirtualHost>
- Save and restart your apache
Redirect permanent / https://yourdomain.com
service apache2 restart
Sumber:
https://wiki.apache.org/httpd/RedirectSSL
Install Comodo SSL Ke Apache Ubuntu 14.04
Sekilas tentang SSL
Istilah gampangnya adalah SSL memungkinkan kita untuk mengubah akses ke website dari http menjadi https. Keungguan https adalah adanya enkripsi dari komputer kita ke web server. Kalo mengirim password tanpa https, maka password akan dapat dengan mudah dibaca, sedangkan kalo pake https, maka semua data yang dikirim ataupun yang diterima akan di enkripsi, sehingga tidak mudah untuk disadap. Untuk tutorial kali ini, apache web server harus sudah terinstall dan IP yang digunakan adalah IP global yang static.
Hal yang perlu dilakukan untuk memasang ComodoSSL adalah sebagai berikut:
Istilah gampangnya adalah SSL memungkinkan kita untuk mengubah akses ke website dari http menjadi https. Keungguan https adalah adanya enkripsi dari komputer kita ke web server. Kalo mengirim password tanpa https, maka password akan dapat dengan mudah dibaca, sedangkan kalo pake https, maka semua data yang dikirim ataupun yang diterima akan di enkripsi, sehingga tidak mudah untuk disadap. Untuk tutorial kali ini, apache web server harus sudah terinstall dan IP yang digunakan adalah IP global yang static.
Hal yang perlu dilakukan untuk memasang ComodoSSL adalah sebagai berikut:
Friday, August 22, 2014
Enable Root Login Over SSH in FreeBSD 10.0
By default, we cannot login to FreeBSD over ssh. So, we must enable it from openSSH configuration.
Open /etc/ssh/sshd_config with your 'ee' text editor
Finally, restart your ssh daemon
Source:
http://blog.bobbyallen.me/2011/07/22/how-to-enable-root-login-over-ssh-on-freebsd-8-2/
Open /etc/ssh/sshd_config with your 'ee' text editor
ee /etc/ssh/sshd_configFind this
#PermitRootLogin noChange to
PermitRootLogin yesPress escape, and then choose yes for save confirmation.
Finally, restart your ssh daemon
service sshd restart...and done. You can login with root remotely over ssh.
Source:
http://blog.bobbyallen.me/2011/07/22/how-to-enable-root-login-over-ssh-on-freebsd-8-2/
Thursday, August 7, 2014
Installing Flash Player Ubuntu In Single Step
Close all running Firefox
Open your terminal
Type "sudo apt-get install flashplugin-nonfree"
Now flash player should be working.
Source:
http://www.cyberciti.biz/faq/ubuntu-linux-how-to-install-flash-player-for-firefox/
Open your terminal
Type "sudo apt-get install flashplugin-nonfree"
Now flash player should be working.
Source:
http://www.cyberciti.biz/faq/ubuntu-linux-how-to-install-flash-player-for-firefox/
Thursday, July 17, 2014
Deleting Single Iptables Rule
I look at my iptables rules
For example I make rule to accept port 80, so I do this
http://major.io/2007/02/09/delete-single-iptables-rules/
iptables -Land get this
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere
ACCEPT all -- anywhere anywhere
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
For example I make rule to accept port 80, so I do this
iptables -I INPUT 3 -p tcp --dport 80 -j ACCEPTand then iptables -L give us this
Chain INPUT (policy ACCEPT)Look at third line, there is rule for accepting connection from port 80. The rule inserted in third line because I use 3 in this rule
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT all -- anywhere anywhere
iptables -I INPUT 3 -p tcp --dport 80 -j ACCEPTIf we want to delete this single rule, do
iptables -D INPUT 3So iptables -L give us
Chain INPUT (policy ACCEPT)Source:
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere
ACCEPT all -- anywhere anywhere
http://major.io/2007/02/09/delete-single-iptables-rules/
Upgrade Ubuntu 12.04 to Ubuntu 14.04
Ensure that your Ubuntu is up to date
sudo apt-get update && sudo apt-get upgrade -yInstall update manager core
sudo apt-get install update-manager-core -yUpgrade your Ubuntu
sudo do-release-upgrade -dAnd follow next instruction carefully.....
Source:
http://www.namhuy.net/2853/upgrade-ubuntu-12-04-lts-ubuntu-14-04-lts.html
Wednesday, July 16, 2014
Grant Root Access To Additional User FreeBSD
Just add user to group wheel with this
pw user mod username -G wheelFor example I add user akhfa to wheel group
pw user mod akhfa -G wheelIf you do it well, if you type
groups akhfayou will get
akhfa wheelSource:
http://www.cyberciti.biz/tips/freebsd-becoming-super-user-su-or-enabling-su-access-to-user.html
Install Nano On FreeBSD
Go to nano directory
cd /usr/ports/editors/nanoCompile and install nano
make install cleanMake symbolic link
ln -s /usr/local/bin/nano /usr/bin/nanoSource:
http://blog.bobbyallen.me/2012/05/28/how-to-install-nano-on-freebsd/
Updating FreeBSD
To update your FreeBSD, do this
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/updating-upgrading-freebsdupdate.html
freebsd-update fetch
freebsd-update installIf something wrong, you can cancel update by
freebsd-update rollbackSource:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/updating-upgrading-freebsdupdate.html
Tuesday, July 8, 2014
Install Htop On CentOS
Htop, a process manager based on command line interface, is a powerful tool to manage process from terminal.
Sunday, July 6, 2014
Enable Remote Access To Mysql Database Server Or On VPS Ubuntu
If you want to make application with remote database, you will need to grant database on your server to be accessed by your application. Now I will tell you how to grant access so your application can use mysql from your server.
Friday, July 4, 2014
Fix GPG Error Ubuntu
Sometimes you can find like this on terminal when updating repository
W: There is no public key available for the following key IDs:If you found it, fix with this
3B4FE6ACC0B21F32
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32And then try "apt-get update" again
Install Dropbear And Change Dropbear Port On Ubuntu
Make sure that your Ubuntu is up to date
sudo apt-get update && sudo apt-get upgrade -yTo install Dropbear, run this on terminal
sudo apt-get install dropbearTo start and change dropbear port, make sure nano was installed and do this
Sunday, June 29, 2014
Change Boot Splash Ubuntu To Kubuntu
If you are boring on your boot splash and want to change into Kubuntu boot splash, you can do it by
sudo apt-get install plymouth-theme-kubuntu-logoTo change back to Ubuntu boot splash, do this
update-alternatives --config default.plymouthand then choose by inserting the number of boot splash you want....
Sunday, April 27, 2014
Make Colorful Folder Icon in Nautilus
Folder Color is a Nautilus extension that allows you to easily change the folder icon color to some predefined colors such as blue, pink, black, yellow, violet, orange, green, grey or red. With a small tweak, the extension also works with Nemo file manager.
Saturday, April 26, 2014
Install and Configure Apache Tomcat in Netbeans Ubuntu
- If Tomcat is not installed yet, install it first
sudo apt-get install tomcat7
- And then configure like this
cd /usr/share/tomcat7
sudo mkdir common
cd common
sudo ln -s ../lib lib
cd ..
sudo mkdir conf
cd conf
sudo ln -s /etc/tomcat7/server.xml server.xml
sudo chmod o+rx /usr/share/tomcat7/conf
- Open service tab on upper left beside project tab
- Right click servers, add server
- Choose Apache Tomcat
- Browse server location in /usr/share/tomcat7
- Enter username and password you want, for example I add "admin" for the username and password
- Open terminal and execute
sudo nano /etc/tomcat7/tomcat-users.xml
- Add this on the top of </tomcat-users>
<role rolename="admin-gui"/>
<user username="admin" password="admin" roles="admin-gui"/>
- Press Ctrl + O and the enter
- Type this in terminal
sudo service tomcat7 restart
- Access your apache tomcat from browser in http://localhost:8080
- The root web directory located in /usr/share/tomcat7-root/default_root
Install Adobe Reader Ubuntu
- Get installer here
- Open the deb with gdebi or software center or dpkg
Friday, April 25, 2014
Source For Adding File System into Linux
- http://www.ibm.com/developerworks/library/l-fuse/
- http://www.cs.nmsu.edu/~pfeiffer/fuse-tutorial/
- http://pramode.net/articles/lfy/fuse/pramode.html
- http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=9&cad=rja&uact=8&ved=0CHUQFjAI&url=http%3A%2F%2Fstuff.mit.edu%2Fiap%2F2009%2Ffuse%2Ffuse.ppt&ei=01haU9mxGc_gsASPiICAAQ&usg=AFQjCNGlgaNYXpyb0eCXYPwo0o8LdQheAw&sig2=bP5GohtBG3DwG4G9ReAkfg&bvm=bv.65397613,d.cWc
- http://easytricksportal.blogspot.com/2013/11/filesystem-in-userspace-fuse-tutorial.html#.U1pYVY-Ro8o
- http://www.youtube.com/watch?v=XUDCAk8bi2w
- http://revista.python.org.ar/3/en/html/python_en_tu_fs.html
- http://pysnippet.blogspot.com/2009/11/fuse-filesystem-in-userspace-part-1.html
- creating a temporary file in python with FUSE
- http://www.willmcgugan.com/blog/tech/2011/3/20/creating-a-virtual-filesystem-with-python-and-why-you-need-one/
- http://stackoverflow.com/questions/23208634/writting-a-simple-filesystem-in-c-using-fuse
- http://www.gtoal.com/fusestuff/fuse-2.7.0/example/fusexmp.c.html
- http://www.slideshare.net/adorepump/building-file-systems-with-fuse?qid=d3633879-840b-4135-b61b-f118eef58512&v=default&b=&from_search=1
- http://www.slideshare.net/danny00076/fuse-filesystem-in-user-space?qid=aa9bf08a-29aa-4c6c-abf9-7a9511b6699b&v=default&b=&from_search=2
- http://biematas.wordpress.com/2011/01/25/system-file/
10 Super Powerful Linux Commands
We always say that the most powerful Linux tools are its Command lines. This is because you can do about everything right from your command line. You can easily explain your computer exactly what you require and it comes back to you with appropriate results. Infact there are some commands that make this tool even more powerful! Here we bring to you a list of 10 such commands that work like energy drinks for you Linux machines!
Thursday, April 24, 2014
Solving "perl: warning: Setting locale failed" in Ubuntu
It is happen because locale setting needs to be reconfigured. To do that, just type this in terminal
source
If it doesn't successfull, try to set locale firstsudo dpkg-reconfigure locales
and then type dpkg again.sudo locale-gen en_US en_US.UTF-8
source
Sunday, April 20, 2014
Install Squid Proxy Ubuntu Server
- Install Squid
sudo apt-get install squid
- Set squid to run after startup
update-rc.d squid3 defaults
- Open squid configuration file
sudo nano /etc/squid/squid.config
- Add this to the first line of squid.conf to use ipv4 only
dns_v4_first on
- Press Ctrl+w to search "http_access deny all"
- clear "#"
- Search "acl localnet" with Ctrl+w
- add line "acl localnet src your-ip-public"
- Press Ctrl+w to search "http_access allow"
- add line "http_access allow localnet"
- Press Ctrl+o and then press enter to save edited file
- restart squid service
NB:sudo service squid3 restart
- You can change localnet to whatever you want
- To change proxy port, search "http_port 3128" and change 3128 with port you want
Friday, April 11, 2014
How Priority Queue in Java is Working
Source Code
- import java.util.*;
- class PQ{
- static class PQsort implements Comparator<Integer>{ // inverse sort
- public int compare(Integer one, Integer two){
- return two - one; // unboxing
- }
- }
- public static void main(String[] args){
- int[] ia = {1,5,3,7,6,9,8}; // unordered data
- PriorityQueue<Integer> pq1 =
- new PriorityQueue<Integer>(); // use natural order
- for (int x : ia) // load queue
- pq1.offer(x);
- for (int x : ia) // review queue
- System.out.print(pq1.poll() + " ");
- System.out.println("");
- PQsort pqs = new PQsort(); // get a Comparator
- PriorityQueue<Integer> pq2 =
- new PriorityQueue<Integer>(10,pqs); // use Comparator
- for (int x : ia) // load queue
- pq2.offer(x);
- for (int x : ia) // review queue
- System.out.print(pq2.poll() + " ");
- System.out.println(" ");
- }
- }
Saturday, April 5, 2014
Backup and Restore Database MySQL
For backup all databases
mysqldump -u username -ppassword --all-databases > /tmp/alldatabases.sqlFor backup spesific database
mysqldump -u username -ppassword --databases databasename > /tmp/filename.sqlFor restore
mysql -u username -ppassword databasename < /tmp/filename.sql
Friday, April 4, 2014
Instaling Kubuntu Desktop without KDE Application
Just type this in terminal
sudo apt-get install --no-install-recommends kubuntu-desktop
Setting Proxy for apt-get in Ubuntu
- Open terminal
- Type this
sudo nano /etc/apt/apt.conf
- Add this line if there in no authentication in your proxy
Acquire::http::proxy "http://proxyserver:port/";
- Add this if there is authentication in your proxy
Acquire::http::proxy "http://username:password@proxyserver:port/";
- Press Ctrl+x and then press y
Wednesday, March 12, 2014
Check Status and Wear Level Battery in Ubuntu
Just try this in terminal
And you will get this
In there you can get your battery status. You can also look how many real capacity your battery have. My battery have 38.006 Wh for its designed capacity but just 34.942 Wh left because battery will lose its capacity over time. Thats all :D
upower -i /org/freedesktop/UPower/devices/battery_BAT0
And you will get this
In there you can get your battery status. You can also look how many real capacity your battery have. My battery have 38.006 Wh for its designed capacity but just 34.942 Wh left because battery will lose its capacity over time. Thats all :D
Wednesday, February 5, 2014
Install qt Latest Ubuntu
Qt adalah sebuah GUI frameworks yang cross platform dan juga mendukung untuk berbagai bahasa pemrograman. Cara penginstalan di Ubuntu:
Di windows, download installer di sini
sudo apt-add-repository ppa:ubuntu-sdk-team/ppa sudo apt-get update sudo apt-get install qt-sdk
Di windows, download installer di sini
http://qt-project.org/downloads
Subscribe to:
Posts (Atom)