a technical notebook
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

228 lines
9.2 KiB

9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
  1. Monday, December 8, 2014
  2. ========================
  3. ssh
  4. ---
  5. I use SSH for damn near everything. We need SSH for damn near everything.
  6. I have this thought that SSH is quite possibly the only end-user-exposed
  7. implementation of acceptable crypto in wide use which actually satisfies the
  8. "actual human beings can use this" constraint at the same time as satisfying
  9. the "this makes your shit relatively secure" constraint. That's not to say
  10. it's easy for the average mortal to comprehend, but it beats the shit out of
  11. almost everything else I can think of.
  12. In "almost everything else", I include SSL/TLS/HTTPS, which sort-of works as
  13. far as the general user population of browsers is concerned, much of the time,
  14. but which is an absolute nightmare to administer and which is a fundamentally
  15. broken design on a political / systems-of-control / economic /
  16. regular-admins-get-this-right level. Arguably, the only thing that has been
  17. worse for the wide adoption of crypto by normal users than SSL/TLS is PGP.
  18. DISCLAIMER: I DON'T KNOW SHIT ABOUT CRYPTO. Tell me how I'm wrong.
  19. -> ✴ <-
  20. * "[Sorry Theo, but SSH Sucks](http://harmful.cat-v.org/software/ssh)"
  21. mosh
  22. ----
  23. I'm not exactly sure when mosh started to catch on with people I know, but I'd
  24. say it's on the order of a year or two that I've been aware of it. The basic
  25. thing here is that it's essentially OpenSSH with better characteristics for a
  26. specific cluster of use cases:
  27. - laggy, high-latency, intermittently-broken network connections
  28. - client machines that frequently hop networks and/or suspend operations
  29. - unreliable VPNs (which is to say very nearly all VPNS in actual use)
  30. time tracking
  31. -------------
  32. I'm about to start in on some remote contracting stuff, so I go looking for a
  33. time tracking tool. For the moment I settle on this little tray widget called
  34. [hamster](http://projecthamster.wordpress.com/), which looks functional if not
  35. precisely inspiring.
  36. noobs / raspbian
  37. ----------------
  38. Last year I did a bunch of work on a Raspberry Pi, but it's been a few months
  39. since I booted one up. I got a model B+ (more USB ports, various hardware
  40. tweaks, takes a microSD card instead of the full-size one) in my last employee
  41. order at SparkFun, and I'm stepping through what seems to be the stock
  42. recommended installation process.
  43. - http://www.raspberrypi.org/new-raspbian-and-noobs-releases/
  44. - http://www.raspberrypi.org/downloads/
  45. - http://downloads.raspberrypi.org/NOOBS_latest.torrent
  46. I torrented `NOOBS_v1_3_10.zip`. Be careful unzipping this one - everything is at
  47. the top level of the archive (advice to distributors of basically anything: don't
  48. do that).
  49. If I'd been smart I probably would have done:
  50. $ mkdir noobs && unzip NOOBS_v1_3_10.zip -d noobs/
  51. The basic system here is "get an SD card, put the stuff in this zip file on the
  52. SD card, put it in the Pi". Everything about this has always felt kind of
  53. weird (if not actively broken) to me, but it's probably important to remember
  54. that for most users "put some files on this media" is a lot easier than "image
  55. this media with the filesystem contained in this file".
  56. -> ✩ <-
  57. So I plug in all the stuff: microSD card, keyboard, HDMI cable to random spare
  58. monitor, power.
  59. Nothing. Well, almost nothing. Blinkenlights, no video output. Red light is
  60. steady, green light blinks a couple of times periodically.
  61. I am reminded that this is, fundamentally, a terrible piece of hardware.
  62. Power down, remove SD card, mount SD card on Linux machine, google variously,
  63. delete and recreate FAT32 partition using gparted, re-copy NOOBS files, unmount
  64. SD card, replace card in Pi, re-apply power.
  65. Green LED flashes spasmodically for a bit then seems mostly off, but is actually
  66. flickering faintly on closer examination. Red light is solid.
  67. [This wiki page](http://elinux.org/R-Pi_Troubleshooting#Red_power_LED_is_on.2C_green_LED_does_not_flash.2C_nothing_on_display)
  68. suggests this means that no boot code has been executed at all. It's failing to
  69. read the card, or it's missing some file, or something is corrupt.
  70. Ok, so, mount SD card on Linux machine again; immediately discover that the
  71. card is now a volume called "SETTINGS", or seems to be.
  72. $ ls /media/brennen/SETTINGS
  73. lost+found
  74. noobs.conf
  75. $ cat /media/brennen/SETTINGS/noobs.conf
  76. [General]
  77. display_mode=0
  78. keyboard_layout=gb
  79. language=en
  80. brennen@desiderata 15:52:24 /home/brennen ★ sudo parted /dev/mmcblk0
  81. GNU Parted 2.3
  82. Using /dev/mmcblk0
  83. Welcome to GNU Parted! Type 'help' to view a list of commands.
  84. (parted) print
  85. Model: SD SL16G (sd/mmc)
  86. Disk /dev/mmcblk0: 15.9GB
  87. Sector size (logical/physical): 512B/512B
  88. Partition Table: msdos
  89. Number Start End Size Type File system Flags
  90. 1 1049kB 823MB 822MB primary fat32 lba
  91. 2 826MB 15.9GB 15.1GB extended
  92. 3 15.9GB 15.9GB 33.6MB primary ext4
  93. (parted)
  94. Well, obviously something ran, because I definitely didn't arrange anything
  95. that way. And this seems a little telling:
  96. brennen@desiderata 15:55:36 /home/brennen ★ dmesg | tail -12
  97. [51329.226687] mmc0: card aaaa removed
  98. [51776.154562] mmc0: new high speed SDHC card at address aaaa
  99. [51776.154894] mmcblk0: mmc0:aaaa SL16G 14.8 GiB
  100. [51776.169240] mmcblk0: p1 p2 < > p3
  101. [51781.342106] EXT4-fs (mmcblk0p3): mounted filesystem with ordered data mode. Opts: (null)
  102. [51791.757878] mmc0: card aaaa removed
  103. [51791.773880] JBD2: Error -5 detected when updating journal superblock for mmcblk0p3-8.
  104. [51793.651277] mmc0: new high speed SDHC card at address aaaa
  105. [51793.651601] mmcblk0: mmc0:aaaa SL16G 14.8 GiB
  106. [51793.666335] mmcblk0: p1 p2 < > p3
  107. [51799.516813] EXT4-fs (mmcblk0p3): recovery complete
  108. [51799.518183] EXT4-fs (mmcblk0p3): mounted filesystem with ordered data mode. Opts: (null)
  109. (The "Error -5 detected bit.)
  110. Ok, so I bought a new Sandisk-branded card because I didn't have a decently
  111. fast microSD card laying around. What I'm going to check before I go any
  112. further is whether I got one the Pi can't deal with. (Or just one that's bunk.
  113. I bought this thing for 15 bucks at Best Buy, so who knows.)
  114. Here's an 8 gig class 4 card, branded Kingston, but I probably got it off the
  115. shelves at SparkFun some time in the last 3 years, so its actual provenance is
  116. anybody's guess. Looking at what's on here, I've already used it for a
  117. Raspberry Pi of some flavor in the past. Let's see if it'll boot as-is.
  118. Ok, no dice. I'm starting to suspect my problem lies elsewhere, but I'll try
  119. one more time on this card with NOOBS.
  120. Again: No dice.
  121. Also checked:
  122. - the monitor with other inputs, because who knows
  123. - tried a couple of different power supplies - USB cable from my laptop, 5V
  124. wall wart purchased from SFE, cell phone charger.
  125. - the usual plug-things-in-one-at-a-time routine.
  126. -> ✦ <-
  127. Time to try one of these cards with an older RasPi, if I can figure out where I
  128. put any of them.
  129. After much shuffling through stuff on my dining room table / workbench, I find
  130. a model B. It fails in much the same way, which leads me to suspect again that
  131. I'm doing something wrong with the card, but then I can't quite remember if
  132. this one still worked the last time I plugged it in. They can be fragile
  133. little critters.
  134. Here's a thought, using a Raspbian image I grabbed much earlier this year:
  135. brennen@desiderata 17:10:03 /home/brennen/isos ★ sudo dd if=/home/brennen/isos/2014-01-07-wheezy-raspbian.img of=/dev/mmcblk0
  136. No dice on either the model B or model B+, using the new SanDisk.
  137. Trying with the older card, `dd` spins through 800ish megs before giving me an I/O error.
  138. It may be time to start drinking.
  139. -> ✦ <-
  140. The next day: I swing through a couple of stores in town with the [wiki list
  141. of known cards in hand](http://www.raspberrypi.org/forums/viewtopic.php?t=58151) and buy a pile
  142. of cards across a handful of brands, plus a $20 card reader (the Insignia
  143. NS-CR20A1) since there's not one built in to the laptop I'm carrying today.
  144. The first card I try boots NOOBS instantly; an installer is running as I type
  145. this.
  146. Suddenly It occurs to me that the card reader on the laptop I was using last
  147. night might is likely dying/dead.
  148. This is a really slick install process now, so good work to somebody on that.
  149. beaglebone black
  150. ----------------
  151. I've got a Beaglebone Black sitting here new in the box. It comes with a USB
  152. cable, so I plug it in. Instantly there are bright blue blinky lights, and my
  153. laptop tells me I'm connected to an ethernet network and I've got a new drive
  154. mounted with some README files in it.
  155. This is kind of great.
  156. Browsing to to 192.168.7.2 gets a bunch of docs and a link to Cloud9, an
  157. in-browser IDE that happens to include a root terminal.
  158. I don't really know what's going on here. I think it might be a little
  159. scattered and confused as a user experience, in some ways. But it immediately
  160. strikes me as good tech in a bunch of ways.
  161. Josh Datko, who I've gotten to know a little bit, has a book called _Beaglebone
  162. for Secret Agents_. It's been on my ever-growing to-read list for a while; I'm
  163. going to have to give it a look sooner rather than later.
  164. reading list
  165. ------------
  166. * http://www.jann.cc/2013/01/15/trying_out_the_adafruit_webide.html
  167. * http://www.angstrom-distribution.org/
  168. * http://www.raspberrypi.org/documentation/configuration/config-txt.md