Wednesday, October 12, 2011
This is VBScript example of automatically pressing [SHIFT] key every 30sec to avoid screen lock due to inactivity
Open Notepad, type this commands & save as .vbs
---
Dim myKey
set myKey=CreateObject("WScript.Shell")
Do While True
myKey.SendKeys "+"
WScript.Sleep 30000
Loop
---
Dblclick on file to run the program. To terminate, [End Process] wscript.exe from TaskManager
Wednesday, July 20, 2011
Control two pc with 1 keyboard & mouse
Use Synergy or InputDirector
Synergy did not work in my situation - Win7 and WinXP in office domain.
So I tried Input Director program and it worked perfectly.
Install on all the pc required.
Wednesday, May 18, 2011
Delete Startup items from Msconfig
Run regedit and delete related items in
> HKLM - Software - Microsoft - Shared Tools - MsConfig - startupreg
other than usual
> HKLM - Software - Microsoft - CurrentVersion - Run
Wednesday, March 30, 2011
Audio Problem - HP Desktop dx2000, laptop 6910p
My home desktop pc HP dx2000 MT suddenly not functioning after I access to it using Remote Desktop. Its running on WinXP SP2. Its a known issue.
Download and install "Microsoft Windows XP SP2 Fix for RDC Audio Redirect Failure (Q886199)" from HP Driver website for your model.
Example :
HP dx2000MT - ftp://ftp.hp.com/pub/softpaq/sp28501-29000/sp28969.exe
HP laptop 6910p - ftp://ftp.hp.com/pub/softpaq/sp32001-32500/sp32385.exe
Reboot is required after the patch installation.
Tuesday, March 29, 2011
Find XP Serial No
Need to reinstall windows but lost your serial key ?
Download programs like winkeyfinder from http://www.winkeyfinder.com/
Dont have an installation CD?
You can create one, from C:\I386 folder which is usually available in preinstalled pc & laptops.
Just bought a new pc/laptop?
The best thing to do is create a clone image from your new pc/laptop before you start configuring or installing anything. Over the time, if you need to refresh your OS, it'll just take 10 minutes to restore from clone image and you'll have that new pc/laptop feel again.
Google on how to create clone image...or email to me personally if you want a tip!
Monday, March 28, 2011
Webcam Timer
I choose to have a very basic setting to broadcast my webcam to the internet.
The webcam software will capture an image every 5 seconds and saves to c:\inetpub\wwwroot\mypic.jpg which is my winXP webserver
www.yawcam.com
2. java script to autorefresh every 5 second. Paste this in your html file.
[script language="javascript"]
var refreshrate=5;
var image="mypic.jpg";
function refresh(){
document.images["pic"].src=image+"?"+new Date();
setTimeout('refresh()', refreshrate*1000);}
document.write('[IMG SRC="'+image+'" ALT="Alternate Text" NAME="pic" ID="pic" STYLE="border: 1px solid Black;"]');
if(document.images)window.onload=refresh;
[/script]
*note: replace [ ] at script and IMG tag with < >
Wednesday, March 16, 2011
Linux - convert Ext2 to Ext3
This is commands to convert Ext2 to Ext3. This example if using volgroups
# tune2fs -j /dev/vgname/lvname
or if using disk /dev/sda
# tune2fs -j/dev/sda
--
If something wrong happened, such as unable to bootup after converted.
Like what happened to me : "kernel panic, unknown ext3 partition"
Convert back from Ext3 to Ext2.
- boot up system using "rescue" mode from installation cd
# tune2fs -O ^has_journal /dev/vgname/lvname
# e2fsck /dev/vgname/lvname
- reboot
Friday, October 15, 2010
Compaq 6910p brightness problem-solved
Problem: Unable to increase screen brighness on laptop HP Compaq 6910p. Operating system Windows XP.
Cause : In XP, Ctrl & [Fn] button is mixed-up. Left Ctrl is actually [Fn] button.
Solution : To increase screen brightness, press Left Ctrl + [F10]. Press many times until screen brightness indicator appear on screen.
Please thank me in comment box. This way I know that I've helped people.
Thanks - Ray Rosli Abas, Malaysia
Cause : In XP, Ctrl & [Fn] button is mixed-up. Left Ctrl is actually [Fn] button.
Solution : To increase screen brightness, press Left Ctrl + [F10]. Press many times until screen brightness indicator appear on screen.
Please thank me in comment box. This way I know that I've helped people.
Thanks - Ray Rosli Abas, Malaysia
Wednesday, October 13, 2010
RPM Erase Problem
System : Linux (SLES10 SP2)
Symptom : Unable to erase a failed program/package
Error message : scriptlet failed, exit status 1
Solution : rpm -e --noscripts [package-name]
Symptom : Unable to erase a failed program/package
Error message : scriptlet failed, exit status 1
Solution : rpm -e --noscripts [package-name]
Thursday, July 08, 2010
SLES10 - VNC Remote problem
Something went wrong on my SLES10-SP1 vnc connection.
I can only get a basic grey VNC Connection when I connect to the server using vncviewer.
Note : uninstall all vnc* first if neccessary
1. Login via SSH to the server
2. Start Yast. Choose Network Services - Remote Administration - [x] Allow Remote Administration.
3. Choose to install tightvnc etc when asked.
4. Quit Yast and run # rcxdm restart
Then run vncviewer to the server's ip eg; 192.168.0.156:1
I can only get a basic grey VNC Connection when I connect to the server using vncviewer.
Note : uninstall all vnc* first if neccessary
1. Login via SSH to the server
2. Start Yast. Choose Network Services - Remote Administration - [x] Allow Remote Administration.
3. Choose to install tightvnc etc when asked.
4. Quit Yast and run # rcxdm restart
Then run vncviewer to the server's ip eg; 192.168.0.156:1
Thursday, June 03, 2010
Get Linux Version Info
Commands to display the linux installation version & kernel info
# cat /etc/issue
Welcome to SUSE Linux Enterprise Server 10 SP1 (s390x) - Kernel \r (\l).
# cat /proc/version
Linux version 2.6.16.46-0.12-default (geeko@buildhost) (gcc version 4.1.2 20070115 (prerelease) (SUSE Linux)) #1 SMP Thu May 17 14:00:09 UTC 2007
# uname -r
2.6.16.46-0.12-default
# uname -a;uptime
Linux trktsv21 2.4.21-50.ELsmp #1 SMP Tue Jun 12 17:36:47 CDT 2007 i686 i686 i386 GNU/Linux
15:45:33 up 32 days, 1:05, 1 user, load average: 2.32, 1.93, 1.84
# cat /etc/issue
Welcome to SUSE Linux Enterprise Server 10 SP1 (s390x) - Kernel \r (\l).
# cat /proc/version
Linux version 2.6.16.46-0.12-default (geeko@buildhost) (gcc version 4.1.2 20070115 (prerelease) (SUSE Linux)) #1 SMP Thu May 17 14:00:09 UTC 2007
# uname -r
2.6.16.46-0.12-default
# uname -a;uptime
Linux trktsv21 2.4.21-50.ELsmp #1 SMP Tue Jun 12 17:36:47 CDT 2007 i686 i686 i386 GNU/Linux
15:45:33 up 32 days, 1:05, 1 user, load average: 2.32, 1.93, 1.84
Friday, April 30, 2010
Tuesday, April 13, 2010
Forwarding Remote Desktop
I require forwarding of a remote desktop because a pc with windows XP is in different network segment than my laptop. In between, there is a linux server which is accessible by both my laptop and that XP pc.
To enable a Remote Desktop Connection, first I must log in to the linux server using Putty.exe via ssh connection. Set tunnelling in putty like this,
L1234 192.168.200.10:3389
From my laptop, connect to XP pc with Windows Remote Desktop application to 127.0.0.1:1234

