Blog xaie

Tidak Enak Badan Redux

6 September 2009 · Tinggalkan sebuah Komentar

Sedang tidak enak badan nih. Kepala pusing, tenggorokan sakit waktu coba menelan ludah. Aneh, kok sakitnya bisa bareng dengan kakak gw ya?

Karena sudah pernah seperti ini kira-kira setahun yang lalu, jadi minum obat seadanya: Panadol dan Amoxan. Panadol untuk sakit kepala, sedangkan amoxan untuk membantu sistem ketahanan tubuh karena antibiotik.

Setelah minum obat, browsing tentang Panadol di Wikipedia, ternyata paracetamol/acetaminophen cukup berbahaya juga. Pokoknya jangan minum diatas 4000mg, karena 2000mg pun sudah bisa menyebabkan gagal liver, keracunan hati .. hepato.. apalah itu.

Serem juga, terlebih lagi karena 1 tablet Panadol itu berisi 500mg (!!), gw kira cuma 100mg atau lebih rendah. Jadi pada intinya tidak boleh minum 8 tablet Panadol sekaligus. Untung baru minum 1 :D kekekeke..

→ Tinggalkan KomentarKategori: Orang bego punya kegiatan
Ditandai:

Lupa-lupa Ingat: Double SSH Stupidity

1 September 2009 · Tinggalkan sebuah Komentar

Login menggunakan Open SSH dari komputer A ke komputer B, pada saat asik kerja tiba-tiba ingat perlu file dari komputer A. Karena tidak tahu letak persisnya di mana, SSH ke komputer A untuk find file yang dimaksud. Gunakan scp (!!!) untuk kirim file ke komputer B.

Baru sadar setelah ketik exit. :D :D cengengesan maksudnya :D :D

PS: Sedang terlalu fokus, terburu-buru, apalah..

→ Tinggalkan KomentarKategori: Orang bego punya kegiatan
Ditandai: , ,

The Joy Of New Toy

23 Agustus 2009 · Tinggalkan sebuah Komentar

I think I just found out how to download a file from an online file storage for free without that silly ‘waiting time’ thing. It doesn’t require anything else than a not-your-everyday web-browser, a decent web proxy which I have to say not so difficult to find, and a bit of brain cells.

No, this is not using proxy to skip IP-based detection from the server’s part. I use proxy because as I also found out, in the past, that they put downloads limit for my country. This might sound unfair, but I know that I can think one reason why they put a downloads limit; anyway that’s not the point.

If I did’t know better I might post it on the internet, but I know (and I think anybody else who smart enough) once it made into public knowledge then bye bye to no ‘waiting time’.

Hmm… now let me see, is there anything else I would like to download from this file storage website?

→ Tinggalkan KomentarKategori: Orang bego punya kegiatan
Ditandai: , ,

Wow, even Geocities is closing down

20 Juli 2009 · Tinggalkan sebuah Komentar

Although I didn’t put any attention to Geocities for the past few years; I never log in TO Geocities for years, maybe, but apparently the service is closing.

I do have an account there (who doesn’t?), and it was from way back 2002. I remember back then when Geocities was a company of its own, before Yahoo! bought them. It IS a great service, provided if you dont mind using HTML-only website, I know one or two guys who do. So here I am, waiting for another hour because my hourly limit just sets off from downloading my files.

I don’t know what’s next, will Google close its GMail service in 2018? I hope I’ll live long enough to see that happening.

→ Tinggalkan KomentarKategori: Orang bego punya kegiatan
Ditandai: ,

Stupid Debian Kernel

5 Juli 2009 · Tinggalkan sebuah Komentar

I freaked out when my server computer didn’t boot to my new Debian install. I guess something about this generic kernel just ain’t right; I mean at least on this computer, because somehow it ran just fine on VirtualBox.

For a quick hack I tried booting from some live cd (I think it was a Slax) so at least I can mount it and get an older kernel from my other computer, extract the old 2.6.22-generic kernel from backup archive (that was coming from an Ubuntu 7.04 partition, because that’s my only kernel backup) and get that damned grub to play nicely by setting it to default. Why? Because I’m using an old CRT monitor, so old that I can’t see anything before 3 to 5 minutes after the first time i press power-on button or reset; I know.. I know it’s time to get a new one;).

