Thursday, 5 July 2012

CDE AIX : start up and setup

To install CDE:
* smitty installp
   --> choose "install software bunde"
   --> choose X11 and Graphics

To remote :
* Use cygwin with x11 component installed (or X-manager if u like to pay money)
* X -query

To display in monitor when u are connecting using serial port at the beginning:
* ensure you have graphics card in your POWER machine
* plug the monitor (using special converter to the graphic card) and plug the usb mouse-keyboard at usb port POWER
* during boot, put password "admin" when prompted at SMS mode
* choose "chose console"
* it will emerge something in the monitor saying "press if u choose this as active console"
* you choose that number and now the SMS will be on monitor

To activate CDE login prompt:

0. * /usr/dt/bin/dtconfig -e  (enable)   -- opposed to -d to disable auto start the desktop
1. if using bitmap (graphical) monitor : verify file in /usr/dt/config/Xservers
2. if using number 1 and u wanna use additional character display (dump terminal) :
     -->  cp /usr/dt/config/Xservers to /etc/dt/config/Xservers
     --> verify the file
3. if wanna disable number 1 and only activate dump terminal:
    --> edit the /etc/dt/config/Xservers
    --> comment out the line containing "display 0" thingie

 4. to disable CDE login prompt in monitor local display (physical):
     --> comment out the line in /usr/dt/config/Xservers

To restart CDE to take effect after config file changed:

* /usr/dt/bin/dtconfig -kill
* /usr/dt/bin/dtconfig -reset
* /usr/dt/bin/dtconfig -e

 To activate session from native shell:
* xinit /usr/dt/bin/Xsessions

Sunday, 29 April 2012

Fixing GPS navistar or other china brand

Accessing your GPS from PC:

1. connect your GPS to your PC using the usb cable

2. boot up your GPS, during the booting PC might not recognise it

3. after boot up, PC will recognise it as HDD external drive

4. if still PC does not recognise it, then check if external SD card is in your GPS

5. remove the external SD card

6. reboot the GPS

7. in windows you can copy/delete/move file in GPS (or flash) to your PC

8. you can update map, by accessing the navistar website and donwload the files there, then replace the files in your GPS with the new downloaded one.



Problem GPS signal can not be found, the question mark is in the satelite icon:

1. go to advance setting - system status

2. ensure you have 4 blue bar signal there, red signals meaning the satelite is detected (otherwise it wont be there), but the gps get low signal.

3. after you move to better position, if the signal is still weak, try to change your navigator path to different papagom com baud/rate to another ones, example in my case after i change to papagoCOM2_4800 is better than papagoCOM5_4800.

note : access navogator path by going to main menu (home icon), or exit first if you are in navi mode. then go to navigation setup icon, then choose the path there.

4. if still can not, then try update your maps using above instruction

5. if still can not, then it means your gps broken.

Multi maps on your GPS

Copy the maps folder (contain many files), example "indonesia-xxx-xxx" from your PC to the GPS "/flash/navi/maps/   "

reboot your GPS, and now when u navy and go to advance setting, you can switch maps in "maps options" from your original maps to your new maps.

Note that : GPS X5 can not locate maps stored in the external SD.

Thursday, 23 February 2012

Redhat 6 on POWER 6 using VNC

1. How to clone : use dd command and then if u had done the network config, now you should edit the ifcfg-eth0/1/2/3/??? and change the HW address inside those file(s) following your target machine, otherwise the target has eth2/3 instead of 0/1 (if u have 2 ports)


2. Install as normal, by using SMS mode in POWER6 (either by choose "open firmware" from advance button in "activate" profile section OR press an immediate number 1 after menu booting)


3. If you overwrite an AIX LPAR, installation will fail with message "vfs unable to mount". In this case you go to Open firmware (either by choose "open firmware" from advance button in "activate" profile section OR press an immediate number ? after menu booting). In OF prompt, type "dev nvram" and then "wipe-nvram".


4. Reboot again and go to SMS mode again.

5. Type "tab" to see available option (rescue, vnc, auto=nodmraid), or just enter to pass through.

6. No need test media

7. Everything as normal until.. the selecting disk

8. When you see the menu contain 3 options (Enitre disk, free space, overwrite linux partition), below that there is supposed to be disk(s) that you can use. if not there, can lead to hang when u do something.

9. Figure out first why the disk(s) are not there.

10. After solved, go as normal.

