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

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...
--

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>

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
--

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.

Friday, April 03, 2009

Disable Vista security alert

Start-Control Panel-Security-Security Center
Change the way security center alerts me
--Dont notify me, but display the icon

Wednesday, March 25, 2009

Virtual PC-switch mouse cursor with [Right Alt]

Microsoft Virtual PC 2007 software enables running of another operating system (Eg, Linux) from within your current Windows XP desktop.
Most important key to remember is [Right Alt] key which move your mouse cursor from guest OS to the host desktop. 

Monday, March 16, 2009

AT Command

AT is linux simple scheduling command to execute a program or script at a specific date/time. This command will run hello.script file at 1.45pm 16 Mar 2009.

at -f /home/hello.script 13:45 03/16/09

other options are...
atq --list all pending commands and its job number.
atrm 99 --delete job number 99

more info - http://linux.about.com/library/cmd/blcmdl1_at.htm

Thursday, February 19, 2009

Set permanent IP

edit file /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
BOOTPROTO=none
BROADCAST=192.168.1.255
HWADDR=00:30:0a:4b:72:f0
IPADDR=192.168.1.15
NETMASK=255.255.255.0
NETWORK=192.168.1.0
ONBOOT=yes
GATEWAY=192.168.1.1
TYPE=Ethernet

to configure route table on every boot
edit file /etc/rc.d/rc.local
route add default gw 192.168.1.1 dev eth0
route add -net 10.0.8.0 netmask 255.255.255.0 gw 10.0.8.1

Thursday, January 22, 2009

Routing Table

Editing routing table will enable the use of more than 1 network card in a pc/server. For example, using both Local Network and WIFI connection at the same time. The purpose is to tell the computer which network card for which ip's. These are the commands, a slight difference in Windows and Linux.

Windows
route add 10.8.2.25 10.8.1.1
route add 0.0.0.0 mask 0.0.0.0 192.168.2.1
route print (to display routing table)

Linux
route add 10.8.2.25 gw 10.8.1.1
route add default gw 192.168.1.1

or to add the whole network segment
route add -net 10.8.2.0 netmask 255.255.255.0 dev eth0

route -n (to display routing table)

Friday, January 16, 2009

SSH Tunnelling

connecting to office's Application server from home, securely via SSH Server using putty.exe

Putty Settings
SSH-Tunnels
--Source Port : 23
--Destination : 192.168.5.20:23

Applications Setting
IP : 127.0.0.1
Port : 23

Wednesday, December 24, 2008

PSCP-Putty Secure Copy Program

PSCP is secure way of downloading file from an SSH Server instead of using FTP protocol. This is an example of how to copy file flower.jpg from an SSH server ip 202.190.128.115 using port 447

pscp -P 447 username@serverhostname.com:flower.jpg .

note: do not forget the last dot (.) which means that you're saving the file to current local directory.

command for uploading file to SSH server
pscp -P 447 flower.jpg username@serverhostname.com:flower.jpg

Wednesday, December 03, 2008

Linux SysLog

Linux system log function is to record every activity that took place in a server. It provides information about who logs in or what program is being executed and at what time. I found out sometime ago that someone tried to hack into my server using root id and guessing passwords from the system log. To solve that problem, I disable root id from remote login and a waiting period of 5 minutes if number of tries with wrong password exceeded 3 times.

By default, linux syslog will create a MARK in the log file every 20 minutes just to inform you that it is running in the background. This can make the log file, cluttered and harder to read. Just change this default interval into something better like once every 3 hours (180 minutes) with a command like this.

# /sbin/syslogd -m 180

to view the last 50 lines of the log messages, type this :
# tail -n 50 /var/log/messages

Tuesday, December 02, 2008

DB2 SQL - Select Distinct

Select Distinct is used to ensure that data retrieved from a query will not display duplicate records. It is useful if you want to get a list of users list of names from a database. The format of the sql is SELECT DISTINCT column-name.

Here's an example :
SELECT DISTINCT GRANTEE FROM SYSIBM.SYSTABAUTH WHERE GRANTEETYPE <> 'P';

Updating Blog By Email