Now at least I can get online from LAN-sharing because I can’t get Huawei E220 to work yet. Something that was as trivial as ‘wvdial MyNetProfile &’ have to wait because I know that I have to get/compile a better kernel. So, yeah busy. But the bright side of this whole situation is nothing of value deleted from this install …….. yet (O’ UNIX gods, please guide my fingers).

Aaaarrrggghhh!!!!

→ Tinggalkan KomentarKategori: Orang bego punya kegiatan
Ditandai: , ,

updateln.py

18 Juni 2009 · Tinggalkan sebuah Komentar

A Python script to update links under a path to use new prefix.


#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os, sys, getopt;
options = {'start': None, 'oprefix': None, 'nprefix': None, 'simulate': True};

class PathError (Exception):
  pass;

def ShowUsage():
  progname = os.path.split(sys.argv[0])[1];
  print progname;
  print '-'*len(progname)
  print " Usage: %s [-w] [-s startpath] -o oldprefix -n newprefix\n" % progname;
  print " Parameters: "
  print " -w, --write       Dont run the program run in simulation mode.\n";
  print " -s, --start-path  Use custom starting directory.\n";
  print " -o, --old-prefix  Find link(s) with prefix as specified by this parameter.\n";
  print " -n, --new-prefix  New prefix for the offending link(s) to use.\n";
####  

def GetOptions():
  global options;
  ret = 0;

  arguments = sys.argv[1:];

  try:
    wnt, dummy = getopt.getopt(arguments, "o:n:s:w", ["old-prefix=",
                    "new-prefix=", "start-path=", "write"]);
    for name, val in wnt:
      if name in ('-o', '--old-prefix'):
        options['oprefix'] = val;
      elif name in ('-n', '--new-prefix'):
        options['nprefix'] = val;
      elif name in ('-s', '--start-path'):
        options['start'] = val;
      elif name in ('-w', '--write'):
        options['simulate'] = False;
    ##

    if options['start'] == None:
      options['start'] = os.getcwd();
  except getopt.GetoptError:
    ret = -1;
  ##

  if (options['oprefix'] == None) or (options['nprefix'] == None): ret = -1;
  if ret != -1:
    print "Start      : %s" % options['start'];
    print "Old prefix : %s" % options['oprefix'];
    print "New prefix : %s" % options['nprefix'];
    if options['simulate'] == False:  print "WARNING    : This program may change links.";
    print;
  ##

  return ret;
####

def ProcessPath(curPath, recursive):
  proccount = 0;
  files = os.listdir(curPath);

  if len(files) > 0:
    print "Examining %s" % curPath;

  for entry in files:
    curFile = os.path.join(curPath, entry);

    if os.path.islink(curFile):
      linkPath = os.readlink(curFile);
      if linkPath.find(options['oprefix']) == 0:
        # we need to update this one
        newLinkPath = linkPath.replace(options['oprefix'], options['nprefix'],
                                      1);
        print "Fixing %s\n   Old path: %s\n   New path: %s" % (curFile,
          linkPath, newLinkPath);

        if options['simulate'] == False:
          # these two lines will modify/regenerate the symbolic link
          os.unlink(curFile);
          os.symlink(newLinkPath, curFile);
          proccount += 1;
        ##
      else:
        # good link, skip it
        pass;
    elif os.path.isdir( curFile ) and recursive:
      proccount += ProcessPath(curFile, recursive);
  ##    

  return proccount;
####

def main():
    if GetOptions() == 0:
      i = ProcessPath(options['start'], True);
      print;
      print ["Nothing processed by this program", \
             "There are %s link(s) processed" % i][i > 0] + '.';
    else:
      ShowUsage();
####

if __name__ == '__main__':
    main();
##

→ Tinggalkan KomentarKategori: Ilmu
Ditandai: , , ,

ssh_mp32ogg.sh

17 Juni 2009 · Tinggalkan sebuah Komentar

‘cos those MP3 wont convert by themselves.


#!/bin/sh

# -----------------------------------------------------------------------------
# It is a simple script to convert mp3 files (one at a time) to ogg on my
# other computer, because that's where the LAME codec is installed.
# Last edit: 5 June 2009
#
# It requires sox (with LAME installed) on the other computer.
#
# Usage: ssh_mp32ogg.sh [-s SERVER] [-u USERNAME] [-r BITRATE] infile outfile
# -----------------------------------------------------------------------------

