Wednesday, November 12, 2014

GRUB

If you find that grub-mkrescue -o os.ios is not working ... install xorriso

Tuesday, November 11, 2014

Good HTML5 video

https://www.youtube.com/watch?v=WqV5kqaFRDU

The guy talks about reading and writing files in JS.

Also - mentioned indexdb - which is the persistence solution for webapp

CORS - cross origin resource sharing
EasyXDM  - cross domain messaging  - uses iframe

Sunday, November 9, 2014

Creating a bootable HD image using grub

It is nicely documented here - http://tomermargalit.wordpress.com/tag/create-grub2-bootable-image-over-loopback-device/

#!/bin/sh -x

dd if=/dev/zero of=out.img seek=8MB count=1k bs=1


outlo=`sudo losetup -f --show out.img`


parted -s ${outlo} mklabel msdos

parted  ${outlo} mkpart primary ext2 32k 100% -a minimal

parted ${outlo} set 1 boot on

partx -a ${outlo}


mke2fs ${outlo}p1

mkdir -p /mnt/out

mount -t ext2 ${outlo}p1 /mnt/out

grub-install --boot-directory=/mnt/out/boot/ --modules="ext2 part_msdos" ${outlo}

#####


umount /mnt/out
partx -d ${outlo}p1
losetup -d ${outlo}


Friday, November 7, 2014

Starting a network service on Ubuntu 14.04 at boot

I run an Ubuntu 14.04 VM on my Mac Mini with Yosemite. For some reason I cant get "bridged" network to work so I have to stick to NAT. What I needed was for the VM to start a Remote Port forwarding onto the host Mac at boot - so that I could simply use ssh to log into my VM. I needed answers to the following questions for this -


1. How do I get my networking to start at boot?
I am not sure of this I had to do this - add
auto eth0
iface eth0 inet dhcp

into /etc/network/interfaces


2. Add a cron job to ssh into my mac -

#!/bin/sh

x=`ps -Aef |grep 2222:localhost:22  | grep -v grep`

logfile="/home/kashyap/Desktop/log.txt"

if [ "$x" = "" ]
then
echo "Started the service" > $logfile
date >> $logfile 
ssh -N -i /home/kashyap/.ssh/id_rsa -R 2222:localhost:22 10.0.2.2 &
else
echo "Service already running" > $logfile
echo "$x" >> $logfile
date >> $logfile
fi                     

Tuesday, November 4, 2014

Sonic Pi

A nice program for Raspberry Pi- works on regular machines to -

A nice video introduction by the creator -

https://skillsmatter.com/skillscasts/5809-live-coding-in-the-classroom


Sam talks about a couple of things here -


1. Why's programming guide to Ruby - I think it is this - http://mislav.uniqpath.com/poignant-guide/book/

2. live_loop :loop_name do
   end

3. Examples in sonic pi are cool