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 : http://portableapps.com/apps

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

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.



Requirements










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

http://firephp.org/

PHPIDS

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
session.


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!

http://php-ids.org/

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

Thursday, June 05, 2008

PHP HTTP Headers / content-type

// See related links for more status codes

// Use this header instruction to fix 404 headers
// produced by url rewriting...
header('HTTP/1.1 200 OK');

// Page was not found:
header('HTTP/1.1 404 Not Found');

// Access forbidden:
header('HTTP/1.1 403 Forbidden');

// The page moved permanently should be used for
// all redrictions, because search engines know
// what's going on and can easily update their urls.
header('HTTP/1.1 301 Moved Permanently');

// Server error
header('HTTP/1.1 500 Internal Server Error');

// Redirect to a new location:
header('Location: http://www.example.org/');

// Redriect with a delay:
header('Refresh: 10; url=http://www.example.org/');
print 'You will be redirected in 10 seconds';

// you can also use the HTML syntax:
// <meta http-equiv="refresh" content="10;http://www.example.org/ />

// override X-Powered-By value
header('X-Powered-By: PHP/4.4.0');
header('X-Powered-By: Brain/0.6b');

// content language (en = English)
header('Content-language: en');

// last modified (good for caching)
$time = time() - 60; // or filemtime($fn), etc
header('Last-Modified: '.gmdate('D, d M Y H:i:s', $time).' GMT');

// header for telling the browser that the content
// did not get changed
header('HTTP/1.1 304 Not Modified');

// set content length (good for caching):
header('Content-Length: 1234');

// Headers for an download:
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="example.zip"');
header('Content-Transfer-Encoding: binary');
// load the file to send:
readfile('example.zip');

// Disable caching of the current document:
header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past
header('Pragma: no-cache');

// set content type:
header('Content-Type: text/html; charset=iso-8859-1');
header('Content-Type: text/html; charset=utf-8');
header('Content-Type: text/plain'); // plain text file
header('Content-Type: image/jpeg'); // JPG picture
header('Content-Type: application/zip'); // ZIP file
header('Content-Type: application/pdf'); // PDF file
header('Content-Type: audio/mpeg'); // Audio MPEG (MP3,...) file
header('Content-Type: application/x-shockwave-flash'); // Flash animation

// show sign in box
header('HTTP/1.1 401 Unauthorized');
header('WWW-Authenticate: Basic realm="Top Secret"');
print 'Text that will be displayed if the user hits cancel or ';
print 'enters wrong login data';

Monday, March 24, 2008

Small car crash



I had a small car crash tonight. Am loosing few hundred paying the broken window to old man. :) what to do crash is not my plan. I believe all people also vulnerable to accident. Be careful dude when you ride or drive. It's about your life. Proton perdana vs Toyota seg. Pv6 loosing the money.

Sunday, March 23, 2008

Health - Important Tips

Answer the phone by LEFTear


Do not drink coffee
TWICEa day


Do not take pills with
COOLwater


Do not have
HUGEmeals after 5pm


Reduce the amount of
TEAyou consume


Reduce the amount of
OILYfood you consume


Drink more
WATERin the morning, less at night


Keep your distance from hand phone
CHARGERS


Do not use headphones/earphone for
LONGperiod of time


Best sleeping time is from
10pmat night to 6amin the morning


Do not lie down immediately after taking
medicinebefore sleeping


When battery is down to the
LASTgrid/bar, do not answer the phone as the radiation is 1000 times