Sunday, February 23, 2014

Automation with odroidu2 and belkin WeMo



So I have been having trouble going to be because I have been staying up to late watching Netflix or watching stuff on xbmc. What I ended up doing was setting up a rule on my belkin WeMo switch to kill the power at 1




am.

Home theater setup

List of things in my setup



Living room
PANAMAX M4300-EX Home Theater Power Conditioner
LG Electronics NB3530A Sound Bar System
Xbox 360 4g with 1 32gb flash drive
Comcast DVR  DCX3400-M
WD live plus
FirmwareFW Base: 1.05.04Device: WDLXTV_PLUSLatest version: 0.5.1.1Current version: 0.5.1.1

Android remote  https://play.google.com/store/apps/details?id=com.osdmod.remote&hl=en
LG - 47" Class (44-9/10" Diag.) - LED - 1080p - 120Hz - HDTV Model: 47LS4500


Bed room



VIZIO 32" Class LED-LCD 720p 60Hz HDTV

Chromecast
Odroidu2 with android and xbmc
Android remote https://play.google.com/store/apps/details?id=org.leetzone.android.yatsewidgetfree&hl=en
 Comcast Digital Transport Adapter DCI105COM1

Wednesday, February 12, 2014

Random system info gathering with kickstarts

I started writing up little commands to get system info for when new hardware that comes in.


]# for i in $(cat /proc/net/dev | grep ':' | cut -d ':' -f 1); do echo "Interface : $i" "  $(ethtool $i | grep Link)"; done
Interface : lo          Link detected: yes
Interface : em1         Link detected: yes
Interface : em2         Link detected: no
Interface : em3         Link detected: no
Interface : em4         Link detected: no
Interface : p3p1        Link detected: no
Interface : p3p2        Link detected: no
Interface : p3p3        Link detected: no
Interface : p3p4        Link detected: no


01 ~]# for i in $(cat /proc/net/dev | grep ':' | cut -d ':' -f 1); do echo -e NIC  : $i $(cat /sys/class/net/"$i"/address); done 
NIC : lo 00:00:00:00:00:00
NIC : em1 00:00:00:00:00:00
NIC : em2 00:00:00:00:00:00
NIC : em3 00:00:00:00:00:00
NIC : em4 00:00:00:00:00:00
NIC : p3p1 00:00:00:00:00:00
NIC : p3p2 00:00:00:00:00:00
NIC : p3p3 00:00:00:00:00:00
NIC : p3p4 00:00:00:00:00:00


 ~]# service ipmi start
Starting ipmi drivers:                                     [  OK  ]
1 ~]# mac=$(ipmitool lan print | grep 'MAC Address' | cut -f 16 -d' ') && echo -e NIC : mgmt $mac
NIC : mgmt 00:00:00:00:00:00


01 ~]# dmidecode -t 1
# dmidecode 2.11
SMBIOS 2.7 present.

Handle 0x0100, DMI type 1, 27 bytes
System Information
        Manufacturer: Dell Inc.
        Product Name: PowerEdge pony
        Version: Not Specified
        Serial Number: xxxxxxxxxxxxx
        UUID: xxxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxxxxx
        Wake-up Type: Power Switch
        SKU Number: Not Specified
        Family: Not Specified


What I ended up doing was putting this in the end my post section at the bottom of my kickstarts so I can capture all this info.

%post --interpreter=/bin/bash
(
# Turn on bash debugging for more meaningful output in logfile
set -x

service ipmi start
for i in $(cat /proc/net/dev | grep ':' | cut -d ':' -f 1); do echo "Interface : $i" "  $(ethtool $i | grep Link)"; done >> /root/host-info.log
for i in $(cat /proc/net/dev | grep ':' | cut -d ':' -f 1); do echo -e NIC  : $i $(cat /sys/class/net/"$i"/address); done  >> /root/host-info.log
mac=$(ipmitool lan print | grep 'MAC Address' | cut -f 16 -d' ') && echo -e NIC : mgmt $mac >> /root/host-info.log
dmidecode -t 1 >> /root/host-info.log

) &> /root/ks_output.log
%end

Saturday, October 26, 2013

HP 10.10 DVD Network boot




Here is my entry for my pxe menu

LABEL HP_FWDVD_10.10
MENU LABEL 6)  Automatic Firmware Update Version 10.10
KERNEL /hpcd/10v/vmlinuz
APPEND initrd=/hpcd/10v/hpfw-1010-initrd.img media=net rw root=/dev/ram0 d3bug ramdisk_size=782392 init=/bin/init loglevel=3 ide=nodma ide=noraid nopat pnpbios=off vga=791 splash=silent hp_fibre showopts noexec32=off numa=off nox2apic TYPE=AUTOMATIC iso1=nfs://IP/exports/hp/FW1010.iso iso1mnt=/mnt/bootdevice pci=bfsort


To fix the initrd

mkdir /tmp/initrd.fix
cd /tmp/initrd.fix
gunzip -c /data/kickstart/images/hpfw-1010/system/initrd.img | cpio -i
sed -i 's/NET_MODULES=.*$/NET_MODULES="e100 e1000 igb qlcnic tg3 bnx2 bnx2x"/' etc/initrd.functions
sed -i 's/dhcpcd -t 45/dhcpcd -L -t 30/' sbin/netconfig.sh
find . | cpio  --create --'format=newc'  | gzip > /data/kickstart/tftpboot/hpfw-1010-initrd.img