mp3_fn=;
out_fn=;
server="CHIKUZA.KRYIE";	# default server
server_usr="ariel"	# default user @ server, must be exists
out_rate=4	# output bitrate to ~ 128

for cur_arg in "$@" ; do
  if [ -z "$mp3_fn" ] && [ -f "$cur_arg" ] ; then
    mp3_fn="$cur_arg";
    echo "Input file is $mp3_fn";
  elif [ -z "$out_fn" ] && [ ! -z "$mp3_fn" ] ; then
    out_fn="$cur_arg";
    echo "Output file is $out_fn";
  fi
done

while getopts s:u:r: OPTION; do
  case "$OPTION" in
	s)	shift `echo "$OPTIND -1" | bc`;
		server="$OPTARG";
		;;
	u)	shift `echo "$OPTIND -1" | bc`;
		server_usr="$OPTARG";
		;;
	r)	shift `echo "$OPTIND -1" | bc`;
		out_rate=`echo "$OPTARG / 32" | bc`;
		;;
  esac
done

# do the format conversion
cat "$1" | ssh $server_usr@$server "sox -S -t mp3 - -C $out_rate -t ogg -" > "$2"

→ Tinggalkan KomentarKategori: Ilmu · Orang bego punya kegiatan
Ditandai: , , ,

Holy crackamoley Batman! I just know how to use escape keys in OpenSSH!

22 Mei 2009 · Tinggalkan sebuah Komentar

Few minutes ago I just found out that I can actually send SSH session into background by suspending it. From now on I can use one terminal for everything I need.

How is it done? That sneaky escape_char is the key. A quick glance at the ssh manual should explain you all about it, but I found it hard to practice; I just can’t understand what “The escape character is only recognized at the beginning of a line” is supposed to mean.

I mean I know that sentence in English, duh, but what the heck is this “at the beginning of a line” is all about? Are we talking about the shell prompt here or what, Vim? I recall that every time I send a command it occupy its own line, is this a trick to confuse newbie? Even though I know that you CAN type multiple-line commands, but that is not what I’m concerned about.

I tried to type ‘~?’ literally, but that didn’t work. As I just found out (by bashing my keyboard like a space chimps) “the beginning of a line” mentioned here is to put empty command before entering ~. So all I have to do in my terminal is this:

