Saturday, December 13, 2014

Import Mysql Dump into PostgreSQL Ubuntu

First, you must dump mysql with command below
mysqldump --compatible=postgresql --default-character-set=utf8 -r nama_file.sql -u root -p db_name
 If 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
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
  • nano /etc/sysconfig/network
  • Change "HOSTNAME=yourNewDesiredHostname"
And the next step is
  • nano /etc/hosts
  • Change "127.0.0.1 yourDesiredHostname.com"
Finally reboot to take effect

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
cat /dev/net/tun
If the result is
cat: /dev/net/tun: File descriptor in bad state
your module has been enabled on your server.

To check if PPP is enabled, do this
cat /dev/ppp
if you receive message
cat: /dev/ppp: No such device or address
the 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