Enable Wifi Dongle in Raspberrypi OSMC

on Wednesday, June 24, 2015
Go to the command line interface of OSMC. Click the Power Icon. Select Exit, wait for the OSMC logo then press ESC.
Use username: osmc password: osmc

 Run the following Command:

 connmanctl  
 technologies  
 enable wifi  
 scan wifi  
 agent on  
 services  
 connect wifi_xxxxx #it will be a long string, hit tab for completion  

ref: https://osmc.tv/help/wiki/console
      https://discourse.osmc.tv/t/enable-wifi-under-gui/430/6

How to get the last IP address on the Subnet using Ruby

on Tuesday, June 9, 2015
 >> require 'ipaddr'  
 >> ip=IPAddr.new("192.168.1.0/24")  
 => #<IPAddr: IPv4:192.168.1.0/255.255.255.0>  
 >> gateway=IPAddr.new(ip.to_range.last.to_i-1,ip.family).to_s  
 => "192.168.1.254"  
 >> ip=IPAddr.new("192.168.1.0/20")  
 => #<IPAddr: IPv4:192.168.0.0/255.255.240.0>  
 >> gateway=IPAddr.new(ip.to_range.last.to_i-1,ip.family).to_s  
 => "192.168.15.254"  

KVM Commands

To install with prompt
 virt-install --prompt  


List virtual machine
 virsh list 


Stop virtual machine
 virsh destroy


Configure VM autostart
 virsh autostart


Unconfigure VM autostart
 virsh autostart --disable


To install using kickstart
 virt-install --name=rhel03.localdomain -r 768 --disk path=/var/lib/libvirt/images/rhel03.localdomain.img,size=8 -l http://192.168.122.1/pub/inst -x "ks=http://192.168.122.1/pub/ks/rhel03.cfg"


To create VM snapshot
 virsh save centos01 centos01.snap.$(date +%y%m%d)


To restore VM snapshot
 virsh shutdown centos01  
 virsh restore centos01.snap  


Clone vm
 virt-clone --original centos01 --name centos02 --file /home/penoycentral/images/centos02.img  


Troubleshooting KVM

Error when starting the VM snapshot
error restoring domain unable to read from monitor


To fix
 virsh managedsave-remove domain-name  

Raspoison

on Monday, June 8, 2015
This is an old blog entry but hopefully still relevant to some. Setting up a web kiosk system using raspberrypi+raspbian+ratpoison.This instruction assumes that you already installed raspbian on your SD card
sudo apt-get update  
sudo apt-get ratpoison  
sudo apt-get chromium  
sudo apt-get x11vnc  
sudo apt-get install x11-xserver-utils  

Start user pi at startup
 pi@raspberrypi:~$ grep pi /etc/inittab   
 1:2345:respawn:/bin/login -f pi tty1 /dev/tty1 2>&1  
 pi@raspberrypi:~$ cat /home/pi/.bash_profile   
 if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty1 ]; then  
 startx  
 fi  
Set ratpoison's config file
 pi@raspberrypi:~$ cat /home/pi/.xinitrc  
 exec ratpoison  
 pi@raspberrypi:~$ cat /home/pi/.ratpoisonrc  
 banish  
 exec xset s off  
 exec xset -dpms  
 exec unclutter -root  
 exec x11vnc -loop  
 exec /usr/bin/chromium --kiosk http://www.penoycentral.net  
Remotely connec thru vnc
 vncviewer raspberrypi.local  

You can try to test my Puppet module from github

Simulation Lab

on Wednesday, June 3, 2015
Simulation lab

Host:
Toshiba Laptop
Processor: Intel Corei7
Memory: 16G
Harddisk: Samsung SSD 256Gb
Operating System: Windows 8
Virtual Machine Software: VMware Workstation 9


Virtual Machines
pfsense : Nat Firewall/VPN
spacewalk: yum repository
Foreman: Configuration management
Centos1: host 1

Spacewak

on Tuesday, June 2, 2015
Channel sync
spacewalk-repo-sync --channel lab-local-centos-66

ref:
http://www.itzgeek.com/how-tos/linux/centos-how-tos/configuring-spacewalk-upoading-content-on-spacewalk-in-centos-6-rhel-6.html

 http://www.thenoccave.com/2012/03/29/install-spacewalk-client-on-centos-6/