Opening MacOS X Finder Window on A Hidden Folder from Terminal

Most Unix/Linux based operating system such as Ubuntu or Mac OS X has their own method to hide a specific file or folder from a File Manager application. A file or folder with a dot character (.) at the beginning on its name normally will not be shown by a simple ls command or File Manager application except configured to do so. On a Mac OS X Finder application, files Continue reading

Android: Returning Value To The Calling Activity

In my┬áprevious post, I had explained how to switch (call) to another activities and passing value to it. This time I will try to explain on how to return some value back to the calling activity. Returning some values to the calling activity can be done by the following example: Intent resultData = new Intent(); String token = “some token”; String verifier = “some verifier”; resultData.putExtra(“token”, token); resultData.putExtra(“verifier”, verifier); setResult(Activity.RESULT_OK, Continue reading

Fixing Perl Warning Setting Locale Failed Error Message on Ubuntu/Debian

If you run across Ubuntu/Debian perl or shell script and see the following locale error: perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LC_CTYPE = “UTF-8″, LANG = “en_GB.UTF-8″ are supported and installed on your system. perl: warning: Falling back to the standard locale (“C”). Then it is more likely that your Ubuntu/Debian locale is not configured properly. I Continue reading

Configure Timezone Settings on Raspberry Pi Raspbian Wheezy

Below is an example on how to configure date and timezone settings on your Raspberry Pi Raspbian Wheezy. The following example is based on Debian Linux and it is working perfectly with Raspbian Wheezy for Raspberry Pi. pi@raspi: ~ $ sudo -i password: root@raspi:~# tzselect Please identify a location so that time zone rules can be set correctly. Please select a continent or ocean. 1) Africa 2) Americas 3) Antarctica Continue reading

Connecting Raspberry Pi to WiFi

Raspberry Pi doesn’t come with WiFi adapter built-in. It only have one fast ethernet (RJ45) port to connect it to the network. In order to make your Raspberry Pi become wireless, there are many small-sized WiFi USB dongle which is work out of the box with Raspberry Pi. One of them is TP-LINK TL-WN823N WiFi USB dongle. Plug in the dongle to the Raspberry Pi USB port, then it should Continue reading

Enable DHCP Server on MacOS X Mountain Lion

MacOS X comes with DHCP server out of the box, but it is not enabled by default. The server, which is called bootpd in MacOS X, serves as DHCP server and BOOTP server. However, if you just need to enable DHCP server on your MacOS X, it is very easy. You need to create bootpd configuration file which is contains DHCP server configuration. The bootpd configurations are stored in /etc/bootpd.plist Continue reading

Install Raspbian Wheezy on Raspberry Pi SD Card Using MacOS X

Raspberry Pi is a credit card size ARM-powered mini computer which is very popular among embedded system developer and hobbyist. A vanilla Raspberry Pi is not come built-in with an operating system. The operating system for Raspberry Pi can be installed on an SD-card which is loaded during bootup process. So, to make your Raspberry Pi useful, you need to install an operating system into an SD Card, plug it Continue reading

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

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

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