January, 2008

Eugene Teo

shian

Harish Pillay

Sieghart

Yingzhen

Dmingz

Bangladash Linux User Alliance

Anshul

Search Results

Happy New Year!

It's the beginning of a new year!! And what a happening year 2007 was...

I graduated, for one. That's a big big thing!! After 4 years of very very hard work, I finally managed to graduate. Yeah!!

Then I got a job almost immediately at National Cancer Centre Singapore as a network administrator. Basically in charge of the computation servers and SAN for one of the bioinformatics group there. Wee~

And yes, got to travel twice this year, both to Malaysia (poor bloke, what to do?). Must try to post in the travel journal.

Hmm... Some new year resolutions are in order, I think...

Resolutions:

  • Must not work so hard. Working till midnight every day will definitely make me burn out very soon
  • Must chant every day. I seem to be slipping
  • Must clear all my leave this year. That's what leave is for what
  • Must blog more often
  • Must play games. I still haven't finish chapter 1 of neverwinter nights 2. Damn

Trackback URL for this post:

http://www.jmarki.net/drupal/trackback/83

New Year, New Blog, New Features!

Wee~, I have ported the old blog into this new one. It's still Drupal. Smiling The previous site layout and tags don't make much sense, especially since I started working, hence the makeover.

New features:

Do leave shouts and comments everywhere (legitimate ones, please). Laughing out loud

Any comments about the site?

Trackback URL for this post:

http://www.jmarki.net/drupal/trackback/84

Hao

WTF!!! Live Electrical Current Fun In Pool Party

Win. Can anyone be so dumb as to do this?!


[Gizmodo: How to win a Darwin Award: Float a live surge protector in a pool on flip flops]

If you really don't know why that's moronic, here's a good explanation by trotskysghost:

I'm an electrical engineer and I did my internship working at an amusement park with several water slides. I am VERY well aquainted with electricity and pools. If a grounded plug strip such as that were to be submerged, it would electrify the entire volume of water in that pool. The return path to ground would likely be through the plug strip's own grounding pin. The rubber material of the pool would PROBABLY insulate the pool water from the ground, but not all plastic is an insulator. I actually had a problem where a plastic was conducting enough of a leakage curent to throw off electronic water quality sensors.

In the US the National Electric Code (NFPA 70) requires the use of Ground Fault Circuit Interupters (GFCI) on all cicruits that are likely to come into contact with water, and I am pretty sure that the IEC also requires the use of GFCIs. It takes very little current across the heart to kill someone, approximately 0.04 Amperes, and seeing as most circuit breakers are rated at least 10 amperes, you do the math.

People die everyday from electrocution by 110/220V AC. Even experienced electricians who take the proper safety percautions are not always safe.

How moronic can people be?!?!

Trackback URL for this post:

http://www.jmarki.net/drupal/trackback/86

Bash Scripting Tips

I went looking around for bash scripting tips, especially secure coding of bash. Can't find much information, so decided to consolidate whatever I found here. Smiling

  • Salt string comparisons of variables to increase security

    if [[ "a$?" == "a4" ]]; then
    

  • Use the full paths to any binaries, either by hardcoding them into the script or use variable substitution. This prevents the script from executing incorrect/rogue binaries in the path.

    /bin/grep "hardcoding the full path" *
    
    echo=/bin/echo
    ${echo} "From bash manpage under EXPANSION:
    The order of expansions is: brace expansion, tilde expansion,  parameter,
    variable  and  arithmetic  expansion  and command substitution (done in a
    left-to-right fashion), word splitting, and pathname expansion."
    

  • Change the environment path at the start of the script to ensure no rouge directories are in the PATH

    #!/bin/bash
    # comments
    PATH=/bin:/usr/bin
    

  • Write a function to explain the usage of the script

    function print_usage () {
        ${echo} "
    $0
    Usage: $0 [-a opts] [arguments]
     or    $0 -h
    Description: Something fishy
    Options:
      -a opts    (Optional) Options
      -h         (Optional) Help
      arguments  Smelly smelly fish
    "
    }
    

  • Here's a sample code snippet to process script options

    if [ $# -lt 2 ]; then
        print_usage
        exit 1
    else
        while getopts ha:b: options; do
            case "${options}" in
                h)  print_usage
                    exit 1
                    ;;
                a)  flag=${options}
                    ;;
                b)  flag=${options}
                    ;;
                *)  echo "default case, everything else fits here"
                    ;;
            esac
        done
        shift $((${OPTIND} - 1))
    

  • Variables should be enclosed in parenthesis when used, to indicate exactly which variable you are using. Of course, this can prevent an exploit involving longer variable names.

    a=erie
    ab=were
    if [[ "${a}b" == "erieb" ]]; then
    

Vegetarian tastes

Recently, I'm starting to realise how much my vegetarian diet has changed me.

The smell of meat now smells very pungent, to the extent I sometimes have to avoid sitting close to people eating strong smelling bowls of meat. Things like cheeseburgers, or "lo mai gai" are especially bad.

Tastebuds have also changed. EU and I sometimes buy plates of nice things to share during meals. During the recent Malacca trip, we shared a plate of vegetarian oyster omelette. It was very delicious to me, as a overwhelming weird taste (?taint?) in the non-vegetarian version is gone. EU feels something is gone though, he doesn't like it.

And to top it all, a few days ago during a discussion during work, someone started eating a banana... And I got very, very, very hungry... Kaoz... Hunger cravings over a banana!!

I am vegetarian for almost 3 years... What other changes are on the horizon?

Trackback URL for this post:

http://www.jmarki.net/drupal/trackback/88