I can now update my blog via email. Simply by sending an email to
rayrosliabas.secretword@blogger.com
Make sure you set your Email Address and SecretWord in your blogs'
Settings - Email options.
--
Regards,
Rosli Abas... via email

Wednesday, November 12, 2008

DB2-Limit SQL Query

This is and example on how to limit a no of lines to display during DB2 SQL Query.

SELECT * FROM TEST.CUSTOMER WHERE LASTNAME='SMITH' FETCH FIRST 10 ROWS ONLY;

IRC with Opera browser

I'm not a frequent chatter. If I feel like chatting online, yahoo messenger is for sure the only choice I know. However public chatrooms are very limited and quite a limited number of users allowed in a room.

Today is the first time (after quite some time) that I'm (back) on IRC. First I browse for IRC clients that is available because mIRC, a popular client is actually not a freeware. To my surprise, IRC Client is included in Opera browser. (I'm using Opera as my default browser because Firefox is not too efficient on memory and sometimes unable to display certain webpages correctly. There is also IRC client in Firefox addons).

Here's simple guide on using IRC in Opera.
-Tools - Mail and Chat Account
-fill in your name, email and nickname
-choose a server. I choosed Dalnet Asia
-join a room. The only room I know is "kampung"

Thats it. You can now start chatting with other users.
Dont ask me about IRC commands... I'm a newbie too...

Monday, October 13, 2008

Playing Videos on Linux Fedora 8

Configuring Fedora 8 to play videos is one of the toughest task. This
is because Redhat & Fedora are designed not for entertainment and in
respect of multimedia license and copyright issues.

Here's a list of task I performed to enable my laptop to play MPEG, AVI,
FLV and WMV files.

1. install repositories of livna
#wget http://rpm.livna.org/livna-release-8.rpm
#rpm
-ivh livna-release-8.rpm

2. install pulseaudio-libs
-due to dependency problem during mplayer installation
-download and install pulseaudio-libs-0.9.8-5.fc8.i386.rpm from
http://rpm.pbone.org

3. install lzo and libdvdnav-4 required by mplayer
download and install these packages
-lzo-2.02-3.fc8.i386.rpm
-libdvdnav-4.1.2-2.fc8.i386.rpm

4. install mplayer (multimedia player) package
yum install mplayer

5. install mplayer gui application and related codec
yum install gnome-mplayer
yum install mencoder

Friday, October 10, 2008

Configure Linux DNS setting

Installing a dual booting Linux & WinXP on my laptop is fairly easy for me. But configuring it afterwards to suit my daily work/leisure needs is quite hard. Heres the solution I got to set up internet connection which main problem is unrecognised DNS server list.

-edit the file
# vi /etc/resolv.conf
-enter dns server ip
nameserver 192.168.1.1
nameserver 61.6.32.163

Note : ip numbers depends on what is assigned by your internet service providers (ISP).

Wednesday, October 08, 2008

Playing MP3 in Linux-Fedora

By default, Redhat & Fedora Linux are unable to play mp3 files due to copyright restrictions. To enable my laptop (installed with Fedora 8) to play mp3 songs, i just need to install these 2 files.
1. XMMS - available from installation dvd & listed in package list.
2. XMMS-MP3 - download rpm from www.rpm.pbone.net

Thursday, June 26, 2008

Simple Yahoo Messenger

My yahoo messenger is always in 'Online' mode most of the time whenever I'm in front of my pc. To me, its an effective and fast mode of communication. Emails? considered as a 'snail' mails nowadays. But what if instant messaging protocols are not allowed in workplace? IM's despite its advantages could also be distracting. Meebo is an alternatives but sometimes its url is also blocked through network restrictions.

Well, try this site - www.m.yahoo.com

Its yahoo mobile website developed for PDA's and mobile devices. Minimum graphics and interactivity. You can check your yahoo email & yahoo messenger communication.
Just remember that you need to press [Refresh] link to check for new messages.

Friday, January 04, 2008

Using both LAN and WIFI

My work requires me to connect to a Server via Local Area Network. But to browse the internet, I had to plug it off and switch to a Wireless Network. I found a way to use both LAN and WIFI at the same time by configuring the Routing Table. Its easier in Linux/Unix environment.
After searching for quite some time, I've finally succeeded to apply the same method in Windows. So here's the commands :