$ < press Return / Enter >
$ < just press key combination to '~', which in my case Shift + ` >

It will be easier that way especially because I’m accustomed to reuse commands from history, walking through the command each character/word at a time, or plain-ol’ Ctrl + C.

For practice purpose I recommend you to try the ~? command. It will print the other available commands, lookup the manual to find out more.

All this time… can you imagine that??

→ Tinggalkan KomentarKategori: Ilmu · Orang bego punya kegiatan
Ditandai: , ,

kidsxp_ico2png.py

21 Mei 2009 · Tinggalkan sebuah Komentar

Because I got ICO files and I want them in PNG.


#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os, glob

# location of the files
sourceDir = "/media/yamazaki/Work/Pictures/Icons/KidsXP/"
# output directory
targetDir = "/tmp/kidsxp_png/"
# the real processor of this script: imagemagick
convertCmd = "convert %s[9] -resize %s %s"
# which categories to process? all of 'em?
processDirs = ("actions", "apps", "devices", "filesystems", "mimetypes")
# extract it and move into known usable sizes
knownSizes = ('16x16', '22x22', '32x32', '48x48', '64x64', '96x96', '128x128')

def processDir(path, thissize):
  print "Processing source path : %s" % path
  dummy, category = os.path.split(path)

  for item in glob.glob(path + '/*.ico'):
    dummy, itemName = os.path.split(item)
    tgtDir = os.path.join(targetDir, thissize, category, '')
    tgtName = itemName[:-3] + 'png' # "xyz.ico" filename to "xyz.png"

    print "Writing %20s -> %s" % (itemName, tgtDir + tgtName)
    if not os.path.exists(tgtDir):
      os.makedirs(tgtDir)

    cmd = convertCmd % (item, thissize, tgtDir + tgtName)

    # execute
    os.system(cmd)  # ooh! the horror!!
  ##
  print
##

for item in processDirs:
  s = sourceDir + item
  if os.path.isdir(s):
    for size in knownSizes:
      processDir(s, size)
  else:
    print "Skipping %s" % (s)
##

→ Tinggalkan KomentarKategori: Ilmu
Ditandai: , , , ,

Jokes, because I’m bored to death!

12 April 2009 · Tinggalkan sebuah Komentar

  • If you put a million monkeys at a million keyboards, one of them will eventually write a Java program.
    The rest of them will write Perl programs.
  • Once upon a time there was a shepherd looking after his sheep on the side of a deserted road. Suddenly a brand new Porsche screeches to a halt. The driver, a man dressed in an Armani suit, Cerutti shoes, Ray-Ban sunglasses, TAG-Heuer wrist-watch, and a Versace tie, gets out and asks the Shepherd:

    Man: “If I can tell you how many sheep you have, will you give me one of them?”

    The shepherd looks at the young man, and then looks at the large flock of grazing sheep and replies:

    Shepherd: “Okay.”

    The young man parks the car, connects his laptop to the mobile-fax, enters a NASA Webster, scans the ground using his GPS, opens a database and 60 Excel tables filled with logarithms and pivot tables, then prints out a 150 page report on his high-tech mini-printer. He turns to the shepherd and says,

    Man: “You have exactly 1,586 sheep here.”

    The shepherd cheers,

    Shepherd: “That’s correct, you can have your sheep.”

    The young man makes his pick and puts it in the back of his Porsche. The shepherd looks at him and asks,

    Shepherd: “If I guess your profession, will you return my animal to me?”

    The young man answers;

    Man: “Yes, why not?”

    Shepherd: “You are an IT consultant.”

    Man: “How did you know?”

    Shepherd: “Very simple. First, you came here without being called. Second, you charged me a fee to tell me something I already knew, and third, you don’t understand anything about my business…Now can I have my DOG back?”

  • C++ – Where your friends have access to your private parts.
  • A pessimistic programmer sees the array as half empty.
    An optimistic programmer sees the array as half full.
    A real programmer sees the array as twice as big as it needs to be and calls realloc().
  • Computers are high-speed idiots, programmed by low-speed idiots.
  • There were three engineers in a car; an electrical engineer, a chemical engineer, and a Microsoft engineer.
    Suddenly, the car stops running and they pull off to the side of the road wondering what could be wrong.
    The electrical engineer suggests stripping down the electronics of the car and trying to trace where a fault may have occurred.
    The chemical engineer, not knowing much about cars, suggests maybe the fuel is becoming emulsified and getting blocked somewhere.
    The Microsoft engineer, not knowing much about anything, came up with a suggestion. “Why don’t we close all the windows, get out, get back in, and open all the windows and see if it works?”
  • The programmer to his son: “Here, I brought you a new basketball.”

    Son: “Thank you, daddy, but where is the user’s guide?”

  • Once a programmer drowned in the sea. Many Marines where at that time on the beach, but the programmer was shouting “F1 F1″ and nobody understood it.
  • Q: How do you keep a programmer in the shower all day?
    A: Give him a bottle of shampoo which says “lather, rinse, repeat.”
  • An inscription on the gravestone of a programmer reads:

    General protection fault – 10.10.61

    Runtime error – 23.09.1998

  • .NET is called .NET so that it wouldn’t show up in a Unix directory listing.
  • CD-ROM: Consumer Device, Rendered Obsolete in Months
    PCMCIA: People Can’t Memorize Computer Industry Acronyms
    ISDN: It Still Does Nothing
    SCSI: System Can’t See It
    MIPS: Meaningless Indication of Processor Speed
    DOS: Defunct Operating System
    WINDOWS: Will Install Needless Data On Whole System
    OS/2: Obsolete Soon, Too
    PnP: Plug and Pray
    APPLE: Arrogance Produces Profit-Losing Entity
    IBM: I Blame Microsoft
    MICROSOFT: Most Intelligent Customers Realize Our Software Only Fools Teenagers
    COBOL: Completely Obsolete Business Oriented Language
    LISP: Lots of Insipid and Stupid Parentheses
    MACINTOSH: Most Applications Crash; If Not, The Operating System Hangs
    AAAAA: American Association Against Acronym Abuse.
    WYSIWYMGIYRRLAAGW: What You See Is What You Might Get If You’re Really Really Lucky And All Goes Well.

→ Tinggalkan KomentarKategori: Uncategorized