11. Redhat 6 does not install many thing by default / only 2GB.

12. install createrepo by rpm command in cd-linux-ppc64/Packages (must install 2 dependencies bfore that, which is told after you run that command).
run : createrepo target-directory-where-the-repodata-local-reside

13. configure group installation: createrepo -g cd-linux-ppc64/repodata/xxxxx-comps-xxxx.xml target-directory-where-the-repodata-local-reside (must install 2 dependencies bfore that, which is told after you run that command)

13. yum grouplist

14. yum install Desktop

15. yum install tigervnc

16. activate : vncserver (config in /usr/bin/vncserver file), can see ur current options ps -ef | grep Xvnc, can initally use the option like vncserver -geometry 1024x768 -geometry 800x600. Then form client you can choose which, by command xrandr

17. from vncviewer somewhere : use IP and port 590X (X should be 1 for the first vncserverprocess) Might need to stop iptables services first.

18. can test in terminal : xset q --> to see the vnc properties

19. mmhh, but maybe you dont have terminal yet, install xterm. or install gnome-terminal. better yet install with gnome-terminal-xxxxxx to make "open terminal" available in right-click desktop.

20. Now u might see the font in gnome terminal is weird, in this case you must install packages bitmap-xxxxx, and use that font.

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

Friday, 24 June 2011

syslog in linux/redhat

File is in /etc/syslog.conf

by default:
*.info;mail.none;authrpiv.none;cron.none /var/log/messages


meaning logging all subject at info (and above) level but the mail and cron not.
to the messages file

To make it particular:
kern.=info (only kernel with level info)

Numerical Code Severity Reference
-------------- ------------------------------------------- ---------
0 Emergency: system is unusable [RFC3164]
1 Alert: action must be taken immediately [RFC3164]
2 Critical: critical conditions [RFC3164]
3 Error: error conditions [RFC3164]
4 Warning: warning conditions [RFC3164]
5 Notice: normal but significant condition [RFC3164]
6 Informational: informational messages [RFC3164]
7 Debug: debug-level messages [RFC3164]


7 is the most detail severity level.

Tuesday, 21 June 2011

Explanation free Command in Linux

total Used free shared buffers cached
Mem: 49415736 49139132 276604 0 5656 47368280
-/+ buffers/cache: 1765196 7650540
Swap: 5237180 20 5237160

Mem total : Mem used + free
Mem used : 49GB (ps + buffers 5656 + cache 47GB)


- buffer/cache : Mem used - (buffers 5656 + cache 47GB)
+ buffer/cache : Mem free + (buffers 5656 + cache 47GB)

Swap (paging/Hard disk) used is 20KB only.



Buffers and cache are considered low priority, they r using large mem when none uses it. when apps using it, they will be decreased.

Buffers is for remembering the FS like dir structure (ls -R . will boost the buffr)
cache is storing the file content, so processes can access file in cache instead read it over and over from the disk.

Wednesday, 18 May 2011

SCSI harddisk on linux

Manually:
cat /proc/scsi/scsi
ls /sys/class/scsi_host/.....
==> contain the host:bus:ID:Lun and Port name

By command:
lsscsi (many flag options)
fdisk -l
sginfo

Note : /dev/sdX mapped from /dev/sgX

When a HBA attach to SAN which contain 4 logical disks:
/dev/sdb,c,d,e (the partner is /dev/sdf,g,h,i)

How to see the partner :
e2label /dev/sdb XXX ==> to lable the HD
e2label /dev/sdf --> to see if it has same lable or not

Will be like this :
H:B:I:L == 5.0.0.1,2,3 (for sdb,c,d,e) and 5.0.1.1,2,3,4 (for the partner)

H is host, same as comes from one HBA. (diffrent from CDROM and LOCAL HD as it connects from different card)

B is BUS : dunno what
I is ID : same for LUNS (show same S/N of harddisk)
L is LUN : different for each partition/logical disks

additional commands:
hdparm
sdparm
scsi_id
parted /dev/sdX print ==> to see File System of a harddisk
rescan_scsi_bus.sh

Wednesday, 9 March 2011

Linux HD ATA problem : fsck, e2fsck

when disk has problem, normally you done fsck.

when fsck generates error like ext2 not recognized, please run e2fsck -b xxxx, this one what you must do:

