Oracle cheat sheet
- SQLPlus short connection
sqlplus <username>/<password>@<ipAddress>:<port>/<sid> [@<scriptfile>]
Ex:
sqlplus user/pass@192.168.1.10:3267/MYDB @test.sql
- MySQL limit equivalent
Ex:
SELECT last_name FROM
(SELECT last_name, ROW_NUMBER() OVER (ORDER BY last_name) R FROM employees)
WHERE R BETWEEN 51 and 100;
Alternative:
select *
from ( select a.*, rownum rnum
from ( YOUR_QUERY_GOES_HERE -- including the order by ) a
where rownum <= MAX_ROWS )
where rnum >= MIN_ROWS;
Linux cheat sheet
- show disk usage: du
- show disk capacity: df
- search word from file inside directory:
find /start/dir -exec grep -q my_search_word {} \; -print
- search files with specific name inside directory (HP-Unix, maxdepth=1):
find . \( ! -name . -prune \) \( -name “*TEST1*.ps” -o -name “*TEST2*.ps” \) -mtime +30 -type f
find /parent/child \( ! -name child -prune \) \( -name “*TEST1*.ps” -o -name “*TEST2*.ps” \) -mtime +30 -type f
- display before+after line with matched specific pattern (Solaris):
nawk 'c-->0;$0~s{if(b)for(c=b+1;c>1;c--)print r[(NR-c+1)%b];print;c=a}b{r[NR%b]=$0}' b=2 a=1 s="SEARCH_STRING" <file_name>
- display running process command args (Solaris):
pargs -a <pid>
/usr/ucb/ps -lawwx
Simple IRIS for SBS Bus
Do you frequently travel by bus in Singapore? Do you use SBS bus? Have you ever waited for long time and the bus still hasn’t come yet? Have you ever faced situation when you needed to choose between bus or MRT but you were afraid if you chose bus you would wait for a long time? If all the answers are YES, you should use IRIS. It is small application based on WEB and SMS provided by sbstransit, which provides estimated time specific bus (no) will arrive at specific bus stop (no). What you need in here are BUS NO and STOP NO.
So how about Simple IRIS, what kind of tool is this? It is actually same like web based IRIS provided by sbstransit. It even uses the data from web based IRIS. The benefits compared to web based IRIS:
- Simpler
It’s based on url, only needs 1 step (insert the url, clik, then you get the result). - Faster & cheaper
Your browser only loads 1 page which is plain text, no images at all. If you aren’t using flat plan, more data you download higher you pay
Ok, enough for the preface. So how to use it? As the title of this post, it is very easy to use it. Just type this address/url in your browser :
http://simpledifference.net/bus/
EXAMPLE:
busNo: 111
stopNo: 09048 (bus stop in front of lucky plaza, orchard)
url: http://simpledifference.net/111/09048
RESULT:
9 minutes
26 minutes
111
09048
ORCHARD RD – LUCKY PLAZA
***
RESULT DESCRIPTION:
9 minutes, estimated arrival time for bus no 111
26 minutes, estimated arrival time for next bus no 111 (after the first bus)
111, bus no 111
09048, bus stop no
ORCHARD RD – LUCKY PLAZA, bust stop description
The last but no less important, thanks to Ganius Taniel for the idea and the script.
Our Deepest Fear
Our deepest fear is not that we are inadequate.
Our deepest fear is that we are powerful beyond measure.
It is our light, not our darkness, that most frightens us.
We ask ourselves, who am I to be brilliant, gorgeous, talented and fabulous?
Actually who are we not to be?
You are a child of God.
Your playing small doesn’t serve the world.
There is nothing enlightened about shrinking
so that other people won’t feel insecure around you.
We are all meant to shine as children do.
We were born to make manifest the glory of God that is within us.
It’s not just in some of us, it’s in all of us.
And when we let our own light shine,
we unconsciously give other people permission to do the same.
As we are liberated from our own fear,
our presence automatically liberates others.
- Marianne Williamson
A Return to Love: Reflections on the Principles of “A Course in Miracles”
Chingay parade 2007
Yesterday I went to Orchard road for watching Chingay parade. The parade is held every year to celebrate Chinese New Year. I arrived at the location around 6 pm. It was starting to be crowded at there. All of the officers correlated to that event were busy for the preparation. Every spot was looked colorful with chingay accessories. I walked along the way to find a place which wasn’t so crowded, so I could watch the parade comfortably. Actually there were 3 kinds of place where we can watch it : stage (the best view, need to pay S$45), half lane (sit on road border, free but need to register first) and outside the road. Because I didn’t want to pay and haven’t registered, no choice I was only able to watch it outside the road. I watched nearby second stage in front of The Heeren. The reason I chose it because the Chingay participant will perform in front of the stage.
After waiting almost 1 hour, the parade was started. In the stage nearby my location it was opened by hip hop dance and followed by belly dance. And then after 2 – 3 participants, President Nathan, the most important person on that event passed the stage. In the same vehicle with President Nathan there was Gurmit Singh (Phua Chu Kang actor). They got many applauses from the audiences. Globally all of the participants are attractive, like women in ball (still wonder how they can breath inside the ball), fake thailand elephant, dragon dance and of course there are many gorgeous girls in the parade. I took some of participant photos and you can see in here Chingay Photos. If you have friend or parent who is visiting Singapore for vacation at that time, I think paying S$45 is worth it for the stage. Remember no one can steal your experience