info from here 
 http://h30499.www3.hp.com/t5/ITRC-ProLiant-Deployment/PXE-Boot-Image-from-an-ISO/m-p/5681899#M9269




Here is a copy of the hpfw-1010-initrd.img patched

https://dl.dropboxusercontent.com/u/21180906/HP/10.10/hpfw-1010-initrd.img

Tuesday, October 8, 2013

Random single user mode stuff

How to boot s390x in single user mode


Connected to server x.x.x.x

zPXE MENU
---------
** Error connecting to server: no profiles found **
1. Exit to CMS shell [IPL CMS]

Enter Choice -->
or press to boot from disk [DASD 2xxx]

Booting from DASD 2xxx...
00: zIPL v1.8.2-36.el6 interactive boot menu
00:
00:  0. default (2.6.32-131.39.1.el6.s390x)
00:
00:  1. 2.6.32-131.39.1.el6.s390x.debug
00:  2. 2.6.32-131.39.1.el6.s390x
00:  3. 2.6.32-131.0.15.el6.s390x.debug
00:  4. linux-2.6.32-131.0.15.el6.s390x
00:
00: Note: VM users please use '#cp vi vmsg '
00:


#cp vi vmsg  1 single       // should do the trick



How to boot ppc64 in single user mode

When grub is used this part is pretty simple.
But when yaboot is used its a little different


Config file read, 1024 bytes

Welcome
Welcome to yaboot version 1.3.13 (Red Hat 1.3.13-14.el5)
Enter "help" to get some basic usage information
boot:


linux single  // should do the trick
                     // came across another time where selinux blew up . used enforcing=0



How to boot arm in single user mode

coming soon


Tuesday, September 3, 2013

Network boot HPS update cd

Here is what my working pxe entry looks like



LABEL HP_FWDVD_9.30
MENU LABEL 5)  Manual Firmware Update Version 9.30
KERNEL /hpcd/vmlinuz
APPEND initrd=/hpcd/initrd.img media=cdrom rw root=/dev/ram0 ramdisk_size=815744 init=/bin/init loglevel=3 ide=nodma ide=noraid nopat pnpbios=off vga=791 splash=silent hp_fibre showopts noexec32=off numa=off nox2apic TYPE=MANUAL iso1=nfs://yourhost/exports/hp/FW930.iso iso1mnt=/mnt/bootdevice

Friday, July 26, 2013

Network speed tests in house -- (edited)

Server Seagate dockstar 1GB port hosting 1GB file via http

Download command
 wget --output-document=/dev/null http://host/disk.img

Clients

T510 fedora Wired


 HTTP request sent, awaiting response... 200 OK
Length: 1073741824 (1.0G) [application/octet-stream]
Saving to: ‘/dev/null’

20% [===>  224,403,456 50.7MB/s  eta 16s


 T510 fedora wireless with airlink wireless N

 HTTP request sent, awaiting response... 200 OK
Length: 1073741824 (1.0G) [application/octet-stream]
Saving to: ‘/dev/null’

 0% [             ] 4,665,175    869KB/s  eta 19m 42

OLPC using usb 10/100 linksys


HTTP request sent, awaiting response... 200 OK
Length: 1073741824 (1.0G) [application/octet-stream]
Saving to: ‘/dev/null’

 0% [          ] 3,056,447    809KB/s  eta 22m 38s

Odroidu2 Wired (10/100 NIC)


HTTP request sent, awaiting response... 200 OK
Length: 1073741824 (1.0G) [application/octet-stream]
Saving to: ‘/dev/null’

 5% [=======>    ] 63,779,235  11.2MB/s  eta 86s

Rpie Wired (10/100 NIC)

HTTP request sent, awaiting response... 200 OK
Length: 1073741824 (1.0G) [application/octet-stream]
Saving to: `/dev/null'

 2% [==>   ] 29,108,451  6.22M/s  eta 2m 31s


Readynas Wired (GB NIC)

HTTP request sent, awaiting response... 200 OK
Length: 1073741824 (1.0G) [application/octet-stream]
Saving to: `/dev/null'

 0% [>     ] 8,814,592   1.79M/s  eta 9m 33s 


Netgear Stora Wired (GB NIC)

HTTP request sent, awaiting response... 200 OK
Length: 1073741824 (1.0G) [application/octet-stream]
Saving to: `/dev/null'

17% [===========>     ] 192,380,928 39.7M/s  eta 22s


wdlive wifi airlink wireless N ( went from 200k to 800K)
HTTP request sent, awaiting response... 200 OK
Length: 1073741824 (1.0G) [application/octet-stream]
Saving to: `/dev/null'

 1% [>         ] 13,298,607   569K/s  eta 32m 31s

wdlive hard wire (cat 6 cable)
HTTP request sent, awaiting response... 200 OK
Length: 1073741824 (1.0G) [application/octet-stream]
Saving to: `/dev/null'

 1% [                                       ] 11,470,775  1.08M/s  eta 15m 31s



What did all this tell me. That  my wifi card on airlink wireless N sucks, and that I need to tweak my wifi settings a lot. Another note the wdlive box has terrible network performance



Wednesday, June 12, 2013

Showing All nics with link using bash



 # for i in $(cat /proc/net/dev | grep ':' | cut -d ':' -f 1); do echo "Interface : $i" "  $(ethtool $i | grep Link)"; done
Interface : lo          Link detected: yes
Interface : virbr0-nic          Link detected: no
Interface : virbr0      Link detected: no
Interface : em1         Link detected: no
Interface : wlan0       Link detected: yes