How to fix warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)

When you do an SSH to a certain server and execute some command in terminal, you may notice a warning that said “warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)”. This caused a few problems when running some perl or installation scripts that would complain about the locale variables not being set. This warning occurs when I am trying to do a remote command to my Ubuntu server through an SSH from Continue reading How to fix warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)

Backup Your MySQL Database Contents to SQL File Using PHP

Here’s a snippet to backup MySQL database content to SQL file using PHP code. This code is very useful when you want to make a daily or hourly snapshot of your currently running database. Or maybe you want to add a backup feature on your blog CMS. backup_tables(‘localhost’,’username’,’password’,’blog’); /* backup the db OR just a table */ function backup_tables($host,$user,$pass,$name,$tables = ‘*’) { $link = mysql_connect($host,$user,$pass); mysql_select_db($name,$link); //get all of the Continue reading Backup Your MySQL Database Contents to SQL File Using PHP

Make Ubuntu iptables Rules Persistent Across Restart

By default, Ubuntu (desktop) is different than Fedora in terms of iptables rules persistence. Ubuntu’s iptables rules are live and not persistent, so that Ubuntu’s rule will always reset after system restart. There are many ways to make it persistent, the one easy to do that is installing iptables-persistent package using apt-get. Below is a terminal output while installing iptables-persistent package. During installation, you will prompted whether you want to Continue reading Make Ubuntu iptables Rules Persistent Across Restart

Using root User on Ubuntu

By default, Ubuntu are using sudo by a sudoer to issue a root-only command rather than using root user. Sometimes it is annoying while you are configuring your Ubuntu box by typing sudo and password on every (root-only) command that you type. You can activate the root user (and setup/change root password) using the following command: aryo@ubuntu:~$ sudo su – [sudo] password for aryo: root@ubuntu:~# passwd Enter new UNIX password: Continue reading Using root User on Ubuntu

Fixing Apache 2 “Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName” Error on Raspberry Pi Wheezy

You might probably find this error while starting/restarting Apache web server on Raspberry Pi Wheezy: root@raspi:# /etc/init.d/apache2 restart [….] Restarting web server: apache2apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName … waiting apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName . ok This error caused by Apache’s ServerName confguration is missing in apache2.conf file. So, as Continue reading Fixing Apache 2 “Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName” Error on Raspberry Pi Wheezy