Wednesday, December 27, 2006

ASCII Table (7-bit)

(ASCII = American Standard Code for Information Interchange)
(also see Related Links below)
       Decimal   Octal   Hex    Binary     Value
------- ----- --- ------ -----
000 000 000 00000000 NUL (Null char.)
001 001 001 00000001 SOH (Start of Header)
002 002 002 00000010 STX (Start of Text)
003 003 003 00000011 ETX (End of Text)
004 004 004 00000100 EOT (End of Transmission)
005 005 005 00000101 ENQ (Enquiry)
006 006 006 00000110 ACK (Acknowledgment)
007 007 007 00000111 BEL (Bell)
008 010 008 00001000 BS (Backspace)
009 011 009 00001001 HT (Horizontal Tab)
010 012 00A 00001010 LF (Line Feed)
011 013 00B 00001011 VT (Vertical Tab)
012 014 00C 00001100 FF (Form Feed)
013 015 00D 00001101 CR (Carriage Return)
014 016 00E 00001110 SO (Shift Out)
015 017 00F 00001111 SI (Shift In)
016 020 010 00010000 DLE (Data Link Escape)
017 021 011 00010001 DC1 (XON) (Device Control 1)
018 022 012 00010010 DC2 (Device Control 2)
019 023 013 00010011 DC3 (XOFF)(Device Control 3)
020 024 014 00010100 DC4 (Device Control 4)
021 025 015 00010101 NAK (Negative Acknowledgement)
022 026 016 00010110 SYN (Synchronous Idle)
023 027 017 00010111 ETB (End of Trans. Block)
024 030 018 00011000 CAN (Cancel)
025 031 019 00011001 EM (End of Medium)
026 032 01A 00011010 SUB (Substitute)
027 033 01B 00011011 ESC (Escape)
028 034 01C 00011100 FS (File Separator)
029 035 01D 00011101 GS (Group Separator)
030 036 01E 00011110 RS (Request to Send)(Record Separator)
031 037 01F 00011111 US (Unit Separator)
032 040 020 00100000 SP (Space)
033 041 021 00100001 ! (exclamation mark)
034 042 022 00100010 " (double quote)
035 043 023 00100011 # (number sign)
036 044 024 00100100 $ (dollar sign)
037 045 025 00100101 % (percent)
038 046 026 00100110 & (ampersand)
039 047 027 00100111 ' (single quote)
040 050 028 00101000 ( (left/opening parenthesis)
041 051 029 00101001 ) (right/closing parenthesis)
042 052 02A 00101010 * (asterisk)
043 053 02B 00101011 + (plus)
044 054 02C 00101100 , (comma)
045 055 02D 00101101 - (minus or dash)
046 056 02E 00101110 . (dot)
047 057 02F 00101111 / (forward slash)
048 060 030 00110000 0
049 061 031 00110001 1
050 062 032 00110010 2
051 063 033 00110011 3
052 064 034 00110100 4
053 065 035 00110101 5
054 066 036 00110110 6
055 067 037 00110111 7
056 070 038 00111000 8
057 071 039 00111001 9
058 072 03A 00111010 : (colon)
059 073 03B 00111011 ; (semi-colon)
060 074 03C 00111100 < (less than) 061 075 03D 00111101 = (equal sign) 062 076 03E 00111110 > (greater than)
063 077 03F 00111111 ? (question mark)
064 100 040 01000000 @ (AT symbol)
065 101 041 01000001 A
066 102 042 01000010 B
067 103 043 01000011 C
068 104 044 01000100 D
069 105 045 01000101 E
070 106 046 01000110 F
071 107 047 01000111 G
072 110 048 01001000 H
073 111 049 01001001 I
074 112 04A 01001010 J
075 113 04B 01001011 K
076 114 04C 01001100 L
077 115 04D 01001101 M
078 116 04E 01001110 N
079 117 04F 01001111 O
080 120 050 01010000 P
081 121 051 01010001 Q
082 122 052 01010010 R
083 123 053 01010011 S
084 124 054 01010100 T
085 125 055 01010101 U
086 126 056 01010110 V
087 127 057 01010111 W
088 130 058 01011000 X
089 131 059 01011001 Y
090 132 05A 01011010 Z
091 133 05B 01011011 [ (left/opening bracket)
092 134 05C 01011100 \ (back slash)
093 135 05D 01011101 ] (right/closing bracket)
094 136 05E 01011110 ^ (caret/circumflex)
095 137 05F 01011111 _ (underscore)
096 140 060 01100000 `
097 141 061 01100001 a
098 142 062 01100010 b
099 143 063 01100011 c
100 144 064 01100100 d
101 145 065 01100101 e
102 146 066 01100110 f
103 147 067 01100111 g
104 150 068 01101000 h
105 151 069 01101001 i
106 152 06A 01101010 j
107 153 06B 01101011 k
108 154 06C 01101100 l
109 155 06D 01101101 m
110 156 06E 01101110 n
111 157 06F 01101111 o
112 160 070 01110000 p
113 161 071 01110001 q
114 162 072 01110010 r
115 163 073 01110011 s
116 164 074 01110100 t
117 165 075 01110101 u
118 166 076 01110110 v
119 167 077 01110111 w
120 170 078 01111000 x
121 171 079 01111001 y
122 172 07A 01111010 z
123 173 07B 01111011 { (left/opening brace)
124 174 07C 01111100 | (vertical bar)
125 175 07D 01111101 } (right/closing brace)
126 176 07E 01111110 ~ (tilde)
127 177 07F 01111111 DEL (delete)
(Link to original page)

Back to Top

Related Links

If you have questions or suggestions about this document, please send them by e-mail to kochhar@physiology.wisc.edu

Return to Computing Page
Back to The Basement
This page last modified on : Nov. 21, 2006

ASCII Table (7-bit)

(ASCII = American Standard Code for Information Interchange)
(also see Related Links below)
       Decimal   Octal   Hex    Binary     Value
------- ----- --- ------ -----
000 000 000 00000000 NUL (Null char.)
001 001 001 00000001 SOH (Start of Header)
002 002 002 00000010 STX (Start of Text)
003 003 003 00000011 ETX (End of Text)
004 004 004 00000100 EOT (End of Transmission)
005 005 005 00000101 ENQ (Enquiry)
006 006 006 00000110 ACK (Acknowledgment)
007 007 007 00000111 BEL (Bell)
008 010 008 00001000 BS (Backspace)
009 011 009 00001001 HT (Horizontal Tab)
010 012 00A 00001010 LF (Line Feed)
011 013 00B 00001011 VT (Vertical Tab)
012 014 00C 00001100 FF (Form Feed)
013 015 00D 00001101 CR (Carriage Return)
014 016 00E 00001110 SO (Shift Out)
015 017 00F 00001111 SI (Shift In)
016 020 010 00010000 DLE (Data Link Escape)
017 021 011 00010001 DC1 (XON) (Device Control 1)
018 022 012 00010010 DC2 (Device Control 2)
019 023 013 00010011 DC3 (XOFF)(Device Control 3)
020 024 014 00010100 DC4 (Device Control 4)
021 025 015 00010101 NAK (Negative Acknowledgement)
022 026 016 00010110 SYN (Synchronous Idle)
023 027 017 00010111 ETB (End of Trans. Block)
024 030 018 00011000 CAN (Cancel)
025 031 019 00011001 EM (End of Medium)
026 032 01A 00011010 SUB (Substitute)
027 033 01B 00011011 ESC (Escape)
028 034 01C 00011100 FS (File Separator)
029 035 01D 00011101 GS (Group Separator)
030 036 01E 00011110 RS (Request to Send)(Record Separator)
031 037 01F 00011111 US (Unit Separator)
032 040 020 00100000 SP (Space)
033 041 021 00100001 ! (exclamation mark)
034 042 022 00100010 " (double quote)
035 043 023 00100011 # (number sign)
036 044 024 00100100 $ (dollar sign)
037 045 025 00100101 % (percent)
038 046 026 00100110 & (ampersand)
039 047 027 00100111 ' (single quote)
040 050 028 00101000 ( (left/opening parenthesis)
041 051 029 00101001 ) (right/closing parenthesis)
042 052 02A 00101010 * (asterisk)
043 053 02B 00101011 + (plus)
044 054 02C 00101100 , (comma)
045 055 02D 00101101 - (minus or dash)
046 056 02E 00101110 . (dot)
047 057 02F 00101111 / (forward slash)
048 060 030 00110000 0
049 061 031 00110001 1
050 062 032 00110010 2
051 063 033 00110011 3
052 064 034 00110100 4
053 065 035 00110101 5
054 066 036 00110110 6
055 067 037 00110111 7
056 070 038 00111000 8
057 071 039 00111001 9
058 072 03A 00111010 : (colon)
059 073 03B 00111011 ; (semi-colon)
060 074 03C 00111100 < (less than) 061 075 03D 00111101 = (equal sign) 062 076 03E 00111110 > (greater than)
063 077 03F 00111111 ? (question mark)
064 100 040 01000000 @ (AT symbol)
065 101 041 01000001 A
066 102 042 01000010 B
067 103 043 01000011 C
068 104 044 01000100 D
069 105 045 01000101 E
070 106 046 01000110 F
071 107 047 01000111 G
072 110 048 01001000 H
073 111 049 01001001 I
074 112 04A 01001010 J
075 113 04B 01001011 K
076 114 04C 01001100 L
077 115 04D 01001101 M
078 116 04E 01001110 N
079 117 04F 01001111 O
080 120 050 01010000 P
081 121 051 01010001 Q
082 122 052 01010010 R
083 123 053 01010011 S
084 124 054 01010100 T
085 125 055 01010101 U
086 126 056 01010110 V
087 127 057 01010111 W
088 130 058 01011000 X
089 131 059 01011001 Y
090 132 05A 01011010 Z
091 133 05B 01011011 [ (left/opening bracket)
092 134 05C 01011100 \ (back slash)
093 135 05D 01011101 ] (right/closing bracket)
094 136 05E 01011110 ^ (caret/circumflex)
095 137 05F 01011111 _ (underscore)
096 140 060 01100000 `
097 141 061 01100001 a
098 142 062 01100010 b
099 143 063 01100011 c
100 144 064 01100100 d
101 145 065 01100101 e
102 146 066 01100110 f
103 147 067 01100111 g
104 150 068 01101000 h
105 151 069 01101001 i
106 152 06A 01101010 j
107 153 06B 01101011 k
108 154 06C 01101100 l
109 155 06D 01101101 m
110 156 06E 01101110 n
111 157 06F 01101111 o
112 160 070 01110000 p
113 161 071 01110001 q
114 162 072 01110010 r
115 163 073 01110011 s
116 164 074 01110100 t
117 165 075 01110101 u
118 166 076 01110110 v
119 167 077 01110111 w
120 170 078 01111000 x
121 171 079 01111001 y
122 172 07A 01111010 z
123 173 07B 01111011 { (left/opening brace)
124 174 07C 01111100 | (vertical bar)
125 175 07D 01111101 } (right/closing brace)
126 176 07E 01111110 ~ (tilde)
127 177 07F 01111111 DEL (delete)
(Link to original page)

Back to Top

Related Links

If you have questions or suggestions about this document, please send them by e-mail to kochhar@physiology.wisc.edu

Return to Computing Page
Back to The Basement
This page last modified on : Nov. 21, 2006

ASCII Table (7-bit)

(ASCII = American Standard Code for Information Interchange)
(also see Related Links below)
       Decimal   Octal   Hex    Binary     Value
------- ----- --- ------ -----
000 000 000 00000000 NUL (Null char.)
001 001 001 00000001 SOH (Start of Header)
002 002 002 00000010 STX (Start of Text)
003 003 003 00000011 ETX (End of Text)
004 004 004 00000100 EOT (End of Transmission)
005 005 005 00000101 ENQ (Enquiry)
006 006 006 00000110 ACK (Acknowledgment)
007 007 007 00000111 BEL (Bell)
008 010 008 00001000 BS (Backspace)
009 011 009 00001001 HT (Horizontal Tab)
010 012 00A 00001010 LF (Line Feed)
011 013 00B 00001011 VT (Vertical Tab)
012 014 00C 00001100 FF (Form Feed)
013 015 00D 00001101 CR (Carriage Return)
014 016 00E 00001110 SO (Shift Out)
015 017 00F 00001111 SI (Shift In)
016 020 010 00010000 DLE (Data Link Escape)
017 021 011 00010001 DC1 (XON) (Device Control 1)
018 022 012 00010010 DC2 (Device Control 2)
019 023 013 00010011 DC3 (XOFF)(Device Control 3)
020 024 014 00010100 DC4 (Device Control 4)
021 025 015 00010101 NAK (Negative Acknowledgement)
022 026 016 00010110 SYN (Synchronous Idle)
023 027 017 00010111 ETB (End of Trans. Block)
024 030 018 00011000 CAN (Cancel)
025 031 019 00011001 EM (End of Medium)
026 032 01A 00011010 SUB (Substitute)
027 033 01B 00011011 ESC (Escape)
028 034 01C 00011100 FS (File Separator)
029 035 01D 00011101 GS (Group Separator)
030 036 01E 00011110 RS (Request to Send)(Record Separator)
031 037 01F 00011111 US (Unit Separator)
032 040 020 00100000 SP (Space)
033 041 021 00100001 ! (exclamation mark)
034 042 022 00100010 " (double quote)
035 043 023 00100011 # (number sign)
036 044 024 00100100 $ (dollar sign)
037 045 025 00100101 % (percent)
038 046 026 00100110 & (ampersand)
039 047 027 00100111 ' (single quote)
040 050 028 00101000 ( (left/opening parenthesis)
041 051 029 00101001 ) (right/closing parenthesis)
042 052 02A 00101010 * (asterisk)
043 053 02B 00101011 + (plus)
044 054 02C 00101100 , (comma)
045 055 02D 00101101 - (minus or dash)
046 056 02E 00101110 . (dot)
047 057 02F 00101111 / (forward slash)
048 060 030 00110000 0
049 061 031 00110001 1
050 062 032 00110010 2
051 063 033 00110011 3
052 064 034 00110100 4
053 065 035 00110101 5
054 066 036 00110110 6
055 067 037 00110111 7
056 070 038 00111000 8
057 071 039 00111001 9
058 072 03A 00111010 : (colon)
059 073 03B 00111011 ; (semi-colon)
060 074 03C 00111100 < (less than) 061 075 03D 00111101 = (equal sign) 062 076 03E 00111110 > (greater than)
063 077 03F 00111111 ? (question mark)
064 100 040 01000000 @ (AT symbol)
065 101 041 01000001 A
066 102 042 01000010 B
067 103 043 01000011 C
068 104 044 01000100 D
069 105 045 01000101 E
070 106 046 01000110 F
071 107 047 01000111 G
072 110 048 01001000 H
073 111 049 01001001 I
074 112 04A 01001010 J
075 113 04B 01001011 K
076 114 04C 01001100 L
077 115 04D 01001101 M
078 116 04E 01001110 N
079 117 04F 01001111 O
080 120 050 01010000 P
081 121 051 01010001 Q
082 122 052 01010010 R
083 123 053 01010011 S
084 124 054 01010100 T
085 125 055 01010101 U
086 126 056 01010110 V
087 127 057 01010111 W
088 130 058 01011000 X
089 131 059 01011001 Y
090 132 05A 01011010 Z
091 133 05B 01011011 [ (left/opening bracket)
092 134 05C 01011100 \ (back slash)
093 135 05D 01011101 ] (right/closing bracket)
094 136 05E 01011110 ^ (caret/circumflex)
095 137 05F 01011111 _ (underscore)
096 140 060 01100000 `
097 141 061 01100001 a
098 142 062 01100010 b
099 143 063 01100011 c
100 144 064 01100100 d
101 145 065 01100101 e
102 146 066 01100110 f
103 147 067 01100111 g
104 150 068 01101000 h
105 151 069 01101001 i
106 152 06A 01101010 j
107 153 06B 01101011 k
108 154 06C 01101100 l
109 155 06D 01101101 m
110 156 06E 01101110 n
111 157 06F 01101111 o
112 160 070 01110000 p
113 161 071 01110001 q
114 162 072 01110010 r
115 163 073 01110011 s
116 164 074 01110100 t
117 165 075 01110101 u
118 166 076 01110110 v
119 167 077 01110111 w
120 170 078 01111000 x
121 171 079 01111001 y
122 172 07A 01111010 z
123 173 07B 01111011 { (left/opening brace)
124 174 07C 01111100 | (vertical bar)
125 175 07D 01111101 } (right/closing brace)
126 176 07E 01111110 ~ (tilde)
127 177 07F 01111111 DEL (delete)
(Link to original page)

Back to Top

Related Links

If you have questions or suggestions about this document, please send them by e-mail to kochhar@physiology.wisc.edu

Return to Computing Page
Back to The Basement
This page last modified on : Nov. 21, 2006

ASCII Table (7-bit)

(ASCII = American Standard Code for Information Interchange)
(also see Related Links below)
       Decimal   Octal   Hex    Binary     Value
------- ----- --- ------ -----
000 000 000 00000000 NUL (Null char.)
001 001 001 00000001 SOH (Start of Header)
002 002 002 00000010 STX (Start of Text)
003 003 003 00000011 ETX (End of Text)
004 004 004 00000100 EOT (End of Transmission)
005 005 005 00000101 ENQ (Enquiry)
006 006 006 00000110 ACK (Acknowledgment)
007 007 007 00000111 BEL (Bell)
008 010 008 00001000 BS (Backspace)
009 011 009 00001001 HT (Horizontal Tab)
010 012 00A 00001010 LF (Line Feed)
011 013 00B 00001011 VT (Vertical Tab)
012 014 00C 00001100 FF (Form Feed)
013 015 00D 00001101 CR (Carriage Return)
014 016 00E 00001110 SO (Shift Out)
015 017 00F 00001111 SI (Shift In)
016 020 010 00010000 DLE (Data Link Escape)
017 021 011 00010001 DC1 (XON) (Device Control 1)
018 022 012 00010010 DC2 (Device Control 2)
019 023 013 00010011 DC3 (XOFF)(Device Control 3)
020 024 014 00010100 DC4 (Device Control 4)
021 025 015 00010101 NAK (Negative Acknowledgement)
022 026 016 00010110 SYN (Synchronous Idle)
023 027 017 00010111 ETB (End of Trans. Block)
024 030 018 00011000 CAN (Cancel)
025 031 019 00011001 EM (End of Medium)
026 032 01A 00011010 SUB (Substitute)
027 033 01B 00011011 ESC (Escape)
028 034 01C 00011100 FS (File Separator)
029 035 01D 00011101 GS (Group Separator)
030 036 01E 00011110 RS (Request to Send)(Record Separator)
031 037 01F 00011111 US (Unit Separator)
032 040 020 00100000 SP (Space)
033 041 021 00100001 ! (exclamation mark)
034 042 022 00100010 " (double quote)
035 043 023 00100011 # (number sign)
036 044 024 00100100 $ (dollar sign)
037 045 025 00100101 % (percent)
038 046 026 00100110 & (ampersand)
039 047 027 00100111 ' (single quote)
040 050 028 00101000 ( (left/opening parenthesis)
041 051 029 00101001 ) (right/closing parenthesis)
042 052 02A 00101010 * (asterisk)
043 053 02B 00101011 + (plus)
044 054 02C 00101100 , (comma)
045 055 02D 00101101 - (minus or dash)
046 056 02E 00101110 . (dot)
047 057 02F 00101111 / (forward slash)
048 060 030 00110000 0
049 061 031 00110001 1
050 062 032 00110010 2
051 063 033 00110011 3
052 064 034 00110100 4
053 065 035 00110101 5
054 066 036 00110110 6
055 067 037 00110111 7
056 070 038 00111000 8
057 071 039 00111001 9
058 072 03A 00111010 : (colon)
059 073 03B 00111011 ; (semi-colon)
060 074 03C 00111100 < (less than) 061 075 03D 00111101 = (equal sign) 062 076 03E 00111110 > (greater than)
063 077 03F 00111111 ? (question mark)
064 100 040 01000000 @ (AT symbol)
065 101 041 01000001 A
066 102 042 01000010 B
067 103 043 01000011 C
068 104 044 01000100 D
069 105 045 01000101 E
070 106 046 01000110 F
071 107 047 01000111 G
072 110 048 01001000 H
073 111 049 01001001 I
074 112 04A 01001010 J
075 113 04B 01001011 K
076 114 04C 01001100 L
077 115 04D 01001101 M
078 116 04E 01001110 N
079 117 04F 01001111 O
080 120 050 01010000 P
081 121 051 01010001 Q
082 122 052 01010010 R
083 123 053 01010011 S
084 124 054 01010100 T
085 125 055 01010101 U
086 126 056 01010110 V
087 127 057 01010111 W
088 130 058 01011000 X
089 131 059 01011001 Y
090 132 05A 01011010 Z
091 133 05B 01011011 [ (left/opening bracket)
092 134 05C 01011100 \ (back slash)
093 135 05D 01011101 ] (right/closing bracket)
094 136 05E 01011110 ^ (caret/circumflex)
095 137 05F 01011111 _ (underscore)
096 140 060 01100000 `
097 141 061 01100001 a
098 142 062 01100010 b
099 143 063 01100011 c
100 144 064 01100100 d
101 145 065 01100101 e
102 146 066 01100110 f
103 147 067 01100111 g
104 150 068 01101000 h
105 151 069 01101001 i
106 152 06A 01101010 j
107 153 06B 01101011 k
108 154 06C 01101100 l
109 155 06D 01101101 m
110 156 06E 01101110 n
111 157 06F 01101111 o
112 160 070 01110000 p
113 161 071 01110001 q
114 162 072 01110010 r
115 163 073 01110011 s
116 164 074 01110100 t
117 165 075 01110101 u
118 166 076 01110110 v
119 167 077 01110111 w
120 170 078 01111000 x
121 171 079 01111001 y
122 172 07A 01111010 z
123 173 07B 01111011 { (left/opening brace)
124 174 07C 01111100 | (vertical bar)
125 175 07D 01111101 } (right/closing brace)
126 176 07E 01111110 ~ (tilde)
127 177 07F 01111111 DEL (delete)
(Link to original page)

Back to Top

Related Links

If you have questions or suggestions about this document, please send them by e-mail to kochhar@physiology.wisc.edu

Return to Computing Page
Back to The Basement
This page last modified on : Nov. 21, 2006

Friday, December 15, 2006

Convert Google Video FLV’s into AVI, MPG, etc…in LINUX

So, I found a digg on converting flv (Google Video) files to other formats like AVI today...Alas...it was geared for Windows users :P . So, of course, I figured out how to do it painlessly in linux....actually more painless than in Windows.

First, get the ffmpeg CVS source:

cvs -z9 -d:pserver:anonymous@mplayerhq.hu:/cvsroot/ffmpeg co ffmpeg


Then, compile it:

./configure; make; sudo make install


Then, run it like this:

ffmpeg -i video.flv -ab 56 -ar 22050 -b 500 -s 320x240 test.mpg


Where all that crap is:
-b bitrate: set the video bitrate in kbit/s (default = 200 kb/s)
-ab bitrate: set the audio bitrate in kbit/s (default = 64)
-ar sample rate: set the audio samplerate in Hz (default = 44100 Hz)
-s size: set frame size. The format is WxH (default 160x128)

This will convert your video.flv into a test.mpg!

If you need help, there's a great resource RIGHT ON YOUR COMPUTER!
Type man ffmpeg.

(link to note)

Monday, November 27, 2006

Linux XGL



XGL Gentoo Linux - KDE

Sunday, November 26, 2006

Linux on the Thinkpad T60p

Linux on the Thinkpad T60p

After three years with an IBM Thinkpad T40, I bought this summer a new Lenovo laptop, a T60p, model 2007, 83G. This model presents to the user the same form factor than its predecessor, with its 14 inches LCD screen at resolution of 1400x1050 pixels. Inside the box, the hardware naturally evolved: the CPU is an Intel Duo Core (not core 2 duo), running between 1GHz and 2.16 GHz depending on the power management settings, the graphic card is an ATI FireGL V5200, the network card is an Intel 82573L, the sound chipset is an Intel HDA, the modem is a Conexant winmodem, and the hard drive is a Seagate Momentus 100GB SATA 7200 RPM.

Initial installation and partitionning

The machines comes with a big FAT32 partition containing Windows XP, and a Diagnostics partition visible at the end of the disk. Without user intervention, the OS will convert its underlying partition to NTFS the first time the system is launched. So I suggest to reduce the partition size before starting Windows for the first time, while the filesystem is still in VFAT. I typically use a bootdisk running FIPS. The SATA controller must be configured in "compability mode" for this operation.

The minimum size you can reach for the Windows XP partition will be around 11 GB, which is huge compared to the 5GB of the T40. Adding to this space the Diagnostics and recovery partition size, the maximum remaining free space you can gather from your 100GB disk is only 80GB. If you intend to keep the Windows XP partition solely for BIOS upgrades purpose, you may think twice before doing that, because :

  • Lenovo BIOSes are now also provided as standalone bootable CD-ROM. For example, latest version 1.09 is available as a bootable disk.
  • Upgrading from DOS (using a floppy or a CD-ROM support) is more secure, than from Windows, because there're less risks for the machine to randomly freeze during the flashing procedure...

After grub is installed on the MBR, the Diagnostics partition is no longer accessible with the "Thinkvantage" blue button, but an entry for this partition can be added in the grub.conf menu, see the excerpt below. Currently, I can boot on it, but I cannot start the PC-Doctor program from it.

title Diagnostics
rootnoverify (hd0,1)
chainloader +1
makeactive

Supported and unsupported hardware

I run Fedora Core 5 on this machine, without much trouble in my daily work.

What works out of box:

  • Duo core is handled by the linux smp kernel.
  • HDD monitoring with smartd (use the -d ata flag)
  • LCD brightness, ThinkLight, and sound volume control with the tpb program (same setup than the T40).
  • tp_smapi interface to set the battery start and stop charge thresholds.
  • suspend to ram.

What works with a proprietary driver:

What doesn't work:

  • The internal modem. Lenovo provides an OEM RPM package of the linuxant proprietary driver -- search for "T60p linux capable" in the thinkpad drivers matrix web page on the IBM site-- but this package doesn't detect my modem. Lenovo provide version 7.47.00 of the linuxant driver. The non-OEM driver from linuxant.com is currently at version 7.47.00.03, it recognizes the modem, but it also replaces the snd-hda-intel ALSA module, and this modification causes start_udev to freeze at reboot.
  • Suspend to disk (in kernel infrastructure, not swsuspend2). Systematic reboot after resuming. Patches are expected to show up in kernel-2.6.18 for this issue (AHCI suspend/resume problem ?).
  • SATA HDD Acoustic settings. The right side of the palm rest, just above the disk becomes rather hot, even without significant disk activity.
  • The ATI proprietary driver (version 8.28.8) appears to be very unstable, when running OpenGL games. It crashed several times, with errors about mmap memory locking issues ([fglrx:firegl_rmmap] *ERROR* map 0xf684d3d0 still in use (map_count=1)). I reported this bug to the ATI support site, without much hope to receive an answer anytime soon...

Untested:

Power consumption

Clearly, the T60p consumes MUCH more power than the T40 in the same power saving mode, consisting of:

  • removing USB external peripherals, and rmmod'ing the *-hcd usb modules.
  • shutting down the network card and the wireless card : ifconfig [...] down, and rmmod e1000, rmmod ipwxxxx
  • stopping the IrDA services and rmmod'ing the related kernel modules.
  • ditto for bluetooth
  • dimming the LCD
  • running the graphic chipset in the powersaving mode (DynamicClock enabled for the radeon 9000 of my T40, and aticontrol --set-powerstate=1 for the proprietary ATI driver for the FireGL of my T60p)
  • running the CPU at its lowest speed (600MHz for the T40, 1GHz for the T60p) with the cpuspeed driver.

With this setup, the T60p consumes 18W, while the T40 only comsumes 10W. The batteries capacity didn't evolve much on the other side. A brand new 9 cells battery has a maximum capacity of 80Wh, so your T60p will have an autonomy of 4 hours, when the T40 has an autonomy of 8 hours.

These values must be tampered, if we consider a more expensive power utilization. The T40 consumes around 13W, and the T60p is around 24W, that converts to an autonomy of 3h20 and 5h30. Also keep in mind that the battery capacity will drasticaly erode itself quite rapidly, for example 60% of the factory capacity remaing after one year.

The consequence is that the temperatures inside the box are also much hotter, than with the T40, the typical values collected from the acpi /proc interfaces are :

  • CPU temperature around 55 deg (centigrade) when idle, up to 90 deg when busy (cpuspeed control disabled)
  • GPU around 67 deg if a lower powerstate is activated, 75 deg else. Can reach 95 deg.

On the T40, these temperatures were lower for the CPU (40 deg idle, 75 busy).

Hints and Tips

  • remember to disable the "-s " option in cpuspeed, so this program can handle both CPUs.

Benchmark

This benchmark is not a very scientific one, but it gives a rapid performance comparison. It's a full kernel compilation (make allmodconfig). Note that both machines have a 7200 RPM HDD. The T40 has a PATA one, and the T60p a SATA one.

  • T40 : 56min05
  • T60p : using a single CPU, 34min36
  • T60p : two compilations, in parallel, but in two separate work directories : 46min40 / 46min53
  • T60p : a parallel compilation with make -j2 : 21min20

So yes, there's a big power boost with the T60p compared to the T40, and no, the dual core is not that impressive in my opinion.

3D

I tested few stuff. Flightgear runs fine at a very decent frame rate. GoogleEarth is fluid without flickering. I also tried a game demo (Cold War) that crashed the ATI proprietary driver. nexuiz cannot complete in benchmark mode (nexuiz-sdl -game benchmark -benchmark demos/demo1), because the ATI driver miserably fails. Despite this bug, the beginning of the demo runs at 26 fps avg using the game default config.

Troubles

The machine has already been serviced, after 15 days of utilization. The battery could no longer be charged after it's first full discharge. The problem appeared to be located on the motherboard, that got replaced.

Conclusion

As usual when buying a new laptop, with up-to-date hardware inside the box, for use with linux, there's a period of several months before all the hardware, that can be handled by free drivers, is correctly supported. With some more luck, the 2D and 3D specifications of the high-end ATI cards will be disclosed to the Xorg developpers. A reverse engineered driver for the fingerprint hardware is on the way. The support for the internal winmodem remains uncertain. As an alternate solution, it is still possible a resurrect an old 3Com/Megahertz modem pcmcia card, and to use it when this bug will be resolved.

(link to note)

Wednesday, November 15, 2006

- ASCII CODES (acentos)

Alt + 0193 → Á

Alt + 0201/144 → É

Alt + 0205 → Í

Alt + 0211 → Ó

Alt + 0218 → Ú

Alt + 0220/154 → Ü

Alt + 0209/165 → Ñ

Alt + 0225/ 160 → á

Alt + 0233/130 → é

Alt + 0237/161 → í

Alt + 0243/162 → ó

Alt + 0250/163 → ú

Alt + 0252/129 → ü

Alt + 0241/164 → ñ

Alt + 0191/168 → ¿

Alt + 0161/173 → ¡


Alt + 0128 →

Alt + 126 → ~

Monday, November 06, 2006

Commands and Shortcuts

Nice: runs programs/commands at a lower system priority
Nohup: runs nice programs even when you’re logged off the system
By using the two commands simultaneously, your large processes can continue to run, even when you have logged off the system and are relaxing.
Ex: nice nohup c program.c .
This command will allow the c compiler to compile program.c even when you have logged off the system


q
Resume the transfer to the terminal. Try if your terminal mysteriously stops responding.

z
Send the current process to the background.

cat /proc/cpuinfo
Cpu info--it show the content of the file cpuinfo. Note that the files in the /proc directory are not real files--they are hooks to look at information available to the kernel.

cat /proc/interrupts
List the interrupts in use.

cat /proc/version
Linux version and other info

cat /proc/filesystems
Show the types of filesystems currently in use.

cat /etc/printcap
Show the setup of printers.

apropos topic
Give me the list of the commands that have something to to do with my topic.

mcopy source destination

Copy a file from/to a DOS filesystem (no mounting necessary). E.g., mcopy a:\autoexec.bat ~/junk . See man mtools for related commands: mdir, mcd, mren, mmove, mdel, mmd, mrd, mformat ....

cat filename | more
View the content of a text file called "filename", one page a time. The "|" is the "pipe" symbol (on many American keyboards it shares the key with "\") The pipe makes the output stop after each screenful. For long files, it is sometimes convenient to use the commands head and tail that display just the beginning and the end of the file. If you happened to use "cat" a binary file and your terminal displays funny characters afterwards, you can restore it with the command "reset".

less filename
Scroll through a content of a text file. Press q when done. "Less" is roughly equivalent to "more" , the command you know from DOS, although very often "less" is more convenient than "more".

touch filename
Change the date/time stamp of the file filename to the current time. Create an empty file if the file does not exist.

xinit
Start a barebone X-windows server (without a windows manager).

startx
Start an X-windows server and the default windows manager. Works like typing "win" under DOS with Win3.1

startx -- :1
Start another X-windows session on the display 1 (the default is opened on display 0). You can have several GUI terminals running concurrently. Switch between them using , , etc.

xterm
(in X terminal) Run a simple X-windows terminal. Typing exit will close it. There are other, more advanced "virtual" terminals for X-windows. I like the popular ones: konsole and kvt (both come with kde) and gnome-terminal (comes with gnome). If you need something really fancy-looking, try Eterm.

xboing
(in X terminal). Very nice, old-fashioned game. Many small games/programs are probably installed on your system. I also like xboard (chess).

pine
A good text-mode mail reader. Another good and standard one is elm. Your Netscape mail will read the mail from your Internet account. pine will let you read the "local" mail, e.g. the mail your son or a cron process sends to you from a computer on your home network. The command mail could also be used for reading/composing mail, but it would be inconvenient--it is meant to be used in scripts for automation.

elm
A good tex-mode mail reader. See the previous command.

mutt
A really basic but extremally useful and fast mail reader.

mail
A basic operating system tool for e-mail. Look at the previous commands for a better e-mail reader. mail is good if you wanted to send an e-mail from a shell script.

licq
(in X term) An icq "instant messaging" client. Another good one is kxicq. Older distributions don't have an icq client installed, you have to do download one and install it.

talk username1
Talk to another user currently logged on your machine (or use "talk username1@machinename" to talk to a user on a different computer) . To accept the invitation to the conversation, type the command "talk username2". If somebody is trying to talk to you and it disrupts your work, your may use the command "mesg n" to refuse accepting messages. You may want to use "who" or "rwho" to determine the users who are currently logged-in.

mc
Launch the "Midnight Commander" file manager (looks like "Norton Commander" for Linux).

unarj e filename.arj
Extract the content of an *.arj archive.

uudecode -o outputfile filename
Decode a file encoded with uuencode. uu-encoded files are typically used for transfer of non-text files in e-mail (uuencode transforms any file into an ASCII file).

Process control

ps
(=print status) Display the list of currently running processes with their process IDs (PID) numbers. Use ps axu to see all processes currently running on your system (also those of other users or without a controlling terminal), each with the name of the owner. Use "top" to keep listing the processes currently running.

fg PID
Bring a background or stopped process to the foreground.

bg PID
Send the process to the background. Opposite to fg. The same can be accomplished with z. If you have stopped jobs, you have to type exit twice in row to log out.

any_command&
Run any command in the background (the symbol "&" means "run the proceeding command in the background").

batch any_command
Run any command (usually one that is going to take more time) when the system load is low. I can logout, and the process will keep running.

at 17:00
Execute a command at a specified time. You will be prompted for the command(s) to run, until you press d.

kill PID
Force a process shutdown. First determine the PID of the process to kill using ps.

killall program_name
Kill program(s) by name.

xkill
(in an xwindow terminal) Kill a GUI-based program with mouse. (Point with your mouse cursor at the window of the process you want to kill and click.)

lpc
(as root) Check and control the printer(s). Type "?" to see the list of available commands.

lpq
Show the content of the printer queue. Under KDE (X-Windows), you may use GUI-based "Printer Queue" available from "K"menu-Utilities.

lprm job_number
Remove a printing job "job_number" from the queue.

nice program_name
Run program_name adjusting its priority. Since the priority is not specified in this example, it will be adjusted by 10 (the process will run slower), from the default value (usually 0). The lower the number (of "niceness" to other users on the system), the higher the priority. The priority value may be in the range -20 to 19. Only root may specify negative values. Use "top" to display the priorities of the running processes.

renice -1 PID
(as root) Change the priority of a running process to -1. Normal users can only adjust processes they own, and only up from the current value (make them run slower).

c, z, s, and q also belong to this chapter but they were described previously. In short they mean: stop the current command, send the current command to the background, stop the data transfer, resume the data transfer.


Friday, October 27, 2006

How to send a remote xmessage to a desktop GUI

export DISPLAY=:0.0

xmessage -center "Revisa tu Gmail.. " -buttons ok
or
zenity --title "Atencion" --warning --text "Checa tu gmail... \n\n\nJACH"
or (with sound)
kdialog --warningyesno "Revisa tu Gmail.. \n\n\nJACH "
####################

using GUI dialog box

Every GUI program has its command line, even dialog boxes too. zenity for gnome, kdialog for KDE, xmessage for other windows managers, etc.

In this example I am going to show you examples of xmessage and zenity.

xmessage is a very simple dialog box which uses by fluxbox, it allows you to define your text and buttons. Let say I want to create a shutdown script, before execute the shutdown, I would like to ask for comfirmation.

xmessage  "Are you sure you want to shutdown? " -buttons yes,no

This will shows a simple dialog with 2 buttons, if user click yes, it returns 101, if no returns 102. To check the return value, do this

echo $?

You can ask xmessage to return the button label string, so you can store the label and manipulate the function.

answer=$(xmessage "Are you sure you want to shutdown? " -buttons yes,no -print)

User click yes, answer will store “yes”. Checks the value with echo

echo $answer

zenity is more complete, it support various dialogs, question, notification, calendar, error etc. My example make use of question.

To load various types of dialog, just specified the types. Check the types by –help or simple man zenity. For this case, I want to use –question.

zenity --question --text "Are you sure you want to shutdown?"

The question dialog for zenity consist of “ok” and “cancel” buttons. Its button and return value are fixed. When user click “ok” it returns 0, “cancel” returns 1.

zenity allows you to specified you title.

zenity --title "Shutdown Comfirmation"
--question --text "Are you sure you want to shutdown?"


#############################################

shutdown script using xmessage or zenity

,

Uses xmessage
#!/bin/sh
# Say bye to shutdown your pc

#uses xmessage to ask first.
answer=$(xmessage "Are you sure you want to shutdown? " -buttons yes,no -print)
if [ $answer = "yes" ]
then
# Do shutdown at here.
#Ubuntu probably needs gksudo instead of sudo
sudo init 0;
fi

Uses zenity
#!/bin/sh
# Say bye to shutdown your pc

#uses zenity to ask first.
zenity --question --title "Shutdown Confirmation" \
--text "Are you sure you want to shutdown?"

if [ "$?" -eq "0" ]
then
# Do shutdown at here.
#Ubuntu probably needs gksudo instead of sudo
sudo init 0;
fi
#########################################

Tuesday, October 03, 2006

HOWTO Replace RedHat with Gentoo, Remotely over SSH

Author: Jordan Ritter (jpr5 at darkridge dot com) (Link)

Introduction

What is this?

This is a HOWTO that describes how to take a stock RedHat9 system and convert it to Gentoo, remotely over ssh and while it is running. These instructions have been tested with RedHat9, but very likely apply to everything from RedHat9 down to RedHat 7.2, and include everything from advice and gotchas around how to get another distribution installed over RedHat while it is running, to strategies for cleaning up the system of unused files once the transformation is complete.

Why do that?

While everyone has their own tastes in Linux distributions and installed software, there are frequently times when one doesn't have a real choice, and only the most popular distributions prevail. For example, remote ISPs that offer leasable colocated systems will provide only a short list of the most common Linux distros for pre-installation, and while it's almost a sure thing that RedHat is on that list, there is no guarantee that your favorite one is.

I had a remotely colocated server installed with RedHat9 that I had no physical access to. I love Gentoo, though, and so through much trial and tribulation (and about 80 vmware checkpoints) I figured out how to fulfull the Gentoo dream without needing to access the physical console.

Does it really work?

Yes, it really works! It probably seems a bit scary, but I have tried this process now a dozen times and the only problems I've ever had were the result of typo mistakes that can easily be avoided with more careful attention. No more RedHat9 on my systems -- all are 100% pure Gentoo now, baby!

Wait... I have questions about Gentoo..

This HOWTO assumes a basic knowledge of Gentoo. Some time is taken to explain the finer points and possible pitfalls and gotchas, but to successfully install Gentoo Linux really requires ready access to the Gentoo Installation Documentation, in addition to this document. Print it out in advance or have it handy before doing this.

OK, I'm ready. I can sue if this doesn't work, right?

Nope.

THESE INSTRUCTIONS ARE PROVIDED AS-IS AND WITHOUT WARRANTY. ALL USERS ACCEPT FULL RESPONSIBILITY AND LIABILITY IN THE EVENT OF SYSTEM FAILURE, DATA LOSS, OR ANY OTHER FAILURE OR LOSS RESULTING FROM THESE INSTRUCTIONS.

Phew, ok! Here we go!

The General Strategy

In summary, the transformation process is actually fairly simple. Since Gentoo, once unpacked, will run its own binaries from its own libraries, all we're really doing is unpacking Gentoo on top of RedHat without wiping out our remote access mechanism (sshd), then removing the old RedHat files.

The entire process can be distilled down into the following simple steps:

  1. Preparation -- Make copies of important files and configuration items, Download Gentoo tarballs, Get sshd running without PAM, and Tag old files for later removal;
  2. Installation -- Unpack Gentoo tarballs, Re-add important files and configuration items, Remove the old RedHat libc and related files, Synchronize Portage, and proceed with a normal Gentoo install;
  3. Clean-up -- Remove old RedHat files, and Secure the system.
See? Easy!

Step 1: Preparation

There are several things that need to be prepared before actually starting the transformation process. Create a directory on a partition you have plenty of space on and don't intend to touch (like ``/tmp/gentoo''), and use that to store temporary files and such, as explained below.

Again, please have handy in some form the Gentoo Installation Documentation, as this HOWTO won't take the time to explain the various Gentoo-specific concepts in detail.

All instructions assume the user is logged in as ``root''.

  1. Compile a kernel with relevant driver support compiled-in.

    Just to be on the safe side, you should compile a fully-static kernel. In other words, we want a kernel that will run the system that has no externel module dependencies. When we start removing libraries and old files and such, it is quite possible we might accidentially rm something that those exceedingly tedious RedHat kernels rely on. Just compile your own and make sure your system boots and runs from it before you even start this process. I suggest sticking with 2.4.x for now so as not to complicate things.

    NOTE: I suggest not enabling devfs support just yet. Gentoo can still boot without it, and it's better to have a kernel that can boot both systems RedHat + Gentoo than one that may only be able to boot under Gentoo (dunno how well RedHat supports devfs out-of-the-box).

    Also, just to be safe, copy the kernel (again, after you've tested it) to the safe directory where you're keeping copies of things.

  2. Turn off PAM in OpenSSH's sshd_config file.

    Just like with the kernel, we have to be careful about the differences between the PAM setup in RedHat and the PAM setup in Gentoo. You don't need PAM in order for the thing to function, so regardless of whether you like it or not just disable it so as to ensure you'll be able to login again.

    Best way to do this is:

    1. Modify ``/etc/ssh/sshd_config'', set ``UsePAM'' to ``no'', save the file.
    2. Run ``netstat -tanp | grep LISTEN | grep sshd'', and note the sshd PID.
    3. Kill sshd with ``kill PID'', where you got the PID from the previous step. This will only kill the listening sshd, and will not affect any already-connected sessions.
    4. Without logging out, run ``/usr/sbin/sshd''.
    5. Separate from your current logged-in session, try to re-ssh back into the box.

    If you get back in, you're fine on this step.

    Most folks will have no problem with this. If you do experience problems, consult ``/var/log/messages'', and in the worst-case scenario run sshd in the foreground with debugging turned on. That should give you enough detail about what's going on to figure out how to get things running fine.

  3. Download the latest snapshots/stage3 tarball.

    The only thing you need is the latest stage3 tarball. Make sure to decide ahead of time what platform architecture you are using (x86, pentium3, pentium4, etc), as that's an obvious benefit of Gentoo that you'll want to take advantage of. For the purposes of this HOWTO, we assume the safe ``x86'' architecture.

    You can find a full list of Gentoo mirrors at http://www.gentoo.org/main/en/mirrors.xml. As of this writing, the most recent stage3 tarball is:

       ftp://distro.ibiblio.org/pub/linux/distributions/gentoo/releases/x86/2004.2/stages/x86/stage3-x86-2004.2.tar.bz2

  4. Make copies of important files and information.

    Copy the following files to your safe location:

    • /etc/resolv.conf
    • /etc/fstab,mtab
    • /etc/passwd,shadow,group
    • /etc/grub.conf,lilo.conf
    • /etc/sysconfig/network
    • /etc/sysconfig/network-scripts/ifcfg-eth*

    Additionally, take a quick snapshot of what modules are loaded, for later inspection, with ``/sbin/lsmod > /tmp/gentoo/modules.txt''.

  5. Mark all current files with a special date.

    Assuming the author isn't on crack, how would one know what files to delete after the Gentoo installation overlays the RedHat one? Easy! Set the timestamp on all files to a special date before proceeding. I used my birthday!

    First of all, we need to be careful about touching all files, because the kernel will detect accesses to ``/dev'' and try to autoload modules for things that you may not have present or installed, which will make things take a lot longer. So first we temporarily disable modprobe by moving it out of the way, and then move it back when we're done. Also, some filenames and directories have spaces in them, so we need to be careful of that also.

            mv /sbin/modprobe /sbin/.modprobe
    find / | perl -wpe 's/ /\\ /g' | xargs touch -d "Feb 1 1978" -m -a
    mv /sbin/.modprobe /sbin/modprobe

Step 2: Installation

OK! So now it's time to take the dive. Yes, it's a little scary, but follow these instructions and you should be fine.

First, the most effective way to conduct this installation is with two (2) shells, both at or su'd to the root user. We'll call the first shell the "setup" shell and the second shell the "repair" shell. Let's assume that you used "/tmp/gentoo" as the safe directory to store copies of downloaded files and important files and configuration items.

  1. From the "setup" shell: Unpack the stage3 tarball onto the root partition.

    cd / && tar jxvf /tmp/gentoo/stage3-*.tar.bz2

  2. Synchronize Portage.
    emerge sync

  3. While the portage synchronization is happening, continue on by completing the following operations from the "repair" shell:

    • Re-set the root password. This is because the stage3 tarball replaced your password and shadow file.

    • Re-add your own username/account.

      /usr/sbin/useradd $myuser

    • Re-chown your home directory. Your account's UID has changed between RedHat's and Gentoo's numbering schemes.

      chown -R $myuser:users /home/$myuser

    • Add your user account to the wheel group in ``/etc/group'', so you can ``su''.

    IMPORTANT: At this point, test that you can ssh back into the box. You may have to restart the listening sshd server, but that's unlikely.

    • Re-add any other necessary account info, referencing ``/tmp/gentoo/passwd,shadow,group'' files. If any UIDs or GIDs change between the old files vs. the new, make sure to run chown across the filesystem to adjust them.

      find / -uid $olduid |  perl -wpe 's/ /\\ /g'  | xargs chown $newusername

    • Copy back ``/etc/fstab''. Also suggest removing the "LABEL=" stuff, which I believe is a concept introduced by RedHat.
    • Fix ``/etc/grub.conf'' or ``/etc/lilo.conf'' depending on which you use.
    • Optional: Remove RedHat's bash aliases from ``/root/.bashrc''.
    • Edit ``/etc/make.conf''.
      • Add ``MAKEOPTS="-j2"''
      • Define your favorite settings. Please see the Gentoo Installation Guide for details.
    • Fix Network Configuration.
      • Edit ``/etc/conf.d/net''.
        • Set ``iface_eth0'', ``gateway''.
      • Run: ``rc-update add net.eth0 default''.
    • Edit ``/etc/rc.conf''.
      • Optional: Set KEYMAP (suggest ``emacs'' to turn capslock into control key).
      • Set ``CLOCK'' to "local".
      • Set ``EDITOR'' to "/usr/bin/vi" or "/usr/bin/emacs", depending on preference.
    • Set the system locale. For instance, if you live on the West Coast: ``ln -sf /usr/share/zoneinfo/US/Pacific /etc/localtime''.
    • (Temporarily) add ``/usr/bin/sshd'' to ``/etc/conf.d/local.start''.
    • Set the hostname: ``echo some_hostname > /etc/hostname''.
    • Switch from RedHat's system libraries to Gentoo's. Run: ``cd /lib &&amp;amp;amp; rm -rf i686 && /sbin/ldconfig''.

    By this point, you will be completely off of RedHat's system binaries and libraries and on Gentoo's. Now we must install some basic system components before we reboot and clean up.

  4. (Re-)Add basic system components:
    • System Logger: ``emerge sysklogd''
    • Cron Daemon: ``emerge dcron''
    • Fix termcap, otherwise backspace in vi and emacs will be screwed up: ``emerge libtermcap-compat''

    Install any other utilities you would like to have before rebooting. At the very least, you should (re-)install the minimum of things you don't want deleted:

    • grub or lilo (to overwrite RedHat's so that it doesn't get deleted later)
    • openssh (remember to ``rc-update add sshd default'' and remove the ``/etc/conf.d/local.start'' entry afterwards)
    • emacs and/or vi (for a usable editor, I personally don't like nano)
And that's it! Now you're ready to reboot and come back up on Gentoo. At this point the best thing to do is go over your configuration and make sure you have the important things covered before you reboot:
  1. That the bootloader is properly configured to point to your preferred, working kernel.
  2. That your kernel supports the necessary drivers to properly boot the network interface.
  3. That the Gentoo network configuration looks correct and doesn't have any typos.
  4. That your fstab is correct and the right file systems will be mounted at boot time.
  5. That you can login to the system remotely, and that you can su to root.
  6. That the remote access mechanism, openssh, is configured properly to load at boot time. This can be via ``/etc/conf.d/local.start'' or the ``rc-update'' mechanism.

When you're ready, reboot your system: ``shutdown -r now''.

Step 3: Clean-up

The remaining tasks revolve around cleaning up the old RedHat files that Gentoo is not going to use (to get that disk space back), and a few OS security hardening items that can't hurt.

If you're like me, you install the minimum amount of software components necessary to run the system. If however you like installing lots of other things, then keep in mind that you need to consider the spirit of the following instructions rather than the literal directions, as you may have other components you'll want to isolate or protect.

  1. Protect certain files and directories.

    Before we install any more software, we need to take advantage of the timestamp magic from the Preparation Step and nuke all the old files. But before we do that, there are some directories and files we want to make sure are protected no matter what. The following is a command line that touches the timestamps of various files, and it should be good enough if you haven't done anything beyond the scope of these instructions.

    for dir in /lib/modules /etc/ssh ; do \
    find $dir | perl -wpe 's/ /\\ /g' | xargs touch -m -a ; \
    done

    for file in /etc/resolv.conf ; do \
    touch -m -a $file; \
    done

  2. Remove old RedHat files

    Recall that we ``touch''ed the entire file system back in the Preparation Step. This was to make it easy to find them after the installation -- the Gentoo steps would overwrite whatever files were in common with RedHat, thereby updating their timestamps, while the files that were untouched would retain the old timestamp. Now we'll run a ``find'' looking for directories and files older than a certain number of days, and then ``rm'' them.

    NOTE: the ``9125'' number below references the number of days since my birthday, which again was the date I chose in the Preparation Step. If you chose a different date, you need to adjust this number accordingly.

    find /bin /sbin /etc /lib /usr /var -type f -mtime +9125 | perl -wpe 's/ /\\ /g' | xargs rm -v
    find /bin /sbin /etc /lib /usr /var -type d -mtime +9125 | perl -wpe 's/ /\\ /g' | xargs rm -vrf

    Doing this will screw up the installation of groff (man) and emacs. I'm not sure how, but the solution is simple and easy enough so instead of drilling down to figure this out, I just provide you with the solution:

    emerge groff
    emerge emacs
    emerge vi

    See? Simple.

  3. Optional: Remove old RedHat devices and special files.

    In the interest of being complete, we also want to consider wiping out any and all "special" files (devices, pipes, sockets, etc) from RedHat that Gentoo doesn't use. Again, remember that the timestamps will be recent if the Gentoo Installation overwrote any of the files, so you should be safe.

    NOTE: I did not do this step. I don't know if it works, but there won't be much disk space to recover from this step and it just wasn't important to me in light of the fact that the Gentoo system prefers to use DevFS and will take over the ``/dev'' directory.

    find /dev -type b -mtime +9125  | perl -wpe 's/ /\\ /g' | xargs rm -v
    find /dev -type c -mtime +9125 | perl -wpe 's/ /\\ /g' | xargs rm -v
    find /dev -type p -mtime +9125 | perl -wpe 's/ /\\ /g' | xargs rm -v
    find /dev -type s -mtime +9125 | perl -wpe 's/ /\\ /g' | xargs rm -v

  4. Remove old RedHat directories

    If they are empty, you should nuke all the other RedHat directories.

    cd / && rm -rf opt misc tftpboot

    Once you're off of the RedHat kernel, you should ``rmdir /initrd'' as well.

    IMPORTANT: don't nuke the initrd directory, even if it's empty, if you're still on the RedHat kernel -- the RedHat kernel boot will fail and hang when it goes to mount the initrd image if the mount point is missing.

  5. Secure the system.

    As a general practice, I don't like my users doing much on a system beyond what I have specifically provided for them. To that end, I favor limiting the permissions of standard system components, because you never know what's going to become a security risk.

    1. Limit permissions of SUID/SGID binaries.

      for file in /usr/bin/suidperl /usr/bin/sperl5.* /usr/bin/chage /usr/bin/gpasswd                 \
      /usr/bin/crontab /usr/bin/chfn /usr/bin/chsh /usr/bin/newgrp /usr/sbin/traceroute \
      /usr/bin/traceroute6 /bin/ping /bin/ping6 /bin/mount /bin/umount /usr/bin/write; do \
      chmod o-rwx $file; chgrp wheel $file; chmod g-r $file ; \
      done

    2. Limit permissions of system components that users shouldn't need to run.

      for file in /usr/bin/*cc* /usr/bin/*86* /usr/bin/tracepath* /usr/bin/sudo /usr/sbin/*del \
      /usr/bin/i386-pc-linux-gnu-* /usr/bin/?++ /usr/i386-pc-linux-gnu/bin/* \
      /usr/i386-pc-linux-gnu/gcc-bin/3.*/* /usr/sbin/*add /usr/sbin/*mod ; do \
      chmod o-rwx $file; chmod g-rw $file; chgrp wheel $file; \
      done

If you want to recompile parts of the OS, now's the time! Install those missing components, emerge whatever you want. You're done!