First things first, I'll prepare an SD card with the "official" Z2 shell filesystem:
- read the instructions on manufacturer's site.
- download their Z2 shell environment, zipped.
- unzip that archive into a temp directory on my ubuntu netbook
- copy the contents of the archive into the root level of a FAT-formatted mini sSD card
- open the SD card's /etc/wpa_supplicant.conf in a text editor
- edit the 'ssid=' line, to supply the local wifi SSID in quotes
- add a line after that, 'proto=RSN' to make it use WPA2
- edit the 'psk=' line, to supply your WPA2 text password in quotes
ctrl_interface=/tmp/wpa_ctrl network={ ssid="kyorghie" key_mgmt=WPA-PSK proto=RSN psk="smyorghy" }
Now it's ready for use, here's the crazy dance it takes to boot into the shell:
- pop the SD card into the zipit
- push the reset button (left side pinhole) to clear the device
- push the power button to boot into the built-in setup wizard
- tell it my wifi settings (it won't continue without 'em)
- tell it my zipit login (won't continue without)
- skip IM account setup by pushing "next" for those
- once it's setup, press the -Z- button to get its attention.
- now you can press "home," select "tools," and then select "set defaults."
- confirm that you wanna reset, and it reboots
- and now it sees the SD card and boots into that.
- (convoluted, I know. gets me to a known-good state, at least...)
- watch it go --first-run, it generates an ssh host keypair
- if you don't get the # prompt in two or three minutes, start over.
- read his "about" page for IZ2S.
- download version 2.04 from here.
- as before, unzip the archive into a directory
- erase my SD card
- copy the archive contents to the root of the SD card
- edit the SD card's /etc/wpa_supplicant.conf as before, for WPA2
- (may not be necessary, as his boot script asks you for these settings)
- pop the SD card into the Zipit and reset it with the pin
- go through the boring bult-in setup wizard -- all so I can "set default" again
- on reboot, the zipit sees the SD and boots into it
- run `cryptpw NEWPASSWORD root` on the zipit shell command line
- the output is a crypt hash that can be substituted into /etc/passwd
- absent better options, I snapped a cellfone picture of the hash output
- i pulled out the SD card and put it back in my netbook, for easy editing
- i edited the SD card's /etc/passwd and substituted my new hash in root's entry
- i popped the SD card back in the zipit and issued a `reboot` command
- that didn't work, so I had to push the reset pin, go through built-in setup again, and use "set default" again. yeesh. then, on reboot it booted into the shell
- on the zipit shell, use `ifconfig eth0` to see what inet addr: I'm at
- on my ubuntu netbook, in a terminal, ping the zipit's IP, for funzies
- and then on the netbook, `ssh -l root ZIPITIPADDR` to connect to the zipit
- accept the warnings about an unknown ssh host key
- and when prompted for password, use the one I set previously
- and now I'm logged in as root, to the zipit, over ssh. w00t!
- create a docroot on the zipit shell, with `mkdir /share/httpd`
- start the web server with an explicit docroot, `httpd -h /share/httpd`
- make a test file, with `echo "this is on the zipit." >> /share/httpd/index.txt`
- and on my netbook, I can now view http://ZIPITIP/index.txt in a browser!
- `uptime > /share/httpd/uptime.txt`
- `wget -O /share/httpd/fetchedpage.txt http://SOMEINTERNALDEVICE/`
- `ifconfig eth0 > /share/httpd/ifconfig.txt`
- and so on ... maybe there's a cron job in the future.
- `curl -u USERNAME:PASSWORD http://twitter.com/account/verify_credentials.json` to make sure the API likes us
- and then `curl -u USERNAME:PASSWORD -d status="My zipit can tweet from the command line." http://twitter.com/statuses/update.json`
- So I actually got it working, see http://twitter.com/tweetazip w00!
If you need special characters when you're on the actual keyboard, here are the most useful ones I discovered:
- control c : hold the "..." key and press "c"
- escape : hold the "alt" key and press "space"
- pipe : hold the "alt" key and press the smileyface key
- braces : hold "alt" and shift key and press "j" or "k"
- backtick : no fricken idea! using a lot of pipes and redirects instead ;)
- `echo "hostname zipit" >> /mnt/sd0/z2script.sh` should work...
Oh and here are some pages that ended up being constants in my browser's tabs:
- next time i feel like swapping shell, I'm gonna try root nexus.
- oddree.com pages, like the "about" page for IZ2S.
- here's what your zipit's keymap might look like, except it might not exactly.
- crib notes for tweeting from a bash command line.