1. linux rescue
2. fdisk /dev/sdX
3. fsck to each partition, NOT to the disk /dev/sda NOR to the swap NOR to the sda4(extended partition - 0 length partition)

If you got error about superblock, then:
4. each partition : mkfs -n -S /dev/sdXY
5. Get the superblock backup number xxxx, xxx, xxx and run : efsck -b xxxx /de/sdXY, try till succesfully

Reminder : Do not fsck to the disk /dev/sdX, but do it to the partition instead.

Wednesday, 2 March 2011

Linux WWPN and adding SAN disk

To rescan an entire SCSI bus and re-register all devices found:

When dealing with fibre attached storage, it is necessary to issue a LIP (loop initialization primitive) on the fabric:
shell> echo "1" > /sys/class/fc_host/host#/issue_lip

Replace the “#” with the number of the SCSI bus to be rescanned.

Note: Issueing a LIP (above) on Red Hat Enterprise Linux 5 is all that is needed to rescan fibre attached storage. Once the LIP is issued, the bus scan may take a few seconds to complete.

To rescan all other SCSI attached storage, a rescan should be issued:

shell> echo "- - -" > /sys/class/scsi_host/host#/scan

Replace the “#” with the number of the SCSI bus to be rescanned.

In addition to re-scanning the entire bus, a specific device can be added or deleted for some versions or Red Hat Enterprise Linux as specified below.


To remove a single existing device explicitly
shell> echo 1 > /sys/block//device/delete



OR, use the rescan-scsi-bus.sh under sg3-utils.rpm


To see the WWPN:

at BIOS : CTRL-Q Fast Util

at OS : qlogic : /proc/scsi/qlxxxx
emulex : /sys/class/scsi/device/driver/...../portid

Tuesday, 18 January 2011

RHEL6 - Instalation, rpm, repo

After install by default you dont have x windows:
- install xorg-x11-......
- install gnome-.........

The problem is too many packages, you must use:
yum groupinstall "X window system"
yum groupinstall "Desktop"

It used to be "GNOME Desktop Environment", but now the Desktop is refered to GNOME.

If you dont know the file related to which group, just open the comps.xml or repomd.xml file as explain further below.

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

if you find problem group not available, check by :
yum grouplist ==> to see all available group pacakes

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

if that command shows data group not available, so you must:
cp xxxxxxcompsxxxxx.xml to local repo directory.
cd to repo directory
createrepo -g xxxxxxxxcompsxxxx.xml .
yum clean all

this will build repodata folder in your local repo folder.

You copy xxxxxxcompsxxxxx.xml from the same DVD in where you copy all the rpms to your local repo folder. Or you can use the DVD of rhel5 or other version, but maybe there are discrepancies of the packages in the group install, it works though.

If the repomd is overlapped with anotehr comps.xml files, just delete the repodata folder and run the createrepo -g again.

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


createrepo you must install using rpm (or yum) but since this means you have no repo yet, so either way you must install the 2 deps packages manually.

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

rpm --nogpgcheck

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

how to create local repo:
1. copy all the rpms from DVD to a local folder
2. in that local folder type : createrepo .
3. edit the yum.conf in /etc/yum
put the name of your repo (whatever)
baseurl=file:///folder
enabled=1
gpgcheck=0

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

rpm -qa (checking what packages installed in your PC)
rpm -q (chcking if it is insalled or not) same as above but the output diffrent though same meaning.

rpm -qi (see info of the packages)

REMEMBER : dont use * in the packages name, use : rpm -q | grep XXXX instead.
Note : if your CWD has pacakges files also, it cant be confusing, be careful!!

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

Thursday, 13 January 2011

VMware : ESX vs ESXi vs ESXiEmbedded

ESX has service console, service console is restricted shell of redhat OS

ESXi is not using service console, u have to use RemoteCLI to manage it, but still ESXi needs a Harddisk to store. The donwside is could be hard to troubleshoot for newbie since not using service console.


ESXiEmbedded is ESXi but stored in flashdisk instead, the downside is flash disk has no mirroring function, when it is broken, u need to install new one.

Thursday, 28 October 2010

Kernel code and compiling

LKM (loadable kernel module) -> alter without reboot, load/unload when needed, smaller core kernel. Example : device driver

as opposed to SK (static kernel) -> need reboot when altered


xxx.c --> xxx.ko (ko= kernel object)
.so = shared object

