…So, I believe, Singapore is doing the right things and they have set their priorities right. They do not waste their time on things that are non-productive or things that are non-relevant any more. And the big thing is, there’s no corruption there. Singapore is, in many ways, more Islamic than Malaysia….
Grabbed this piece of text from http://on.fb.me/w1SAIY. I like the last part “Singapore is, in many ways, more Islamic than Malaysia”. I do not know much about Islam, but I do not discriminate against it (it is sad to know that many non-Muslim Malaysians like to pass judgement on Islam without knowing what it is). If setting priorities right and doing things that are relevant are the teaching of Islam, than Singapore is more Islamic than Malaysia.
Posted in
Blog at December 9th, 2011.
No Comments.
Was having a conversation with a friend.
Question:
if ( isWeddingInvitation() == true ) {
System.out.println("will you come all the way to \
Singapore/Malaysia to attend?");
}
Answer
try{
invitation.reply(Action.ATTENDING);
} catch (OutOfMoneyException) {
}
Posted in
Blog at November 29th, 2011.
1 Comment.
Internet
Name: IDEAS
APN: e-ideas
MCC: 525
MNC: 01
APN type: default
MMS
Name: IDEAS MMS
APN: e-ideas
Username: 65IDEAS
Password: 65ideas
MMSC: http://mms.singtel.com:10021/mmsc
MMS proxy: 165.21.42.84
MMS port: 8080
MCC: 525
MNC: 01
Authentication type: PAP
APN type: mms
Posted in
Blog at October 20th, 2011.
No Comments.
What? Why?
Objective oriented thinking is a way to structure thinking. I find it very useful for decision making, project planning, debates, problem solving, …. Sometime I get stuck in an activity (e.g problem solving, debating) for too long and it seems that it will not come to an end or conclusion. Objective oriented thinking helps by defining/discovering an objective and aligns all my thoughts toward achieving that objective.
How?
Frequently ask yourself, what is the objective/purpose/goal. If you are planning a new project, ask what is the desire outcome of this project. If you have been working on a task for some time, ask why are you doing it or what is the purpose of doing it. It helps you to “take a step back”, take a look at what you are doing and remind yourself what you want to achieve.
Objectives can be easily defined by continuously asking what and why. These are some of the questions that helps to define objectives:
- What does the customer want?
- Why are you doing it?
- What do you want to achieve?
- What is the expected outcome?
- What is the goal of the company?
Being Specific
If the objective is to be “successful”, you must define what is “successful”. If objective is not clearly defined, it will never be achieved. Being specific helps. It is good to use measurable/testable metrics to describe objectives. At individual level, these metrics make it easy to plan out verifiable actions to achieve objective. When working in a team, these metrics ensure everyone in the team has a common picture of the goal they want to achieve.
Application
These are some examples on how objective oriented thinking can be used in daily life.
- Project Planning
Define the objective (e.g backup all data on server). Based on the objective, defines measurable/testable metrics (e.g. list of all data that needs to be backup). When the objective is communicated to the team, the members know what needs to be done and be able to make decisions when project manager is not around.
- Debates
Arguing over subjective matters is a time waster. Define the objective, and everyone should justify their suggestions based on it. This helps people to stay focus and keep the debate constructive.
- Decision Making
Sometime you are not sure of what is right, which is better, what to do, …. Ask yourself what is the objective of making this decision. What do you want to achieve? Once this is established, decision become clear. Choose the option that best help you achieve your objective.
Posted in
Blog at August 27th, 2011.
No Comments.
Web server support for TRACK and TRACE may make it vulnerable to attacks. I came across Chris Mahns’s script while searching for tools to check web servers. The script is written in Perl but I cannot run it on my machine because of missing Perl libraries. Since I have PHP and CURL installed, I ported the script into PHP. This is what I have done,
#!/usr/bin/php
<?php
#===============================================================================
#
# FILE: test4trace.php
#
# USAGE: ./test4trace.php <host> <port>
#
# DESCRIPTION: Test for the existence of the TRACE method on a web site.
# Adapted from http://bit.ly/qIvvVK. Original Perl version
# written by Chris Mahns.
#
# OPTIONS: ---
# REQUIREMENTS: PHP 5, CURL
# BUGS: None Found Yet
# NOTES: ---
# AUTHOR: Leong Hean Hong (https://about.me/hongster)
# COMPANY: Stream Media Pte Ltd
# VERSION: 0.3
# CREATED: 2011-08-24 17:08:00
# REVISION: ---
#===============================================================================
$help = "Usage: {$argv[0]} <hostname> <port>";
$host = isset($argv[1]) ? trim($argv[1]) : FALSE;
if ($host === FALSE) {
echo "$help\n";
exit;
}
$port = isset($argv[2]) ? (int)$argv[2] : 80;
$scheme = ($port == 443) ? 'https' : 'http';
echo "First we test for Trace...\n";
test($scheme, $host, $port, "TRACE");
echo "Now we test for Track...\n";
test($scheme, $host, $port, "TRACK");
function test($scheme, $host, $port, $method) {
$url = "$scheme://$host:$port/";
$ch = curl_init();
$options = array(
CURLOPT_URL => $url,
CURLOPT_SSL_VERIFYPEER => FALSE, // Skip SSL cert check
CURLOPT_RETURNTRANSFER => 1,
CURLINFO_HEADER_OUT => 1, // To get the request header
CURLOPT_TIMEOUT => 10,
CURLOPT_CUSTOMREQUEST => $method,
CURLOPT_USERAGENT => "test4trace-pci-auditor/v0.3",
CURLOPT_HTTPHEADER => array(
$method,
"Test",
),
);
curl_setopt_array($ch, $options);
curl_exec($ch);
$response = curl_getinfo($ch, CURLINFO_HEADER_OUT);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if (curl_errno($ch)) {
echo "Curl error: ".curl_error($ch)."\n";
curl_close($ch);
return;
}
curl_close($ch);
switch ($http_code) {
case 200:
echo "======this is what you sent======\n";
echo $response;
echo "=================================\n";
echo "$method is working\n";
break;
case 403:
echo "403: Forbidden\n";
break;
case 404:
echo "404: Not Found\n";
break;
case 405:
echo "405: Method Not Allowed\n";
break;
case 501:
echo "501: Not Implemented\n";
break;
default:
echo "Response code: $http_code\n";
break;
}
}
?>
Posted in
Tao Of Programming at August 24th, 2011.
No Comments.