Mac OS X Terminal Color

I was using linux ubuntu for my work now I’m using Mac OS X 10.7.3, I was surprised when I did ls command, the ls result returned had the same color for files and folders. Fortunately there is a trick to set ls command with colors.

Create or edit this file

~/.bash_profile

Then insert this inside it

export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad

Save it, now open your new terminal instance.

PHP Date Timezone error ( date_default_timezone_set )

I was experiencing an error regarding date() function on PHP 5 with error message like this :
Message: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Jakarta' for 'WIT/7.0/no DST' instead

For quick fix in PHP5, add this line

date_default_timezone_set("Asia/Jakarta")

O.A.R Heaven

Recently I play this video repeatly, it’s Heaven by O.A.R
Love it very much, they send peace through this video. Check this out..

Tidung Island Indonesia

a few days ago I was traveling to Tidung Island, this island located in Seribu Archipelago (north of Jakarta). It tooks about 2.5 hours trip from Muara Angke harbor to get Tidung Island. The weather was so clear, we travel by ship under clear blue sky. For this trip I payed Rp.260.000,- all in. Its included ship ticket vice versa, homestay for 2 days, 2 lunch and 2 dinners, barbeque, bicycle, snorkeling tools, boat for snorkeling, also local guide!  Hahahah what a great deal wasn’t it? 🙂 I was searching for the same travel agent to Tidung island, but this guy offer great service with wonderful price. We made a deal then. Continue reading “Tidung Island Indonesia”

How to get list of files handled by process

Ever wondered which program has a particular file or directory open? Now you can find out. Handle is a utility that displays information about open handles for any process in the system. You can use it to see the programs that have a file open, or to see the object types and names of all the handles of a program.

Handle is targeted at searching for open file references, so if you do not specify any command-line parameters it will list the values of all the handles in the system that refer to open files and the names of the files. It also takes several parameters that modify this behavior.

Execute an exe from VBS with space in file name

Hi All,

I was having problem on executing an exe file from vbs, the problem was the exe path has space between it. For example “C:\Program Files\test\my app.exe”.

The vbs will returns an error which says file not found for that path. This is happened because after the space, the vbs will treat the entire command after the space as arguments.

To fix it we can use multiple quote like this.

wscript.run """C:\Program Files\test\my app.exe"""

Use 3 quote.

What if we want to use arguments in our command?

wscript.run """C:\Program Files\test\my app.exe"" /command args"

Cheers!

How to autostart service in linux ubuntu

I was creating a program using python for my linux box and I need this program runs every time when the server booting. I was googling how to get this done, some are suggesting to edit the rc.d file then add our line in there. That’s work though, but I found something better, we can manage what service will be started on booting using rcconf.

You will need to install rcconf from repository to get this work,

apt-get install rcconf

Once installed you can use it by entering this command

rcconf

The rcconf will display what service/program that located in /etc/init.d/, mark the service you want to start manually then save it.

That’s it, so simple and easy 🙂

Powershell enable execution of script

By default powershell prevent the user to run a script file (.ps1), in order to enable the execution of script we have to manually enable it.

First check your powershell execution policy

Get-ExecutionPolicy
Restricted

If it shows “Restricted” then you will have to enable it

We can use "Unrestricted" phrase to enable it

Set-ExecutionPolicy Unrestricted

It will prompt confirmation, if you want it to force put "-f" in the command. The command will look like this

Set-ExecutionPolicy Unrestricted -f

Now you can run your scripts on your Powershell.