Linux User Space i2c

http://www.google.ca/url?sa=t&rct=j&q=&esrc=s&source=web&cd=10&ved=0CGkQFjAJ&url=http%3A%2F%2Fwww.haifux.org%2Flectures%2F258%2Fgpio_spi_i2c_userspace.pdf&ei=hu8EUKyaE8TNqgHrw-CxCA&usg=AFQjCNG-QNxl7brpTBTnzO2_JckFhdlC2Q modprobe i2c-dev

CISCO Switch Commands

Show Commands

show version
show boot 
show running-config
show ip interface
show file system
show ip int brief | excl unassigned
dir
cd

Configure IP

enable
configure t
interface vlan1
ip address 192.168.11.200 255.255.255.0
no shutdown

Upgrade

Method 1, copy tar file and extract tar file

copy tftp://192.168.11.1/c2960c405-universalk9-tar.150-2.SE.tar c2960c405-universalk9-tar.150-2.SE.tar
verify /md5 flash:/c2960c405-universalk9-tar.150-2.SE.tar
config terminal
boot system flash:/c2960c405-universalk9-mz.150-2.SE/c2960c405-universalk9-mz.150-2.SE.bin

Method 2, use archive commands which works with tar archive

archive download-sw  /leave-old-sw /reload  tftp://192.168.11.1/c2960c405-universalk9-tar.150-2.SE.tar

Method 3, bin file upgrade

copy tftp://192.168.11.1/c3560c405ex-universalk9-mz.150-2.SE.bin c3560c405ex-universalk9-mz.150-2.SE.bin
config terminal
boot system flash:c3560c405ex-universalk9-mz.150-2.SE.bin

Other commands

?
copy ?
delete /force /recursive c2960c405-universalk9-mz.150-2.SE

copy system:running-config tftp://192.168.11.1/running-config

copy nvram:startup-config tftp://192.168.11.1/startup-config

copy running-config startup-config

show ip int brief | excl unassigned

vlan


config t
interface vlan303
 ip address dhcp
end

##wan
interface GigabitEthernet0/10
switchport access vlan 303
 switchport mode access
 no cdp enable
 spanning-tree portfast
 spanning-tree bpdufilter enable

##lan
interface GigabitEthernet 0/5
switchport access vlan 303
 switchport mode access

SNMP exec and extend

# cat /etc/snmp/snmpd.conf
rocommunity  public
exec .1.3.6.1.4.1.2021.51 ps /bin/ps
exec .1.3.6.1.4.1.2021.50 shelltest /bin/sh /tmp/shtest
exec .1.3.6.1.4.1.2021.52 echotest /bin/echo hello world
exec echotest11 /bin/echo hello world
extend .1.3.6.1.4.1.2021.56 shelltest1 /bin/sh /tmp/test

# snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.8
UCD-SNMP-MIB::extIndex.1 = INTEGER: 1
UCD-SNMP-MIB::extNames.1 = STRING: echotest11
UCD-SNMP-MIB::extCommand.1 = STRING: /bin/echo hello world
UCD-SNMP-MIB::extResult.1 = INTEGER: 0
UCD-SNMP-MIB::extOutput.1 = STRING: hello world
UCD-SNMP-MIB::extErrFix.1 = INTEGER: 0
UCD-SNMP-MIB::extErrFixCmd.1 = STRING: 


# snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.52
UCD-SNMP-MIB::ucdavis.52.1.1 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.52.2.1 = STRING: "echotest"
UCD-SNMP-MIB::ucdavis.52.3.1 = STRING: "/bin/echo hello world"
UCD-SNMP-MIB::ucdavis.52.100.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.52.101.1 = STRING: "hello world"
UCD-SNMP-MIB::ucdavis.52.102.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.52.103.1 = ""


# snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.50
UCD-SNMP-MIB::ucdavis.50.1.1 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.50.2.1 = STRING: "shelltest"
UCD-SNMP-MIB::ucdavis.50.3.1 = STRING: "/bin/sh /tmp/shtest"
UCD-SNMP-MIB::ucdavis.50.100.1 = INTEGER: 127
UCD-SNMP-MIB::ucdavis.50.101.1 = STRING: "/bin/sh: /tmp/shtest: No such file or directory"
UCD-SNMP-MIB::ucdavis.50.102.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.50.103.1 = ""
[root@vsp-devel ~]# snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.50
UCD-SNMP-MIB::ucdavis.50.1.1 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.50.2.1 = STRING: "shelltest"
UCD-SNMP-MIB::ucdavis.50.3.1 = STRING: "/bin/sh /tmp/shtest"
UCD-SNMP-MIB::ucdavis.50.100.1 = INTEGER: 127
UCD-SNMP-MIB::ucdavis.50.101.1 = STRING: "/bin/sh: /tmp/shtest: No such file or directory"
UCD-SNMP-MIB::ucdavis.50.102.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.50.103.1 = ""

# snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.51
UCD-SNMP-MIB::ucdavis.51.1.1 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.51.2.1 = STRING: "ps"
UCD-SNMP-MIB::ucdavis.51.3.1 = STRING: "/bin/ps"
UCD-SNMP-MIB::ucdavis.51.100.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.51.101.1 = STRING: "  PID TTY          TIME CMD"
UCD-SNMP-MIB::ucdavis.51.101.2 = STRING: "    1 ?        00:00:01 init"
UCD-SNMP-MIB::ucdavis.51.101.3 = STRING: "    2 ?        00:00:00 migration/0"
UCD-SNMP-MIB::ucdavis.51.101.4 = STRING: "    3 ?        00:00:00 ksoftirqd/0"
UCD-SNMP-MIB::ucdavis.51.101.5 = STRING: "    4 ?        00:00:00 watchdog/0"
UCD-SNMP-MIB::ucdavis.51.101.6 = STRING: "    5 ?        00:00:00 migration/1"
UCD-SNMP-MIB::ucdavis.51.101.7 = STRING: "    6 ?        00:02:33 ksoftirqd/1"
UCD-SNMP-MIB::ucdavis.51.101.8 = STRING: "    7 ?        00:00:00 watchdog/1"
UCD-SNMP-MIB::ucdavis.51.101.9 = STRING: "    8 ?        00:00:00 events/0"
UCD-SNMP-MIB::ucdavis.51.101.10 = STRING: "    9 ?        00:00:00 events/1"
UCD-SNMP-MIB::ucdavis.51.101.11 = STRING: "   10 ?        00:00:00 khelper"
UCD-SNMP-MIB::ucdavis.51.101.12 = STRING: "   11 ?        00:00:00 kthread"
UCD-SNMP-MIB::ucdavis.51.101.13 = STRING: "   15 ?        00:00:04 kblockd/0"
UCD-SNMP-MIB::ucdavis.51.101.14 = STRING: "   16 ?        00:00:00 kblockd/1"
UCD-SNMP-MIB::ucdavis.51.101.15 = STRING: "   17 ?        00:00:00 kacpid"
UCD-SNMP-MIB::ucdavis.51.101.16 = STRING: "  131 ?        00:00:00 cqueue/0"
UCD-SNMP-MIB::ucdavis.51.101.17 = STRING: "  132 ?        00:00:00 cqueue/1"
UCD-SNMP-MIB::ucdavis.51.101.18 = STRING: "  135 ?        00:00:00 khubd"
UCD-SNMP-MIB::ucdavis.51.101.19 = STRING: "  137 ?        00:00:00 kseriod"
UCD-SNMP-MIB::ucdavis.51.101.20 = STRING: "  205 ?        00:00:00 khungtaskd"
UCD-SNMP-MIB::ucdavis.51.101.21 = STRING: "  208 ?        00:00:07 kswapd0"
UCD-SNMP-MIB::ucdavis.51.101.22 = STRING: "  209 ?        00:00:00 aio/0"
UCD-SNMP-MIB::ucdavis.51.101.23 = STRING: "  210 ?        00:00:00 aio/1"
UCD-SNMP-MIB::ucdavis.51.101.24 = STRING: "  370 ?        00:00:00 kpsmoused"
UCD-SNMP-MIB::ucdavis.51.101.25 = STRING: "  402 ?        00:00:00 scsi_eh_0"
UCD-SNMP-MIB::ucdavis.51.101.26 = STRING: "  403 ?        00:01:17 usb-storage"
UCD-SNMP-MIB::ucdavis.51.101.27 = STRING: "  408 ?        00:00:00 ata/0"
UCD-SNMP-MIB::ucdavis.51.101.28 = STRING: "  409 ?        00:00:00 ata/1"
UCD-SNMP-MIB::ucdavis.51.101.29 = STRING: "  410 ?        00:00:00 ata_aux"
UCD-SNMP-MIB::ucdavis.51.101.30 = STRING: "  417 ?        00:00:00 kstriped"
UCD-SNMP-MIB::ucdavis.51.101.31 = STRING: "  430 ?        00:00:00 ksnapd"
UCD-SNMP-MIB::ucdavis.51.101.32 = STRING: "  447 ? "
UCD-SNMP-MIB::ucdavis.51.102.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.51.103.1 = ""

YUM Remove Orphaned Packages

Find Orphaned Packages

package-cleanup --orphans
Then remove the old fc-xx packages that no longer supported with "yum remove".

Fedora 17 Nouveau Driver

X does not load with default Nouveau driver option. Add the following to the kernel option to make it work
nouveau.noaccel=1
Alternatively create /etc/modprobe.d/noaccel.conf with
options nouveau noaccel=1

rpmbuild anaconda

$ echo "%_topdir     /home/$USER/anaconda/rpm" > ~/.rpmmacros

$ cd ~/anaconda
$ mkdir -p rpm/{BUILD,RPMS,SOURCES,SPECS,SRPMS}

$ rpm -i anaconda-11.1.2.113-1.el5.centos.2.src.rpm   #extract source

$ cd rpm/SPECS

$ rpmbuild -ba anaconda.spec

Building loader

$ cd rpm/BUILD/anaconda-11.1.2.209/loader2
$ make loader

Repacking Centos Stage2 Image

Extracting

/usr/sbin/unsquashfs -dest centos-stage2 stage2.img


Repacking

# cd centos-stage2
# tar cf - * .buildstamp | (cd ../centos-stage2-new; tar xfp -)

// make change in centos-stage2-new

# cd centos-stage2-new
# mksquashfs . ../stage2.img.new -all-root -no-fragments -noappend


Using rpm2cpio to extract rpms

rpm2cpio some.rpm | cpio -idmv