Monday, February 15, 2010

50 Extremely Useful PHP Tools

Some tools are useful

Friday, February 12, 2010

Quick Tip: Delete the Contents of a File without Removing and Recreating It

Do all this from the command line or terminal.

This will create a new file named t whose contents is the word "test":
$] echo "test" > t

more will display the contents of the file:
$] more t

Here's the new trick I learned. cat reads the contents of /dev/null (which contains nothing) and > writes this into t
$] cat /dev/null > t

Now t contains nothing:
$] more t

Get rid of it (don't do this to your logfile)
$] rm t

Another command :
$] > file.txt
$]echo > something.txt
$]echo "" > something.txt

for windows:
$]copy con > file.txt
$]copy nul > file.txt

Tuesday, November 24, 2009

How To Run Google Chrome OS From A USB Drive [Windows]

Found the to install chrome os into usb thumb drive at

Monday, June 29, 2009

External hardisc review

I just bought Buffalo ext hardisc and my friend bought western digital ext hardisc.

The hardisc just work very well as expected. However the sync software are really troublesome and not friendly. Even referring to documentation and manual. still not much information useful.

I decided to replace Buffalo software with PortableApps. I started with basic installer, then use toucan for backup, sync and encryption. There is few application useful too. check it out :

Thursday, May 28, 2009

Maxis connection conflict with Sun VirtualBox

Symptom :

The connection to internet was successful after 1st time computer booted. But, when it's disconnected (purposely/not). Try to connect again, the connection shown connected with 7.2 mbps on taskbar. However, it's not found the server or any ip address. So you will having problem on connection to internet.

Solution :

As today the only solution is to uninstall virtualBox. It's will work

Windows, maxis usb broadband, virtualBox

Tuesday, September 23, 2008

Javascript popup with PHP Session

Simple to detect whether user is 1st time enter the website, the code below are example working code

if ($_SESSION['SID']['pop'] == '' || $_SESSION['SID']['pop'] == 0) echo 'window.onload=alert("Test, 1 popup for 1 session. By s4femod3")';
$_SESSION['SID']['pop'] += 1;
echo 'window.onload=alert("Test, 1 popup for 1 session. Current session val :'.$_SESSION['SID']['pop'].'")';

Everytime user refreshed the page the value $_SESSION['SID']['pop'] will increase by 1.

Tuesday, June 24, 2008


FirePHP enables you to print to your Firebug Console using a simple PHP function call.

What makes FirePHP different?

All data is sent via a set of X-FirePHP-Data response
headers. This means that the debugging data will not interfere with the
content on your page. Thus FirePHP is ideally suited for AJAX
development where clean JSON or XML responses are required.


PHP: 5 Firefox: 2, 3 Firebug: 1.05, 1.1, 1.2


PHPIDS (PHP-Intrusion Detection System) is a simple to use, well
structured, fast and state-of-the-art security layer for your PHP based
web application. The IDS neither strips, sanitizes nor filters any
malicious input, it simply recognizes when an attacker tries to break
your site and reacts in exactly the way you want it to. Based on a set
of approved and heavily tested filter rules any attack is given a
numerical impact rating which makes it easy to decide what kind of
action should follow the hacking attempt. This could range from simple
logging to sending out an emergency mail to the development team,
displaying a warning message for the attacker or even ending the user's

PHPIDS enables you to see who's attacking your site and how and all
without the tedious trawling of logfiles or searching hacker forums for
your domain. Last but not least it's licensed under the LGPL!

The five levels of leadership

(ORDER BY levels DESC)

5 - Position (Title) "Rights"
People follow because they have to.
Your influence will not extend beyond the lines of your job
description. The longer you stay here, the higher the turnover and
lower the morale. People begin to limit you, to put fences around you.
You can't stay here more than two years.

4 - Permission "Relationship"
People follow because they want to. People will follow you beyond your stated authority. This level allows work to be fun.
Caution: Staying too long on this level without rising will cause highly motivated people to become restless.

3 - Production "Results"
People follow because of what you have done for the organization.
This is where success is sensed by most people. They like you and what
you are doing. Problems are fixed with very little effort because of
momentum. (Don't ; let the momentum stop!).

2 - People Development "Reproduction"
People follow because of what you have done for them personally.
This is where long-range growth occurs. Your commitment to developing
leaders will ensure ongoing growth to the organization and to people.
Do whatever you can archive and stay on this level.

1 - Personhood "Respect"
People follow you because of who you are and what you represent.
This step is reserved for leaders who have spent years growing people
and organizations. Few make it. Those who do are bigger than life!

-- Dr John Maxwell, Developing the leader within you