Saturday, August 9, 2008

AIX has login via the serial console

AIX has login via the serial console disabled as a default. So you need both a suitable serial cable and to change some AIX settings. If you don't have an original IBM serial cable you might use a the standard one. Access the server with a VT100 Term configured at 9600-8-N-1. Start server, choose the right console by pressing the number that is displayed on your screen and then get into maintenance mode by pressing "5" after the word "keyboard" appears on the screen (if you don't see anything you got the wrong cable or chose the wrong console before). Then access a rootvg, start a shell and mount rootvg (writing from memory but these steps are being offerd by menu). When you got the root shell export TERM=vt100. Open SMIT, choose devices and then the TTY in question. Change the following parameters:
* enable LOGIN - enable (switch)
* STTY attributes for RUN time - clocal (add)
* STTY attributes for LOGIN - clocal (add)
* Apply changes to Database only - yes (set)


Exit smit and reboot. The server should come up and let you log in via the console.

CHANGING HOST NAME - Linux

/etc/hosts

/etc/sysconfig/network

/etc/sysconfig/network-scripts/ifcfg-eth0 (depends on NIC name)

Then reboot.

or-

Use sysctl to change the hostname

Use:

sysctl kernel.hostname

to read the current hostname, and

sysctl kernel.hostname=NEW_HOSTNAME

to change it.

CHAGING IP ADDRESS IN LINUX.

vi /etc/sysconfig/network-scripts/ifcfg-eth0

vi /etc/sysconfig/network

And restart the interfaces...

/etc/init.d/network restart


Try /sbin/setup or /usr/sbin/setup

or edit /etc/network/interfaces

vi editor Quick Reference

vi editor Quick Reference

Create new file or  Open existing file in vi
vi without any file name will open a   new file where you can enter the text and edit but while coming out you will  be asked to enter a valid file name to save the text.  vi with a  file name as argument will  open that file for editing  if the file already exists it opens it  otherwise it creates a new file by the argument.
Example :  $vi  testfile
Creates or opens the existing file called testfile
Modes in vi
vi operates in following  two modes :
i. ) Command Mode : After a file is opened it is opened  in command
mode ,that is , input from the keyboard will be treated as vi commands
and you will not see the words you are typing on the screen .
ii.) Insert Mode: To enter the text you have to put vi in insert  by pressing ‘i’ or ‘a’  after  which you can add the text and whatever is being type will be seen on the  screen. . To switch between these mode Esc key is used .   Esc i
(text mode)  Esc (command mode)
Saving  & Exiting  vi editor
You can exit vi in different ways :
1.) Quit without saving : If you don’t  want to save the work :q  will take you out without saving  your editing in vi.
2.) Write & quit : . Simple :w saves the current file but don’t exit. For save and quit  :wq is  used in vi.
3.) Forced Quite : An ! (Exclamation  sign at the end of  exit commands ( :q! , :wq! )  causes a forced  quit from vi  after ignoring editing (for :q!)  or writing (for :wq!)  all the change

Vi Commands – Reference
Moving Cursor in File
Left h
Right l
Up k
Down j
Line
Beginning ^ or B
end $
Sentence
Next sentance )
Previous sentance (
Paragraph
Next }
Previous {
file
Go to end of file :$
on chacter forword :w
One word forword :W
go to a line number :line_number
display file info . ^g
Inserting and appending text
inserts text to the left of cursor i
nserts in the beginning of line I
appends text to right of cursor a
appends to the end of line A
Adding new line
add a new line below the current line o
adds a new line above the current line. O
Deleting the text :
deletes text above the text x
deletes text character on right of cursor X
deletes line 20 20d
deletes current line dd
delete till end of current line. D
Replacing a character & word
replace the character above the cursor. r
replces characters until Esc is pressed. R
replaces the word from cursor to the end indicated by $ sign . cw
replaces till end of line. C
Substitute
subistutes current charcater. s
substitutes entire line. S
Undo last changes
undo last change. u
undo changes to the current line. U
Copy and pasting lines
copys the current line into buffer. yy
copies 5 lines from the current line. 5yy
pastes the current buffer. p
Searching
Searches for the word name in the file :/name
n continues search forward. n
N searches backwards N
Saving
saves the text does not quit. :w
saves & quit the editor . :wq!
save ZZ
Quit without saving q!


Search & Replace s///g .
Repeating last command .
Recovering a unsaved vi file.
vi -r filename