Wednesday, 1 February 2012

Disabling usb storage devices on windows XP

Disabling at BIOS:
Problem is your usb mouse/keyboard might not work.


Using gpedit:

Basically works well to prevent but only prevent for plug-before usb storage.
This one is same like u do manually in the regedit HKLM/CCS/Services/Usbstor/start value 4.
But gpedit will update periodically incase registry is changed by someone.

TIPS : use removeable device adm template which can donwnload at internet, import it by gpedit.msc, and when view PLEASE use "filter" and untick "ALL the RADIO button" otherwise you will see nothing in the right view of gpedit.msc

TROUBLE : when you plug a new-plug usb disk, it will change the "start" value to "3" and can be used after it automatically install the driver.

Tricks : Go to usbstor KEY and set permission to nothing can do anything, additionally also go to usbstor.sys file in \windows\system32\drivers and alter permission to nothing again.

In this point, the newly-plug usb device is detected but driver installation will fail. when you attach again next time the usb device will not be detected cause it is already plug-before usb device.

Friday, 27 January 2012

unix permission directory explanation

directory (other)

x --> other can cd to it and traverse to sub dir under it (as long sub dir under it has the permission for it). can not do alter nor list file BUT can ls and ls -al to specific file and get the detail of it.


w --> other can not do anything, neither ls, touch, re, nor cd

r --> other can ls only (and autocomplete TAB works too), but will show only filename without any permission, date, ownership.


rwx --> you can do many things to folder/file under it

wx --> can cd and can alter file/folder under it, can also ls -al specific file and get the detail of a file, but can not get the whole list of file/folders under it.


rx --> can cd and can list the whole list of file INCLUDING the detail of the file. Can not alter file/folder including owned by him.


rw --> list the whole list WITHOUT the file detail. Can not do alter also (same like r only???)

Wednesday, 25 January 2012

NTP on windows and linux

NTP (UDP 123)

one config as client and server in ntp.conf (might use another file like drift, keys and step ticker).

you can put "server LOCALHOST" but not necesary, as by defualt the driver creates 127.127.1.0 as ip local and in the config listed as it is.

Windows

1. net time /querysntp
2. net time /setsntp:XXXXXXX
3. net stop w32time ; net start w32time
4. w32tm /config /update
5. w32tm /resync

to test ntp server : w32tm /monitor /computers:xxxx.xxxx.xxx.xx

by GUI : go to "date/time setting", choose the 3rd tab, in the server field just type XXXXXXXXX (good hint!!!) and push synchronized.


Linux

ntpd is the service that sets and maintain system time, use port 123.

ntpdate is command which is not relate to ntp.conf
-- ntpdate -u XXXXXXX (u is used when port 123 is used alry, otherwise "ntp sockets is n used" message appears)

-- ntpdate (will give you "error no server to sync", u must put the server )

-- ntpdate XXXXXX (will update your time following the XXXX time)

-- ntpdate -q xxxxxxx (just testing the xxxxx time)

other command:
ntpd -d --> to see error/debug
ntpq -p --> list all the ntp servers that your pc using.


other errors:
bad file descriptor --> two ntpd are running, kill one of them

no server suitable for sync found --> usually happens when ntpdate -q XXXXXX right after restart ntpd on XXXXXX, wait for some time then try again. After a while ntpd server will be ready.

no associtae id 's returned --> after running ntpq -pn , caused by no "server xxxxx" parameter or no xxxxxx server, notice also if you put 127.127.1.0, do not wrongly mix with 127.127.0.1.


ESX:

For ntp client:
esxcfg-frewall -q ntpClients (-d to disable)

for ntp server:
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1002864

TIPS: stop the iptables on ESX !!!

Wednesday, 28 December 2011

extending a partition on Linux / VMware /SAN disk without gparted

First of all extend the hard disk size, either using vmware console, san console or vmdisk-vmanager command.

In my example i extend sda from 10 to 12 GB.

In my current linux:
/dev/sda1,2,3 --> primary partition

/dev/sda4 --> extended partition
/dev/sda5 --> inside sda4, it is also the /home partition

After extend, see the result using fdisk -l,
Notice if the HD size now is 12 GB.
However the partition sector/unit is still remain the same as before.


Since the last sector is /dev/sda4, so now we extend it sda4 first, then we could extend the sda5.

using parted :
# select /dev/sda
# unit mb
# print
# resize 4 xxxxx yyyyy

xxxx is the beginning of the sector
yyyy is the end of sector

Notice that now the /dev/sda4 has some more spaces.

after that we need to resize the /dev/sda5

Follow this link to extend the size:
http://www.hermann-uwe.de/blog/resizing-ext3-partitions-with-parted

>>>>>>>>>>>

unfortunately resize ext3 can be failed with error like "file system has an incompatibility feature" which is caused by the ext3 has been customized by redhat.

The quick way is just by using fdisk, remove the sda5 partition, and create again using the total sector of /dev/sda4.

Now u have /dev/sda5 extended size.


The longest way is by modifying all the custom attribute redhat:
http://gtechnotes.blogspot.com/2005/10/parted-gives-error-filesystem-has.html

>>>>>>>>>>>>>>

Wednesday, 7 December 2011

fedora 14 and intel graphic card : x11 won't start

Fatal server error
caught exception

Check your video driver:
lsmod | grep video

==> i915

Incase wanna see the card:
lspci

change the driver:
/etc/X11/xorg.conf

OR

system-config-display

(the GUI will work eventhough your X still not on)

>>>>>>>

choose VESA driver and if appear depth error message, just change the color depth to lower value.

>>>>>>>>

when u choose wrong driver, like NV (nvidia), it will give u error device not found, cause the card is not there.

Wednesday, 14 September 2011

multipath on linux - how the disk look like

modprobe -l | grep the "driver desc"

if not there, install it...
ex. go to brocade, download, install with some options like --update-initrd

after this the /sys/class/fc_host folder is there

after you scanning with
echo "1" > ............./issue_lip
echo "- - -" > ................../scan

the device will appear in proc/scsi/scsi file.

when you part it, you need to restart it:
ex. dm-2 will have dm-2p1 as partition 1, but you can not format it untill you reboot it, it will add another disk called dm-3 whcih is same with dm-2p1.

RHEL 4 does not have yum

You can either install it manually with some deps packages, or just use GUI :
system-config-application --isodir=/isoFolder

useful also when u have no CDRom