A. /proc/kallsyms contains all function of kernel (ex. printk) and the services using it.
===> printk is print at kernel (seen at dmesg or /var/log/messages)
===> printf is print at user mode

B. /boot/System.map.xxxxx contains all the system calls (which is a "call" to kernel space, from user space)

Symbols that are visible for Load kernel module is in:
C. /lib/modules/'uname -r'/build/Module.symvers


ABC relation:
C containing the symbol (function/call) and the memory address (address important for debugging). B containing all the symbol(along with the ID) with the services use it (ex. service : ip, ipv6,nfs). A containing the symbol/function/call(along with the ID) available, and with subs of that function.





To compile:

Make the xxx.c file (C source code)
Cretae the Makefile (enough this 1 line ==> obj-m := xxx.o )

compile it by:
make -C /usr/src/kernels/2.6.18-92.el5-i686/ modules M=$PWD

Result many files, one of them is xxx.ko

modinfo xxx.ko (To see the information which is written in the xxx.c)

insmod xxx.ko (opposed : rmmod xxx.ko or rmmod xxx)
==> must use the path/file location, and execute/install module dependency beforehand
==> modules and its alias is in /etc/modules.conf (either can be used)
==> dependency is in /lib/modules/version/modules.dep

modprobe xxx (opposed : modprobe -r xxx)
==> modprobe use insmod too, but it is aware the def location of module /lib/modules/version, and it is aware of the dep. So use this better.

lsmod (to see what is installed) ==> /proc/modules

depmod -a (to refresh the module database list) IMPORTANT!!

To make it (copy auto) to /lib/modules/.........
make -C /usr/src/kernels/2.6.18-92.el5-i686/ modules_install M=$PWD

Monday, 25 October 2010

Memory physical types

RAM vs SAM (random addresses vs serial addresses(tape) )

DRAM vs SRAM
*Dynamic(keep refreshed the voltage, up to 1000times/sec)
*Static (need not refreshed, so faster but more expensive)

Note : memory chips containing transistors (each transistor has capacitor for storing electric as represent of bit 1), the transistor function as switch, 0 or 1. Transistor has Base, C and Emitter. These 3 legs make a transistors as electronic switch.

DRAM vs SDRAM

* Synchronous : faster and more expensive (it has feature pipelines, where it can do next task without wait the prev one). The sync is about time clock, so it has cycle to do actions.

== Pipelining means that the chip can accept a new instruction before it has finished processing the previous one. In a pipelined write, the write command can be immediately followed by another instruction without waiting for the data to be written to the memory array. In a pipelined read, the requested data appears after a fixed number of clock pulses after the read instruction, cycles during which additional instructions can be sent. (This delay is called the latency and is an important parameter to consider when purchasing SDRAM for a computer.) ====

Complete on : http://en.wikipedia.org/wiki/Synchronous_dynamic_random_access_memory


DIMM vs SIMM

* dual inline memory module



DDR (dual data rate)vs SDR (single)
*


DDR2 ( is then DDR1)
DDR3 (is faster in transfer than DDR2)



x4 vs x8 (by 4 vs by 8)

Sunday, 24 October 2010

How raid 5 works and the parity calculated

RAID 5, required 3 disks minimum. The total storage afterward is (n-1) disk capacity, and YES all disks must have same size.

How they calculate it the parity is like this:

disk1 disk2 disk3 .... diskLast
0 1 0 parity:disk1 XOR disk2 then the result is XOR to disk3
parity 0 0 1

Above example of disk stripe segment of 1 bit, in real world the normal ones is between 4bits to 256bits.


The magic is when disk1/2/3 failed, it can rebuild from the result, as following:
disk2 XOR disk3 then XOR to parity(above is in diskLast) = disk1

It is not magic though, it is only about:
if bits same then it friend (0 XOR 0 = 0 (friends) 1 XOR 1 = 0 (friends) )
if bits differs then it is enemy.
So from the friend/enemy, you can figure the other bit from the partner bit.

Here is the best explanation:
http://www.scottklarr.com/topic/23/how-raid-5-really-works/

The other thing you must know, when the drive failed, the server will use more IO and CPU, cause when read operation happening it will calculate to result the missing data ( i wanna say that everything is in place as normal, NOT like the idea where if a drive failed then the parities are all calculated and stores the missing bits to the parity bits place as replacing, it is NOT like that)

When a new drive comes, rebuild happens and same exactly as the failed one + the parity from the write operation after failed time.