Note :
The key is not to configure using the same port number 3389. In this example, I use port 1234.
To enable a Remote Desktop Connection, first I must log in to the linux server using Putty.exe via ssh connection. Set tunnelling in putty like this,
L1234 192.168.200.10:3389
From my laptop, connect to XP pc with Windows Remote Desktop application to 127.0.0.1:1234
Note :
The key is not to configure using the same port number 3389. In this example, I use port 1234.
Friday, April 09, 2010
Play FLV in Media Player
This is a small, simple codec (300kb) to enable windows media player to play .flv videos.
http://www.playflv.com/playFLV/
http://www.playflv.com/playFLV/
Wednesday, April 07, 2010
Streamline SATA driver for HP CQ40
I am trying to install win XP on a HP CQ40 laptop which was actually build for Vista.
First problem is that it will not be able to detect a SATA hard disk. You can try to disable SATA in BIOS but my CQ40 does not come with that option.
I had to download a SATA driver and then try to integrate it into existing winXP cd. A process called streamlining. Need to have:
1. SATA driver file
2. nLite program
3. WinXP CD
4. blank CD and an ISO burner software
Reference : http://www.howtogeek.com/howto/windows/resolving-setup-did-not-find-any-hard-disk-drives-during-windows-xp-installation/
For CQ40-406AU winXP drivers
http://laptop-driver.blogspot.com/2009/05/compaq-presario-cq40-406au-windows-xp.html
First problem is that it will not be able to detect a SATA hard disk. You can try to disable SATA in BIOS but my CQ40 does not come with that option.
I had to download a SATA driver and then try to integrate it into existing winXP cd. A process called streamlining. Need to have:
1. SATA driver file
2. nLite program
3. WinXP CD
4. blank CD and an ISO burner software
Reference : http://www.howtogeek.com/howto/windows/resolving-setup-did-not-find-any-hard-disk-drives-during-windows-xp-installation/
For CQ40-406AU winXP drivers
http://laptop-driver.blogspot.com/2009/05/compaq-presario-cq40-406au-windows-xp.html
Tuesday, April 06, 2010
Vista Administrator
This is how to enable Administrator account in Windows Vista.
Login with administrator previleges, run cmd prompt and type this
net user administrator /active:yes
Login with administrator previleges, run cmd prompt and type this
net user administrator /active:yes
Friday, April 02, 2010
DB2 Connect
su - db2inst1
db2start
db2 connect to [database] user [username] using [password]
db2 "select * from [tblname] fetch first 10 rows only"
db2start
db2 connect to [database] user [username] using [password]
db2 "select * from [tblname] fetch first 10 rows only"
Saturday, March 06, 2010
Play everything in Windows Media Player
This is how you could play (almost) every multimedia/video format with Windows Media Player. Download and install Windows Essentials Codec Pack from this link.
http://www.mediacodec.org/Setup.exe
Size = 8.8MB
Alternative player of my favourite is Media Player Classic.
http://download.cnet.com/Media-Player-Classic/3000-2139_4-10518778.html
http://www.mediacodec.org/Setup.exe
Size = 8.8MB
Alternative player of my favourite is Media Player Classic.
http://download.cnet.com/Media-Player-Classic/3000-2139_4-10518778.html
Sunday, October 18, 2009
Reset XP Admin Password
Reset XP Administrator's password using Linux Backtrack Live CD
1. umount /mnt/hda1
2. modprobe fuse
3. ntfsmount /dev/hda1 /mnt/hda1
4. cd /mnt/hda1/windows/system32/config
5. chntpw -i sam system security
6. choose Administrator id
7. Enter new password or * to reset blank
Note :
above example is for NTFS partition. If not, use these commands:
umount /mnt/hda1
mount -o rw /dev/hda1 /mnt/hda1
1. umount /mnt/hda1
2. modprobe fuse
3. ntfsmount /dev/hda1 /mnt/hda1
4. cd /mnt/hda1/windows/system32/config
5. chntpw -i sam system security
6. choose Administrator id
7. Enter new password or * to reset blank
Note :
above example is for NTFS partition. If not, use these commands:
umount /mnt/hda1
mount -o rw /dev/hda1 /mnt/hda1
Monday, September 07, 2009
SED-insert quotes symbol
SED (stream editor) is a program to replace text in a file. Its easier to use VI, but sometimes, VI program is not available. Like in my case, I logged into z/Linux Server from Mainframe z/VM panel. I cant login remotely via SSH because network conf file (/etc/sysconfig/network/ifcfg-qeth*) is missing an important " symbol.
IPADDR="192.168.1.233
Typical SED command. Example to change ip from .233 to .234
sed -i ifcfg-qeth* -e 's/233/234/g'
but to add symbol " will not work straight away because ' and " is part of SED input.
Solution : use " twice, like this.
sed -i ifcfg-qeth* -e 's/233/234""/g'
Result :
IPADDR="192.168.1.234"
Thanks to Wan Uni Azran for helping me figure this out!
IPADDR="192.168.1.233
Typical SED command. Example to change ip from .233 to .234
sed -i ifcfg-qeth* -e 's/233/234/g'
but to add symbol " will not work straight away because ' and " is part of SED input.
Solution : use " twice, like this.
sed -i ifcfg-qeth* -e 's/233/234""/g'
Result :
IPADDR="192.168.1.234"
Thanks to Wan Uni Azran for helping me figure this out!
Tuesday, August 18, 2009
GNU Screen
GNU Screen provides virtual multiple screen for a user. Logging in remotely via SSH, a process or program will still continue running even if the line disconnects or the user logs out.
Required to install GNU Screen package.
eg, yum install screen
To start a virtual screen, eg session name=myview01
screen -S myview01
To disconnect/detach
Ctrl+a, d
To reconnect/reattach
screen myview01
Type 'exit' to end screen session
To share/remote Screen
Local machine (user01)
chmod u+s /usr/bin/screen
chmod 755 /var/run/screen
screen -S mywork
Ctrl+a :multiuser on
Ctrl+a :acladd user02
Remote user (user02)
SSH to machine
screen -x user01/mywork
Required to install GNU Screen package.
eg, yum install screen
To start a virtual screen, eg session name=myview01
screen -S myview01
To disconnect/detach
Ctrl+a, d
To reconnect/reattach
screen myview01
Type 'exit' to end screen session
To share/remote Screen
Local machine (user01)
chmod u+s /usr/bin/screen
chmod 755 /var/run/screen
screen -S mywork
Ctrl+a :multiuser on
Ctrl+a :acladd user02
Remote user (user02)
SSH to machine
screen -x user01/mywork
Wednesday, July 29, 2009
Problem reinstall XP on HP nx6310
I was unable to reinstall a fresh copy of Windows XP on my HP nx6310 laptop. Error displayed is that no hard disk was found.
Solution : Disable SATA Native Mode in BIOS setting.
You can also create a bootable WinXP Setup CD from your preloaded system. Follow instructions from here
http://www.howtohaven.com/system/createwindowssetupdisk.shtml
Solution : Disable SATA Native Mode in BIOS setting.
You can also create a bootable WinXP Setup CD from your preloaded system. Follow instructions from here
http://www.howtohaven.com/system/createwindowssetupdisk.shtml
Saturday, July 25, 2009
Z/VM Commands
Z/VM Commands... so that i wouldn't forget
query dasd
query users
query names
filelist user direct
directxa
logon maint here
force LNX01
xautolog LNX01
i cms
det 7500-7503 system
att 7500-7503 maint
ddr
in 7500 dasd
out 7600 dasd
copy all (or copy 1 to 3338)
yes
end
vi /etc/sysconfig/network/ifcfg-qeth*
vi /etc/hostname
vi /etc/hosts
i cms
cpfmtxa
label
7600
LNX700
i cms
att 9001-9003 maint
cpfmtxa
format
9001
0 100
LNX200
yes
end
PA[2] = next screen message
#cp logoff (maint/lglopr id only)
#cp disc - do not use logoff on z/linux image, will shutdown z/linux server
query dasd
query users
query names
filelist user direct
directxa
logon maint here
force LNX01
xautolog LNX01
i cms
det 7500-7503 system
att 7500-7503 maint
ddr
in 7500 dasd
out 7600 dasd
copy all (or copy 1 to 3338)
yes
end
vi /etc/sysconfig/network/ifcfg-qeth*
vi /etc/hostname
vi /etc/hosts
i cms
cpfmtxa
label
7600
LNX700
i cms
att 9001-9003 maint
cpfmtxa
format
9001
0 100
LNX200
yes
end
PA[2] = next screen message
#cp logoff (maint/lglopr id only)
#cp disc - do not use logoff on z/linux image, will shutdown z/linux server
Monday, June 08, 2009
Download Youtube videos
Simple, go to youtube video clip of your choice. For example,
http://www.youtube.com/watch?v=rIb_MUGJwDY
change the url to
http://www.voobys.com/watch?v=rIb_MUGJwDY
http://www.youtube.com/watch?v=rIb_MUGJwDY
change the url to
http://www.voobys.com/watch?v=rIb_MUGJwDY
click on the download button and save to your computer.
Rename it to videoname.flv
--
Wednesday, May 06, 2009
A nice quote I created sometime ago
Of all the music in the world, sound of your voice is all I want to hear.
Of all the places in the world, next to you is all I want to be...
--
Of all the places in the world, next to you is all I want to be...
--
Friday, April 24, 2009
Tiny C Compiler
A very small (275kb) and fast C compiler. Available for Linux & Windows version.
For windows version, just download and uncompress the zip file.
Create a simple C program, example (hello.c)
#include <stdio.h>
main()
{ printf ("Hello world!");
return 0;
}
compile using this command: tcc hello.c
execute your program : hello <enter>
For windows version, just download and uncompress the zip file.
Create a simple C program, example (hello.c)
#include <stdio.h>
main()
{ printf ("Hello world!");
return 0;
}
compile using this command: tcc hello.c
execute your program : hello <enter>
Note : too bad I can't compile a C++ program with this.
Link : http://bellard.org/tcc/
Foxit Reader 3.0
Foxit Reader 3.0 - fast,free,lightweight,simple PDF reader.
Better than the usual Adobe Acrobat Reader.
http://www.foxitsoftware.com/pdf/reader/download.php
--
Better than the usual Adobe Acrobat Reader.
http://www.foxitsoftware.com/pdf/reader/download.php
--
Thursday, April 09, 2009
C++ Function example
#include <iostream>
using namespace std;
int getTotal(int, int);
main()
{
int num1,num2,total;
cout << "Enter first number :";
cin >> num1;
cout << "Enter second number :";
cin >> num2;
total=getTotal(num1,num2);
return 0;
}
int getTotal(int a, int b)
{
int result;
result=a+b;
return result;
}
Notes :
int getTotal() means that this functions returns an integer type variable.
In Linux, compile using this command
g++ yourfile.cpp -o yourfile.exe
Saturday, April 04, 2009
IE Icon on Vista desktop
-run Regedit
-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
Explorer\HideDesktopIcons\NewStartPanel
-create new DWORD (32bit) name {871C5380-42A0-1069-A2EA-08002B30309D}
do not forget the curly bracket {}
-set its value to 0
-refresh desktop by pressing F5. IE icon will be on you desktop now.
-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
Explorer\HideDesktopIcons\NewStartPanel
-create new DWORD (32bit) name {871C5380-42A0-1069-A2EA-08002B30309D}
do not forget the curly bracket {}
-set its value to 0
-refresh desktop by pressing F5. IE icon will be on you desktop now.