Posted in Nodejs

Nodejs | Operate web server whenever power on

Add below lines to ‘/etc/rc.local’

sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3000

node /home/ubuntu/landing_page/landing_page.js

 

External mobule is also available like ‘forever’ for setting the server to execute nodejs script whenever the machine is on.

Posted in Mac, VirtualBox

Mac, VirtualBox – Mount SD-card to virtualbox on Mac OS X

Unmount SDcard on Mac OS X

$ diskutil unmountDisk [SD card path]
(Ex. $ diskutil unmountDisk /dev/disk3)

Generate .vmdk file for VirtualBox

$ sudo VBoxManage internalcommands createrawvmdk -filename [.vmdk file name] -rawdisk [SD card path]
(Ex. $ sudo VBoxManage internalcommands createrawvmdk -filename sdcard.vmdk -rawdisk /dev/disk3)

Authorize .vmdk file and SDcard path as 666 or 777

$ sudo chmod 666 [.vmdk file name]
(Ex. $ sudo chmod 666 microsd.vmdk)

$ sudo chmod 666 [SDcard path]
(Ex. $ sudo chmod 666 /dev/disk3)

Unmount SDcard on Mac OS X whenever SDcard is remounted by Mac OS X

and then

Mount .vmdk file on VirtualBox