1. Create routing of 10.23.179.100 to use gateway 10.23.184.1 using network card no.3
ROUTE ADD 10.23.179.100 10.23.184.1 METRIC 25 IF 0X3
Note : if the above command failed, type again without the "IF 0x3"

2. Create 192.168.1.1 as default gateway, ie using the internet
ROUTE ADD 0.0.0.0 MASK 0.0.0.0 192.168.1.1

3. Display the routing table.
ROUTE PRINT

Ping to both the local server ip and Yahoo website to check the connection.

Monday, September 03, 2007

My Javascript code

I tried to write a complex javascript code in this blog post but I guess blogspot.com does not allow all the features of javascript as a way to prevent people with bad intention from spreading spywares and viruses.

Therefore here's a simple one...


And this is the code :
[script type="text/javascript"]
document.write ("Hello, world!");
[/script]

note : replace [ ] with < >

Saturday, March 24, 2007

Shortcut Keys

Windows XP Shortcut Keys
1. [WinKey]+D = minimise desktop. repeat same key to resume
2. [WinKey]+M = minimise
....[WinKey]+Shift + M = restore
3. [WinKey]+L = lock your screen. require password to continue. all running program remains.
4. [WinKey]+R = run program
5. [WinKey]+E = Explorer (My Computer)

Shutdown Button
how to create a shutdown shortcut key on desktop
-right click-New-Shortcut
-type "c:\windows\system32\shutdown.exe -s -f -t 0"
(meaning -shutdown, force, time=0)
-change icon to your liking.

Friday, January 05, 2007

configure wireless in linux

1. make sure wireless driver is installed.
(get ndiswrapper program to use windows driver in linux)

2. disable lan adapter to avoid conflict & enable wireless device
# ifconfig eth0 down
# ifconfig wlan0 up

3. scan for available wifi signal
# iwlist wlan0 scanning

4. connect to the wifi. example "timezone"
# iwconfig wlan0 essid 'timezone'

5. enter wep key (if required)
# iwconfig wlan0 key 112233445566

6. get ip from dhcp
# dhclient wlan0

7. test the connection
# ping www.google.com

Thursday, January 04, 2007

Me and My Gadgets

Here are some of the gadgets i own...

Nokia 6230. Price RM 1400 (10/2005). 1.3MP Camera, Radio, Bluetooth, GPRS

128MB Kingston Flash Drive. Price RM 80 (05/2005)

Ergotech MP3 Player...128MB. RM 75 (02/2006)

Aztech Wifi USB (my laptop doesn't have a built-in wifi)-RM 75 (06/2006)

meebo.com


www.meebo.com is a website where you can easily logs into instant messenger service without having to install any program into the computer. Especially when you're using public computer at cybercafes, schools or universities. It's also a simple solution if office network blocks all IM protocols.

As for me, i had to use meebo whenever i'm running on linux. Yahoo messenger for linux doesn't work. Gaim (another multiple service messenger) runs well but not if i'm behind a proxy server.

Meebo supports messenger service for AIM, Yahoo, GoogleTalk and MSN.

Friday, November 17, 2006

FrameBuffer calculation

it took me months to figure out how to solve this question... so i thought it would be worth posting it on my blog

Question:
If a raster scan display monitor with a size of 10 inch (height) x 12 inch (width), with a resolution of 120pixel per inch and frame buffer bit depth of 6 bit per pixel. How much is the frame buffer size in KB ?

Answer :
10x12x120x6/8 = 10,800 byte/1024 = 10.55 KB

Monday, October 30, 2006

Umailer - easy smtp email


i can't send email using my company's mail from outside! smtp port was closed to reduce the risk of virus & spam. login thru webmail function takes forever...

so here's the solution. i receive my email as usual using outlook... but wherenever i need to reply, i'll just run this UMAILER program. it acts much like a fakemail program. using free smtp relay option automatically from the internet.

i used to have my own fakemail program which i wrote using visualbasic some time ago (with its own built in smtp engine). but i've lost it... rewritting the whole program might takes few hours, and i'm terribly busy with lots of things to do right now.

size : 500kb
http://radical.xs4all.nl/~thedp/software/umailer/umailer.zip