Archive for the ‘Tips’ category

PHP Date Timezone error ( date_default_timezone_set )

December 9th, 2011

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")

What people search:

How to get list of files handled by process

April 19th, 2011

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.

What people search:

Execute an exe from VBS with space in file name

April 18th, 2011

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!

What people search:

How to execute an exe from vbScript

April 18th, 2011

Sometime we will need to execute an exe file from our vbs, so here’s the snippet.

Set wsShell = WScript.CreateObject("WScript.shell")
wsShell.run "C:\windows\system32\calc.exe"

What people search:

How to autostart service in linux ubuntu

April 8th, 2011

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 :)

What people search:

Powershell enable execution of script

April 4th, 2011

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.

What people search:

Hostgator coupon code 2011

March 22nd, 2011

Hi guys, special info for you who looking for Hostgator coupon. I have the hostgator coupons list, these coupons works for this year (2011).

 

$9.94 Coupon

luvgator994

supercode994

25% Off Coupon

luvgator25

24.94 Off reseller hosting Coupon

gatorresell2494

supercode2494

 

How to use this coupon? When you stepped on Choose a domain page, take a look at this picture. By default there will be a “spring coupon” this coupon only gives you 20% off. Replace it with luvgator then you will get 25% off.

 

What people search:

How to Flush DNS Cache in Windows XP

March 18th, 2011

If you have a domain and set a new nameserver for your domain, your computer will not access the server behind your new nameserver. It’s happened because your computer cached the DNS so when you trying to access your server using the domain, it will always redirected to previous server. The DNS cacheĀ  will be updated automatically after period of time, max time for this update is 2 x 24 hours.

To manually flush your DNS cache on Windows XP, you can use this command in command prompt. Open your command prompt by pressing Windows Button + R, then type cmd.

Use this command.

ipconfig /flushdns

What people search:

How to mount .iso image in Mac OSX

January 5th, 2011

It’s really easy to mount .iso image in Mac OSX, we don’t need to install any third party too. We can use terminal command to mount the .iso image

1
hdiutil mount yourimage.iso

Change the “yourimage.iso” into the .iso path file. You can also mount .dmg using this method.

What people search:

Access CPanel behind company proxy firewall

December 2nd, 2010

I was having problem accessing my web server from my company, my company network only open port 80 for internet access. So it would be impossible if someone trying to do to access CPanel behind this firewall.

But there’s a way for us to access CPanel via port 80 on our server, there’s no change at all both side our network or server. To access CPanel behind company firewall we can go to http://cpanel.domain.com, replace the domain.com with your own domain. For example http://cpanel.leoganda.net

By using this technique we are bypassing the port on our server, and accessing the port 80 over CPanel. So we gain access.

What people search: