Sunday, April 22, 2007

Serial to USB converter

Prerequisites
minicom

kernel configure options:
USB=m # USB subsystem
USB_SERIAL=m # USB serial port support
USB_SERIAL_GENERIC=m # USB serial port generic driver
USB_SERIAL_PL2303=m # USB serial port driver

menuconfig path:
- Device Drivers ->
-- USB Support ->
--- USB Serial Converter support ->
---- USB Generic Serial Driver
---- (hardware specific driver)
---- e.x. USB Prolific 2303 Single Port Serial Driver

lsmod Listing (modules loaded):
usbcore pl2303,usbserial,...
- usbserial pl2303

Minicom serial port settings:
Serial Device: /dev/ttyUSB0
Bps/Par/Bits: 9600 8N1
Hardware Flow Control: No
Software Flow Control: No

http://www.gentoo.org/doc/en/usb-guide.xml

Saturday, April 14, 2007

iproute commands

Prerequisites
iproute2 package


kernel configure options:

CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_ROUTE_MULTIPATH=y

menuconfig path:
- Networking -->
-- Networking Support -->
--- Networking options -->
---- TCP/IP networking
----- IP: Advanced router
----- IP: policy routing
----- IP: equal cost multipath


Enable IP Forwarding
echo "1" > /proc/sys/net/ipv4/ip_forward
echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter

IP LINK
(cmd subset)

Show hardware address

ip link
ip link [show|ls|list|sh]

Take an interface up/down
ip link set dev (device) up
ip link set (device) up
ip link set dev (device) down
ip link set (device) up

Change the MAC address of the interface
ip link set dev (device) address (arp address)


IP ADDRESS (cmd subset)

Show ip address
ip addr
ip addr [show|sh|list|ls]
ip addr show dev eth0 # show specific device

Show ip addresses (the old "ifconfig" way)
ifconfig -a
ifconfig

Assign IP address to interface
ip addr [add|a] (address)/(mask) dev (device)
ex: ip addr add 192.168.1.2/24 dev eth0

Assign IP address to interface (the old "ifconfig" way)
ifconfig eth0 192.168.1.2 netmask 255.255.255.0

Remove IP address from interface
ip addr [delete|del|d] (address)/(mask) dev (device)
ex: ip addr del 192.168.1.2/24 dev eth0


IP NEIGHBOR (cmd subset)

Show ip Layer 2 neighbors (arp table)
ip neigh

Show ip Layer 2 netighbors (the old "arp" way)
arp -a

Add new ARP mapping
ip neigh add 192.168.1.100 dev eth0 lladdr (mac address)
ip neigh add 192.168.1.100 dev eth0 lladdr (mac address) nud reachable

NUD Statuses
--permanent (perm) # administrative mapping
--noarp # neighbor valid but no attempt to rearp will be made
--reachable # neighbor entry valid until timeout
--stale # old arp entry

Remove ARP mapping
ip neigh del 192.168.1.100 dev eth0

Flush arp table
ip neigh flush


IP ROUTE
(cmd subset)

Show ip routing tables

ip route

Show ip routing tabes (the old "route" way)
route

Add Static Route
ip route add (network)/(mask) via (ip to route through)
e.x. ip route add 10.0.0.0/24 via 192.244.7.65
ip route add (network)/(mask) src INTERFACE_IP dev (device)
ip route add (network)/(mask) dev (device) protocol static

Add Static Route (old "route" method)
route add -net 10.0.0.0 netmask 255.255.255.0 dev eth0

Add Default Route
ip route add default via GATEWAY_IP

Add Default Route (old "route" method)
route add default gw 192.168.1.1

Del Route
ip route del 10.0.0.0/24

Delete all routes on an interface
ip route flush dev eth0


http://www.policyrouting.org/iproute2.doc.html
http://gentoo-wiki.com/Dual_internet_connections

Saturday, April 07, 2007

Date Time Clocks

Setting the timezone:
ln -sf /usr/share/zoneinfo/your/zone /etc/localtime

Setting the timezone for a particular user:
export TZ=America/Chicago

Show time in a given timezone:
# relative to the /usr/share/zoneinfo/ directory
zdump Japan
zdump America/Chicago
zdump US/Central

# absolute path to zonefile
zdump /etc/localtime
zdump /usr/share/zoneinfo/America/Chicago

View date and time:
date
date --utc #universal time

Set the date and time:
date -s "16:15:00" # just the time
date -s "16:15:00 April 7, 2007" # date and time
date 040716552007.00 # the fields being MMDDhhmmCCYY.ss

Verify connectivity with NTP server:
ntpdate -q time.nist.gov

Several common time servers:
clock.redhat.com
clock2.redhat.com
ns1.tuxfamily.org
time.nist.gov
time.apple.com

Manually use NTP to set time:
ntpdate time.nist.gov
ntpdate -v time.nist.gov # verbose output

Use NTPd to automatically set date and time:
/etc/init.d/ntpd start #ntpd must be installed, of course

Monitor NTPd:
ntpdc -p
ntpdc -p -n


http://www.linuxsa.org.au/tips/time.html
http://www.vanemery.com/Linux/RH-Linux-Time.html

Sunday, April 01, 2007

Fake RAID links

Wikipedia FakeRAID Def
http://en.wikipedia.org/wiki/Fakeraid
Not transparent to the OS like real RAID. Not controlled entirely by the operating system either like softRAID. However, it uses hardware and needs an OS driver.

LINUX FakeRAID drivers
http://linux-ata.org/driver-status.html

List of FaikRAID hardware devices/controllers
http://linuxmafia.com/faq/Hardware/sata.html

My MoBo
http://www.pcstats.com/articleview.cfm?articleid=1770&page=1

This Mobo uses the following kernel modules:
sata_nv: for the 4 nForce4 controllers

kernel configure option:
CONFIG_SATA_NV=y


menconfig path:
- Device Drivers -->
-- Serial ATA (prod) and ... -->
--- ATA device support -->
---- NVIDIA SATA support
----- sata_sil: for the 4 Sillicon Image 3314 controllers


kernel configure option:
CONFIG_SATA_SLI = y

menuconfig path:
- Device Drivers -->
-- Serial ATA (prod) and ... -->
--- ATA device support -->
---- Silicon Image SATA support
----- ahci: generic Open standard (I don't have this, but worth a mention)


kernel configure option:
CONFIG_SATA_AHCI=y

menuconfig path:
- Device Drivers -->
-- Serial ATA (prod) and ... -->
--- ATA device support -->
---- AHCI SATA support


Both of these modules depend on the module:
libata

Libata depends on the following module:
scsi_mod

kernel configure option:
CONFIG_SCSI=y

menuconfig path:
- Device Drivers -->
-- SCSI device support -->
--- SCSI device support