Saturday, April 26, 2008

Linux: Convert Text File to Upper Case

awk '{ print toupper($0) }' input_file > output_file

Win98: Create New Shortcut Bug

Right click on desktop, click on New - Shortcut. The image displayed on the left side still says "Windows 95"

XP: Disable Warning on Low Disk Space

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
Set "NoLowDiskSpaceChecks" to 1 to disable low disk space check

VFP: Converts Amounts to Indonesian Word

ptbilang.prg is a foxpro source code that converts a number to a character string in Indonesian languange
usage: ptbilang(numeric)
examples: ptbilang(123456789)
result: Seratus Dua Puluh Tiga Juta Empat Ratus Lima Puluh Enam Ribu Tujuh Ratus Delapan Puluh Sembilan Rupiah




**********************************************************
** Author : acrph
** Type : Freeware with reservation to Copyrights
** Warranty : Nothing implied or explicit
** Last modified : 08 April, 2008
**********************************************************

PROCEDURE ptbilang
LPARAMETERS nNum

LOCAL ARRAY aPokok(9)
aPokok[1] = "Satu "
aPokok[2] = "Dua "
aPokok[3] = "Tiga "
aPokok[4] = "Empat "
aPokok[5] = "Lima "
aPokok[6] = "Enam "
aPokok[7] = "Tujuh "
aPokok[8] = "Delapan "
aPokok[9] = "Sembilan "

sAngka = ALLTRIM(TRANSFORM(nNum, "999999999"))
lnLen = LEN(sAngka)
sTer = ''
bBelas = .F.
FOR i = 1 TO lnLen
a = VAL(SUBSTR(sAngka,i,1))
IF (i = lnLen) .AND. !(bBelas) .AND. (a <> 0)
sTer = sTer + aPokok[a]
ENDIF
IF (((lnLen - i) % 3) = 1) .AND. (a <> 0)
DO CASE
CASE a = 1 .AND. VAL(SUBSTR(sAngka,i+1,1)) = 0
sTer = sTer + 'Sepuluh '
CASE a = 1 .AND. VAL(SUBSTR(sAngka,i+1,1)) = 1
sTer = sTer + 'Sebelas '
bBelas = .T.
CASE a = 1 .AND. VAL(SUBSTR(sAngka,i+1,1)) > 1
sTer = sTer + aPokok[VAL(SUBSTR(sAngka,i+1,1))] + 'Belas '
bBelas = .T.
OTHERWISE
sTer = sTer + aPokok[a] + 'Puluh '
ENDCASE
ENDIF
IF (((lnLen - i) % 3) = 2) .AND. (a <> 0)
IF a = 1
sTer = sTer + 'Seratus '
ELSE
sTer = sTer + aPokok[a] + 'Ratus '
ENDIF
ENDIF
IF (lnLen - i) = 3
DO CASE
CASE (a = 1) .AND. (lnLen <= 4)
sTer = sTer + 'Seribu '
CASE (VAL(SUBSTR(sAngka,i-1,1)) = 1) .AND. (bBelas)
sTer = sTer + 'Ribu '
bBelas = .F.
CASE a = 0 .AND. (RIGHT(sTer, 5) <> 'Juta ')
sTer = sTer + 'Ribu '
CASE a <> 0
sTer = sTer + aPokok[a] + 'Ribu '
ENDCASE
ENDIF
IF (lnLen - i) = 6
IF (bBelas)
sTer = sTer + 'Juta '
bBelas = .F.
ELSE
IF a = 0
sTer = sTer + 'Juta '
ELSE
sTer = sTer + aPokok[a] + 'Juta '
ENDIF
ENDIF
ENDIF
ENDFOR

sTer = sTer + 'Rupiah'
RETURN sTer
ENDPROC

XP: Powerful Set of Command Line Utilities

bootcfg
defrag
diskpart
driverquery
eventcreate
eventquery
eventtriggers
fsutil
getmac
helpctr
ipseccmd
logman
openfiles
msconfig
pagefileconfig
perfmon
prncnfg
prndrvr
prnjobs
prnmngr
prnport
prnqctl
regedit
relog
sc
schtasks
shutdown
systeminfo
taskkill
tasklist
tracerpt
typeperf
wmic

Note: Type command following /? for help

XP: Master File Table (MFT)

If you are using NTFS, by default NTFS would reserve 12.5% of your free diskspace for MFT.
You can increase this percentage in HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\FileSystem.
Add a key by the name "NtfsMftZoneReservation"
with the REG_DWORD value of 2. DWORD value of 1 is interpreted as 12.5% ,2 as 25% and so on.
This trick is benefit if you installed many program, because MFT utilization is going to be high.

Win98: Play WMV file

To play wmv file in Windows 98, you must install Windows Media Format Series Runtime
Get it from Microsoft website

Sony Ericsson: Secret Codes

*#06#
Show IMEI number

> * < < * < *
Service menu screen

< * * <
Personalize menu screen

< 0 0 0 0 >
Change to default language (English)

**04*0000*0000*0000# followed by on ‘Wrong Pin’ number
Opening phone without a SIM card

0 then #
Show last dialed numbers

a number then #
Show record number and name field in a SIM card

Press and hold 1
Set voicemail number

Press and hold Back button
End or minimize a java application

What is 'acrph' ?

acrph is my first password to login into server in my university