<?xml version='1.0' encoding='utf-8'?>
<rss version="2.0"><channel><title>Russell Smith</title><link>https://rsmith.co/blog</link><description>Writing by Russell Smith.</description><item><title>Decode This: A Hands-On Guide to QR Code Data Types</title><link>https://rsmith.co/decode-this-a-hands-on-guide-to-qr-code-data-types-d780bea64bd5</link><guid>https://rsmith.co/decode-this-a-hands-on-guide-to-qr-code-data-types-d780bea64bd5</guid><description>
&lt;section&gt;&lt;div&gt;&lt;hr/&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;figure id="69e8"&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/d780bea64bd5.png"/&gt;&lt;figcaption&gt;Scanning a QR code…but what can they do? (image credit: &lt;a href="https://www.pexels.com/video/man-taking-photo-of-the-qr-code-on-the-box-7287306/"&gt;https://www.pexels.com/video/man-taking-photo-of-the-qr-code-on-the-box-7287306/&lt;/a&gt;)&lt;/figcaption&gt;&lt;/figure&gt;&lt;p id="81ec"&gt;Most phone cameras with QR code scanning capabilities can handle the following examples encoded. I used the following code to make these:&lt;/p&gt;&lt;pre id="930b"&gt;&lt;span&gt;&lt;span&gt;require&lt;/span&gt; &lt;span&gt;"rqrcode"&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;data = &lt;span&gt;"the data"&lt;/span&gt;&lt;br/&gt;qrcode = &lt;span&gt;RQRCode::QRCode&lt;/span&gt;.new(data)&lt;br/&gt;&lt;br/&gt;png = qrcode.as_png(&lt;br/&gt;  &lt;span&gt;bit_depth:&lt;/span&gt; &lt;span&gt;1&lt;/span&gt;,&lt;br/&gt;  &lt;span&gt;border_modules:&lt;/span&gt; &lt;span&gt;1&lt;/span&gt;,&lt;br/&gt;  &lt;span&gt;color_mode:&lt;/span&gt; &lt;span&gt;Chunky&lt;/span&gt;PNG::&lt;span&gt;COLOR_GRAYSCALE&lt;/span&gt;,&lt;br/&gt;  &lt;span&gt;color:&lt;/span&gt; &lt;span&gt;"black"&lt;/span&gt;,&lt;br/&gt;  &lt;span&gt;file:&lt;/span&gt; &lt;span&gt;nil&lt;/span&gt;,&lt;br/&gt;  &lt;span&gt;fill:&lt;/span&gt; &lt;span&gt;"white"&lt;/span&gt;,&lt;br/&gt;  &lt;span&gt;module_px_size:&lt;/span&gt; &lt;span&gt;6&lt;/span&gt;,&lt;br/&gt;  &lt;span&gt;resize_exactly_to:&lt;/span&gt; &lt;span&gt;false&lt;/span&gt;,&lt;br/&gt;  &lt;span&gt;resize_gte_to:&lt;/span&gt; &lt;span&gt;false&lt;/span&gt;,&lt;br/&gt;  &lt;span&gt;size:&lt;/span&gt; &lt;span&gt;120&lt;/span&gt;,&lt;br/&gt;  &lt;span&gt;compression:&lt;/span&gt; &lt;span&gt;Zlib&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;:BEST_COMPRESSION&lt;/span&gt;&lt;br/&gt;)&lt;br/&gt;&lt;br/&gt;&lt;span&gt;IO&lt;/span&gt;.binwrite(&lt;span&gt;"qrcode.png"&lt;/span&gt;, png.to_s)&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;&lt;section&gt;&lt;div&gt;&lt;hr/&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;h4 id="18cc"&gt;General examples&lt;/h4&gt;&lt;p id="c664"&gt;Text — which seem to prompt a search for that text:&lt;/p&gt;&lt;figure id="28c9"&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/aaa005da8cd750dd0172.png"/&gt;&lt;figcaption&gt;“Hello, world!”&lt;/figcaption&gt;&lt;/figure&gt;&lt;p id="bf69"&gt;URLs - links that open in a browser:&lt;/p&gt;&lt;figure id="7e88"&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/e81bbe4d7b80483dc4a4.png"/&gt;&lt;figcaption&gt;“https://medium.com/@rhs”&lt;/figcaption&gt;&lt;/figure&gt;&lt;p id="c09d"&gt;Contact Info — via either &lt;a href="https://en.wikipedia.org/wiki/VCard"&gt;vCard&lt;/a&gt; or &lt;a href="https://en.wikipedia.org/wiki/MeCard_%28QR_code%29"&gt;MeCard&lt;/a&gt; (which, is slightly more compact!):&lt;/p&gt;&lt;figure id="e2e6"&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/df23a8315833c02b4aee.png"/&gt;&lt;figcaption&gt;“BEGIN:VCARD&lt;br/&gt;VERSION:3.0&lt;br/&gt;FN:Russ&lt;br/&gt;URL:&lt;a href="https://medium.com/@rhs"&gt;https://medium.com/@rhs&lt;/a&gt;&lt;br/&gt;URL:&lt;a href="https://twitter.com/rhs"&gt;https://twitter.com/rhs&lt;/a&gt;&lt;br/&gt;END:VCARD”&lt;/figcaption&gt;&lt;/figure&gt;&lt;p id="f4bc"&gt;Email - Mailto links for quick email creation (&lt;a href="https://developer.apple.com/library/archive/featuredarticles/iPhoneURLScheme_Reference/MailLinks/MailLinks.html#//apple_ref/doc/uid/TP40007899-CH4-SW1"&gt;apple docs&lt;/a&gt;):&lt;/p&gt;&lt;figure id="fd64"&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/cd20d90d220badd95faa.png"/&gt;&lt;figcaption&gt;“mailto:someone@example.org”&lt;/figcaption&gt;&lt;/figure&gt;&lt;p id="09f3"&gt;SMS - which pre-fills (but doesn’t send) a text message to a specified number:&lt;/p&gt;&lt;figure id="3a22"&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/41057786f286a861a8fd.png"/&gt;&lt;figcaption&gt;“SMSTO:5551234567:Hello, how are you?”&lt;/figcaption&gt;&lt;/figure&gt;&lt;p id="648e"&gt;Wi-Fi Credentials — to help folks join a network joining:&lt;/p&gt;&lt;figure id="37d6"&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/865581d29de1901078b3.png"/&gt;&lt;figcaption&gt;“WIFI:T:WPA;S:MyWiFiNetwork;P:MyPassword;;” — &lt;a href="https://github.com/zxing/zxing/wiki/Barcode-Contents#wi-fi-network-config-android-ios-11"&gt;documented further here&lt;/a&gt;&lt;/figcaption&gt;&lt;/figure&gt;&lt;p id="80bb"&gt;Geo-Coordinates: To open location in map apps.&lt;/p&gt;&lt;figure id="cc6e"&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/728e04f962c9b589f655.png"/&gt;&lt;figcaption&gt;“geo:51.00495,-0.93375,100” — lat,lon,height-in-meters&lt;/figcaption&gt;&lt;/figure&gt;&lt;p id="7848"&gt;Phone Numbers: To dial automatically.&lt;/p&gt;&lt;figure id="1d9f"&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/0cf63dc6df262cc2e07a.png"/&gt;&lt;figcaption&gt;“tel:5551234567”&lt;/figcaption&gt;&lt;/figure&gt;&lt;p id="3684"&gt;Calendar Events: Using iCal format.&lt;/p&gt;&lt;figure id="be9a"&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/e3ebbfa8b7a2819009db.png"/&gt;&lt;figcaption&gt;“BEGIN:VCALENDAR&lt;br/&gt;VERSION:2.0&lt;br/&gt;PRODID:-//Your Company//Your Product//EN&lt;br/&gt;BEGIN:VEVENT&lt;br/&gt;UID:1234567890&lt;br/&gt;DTSTAMP:20230914T080000Z&lt;br/&gt;DTSTART:20230915T090000Z&lt;br/&gt;DTEND:20230915T100000Z&lt;br/&gt;SUMMARY:Meeting with John&lt;br/&gt;DESCRIPTION:Discuss Q4 plans&lt;br/&gt;LOCATION:Conference Room A&lt;br/&gt;END:VEVENT&lt;br/&gt;END:VCALENDAR”&lt;/figcaption&gt;&lt;/figure&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;&lt;section&gt;&lt;div&gt;&lt;hr/&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;h4 id="4536"&gt;Apple&lt;/h4&gt;&lt;p id="6f45"&gt;Most Apple devices support:&lt;/p&gt;&lt;p id="25ef"&gt;&lt;a href="https://developer.apple.com/ios/universal-links/"&gt;Universal Links&lt;/a&gt;: Scanning the QR code with an iPhone that has the app installed will open the app directly to the specified location. If the app isn’t installed, it’ll fall back to opening the web URL.&lt;/p&gt;&lt;figure id="3dd4"&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/50dd5e9304f4b529096c.png"/&gt;&lt;figcaption&gt;“https://www.coinbase.com/price/usdc” — if you have the Coinbase app, this will deep-link&lt;/figcaption&gt;&lt;/figure&gt;&lt;p id="3cf3"&gt;App Store Links: Directs users to an app’s App Store page.&lt;/p&gt;&lt;figure id="7373"&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/959bd756f46aa1dcc222.png"/&gt;&lt;figcaption&gt;“https://apps.apple.com/us/app/apple-store/id375380948" — on iOS, will open the app store, and go to the page for the Apple Store app.&lt;/figcaption&gt;&lt;/figure&gt;&lt;p id="dd8f"&gt;Facetime: Using &lt;code&gt;facetime://&amp;lt;number&amp;gt;&lt;/code&gt; will initiate a FaceTime video call:&lt;/p&gt;&lt;figure id="6aa0"&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/ff51a59196a737219916.png"/&gt;&lt;figcaption&gt;“facetime://5551234567”&lt;/figcaption&gt;&lt;/figure&gt;&lt;p id="caac"&gt;Apple Maps: &lt;code&gt;http://maps.apple.com/?q=&amp;lt;location&amp;gt;&lt;/code&gt; opens Apple Maps. This is similar to geo, but doesn’t seem to have an obvious way to select the zoom / height:&lt;/p&gt;&lt;figure id="bbb4"&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/795f69ad7d4acfcbe438.png"/&gt;&lt;figcaption&gt;“http://maps.apple.com/?q=Petersfield, UK”&lt;/figcaption&gt;&lt;/figure&gt;&lt;p id="1792"&gt;Lastly, Apple Wallet Passes: Encodes a URL that adds a pass to Apple Wallet. It’s a literally just a URL to a zip file. However, the zip file is a little more complex — mostly due to signing; checkout the &lt;a href="https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/PassKit_PG/Creating.html"&gt;docs&lt;/a&gt;, and some &lt;a href="https://github.com/frozon/passbook"&gt;ruby code that helps make them&lt;/a&gt;.&lt;/p&gt;&lt;p id="976a"&gt;As it’s difficult to setup, I used someone elses example code — &lt;a href="https://github.com/keefmoon/Passbook-Example-Code/raw/master/Pass-Example-Generic/"&gt;https://github.com/keefmoon/Passbook-Example-Code/raw/master/Pass-Example-Generic/&lt;/a&gt; — and a Cloudflare Worker to serve it with the correct headers. The worker code is:&lt;/p&gt;&lt;pre id="8918"&gt;&lt;span&gt;&lt;span&gt;addEventListener&lt;/span&gt;(&lt;span&gt;'fetch'&lt;/span&gt;, &lt;span&gt;&lt;span&gt;event&lt;/span&gt; =&amp;gt;&lt;/span&gt; {&lt;br/&gt;  event.&lt;span&gt;respondWith&lt;/span&gt;(&lt;span&gt;handleRequest&lt;/span&gt;(event.&lt;span&gt;request&lt;/span&gt;))&lt;br/&gt;})&lt;br/&gt;&lt;br/&gt;&lt;span&gt;async&lt;/span&gt; &lt;span&gt;function&lt;/span&gt; &lt;span&gt;handleRequest&lt;/span&gt;(&lt;span&gt;request&lt;/span&gt;) {&lt;br/&gt;  &lt;span&gt;const&lt;/span&gt; url = &lt;span&gt;'https://github.com/keefmoon/Passbook-Example-Code/raw/master/Pass-Example-Generic/Pass-Example-Generic.pkpass'&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;  &lt;span&gt;// Fetch the .pkpass file from GitHub Pages&lt;/span&gt;&lt;br/&gt;  &lt;span&gt;const&lt;/span&gt; response = &lt;span&gt;await&lt;/span&gt; &lt;span&gt;fetch&lt;/span&gt;(url)&lt;br/&gt;&lt;br/&gt;  &lt;span&gt;// Read the file as a stream&lt;/span&gt;&lt;br/&gt;  &lt;span&gt;const&lt;/span&gt; body = response.&lt;span&gt;body&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;  &lt;span&gt;// Create a new response with the correct MIME type&lt;/span&gt;&lt;br/&gt;  &lt;span&gt;const&lt;/span&gt; init = {&lt;br/&gt;    &lt;span&gt;headers&lt;/span&gt;: {&lt;br/&gt;      &lt;span&gt;'Content-Type'&lt;/span&gt;: &lt;span&gt;'application/vnd.apple.pkpass'&lt;/span&gt;&lt;br/&gt;    },&lt;br/&gt;    &lt;span&gt;body&lt;/span&gt;: body&lt;br/&gt;  }&lt;br/&gt;&lt;br/&gt;  &lt;span&gt;return&lt;/span&gt; &lt;span&gt;new&lt;/span&gt; &lt;span&gt;Response&lt;/span&gt;(body, init)&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;/span&gt;&lt;/pre&gt;&lt;figure id="44c7"&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/4b1eb1f09a204bd7901a.png"/&gt;&lt;figcaption&gt;“&lt;a href="http://pkpass-demo.isitaboat.workers.dev/example.pkpass"&gt;http://pkpass-demo.isitaboat.workers.dev/example.pkpass&lt;/a&gt;”&lt;/figcaption&gt;&lt;/figure&gt;&lt;p id="c9b0"&gt;However, this doesn’t work for me in iOS — but I’m running in Lockdown mode. It looks like this on MacOS:&lt;/p&gt;&lt;figure id="7ac3"&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/7c65a1fa487ab4bd0c81.png"/&gt;&lt;/figure&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;&lt;section&gt;&lt;div&gt;&lt;hr/&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;h4 id="6b06"&gt;Android&lt;/h4&gt;&lt;p id="fbdd"&gt;For Android, you’ve got a few specialized options too:&lt;/p&gt;&lt;ol&gt;&lt;li id="d745"&gt;Market Links: Kinda like the app-store links — these directs the phone to an app on Google Play (&lt;code&gt;market://details?id=&amp;lt;package_name&amp;gt;&lt;/code&gt;).&lt;/li&gt;&lt;li id="3c58"&gt;Android Intents: These are sort of like the Universal Links on iOS — however the config is in the app, rather than app and web. The schemes seem different too.&lt;/li&gt;&lt;/ol&gt;&lt;p id="bccf"&gt;Did I miss any?&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;
</description><pubDate>Thu, 14 Sep 2023 21:41:24 +0000</pubDate></item><item><title>Fix: Minio refuses to start with mounted ZFS sub filesystems</title><link>https://rsmith.co/fix-minio-refuses-to-start-with-mounted-zfs-sub-filesystems-c04d13741a65</link><guid>https://rsmith.co/fix-minio-refuses-to-start-with-mounted-zfs-sub-filesystems-c04d13741a65</guid><description>
&lt;section&gt;&lt;div&gt;&lt;hr/&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;figure id="be25"&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/c04d13741a65.png"/&gt;&lt;figcaption&gt;Apparently this is an abstract image of two filesystems unioning together in a modern art style. I made it with DiffusionBee on Mac.&lt;/figcaption&gt;&lt;/figure&gt;&lt;p id="4624"&gt;If you’re having the issues like &lt;a href="https://github.com/minio/minio/issues/5080"&gt;this&lt;/a&gt;, or &lt;a href="https://github.com/minio/minio/issues/5080"&gt;this&lt;/a&gt;, or &lt;a href="https://github.com/minio/minio/pull/4807"&gt;this&lt;/a&gt;, you can work around it using UnionFS.&lt;/p&gt;&lt;p id="95ff"&gt;For me, I have a /home/minio folder, and I run an older version of minio in FS mode, on ZFS. When I moved to a new zpool, I setup sub filesystems for different projects in my minio fs, causing it not to start.&lt;/p&gt;&lt;p id="6f5c"&gt;The fix is easy:&lt;/p&gt;&lt;pre id="b6c5"&gt;&lt;span&gt;&lt;span&gt;# assuming /home/minio is the location of your minio data and sub-filesystems&lt;/span&gt;&lt;br/&gt;apt-get install unionfs-fuse&lt;br/&gt;&lt;br/&gt;&lt;span&gt;# make somewhere to mount the unionfs&lt;/span&gt;&lt;br/&gt;&lt;span&gt;mkdir&lt;/span&gt; /home/minio-unionfs&lt;br/&gt;&lt;br/&gt;&lt;span&gt;# stop anything actually writing in this folder if it's not yet mounted&lt;/span&gt;&lt;br/&gt;chattr +i /home/minio-unionfs&lt;br/&gt;&lt;br/&gt;&lt;span&gt;# mount the /home/minio folder RW /home/minio-unionfs&lt;/span&gt;&lt;br/&gt;unionfs-fuse /home/minio=RW /home/minio-unionfs&lt;br/&gt;&lt;br/&gt;&lt;span&gt;# make the mount survive reboots - add to /etc/fstab&lt;/span&gt;&lt;br/&gt;&lt;span&gt;echo&lt;/span&gt; &lt;span&gt;"/home/minio=RW /home/minio-unionfs fuse.unionfs options   0       0"&lt;/span&gt; &amp;gt;&amp;gt; /etc/fstab&lt;/span&gt;&lt;/pre&gt;&lt;p id="6dbc"&gt;That is it. Just don’t forget to change your minio config for the data dir to /home/minio-unionfs.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;
</description><pubDate>Thu, 07 Sep 2023 20:25:38 +0000</pubDate></item><item><title>Linux: How to find which enclosure slot a drive is in</title><link>https://rsmith.co/linux-how-to-find-which-enclosure-slot-a-drive-is-in-ec7b5a12c29c</link><guid>https://rsmith.co/linux-how-to-find-which-enclosure-slot-a-drive-is-in-ec7b5a12c29c</guid><description>
&lt;section&gt;&lt;div&gt;&lt;hr/&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;figure id="7a80"&gt;&lt;img alt="a Huawei RH2288 v3 server with 12 3.5in / LFF bays" loading="lazy" src="https://rsmith.co/assets/media/ec7b5a12c29c.jpeg"/&gt;&lt;figcaption&gt;A bargain on eBay — but how do I find which slot a failing drive is in?&lt;/figcaption&gt;&lt;/figure&gt;&lt;p id="13bd"&gt;If you have a SAS enclosure, usually you can identify failed or failing drives based simply with the following steps.&lt;/p&gt;&lt;p id="e4d3"&gt;Firstly checking to see if something is failing:&lt;/p&gt;&lt;figure id="f17a"&gt;&lt;pre&gt;~# zpool status tank
  pool: tank
 state: DEGRADED
  ....
  ....
config:

        NAME                                                       STATE     READ WRITE CKSUM
        tank                                                       DEGRADED     0     0     0
          mirror-0                                                 DEGRADED     0     0     0
            scsi-SIBM-ESXS_ST18000NM005J_E_ZR57J5C00000C2237WK8    FAULTED     91     0    21  too many errors
            scsi-SIBM-ESXS_ST18000NM005J_E_ZR57P21T0000C2234J2F    ONLINE       0     0     0

errors: No known data errors&lt;/pre&gt;&lt;a href="https://gist.github.com/ukd1/2b364c43f4d19fe1636501da706171bd"&gt;Original Gist&lt;/a&gt;&lt;figcaption&gt;You can see here one of the two drive mirrors is faulted.&lt;/figcaption&gt;&lt;/figure&gt;&lt;p id="da89"&gt;Above we see in &lt;code&gt;zpool status&lt;/code&gt; the pool is degraded as a disk has faulted. This pool was created using &lt;code&gt;/dev/disk/by-id/.......&lt;/code&gt; rather than &lt;code&gt;/dev/sdX&lt;/code&gt; as in theory, these ids do not change&lt;/p&gt;&lt;p id="a570"&gt;.We can check further, this maps to SDK.&lt;/p&gt;&lt;p id="8b02"&gt;Checking our &lt;code&gt;/var/log/syslog&lt;/code&gt; for corresponding entries using &lt;code&gt;ag -r-z sdk /var/log/syslog* | less -S&lt;/code&gt; we can see additional confirmation of the drive being bad:&lt;/p&gt;&lt;figure id="11df"&gt;&lt;pre&gt;/var/log/syslog.1:961696:Aug 12 00:19:41 storagelols kernel: [ 2578.136826] sd 0:0:20:0: [sdk] tag#280 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=13s
/var/log/syslog.1:961697:Aug 12 00:19:41 storagelols kernel: [ 2578.136849] sd 0:0:20:0: [sdk] tag#280 Sense Key : Medium Error [current] [descriptor] 
/var/log/syslog.1:961698:Aug 12 00:19:41 storagelols kernel: [ 2578.136853] sd 0:0:20:0: [sdk] tag#280 Add. Sense: Unrecovered read error
/var/log/syslog.1:961699:Aug 12 00:19:41 storagelols kernel: [ 2578.136860] sd 0:0:20:0: [sdk] tag#280 CDB: Read(16) 88 00 00 00 00 00 07 40 0d 7e 00 00 00 40 00 00
/var/log/syslog.1:961700:Aug 12 00:19:41 storagelols kernel: [ 2578.136864] blk_update_request: critical medium error, dev sdk, sector 973106632 op 0x0:(READ) flags 0x4700 phys_seg 2 prio class 0
/var/log/syslog.1:961703:Aug 12 00:19:43 storagelols kernel: [ 2580.823595] sd 0:0:20:0: [sdk] tag#305 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=15s
/var/log/syslog.1:961704:Aug 12 00:19:43 storagelols kernel: [ 2580.823608] sd 0:0:20:0: [sdk] tag#305 Sense Key : Medium Error [current] [descriptor] 
/var/log/syslog.1:961705:Aug 12 00:19:43 storagelols kernel: [ 2580.823611] sd 0:0:20:0: [sdk] tag#305 Add. Sense: Unrecovered read error
/var/log/syslog.1:961706:Aug 12 00:19:43 storagelols kernel: [ 2580.823617] sd 0:0:20:0: [sdk] tag#305 CDB: Read(16) 88 00 00 00 00 00 07 40 0d d9 00 00 00 0e 00 00
/var/log/syslog.1:961707:Aug 12 00:19:43 storagelols kernel: [ 2580.823620] blk_update_request: critical medium error, dev sdk, sector 973106976 op 0x0:(READ) flags 0x700 phys_seg 3 prio class 0
/var/log/syslog.1:961719:Aug 12 00:19:48 storagelols kernel: [ 2585.520477] sd 0:0:20:0: [sdk] tag#329 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=20s
/var/log/syslog.1:961720:Aug 12 00:19:48 storagelols kernel: [ 2585.520487] sd 0:0:20:0: [sdk] tag#329 Sense Key : Medium Error [current] [descriptor] 
/var/log/syslog.1:961721:Aug 12 00:19:48 storagelols kernel: [ 2585.520491] sd 0:0:20:0: [sdk] tag#329 Add. Sense: Unrecovered read error
/var/log/syslog.1:961722:Aug 12 00:19:48 storagelols kernel: [ 2585.520496] sd 0:0:20:0: [sdk] tag#329 CDB: Read(16) 88 00 00 00 00 00 07 40 0d ff 00 00 00 18 00 00
/var/log/syslog.1:961723:Aug 12 00:19:48 storagelols kernel: [ 2585.520498] blk_update_request: critical medium error, dev sdk, sector 973107288 op 0x0:(READ) flags 0x700 phys_seg 6 prio class 0
/var/log/syslog.1:961846:Aug 12 00:19:57 storagelols kernel: [ 2594.393550] sd 0:0:20:0: [sdk] tag#283 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=7s
/var/log/syslog.1:961847:Aug 12 00:19:57 storagelols kernel: [ 2594.393558] sd 0:0:20:0: [sdk] tag#283 Sense Key : Medium Error [current] [descriptor] 
/var/log/syslog.1:961848:Aug 12 00:19:57 storagelols kernel: [ 2594.393562] sd 0:0:20:0: [sdk] tag#283 Add. Sense: Unrecovered read error
/var/log/syslog.1:961849:Aug 12 00:19:57 storagelols kernel: [ 2594.393566] sd 0:0:20:0: [sdk] tag#283 CDB: Read(16) 88 00 00 00 00 00 07 40 10 31 00 00 00 35 00 00
/var/log/syslog.1:961850:Aug 12 00:19:57 storagelols kernel: [ 2594.393569] blk_update_request: critical medium error, dev sdk, sector 973111696 op 0x0:(READ) flags 0x700 phys_seg 29 prio class 0&lt;/pre&gt;&lt;a href="https://gist.github.com/ukd1/7ff14f02ac4d75fa99bb5a68d4fe0494"&gt;Original Gist&lt;/a&gt;&lt;figcaption&gt;syslog output showing issues with the drive&lt;/figcaption&gt;&lt;/figure&gt;&lt;figure id="ffe1"&gt;&lt;pre&gt;blk_update_request: critical medium error, dev sdk, sector 973106976 op 0x0:(READ) flags 0x700 phys_seg 3 prio class 0
sd 0:0:20:0: [sdk] tag#329 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=20s
sd 0:0:20:0: [sdk] tag#329 Sense Key : Medium Error [current] [descriptor] 
sd 0:0:20:0: [sdk] tag#329 Add. Sense: Unrecovered read error
sd 0:0:20:0: [sdk] tag#329 CDB: Read(16) 88 00 00 00 00 00 07 40 0d ff 00 00 00 18 00 00&lt;/pre&gt;&lt;a href="https://gist.github.com/ukd1/e20336e827f966af7b4b4ebc6a5913f3"&gt;Original Gist&lt;/a&gt;&lt;figcaption&gt;this is the shortened version of above; removing the time and repeated sections — sdk showing unrecovered read errors…&lt;/figcaption&gt;&lt;/figure&gt;&lt;p id="883b"&gt;Great. So, now — usually to tie this disk to a physical slot one can look in &lt;code&gt;/sys/class/enclosure&lt;/code&gt; and see which enclosures you have (for me, just one):&lt;/p&gt;&lt;figure id="b50c"&gt;&lt;pre&gt;~# ls /sys/class/enclosure/
0:0:0:0
&lt;/pre&gt;&lt;a href="https://gist.github.com/ukd1/c08425483a567be69ddc1dd46effb392"&gt;Original Gist&lt;/a&gt;&lt;/figure&gt;&lt;p id="b976"&gt;Inside this, there are usually a bunch of other things — including the slots:&lt;/p&gt;&lt;figure id="bc11"&gt;&lt;pre&gt;~# ls /sys/class/enclosure/0\:0\:0\:0
0  1  10  11  12  13  14  15  2  3  4  5  6  7  8  9  components  device  id  power  subsystem  uevent&lt;/pre&gt;&lt;a href="https://gist.github.com/ukd1/10f9a0baca9fb3dbcb3b3f1773230fe0"&gt;Original Gist&lt;/a&gt;&lt;/figure&gt;&lt;p id="1bb6"&gt;Usually, these slots also link back via &lt;code&gt;device&lt;/code&gt; to something useful — i.e. &lt;code&gt;/dev/sdk&lt;/code&gt; or equivalent. If so, you can just &lt;code&gt;echo 1 &amp;gt; /sys/class/enclosure/0\:0\:0\:0/x/locate&lt;/code&gt; (where X is the right slot number), and this will flash something that slot of your enclosure.&lt;/p&gt;&lt;p id="0638"&gt;However, if your device is missing the &lt;code&gt;device&lt;/code&gt; entry from the slots (like mine was), and you happen to have an LSi card, then the following maybe useful for you, as it took a while to dig up for me.&lt;/p&gt;&lt;h4 id="7ebd"&gt;Using storcli&lt;/h4&gt;&lt;p id="60d9"&gt;LSi kind of ship a utility called storcli. I say kinda, as I couldn’t find any way to get it from their support site, and searching only turned up really old versions of it. I managed to find it for download from &lt;a href="https://docs.hetzner.com/robot/dedicated-server/raid/lsi-raid-controller/"&gt;Hetzners help page&lt;/a&gt; and archive of tools.&lt;/p&gt;&lt;p id="02f9"&gt;This tool is apparently notoriously badly documented, and hard to use. However, for the simple task of identifying a drive it seems pretty easy. After you have it installed:&lt;/p&gt;&lt;p id="f1f7"&gt;&lt;code&gt;storcli64 /c0 /eALL /sALL show all&lt;/code&gt; will list all of the devices for &lt;code&gt;c0&lt;/code&gt; (presumably &lt;code&gt;card0&lt;/code&gt;), as well as full serial numbers. Read through it all, or grep it, and figure out which slot it’s in based on that. For me:&lt;/p&gt;&lt;figure id="bd9e"&gt;&lt;pre&gt;# storcli64 /c0/eALL/sALL show all | egrep 'Device attributes|SN = ' 
Drive /c0/e0/s0 Device attributes :
SN = 5PG0NK5F            
Drive /c0/e0/s1 Device attributes :
SN = 4ZGA2JUV            
Drive /c0/e0/s2 Device attributes :
SN = ZR57HQDQ0000C2231D7U
Drive /c0/e0/s3 Device attributes :
SN = 5PG0XW0F            
Drive /c0/e0/s4 Device attributes :
SN = 2FJHWTAU            
Drive /c0/e0/s5 Device attributes :
SN = ZR57J5C00000C2237WK8
Drive /c0/e0/s6 Device attributes :
SN = 5PG0NZ6F            
Drive /c0/e0/s7 Device attributes :
SN = ZR5DAF460000W311J9WJ
Drive /c0/e0/s8 Device attributes :
SN = ZR57J56K0000C2234JP3
Drive /c0/e0/s9 Device attributes :
SN = 5PG08AAE            
Drive /c0/e0/s10 Device attributes :
SN = ZR5872170000C2257SCT
Drive /c0/e0/s11 Device attributes :
SN = ZR57P1FF0000C2234KAV
Drive /c0/e0/s13 Device attributes :
SN = 50026B77841D2CF1    
Drive /c0/e0/s14 Device attributes :
SN = ZR57HQBJ0000C2231E0V
Drive /c0/e0/s15 Device attributes :
SN = ZR57P21T0000C2234J3F&lt;/pre&gt;&lt;a href="https://gist.github.com/ukd1/0346a47cbecf8ac976b163bd5a43a7d8"&gt;Original Gist&lt;/a&gt;&lt;figcaption&gt;So 7WK8 is in slot /c0/e0/s5&lt;/figcaption&gt;&lt;/figure&gt;&lt;p id="ee74"&gt;Locating the device the standard linux way with the drives not linked seems not worth the risk, so you can also use the &lt;code&gt;storcli&lt;/code&gt; command to locate the slot too by doing:&lt;/p&gt;&lt;p id="5450"&gt;&lt;code&gt;storcli /c0/e0/s5 start locate&lt;/code&gt;&lt;/p&gt;&lt;p id="6d9b"&gt;You should instantly see a new light start blinking on that one slot. From there, I physically removed it from the slot and replacaed it with a spare, and then replaced the drive in the pool:&lt;/p&gt;&lt;p id="9420"&gt;&lt;code&gt;zpool replace -f tank /dev/disk/by-id/&amp;lt;old-id&amp;gt; /dev/disk/by-id/&amp;lt;new-id&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;p id="6101"&gt;Now, &lt;code&gt;zpool status&lt;/code&gt; shows the replacement, and the progress. Now we just wait!&lt;/p&gt;&lt;figure id="ec47"&gt;&lt;pre&gt;# zpool status tank
  pool: tank
 state: DEGRADED
status: One or more devices is currently being resilvered.  The pool will
        continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
  scan: resilver in progress since Tue Aug 15 16:13:14 2023
        14.0T scanned at 3.67G/s, 9.39T issued at 2.45G/s, 14.0T total
        57.7G resilvered, 66.88% done, 00:32:20 to go
config:

        NAME                                                       STATE     READ WRITE CKSUM
        tank                                                       DEGRADED     0     0     0
          mirror-0                                                 DEGRADED     0     0     0
            replacing-0                                            DEGRADED     0     0     0
              scsi-SIBM-ESXS_ST18000NM005J_E_ZR57J5C00000C2237WK8  FAULTED     91     0    21  too many errors
              scsi-SIBM-E050_ST18000NM006J_ZR5DAF050000W311J1W9    ONLINE       0     0     0  (resilvering)
            scsi-SIBM-ESXS_ST18000NM005J_E_ZR57P21T0000C2234J2F    ONLINE       0     0     0

errors: No known data errors&lt;/pre&gt;&lt;a href="https://gist.github.com/ukd1/6ce97f9b6cf8c259ff6d307c4b475442"&gt;Original Gist&lt;/a&gt;&lt;/figure&gt;&lt;p id="79ab"&gt;If you found this useful, please leave some love and a comment if you had to change any of this ideas.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;
</description><pubDate>Tue, 15 Aug 2023 18:13:12 +0000</pubDate></item><item><title>Rosemary Gratin Dauphinoise Potatoes</title><link>https://rsmith.co/dauphinoise-potatoes-38db20a4ea33</link><guid>https://rsmith.co/dauphinoise-potatoes-38db20a4ea33</guid><description>
&lt;section&gt;&lt;div&gt;&lt;hr/&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;p id="642f"&gt;This is mostly written down after making it for friends, but I decided to publish it as folks have asked how I make it.&lt;/p&gt;&lt;p id="a2c1"&gt;Ingredients:&lt;/p&gt;&lt;ul&gt;&lt;li id="46c8"&gt;double cream&lt;/li&gt;&lt;li id="bfab"&gt;fresh garlic&lt;/li&gt;&lt;li id="92f8"&gt;rosemary, thyme&lt;/li&gt;&lt;li id="6461"&gt;potatoes&lt;/li&gt;&lt;li id="5322"&gt;butter&lt;/li&gt;&lt;li id="8fe0"&gt;cheese; I’d suggest ideally Gruyère and or Reblochon, or some interesting meltable cheese. I generally avoid very blue and or mild cheeses, and I like to mix cheeses.&lt;/li&gt;&lt;/ul&gt;&lt;p id="77a3"&gt;Sizing; I’d aim for one baked-potato sized potato per person. Cream, usually even for 4 people 1–2 pints is more than enough.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;&lt;section&gt;&lt;div&gt;&lt;hr/&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;p id="b832"&gt;Take the cream, put in pan along with the crushed garlic (to-taste), and rosemary and thyme in cheesecloth or similar. If you don’t have cheesecloth, you should strain it later. Simmer the cream, avoid boiling it.&lt;/p&gt;&lt;p id="d78f"&gt;Whilst the cream is simmering, peel and wash the potatoes, then slice them with a mandolin. Do not par cook. You should traditionally set your mandolin to the thickness of a coin, but personally I prefer thinner, but not thin enough they’re delicate.&lt;/p&gt;&lt;p id="10cc"&gt;Get a baking dish, and rub some butter on the bottom and sides. If using hard-cheese, pre-grate it.&lt;/p&gt;&lt;figure id="3556"&gt;&lt;img alt="A chopping board with some chunked-up-cheese, a bowl with some bacon and onions, a pot of sliced potatoes, and a empty buttered dish" loading="lazy" src="https://rsmith.co/assets/media/19ca5d24fc3d5af54630.png"/&gt;&lt;figcaption&gt;Grate or slice your cheese, use a madolin to slice your potatoes, and add some butter to the dish&lt;/figcaption&gt;&lt;/figure&gt;&lt;p id="e3f7"&gt;Taste the cream — if it’s taken up enough of the flavor for you, then remove the cheesecloth, and move on to the next step.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;&lt;section&gt;&lt;div&gt;&lt;hr/&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;p id="d3d5"&gt;Put in a complete, slightly overlapping set of potatoes. Pour on some cream until the first layer is covered. Evenly add cheese, either a thin slice per potato, or a medium sprinkle of grated cheese.&lt;/p&gt;&lt;/div&gt;&lt;div&gt;&lt;figure id="25cd"&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/5605ee97da736063f94f.png"/&gt;&lt;/figure&gt;&lt;figure id="9daa"&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/83b2c1f0d0a6a3bdb471.png"/&gt;&lt;figcaption&gt;Layer the potatoes so they’re overlapping, then pour on some cream and evenly add some cheese&lt;/figcaption&gt;&lt;/figure&gt;&lt;/div&gt;&lt;div&gt;&lt;p id="8b42"&gt;Repeat until you get close to the top of the dish, and then add a generous amount of cheese on the final layer. I also like to add some malden salt on top of the last layer, but before I add the cheese.&lt;/p&gt;&lt;figure id="5965"&gt;&lt;img alt="A dish of potatoes with cheese topping uncooked, waiting to be cooked." loading="lazy" src="https://rsmith.co/assets/media/82e16d00e9fd4906b399.png"/&gt;&lt;figcaption&gt;For the final layer, add a more generous amount of cheese&lt;/figcaption&gt;&lt;/figure&gt;&lt;p id="f31e"&gt;Note, avoid over filling the dish, as cream and or cheese will spill over, burn and generally be a pain.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;&lt;section&gt;&lt;div&gt;&lt;hr/&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;p id="79be"&gt;Bake (non-convection) at 350f / 180c for 45 minutes. It should be bubbling away, and slighly browned. Take it out and with a fork, check for the potatoes being done by pushing it in — look for an easy insertion. If in doubt, put it back in a little longer. If it’s getting too brown, cover with tin-foil.&lt;/p&gt;&lt;p id="7149"&gt;Cut, then serve — otherwise the cheese can tear in large blocks.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;&lt;section&gt;&lt;div&gt;&lt;hr/&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;h4 id="1637"&gt;Overnight Compressing&lt;/h4&gt;&lt;p id="b27a"&gt;You can make this recipe better by cooking it, then letting it cool, and covering with seran wrap. Then find something heavy — e.g. another similar dish, filled with something — and put it on top. Store like that in the fridge overnight. Rebake, when you want to eat it, adding extra cheese if needed. This compresses the potatoes, and makes it even better.&lt;/p&gt;&lt;h4 id="4518"&gt;Lardons&lt;/h4&gt;&lt;p id="5b93"&gt;Adding some very thinly sliced bacon, or lardons pre-fried in to the layers adds to the flavor. Dry them and try to remove as much grease as you can.&lt;/p&gt;&lt;h4 id="f3a3"&gt;Tartiflette&lt;/h4&gt;&lt;p id="ab8d"&gt;Whilst not a true &lt;a href="https://en.wikipedia.org/wiki/Tartiflette"&gt;Tartiflette&lt;/a&gt;, adding lardons and some onions to each layer makes this a hybrid between the two. It’s delicious.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;
</description><pubDate>Mon, 20 Feb 2023 03:46:06 +0000</pubDate></item><item><title>Welcome to Recurse</title><link>https://rsmith.co/welcome-to-recurse-18666b897cd7</link><guid>https://rsmith.co/welcome-to-recurse-18666b897cd7</guid><description>
&lt;section&gt;&lt;div&gt;&lt;hr/&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;p id="b4b6"&gt;So, yesterday was my first day in the Fall 22 batch of Recurse. It’s a programmers-retreat, pretty unstructured — based around learning and pushing your boundaries as a programmer.&lt;/p&gt;&lt;p id="a7be"&gt;Why am I doing this? Mostly for fun; to meet interesting folks, push myself to work on things I’ve wanted to, but never gotten around to, and basically get-back-to-doing things post a pretty-lazy sabbatical.&lt;/p&gt;&lt;h3 id="dcc3"&gt;&lt;strong&gt;Day 1:&lt;/strong&gt;&lt;/h3&gt;&lt;p id="a81e"&gt;TLDR, super fun. Met a bunch of folks, and touched a lot of subjects with not that much depth — but, enough to get a good taste.&lt;/p&gt;&lt;p id="503b"&gt;Firstly, there is a music-hacking group. Some of us ended up going through a &lt;a href="http://mmckegg.github.io/web-audio-school/"&gt;web-audio-school&lt;/a&gt; tutorial. For me, it kinda scratched the same itch that doing embedded development did — the feeling of making something physical or real, which was unexpected.&lt;/p&gt;&lt;figure id="cdde"&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/c812e77895654c30a225.png"/&gt;&lt;figcaption&gt;Didn’t quite get this one working, but was fun. The tutorial has really nice “testing” like feedback, which reminded me of how Shenzen/IO’s (&lt;a href="https://www.zachtronics.com/shenzhen-io/"&gt;https://www.zachtronics.com/shenzhen-io/&lt;/a&gt;) feedback worked.&lt;/figcaption&gt;&lt;/figure&gt;&lt;p id="c19c"&gt;Also, for a while I’d wanted a reason to start doing some Rust but never made the time. I posted an idea about working through &lt;a href="https://os.phil-opp.com/"&gt;a tutorial on building an OS from scratch&lt;/a&gt;, and managed to get it to boot and &lt;a href="https://os.phil-opp.com/vga-text-mode/"&gt;display some basic text&lt;/a&gt;. Fun, though how much I actually took in is a different matter.&lt;/p&gt;&lt;figure id="b7af"&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/18666b897cd7.png"/&gt;&lt;figcaption&gt;“Hello RC!” from an OS built in Rust&lt;/figcaption&gt;&lt;/figure&gt;&lt;p id="36c2"&gt;OCaml also always seemed interesting to me; joining a group working on this managed to get me from zero to hello-world super fast; and best of all the people were fun!&lt;/p&gt;&lt;p id="303c"&gt;Leetcode was something I was not particularly familiar with; it seems some RC’ers are at least partially aiming to brush up on skills for hiring — so there is group doing technical interview prep too. I’m probably going to keep going to this, as it’s fun to see how folks do this, and what kinda questions are expected. We didn’t have a pre-set set of questions, so we ran through a question I’ve used for hiring as a stand-in.&lt;/p&gt;&lt;h3 id="b2a6"&gt;Projects I think I wanna work on…&lt;/h3&gt;&lt;p id="8047"&gt;In no particular order:&lt;/p&gt;&lt;h4 id="eee8"&gt;FPGA stuff&lt;/h4&gt;&lt;figure id="b8ba"&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/9e656fc0b1a4c7ec7b4f.jpeg"/&gt;&lt;/figure&gt;&lt;p id="6a57"&gt;I ordered a &lt;a href="https://amzn.to/3bJOGae"&gt;QuickLogic Thing Plus EOS S3&lt;/a&gt;, and some ultrasonic sensors. I’ve got a few ideas for this, but starting with something basic like flashing some LEDs…but also measuring some distance. I’d ultimately like to use the sensors to make a no-moving-parts anemometer, maybe even with wind direction.&lt;/p&gt;&lt;h4 id="82ff"&gt;Counting things from video&lt;/h4&gt;&lt;p id="a64a"&gt;So, not really sure what to count — but this seems like a fun semi-practical project for learning some ML/AI. In Las Vegas / Nevada, there are a lot of public-feeds for traffic cams; maybe I can process those, and see the traffic around me?&lt;/p&gt;&lt;h4 id="70b2"&gt;A toddler game&lt;/h4&gt;&lt;p id="ff37"&gt;I have an 18 month old child…and there are a suprising lack of games for that age range. We currently play with sorting things, by color at the moment. Making a game for that might be fun, and useful. 🤷‍♂️&lt;/p&gt;&lt;p id="e0bf"&gt;…more to come.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;
</description><pubDate>Tue, 09 Aug 2022 16:03:13 +0000</pubDate></item><item><title>Making a DIY Pool Sensor</title><link>https://rsmith.co/making-a-diy-pool-sensor-aa916ac5dcd0</link><guid>https://rsmith.co/making-a-diy-pool-sensor-aa916ac5dcd0</guid><description>
&lt;section&gt;&lt;div&gt;&lt;hr/&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;p id="baae"&gt;If you’re lucky enough to have a pool, knowing the temperture of it is a big plus. Is it up to temperature? Whilst you can do this with some pool controllers, they have a few disadvantages;&lt;/p&gt;&lt;ol&gt;&lt;li id="e68d"&gt;mostly they are stand alone, so don’t integrate in to existing apps or automations systems. I want to keep using &lt;a href="https://www.home-assistant.io"&gt;home assistant&lt;/a&gt;.&lt;/li&gt;&lt;li id="73c9"&gt;they’re expensive e.g. my pool uses Pentair, &lt;a href="https://www.pentair.com/en-us/products/residential/pool-spa-equipment/pool-automation/screenlogic2_interfaceforintellitouchandeasytouchautomationsystems.html"&gt;their wifi bridge is &amp;gt; $600&lt;/a&gt;.&lt;/li&gt;&lt;li id="cf2d"&gt;also, maybe a minor detail, they tend to not be measuring the tempertature in the pool; most measure in a pipe somewhere.&lt;/li&gt;&lt;li id="2e13"&gt;however, they were wired-in — meaning no batteries to replace&lt;/li&gt;&lt;/ol&gt;&lt;p id="8e6d"&gt;So, based on this my requirements were;&lt;/p&gt;&lt;ul&gt;&lt;li id="64fa"&gt;integrates in to home assistant&lt;/li&gt;&lt;li id="ccf8"&gt;not too expensive (&amp;lt;$100)&lt;/li&gt;&lt;li id="001f"&gt;takes the in-pool temperature&lt;/li&gt;&lt;li id="621e"&gt;solar, or at least a very long battery life (3m+?)&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;&lt;section&gt;&lt;div&gt;&lt;hr/&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;figure id="8be8"&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/90ce16c84997ea20340b.jpeg"/&gt;&lt;/figure&gt;&lt;p id="71fe"&gt;This is a quick write up of the tools, hardware, sofware and setup of this project. The total price to assemble this (excluding tools) for me was ~$68, but I have 3 spare batteries, a spare solar panel, and 4 extra temperature sensors for that, and also could have used a $10 rather than $20 board — so you can probably build it for &amp;lt; $50 if you try.&lt;/p&gt;&lt;figure id="1096"&gt;&lt;blockquote&gt;&lt;a href="https://twitter.com/rhs/status/1526359021011148800"&gt;View original post on Twitter&lt;/a&gt;&lt;/blockquote&gt;&lt;/figure&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;&lt;section&gt;&lt;div&gt;&lt;hr/&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;h3 id="c547"&gt;Tools&lt;/h3&gt;&lt;p id="76e3"&gt;I used just a &lt;a href="https://pine64.com/product-category/pinecil/"&gt;soldering iron&lt;/a&gt; and a &lt;a href="https://amzn.to/3sGeiKw"&gt;cheap glue gun&lt;/a&gt;.&lt;/p&gt;&lt;h3 id="44f8"&gt;Hardware&lt;/h3&gt;&lt;p id="5222"&gt;You’ll need to have the following things:&lt;/p&gt;&lt;h4 id="e3f9"&gt;An ESP32 or ESP8266 board&lt;/h4&gt;&lt;p id="7c4f"&gt;One of those would be my choice, but actually any of the compatible boards for the esp-home project &lt;a href="https://esphome.io/#devices"&gt;listed here&lt;/a&gt; should work.&lt;/p&gt;&lt;p id="a160"&gt;Note, you’ll want one that has some ability to charge a battery either via a cable, or built in. Seach for “&lt;a href="https://amzn.to/3loKdLb"&gt;esp32 jst&lt;/a&gt;” on Amazon. If I didn't have a spare TTGO LORA board laying about, I’d have bought a generic board, being careful of the JST connector size. Est $10–20.&lt;/p&gt;&lt;p id="2c5a"&gt;I you don’t have / can’t get a board with charging built in, you can get a very cheap charge controller board — but it complicates things. I’d just run solar-only at that point.&lt;/p&gt;&lt;h4 id="6100"&gt;Optionally, a battery for overnight readings&lt;/h4&gt;&lt;p id="0453"&gt;You can run without, but obviously you’ll only get readings when there is enough solar to run the board. This might actually be ok for some folks.&lt;/p&gt;&lt;p id="4d6d"&gt;Note, you’ll want to check two things when ordering a battery:&lt;/p&gt;&lt;ol&gt;&lt;li id="0257"&gt;the polarity of the connector vs your board. there doesn’t seem to be a fixed standard; some of my ESP32 boards are +/-, then another board will be reversed: &lt;strong&gt;with the same connector&lt;/strong&gt;. Double check, or risk frying something.&lt;/li&gt;&lt;li id="26db"&gt;the connector type. My board uses JST1.25.&lt;/li&gt;&lt;/ol&gt;&lt;p id="6a3f"&gt;I bought a &lt;a href="https://amzn.to/3ljVH2N"&gt;4 pack of 1000mAh&lt;/a&gt; batteries that are quite small. I didn’t bother testing / sizing these properly; so far they seem ok and last the night.&lt;/p&gt;&lt;figure id="15d1"&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/02feeb3678394ca20af5.jpeg"/&gt;&lt;/figure&gt;&lt;p id="bc17"&gt;FYI I’m likely to swap to LiFeP04 due to having had one battery slightly “puff”; I’d be more worried of fire if this wasn’t a project floating in water. I think it puffed as the temperature in the shade Las Vegas is nearly 40c now, and it gets hotter.&lt;/p&gt;&lt;h4 id="8a51"&gt;A solar panel&lt;/h4&gt;&lt;figure id="ccd1"&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/546357b75192df35c49f.jpeg"/&gt;&lt;/figure&gt;&lt;p id="c468"&gt;I bought bunch to try, but one I settled on was from a &lt;a href="https://amzn.to/3MuLg8u"&gt;pair for $14&lt;/a&gt;. Maybe you could try a smaller one, but this seems totally able to charge / last so far.&lt;/p&gt;&lt;p id="a682"&gt;Prep:&lt;/p&gt;&lt;ol&gt;&lt;li id="460c"&gt;solder a reasonbly long pair of wires to the outputs. I used some heatshrink to protect where the wire goes through the lid of the pool float.&lt;/li&gt;&lt;li id="2ce0"&gt;hot-glue over the other exposed pads / outputs; I figured it would help stop any corrosion / shorts if it got wet.&lt;/li&gt;&lt;li id="d2a3"&gt;hot glue it to the lid of the chlorine float&lt;/li&gt;&lt;li id="0973"&gt;solder the positive to the 5v+ (or charge input) and negative to the gnd (or equiv on your charging setup).&lt;/li&gt;&lt;/ol&gt;&lt;h4 id="c982"&gt;A temperature sensor&lt;/h4&gt;&lt;figure id="236a"&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/7aa5e184af020bb4196e.png"/&gt;&lt;/figure&gt;&lt;p id="047f"&gt;DS18B20 sensors are “1-wire”. Confusingly they have 3 wires, I guess only one is for comms, say compared to i2c. Anyway, they’re cheap, fit the range of a pool and you can get them waterproof for cheap.&lt;/p&gt;&lt;p id="d782"&gt;I bought this &lt;a href="https://amzn.to/3lq7v3k"&gt;pack of 5 for $11&lt;/a&gt; with the intention of adding a couple more to the project to sense diffent depths. Watch this space.&lt;/p&gt;&lt;p id="10a4"&gt;Prep: solder the black to GND, red to 5v+ and yellow to a GPIO — in my case (and config you’ll see later pin 13).&lt;/p&gt;&lt;h4 id="a859"&gt;A zip-lock bag and cable tie / twist-tie&lt;/h4&gt;&lt;p id="3fbf"&gt;Shrug, I had these at home. The first attempt I used a zip-lock bag and hot-glued it shut with the wires through the glue to waterproof it. When I wanted to change sensors, or reflash it (I was still fiddling) this proved to be a real pain.&lt;/p&gt;&lt;figure id="f957"&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/1b35a3ade363c0d4a5c6.jpeg"/&gt;&lt;/figure&gt;&lt;p id="6564"&gt;My current version I don’t seal, just fold and aim to have the opening as high up away from the water as possible. The twist-tie fits through the holes in the lid and you can use it to secure it up there. If it submerges, it will obviously drown.&lt;/p&gt;&lt;h4 id="fbb0"&gt;A pool chlorine floater&lt;/h4&gt;&lt;p id="15e0"&gt;I used &lt;a href="https://amzn.to/3G1QZAi"&gt;this one&lt;/a&gt; as it matches the one already in my pool. It’s ~$22 on Amazon.&lt;/p&gt;&lt;figure id="8297"&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/90ce16c84997ea20340b.jpeg"/&gt;&lt;/figure&gt;&lt;h3 id="348b"&gt;Code / Software&lt;/h3&gt;&lt;p id="afaf"&gt;I use home assistant, so this setup is for assuming that you already have that running.&lt;/p&gt;&lt;h4 id="1457"&gt;Setup&lt;/h4&gt;&lt;p id="af71"&gt;You’ll need a usb cable from your computer → the ESP board you chose.&lt;/p&gt;&lt;p id="f9b4"&gt;Install esphome in your homeassistant. There are &lt;a href="https://esphome.io/guides/getting_started_hassio.html"&gt;instructions here&lt;/a&gt;.&lt;/p&gt;&lt;p id="28c1"&gt;Secondly, install esphome on a computer that you can connect the board to. This will be used to build and flash the firmware from esphome to your board. Docs are &lt;a href="https://esphome.io/guides/getting_started_command_line.html"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;blockquote id="410d"&gt;On a Mac (if you have &lt;a href="https://brew.sh"&gt;homebrew&lt;/a&gt; already) it’s just “brew install esphome”…&lt;/blockquote&gt;&lt;p id="6590"&gt;Copy this YAML to a file. Update the wifi SSID (name) and password.&lt;/p&gt;&lt;figure id="5070"&gt;&lt;pre&gt;esphome:
  name: pool-sensor

esp32:
  board: heltec_wifi_lora_32_V2
  framework:
    type: arduino

logger:

api:
  password: ""

ota:
  password: ""

# try turning off the status LED on this board, to save power
status_led:
  pin:
    number: GPIO25
    inverted: false

# with "fast_connect" wifi, this works with 10s run duration
deep_sleep:
  run_duration: 10s
  sleep_duration: 10min

dallas:
  - pin: GPIO13

sensor:
  - platform: dallas
    address: 0xYOURSENSORID
    id: pool_temperature
    name: "Pool Temperature"
    device_class: temperature

wifi:
  ssid: "your-ssid"
  password: "your-password"
  fast_connect: true&lt;/pre&gt;&lt;a href="https://gist.github.com/ukd1/f4c65f67042ccd1b993509481a660ca6"&gt;Original Gist&lt;/a&gt;&lt;/figure&gt;&lt;blockquote id="e1c8"&gt;For testing and finding the sensor ID it can be easier to comment out (prefix with #) the lines relating to deep_sleep.&lt;/blockquote&gt;&lt;p id="5f7f"&gt;Connect your board to USB. It should power-on in someway.&lt;/p&gt;&lt;p id="51ff"&gt;Next we’ll build and flash the board. In a terminal, run:&lt;/p&gt;&lt;blockquote id="6195"&gt;esphome run pool-sensor.yaml&lt;/blockquote&gt;&lt;p id="9292"&gt;It should do a bunch of stuff, then ask you to choose how to connect to the board. With a little luck, you’ll see a option matching the port / board you conencted. Choose that, it will flash the board.&lt;/p&gt;&lt;p id="a103"&gt;Post flashing, you’ll get a log of what the board is doing. You want to:&lt;/p&gt;&lt;ol&gt;&lt;li id="22d0"&gt;see it connect to your wifi (if not, fix the config and reflash)&lt;/li&gt;&lt;li id="28d1"&gt;see it find your sensor’s ID — then replace this in the config and reflash, if not debug your connection to the sensor.&lt;/li&gt;&lt;li id="239c"&gt;see it connect to homeassistant. You’ll see it in the logs here, and if successful also in HA itself.&lt;/li&gt;&lt;/ol&gt;&lt;p id="30cc"&gt;That should be it!&lt;/p&gt;&lt;h4 id="bdb7"&gt;Final Assembly&lt;/h4&gt;&lt;ol&gt;&lt;li id="5241"&gt;do the prep steps from above; attach the battery&lt;/li&gt;&lt;li id="33ac"&gt;thread twist-tie through the chlorine float lid&lt;/li&gt;&lt;li id="aef5"&gt;put board in zip-lock bag, and fix with the twist-tie to the lid&lt;/li&gt;&lt;li id="8a47"&gt;put the sensor coiled up in the bottom and lock it together&lt;/li&gt;&lt;li id="3160"&gt;gently lower into the pool; don’t throw it as it’s top-heavy before there is water in the bottom.&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;&lt;section&gt;&lt;div&gt;&lt;hr/&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;h3 id="61d1"&gt;Misc pictures&lt;/h3&gt;&lt;figure id="5791"&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/864d8d1633d578a3e3fc.png"/&gt;&lt;figcaption&gt;After a while you should end up with some data in Home Assistant! The drop is me taking the sensor out for pictures.&lt;/figcaption&gt;&lt;/figure&gt;&lt;figure id="9009"&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/becddace79ea5dfd2f09.png"/&gt;&lt;figcaption&gt;I also push this through to Apple Home&lt;/figcaption&gt;&lt;/figure&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;&lt;section&gt;&lt;div&gt;&lt;hr/&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;h3 id="8b0d"&gt;Issues so far&lt;/h3&gt;&lt;p id="92cc"&gt;The first version of this project used a more normal i2c temperature sensor that &lt;em&gt;wasn’t&lt;/em&gt; waterproof. I put 3–4 coats of &lt;a href="https://amzn.to/3wBHcfN"&gt;plasti-dip&lt;/a&gt; on it, and it seemed to work well. I sealed and ESP32 and the wires to this up in a bag (…with hot glue), and then decided I wanted to support multiple depths. So this got disassembled. It was a REAL pain to remove from the bag.&lt;/p&gt;&lt;p id="5307"&gt;The first version of this fell in to the pool whilst it was testing on the side. The battery and ESP32 didn’t live, but the sensor and solar panel survived.&lt;/p&gt;&lt;p id="b107"&gt;The second version seems to get very hot itself. The battery seems to expand a little — I think due to being in direct sunlight. Maybe moving to LiFePO4 will be less sensitive?&lt;/p&gt;&lt;p id="fa3c"&gt;Also, I’ve picked the sensor out of the water by the solar panel — at least here, it’s hot enough that the hot-glue isn’t that strong. Avoid doing this, or upgrade your glue.&lt;/p&gt;&lt;h3 id="6e5e"&gt;What is next?&lt;/h3&gt;&lt;figure id="f6b6"&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/aa916ac5dcd0.jpeg"/&gt;&lt;/figure&gt;&lt;p id="fc01"&gt;Ideas, and things I want to do next:&lt;/p&gt;&lt;ol&gt;&lt;li id="13a3"&gt;add 1–2 more sensors for deeper in the pool&lt;/li&gt;&lt;li id="7dc8"&gt;figure out a different battery, as any lipo getting hot doesn’t seem great — or just run without a battery (obvious downsides though)&lt;/li&gt;&lt;li id="c10a"&gt;figure out how to adjust the schedule; I’d rather have much more accurate updates during the day, and then less overnight — but I don’t see that option in esphome.&lt;/li&gt;&lt;li id="ac58"&gt;ph sensing&lt;/li&gt;&lt;li id="c9dd"&gt;battery and or solar voltage reporting&lt;/li&gt;&lt;li id="ccf9"&gt;mapping / location reporting for where the reading was taken. super pointless / overkill, but tbh sounds like a fun challenge&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;
</description><pubDate>Wed, 18 May 2022 22:45:01 +0000</pubDate></item><item><title>Netflix Error ui-800–3</title><link>https://rsmith.co/netflix-error-ui-800-3-457bc7baebb9</link><guid>https://rsmith.co/netflix-error-ui-800-3-457bc7baebb9</guid><description>
&lt;section&gt;&lt;div&gt;&lt;hr/&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;p id="d983"&gt;If you have a Samsung Smart TV, the official docs for this error recommend resetting the smart hub. Doing this resets all your apps, meaning you’ll have to setup and sign-in to each. A pain.&lt;/p&gt;&lt;p id="0b12"&gt;Instead, when the error appears —&lt;strong&gt; click “details”, then “reset” &lt;/strong&gt;— which will clear all of Netflix’s settings, and then you can just sign-in again.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;
</description><pubDate>Fri, 13 May 2022 23:37:24 +0000</pubDate></item><item><title>Auto Auction Life</title><link>https://rsmith.co/auto-auction-life-ce9f01b4af54</link><guid>https://rsmith.co/auto-auction-life-ce9f01b4af54</guid><description>&lt;p id="5d27"&gt;Side projects are fun, especially when they scratch a personal itch. &lt;a href="https://rsmith.co/bring-a-trailer-map-d5983c0d5bba"&gt;Bring-a-trailer-map&lt;/a&gt; is such a side project; starting as a map, it’s now evolved.&lt;/p&gt;&lt;p id="1f15"&gt;Welcome, Auto Auction Life:&lt;/p&gt;&lt;figure&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/a868e9533abe60435bed.png"/&gt;&lt;figcaption&gt;Map, stats, and listings from more places ^&lt;/figcaption&gt;&lt;/figure&gt;&lt;p id="9530"&gt;The major changes are:&lt;/p&gt;&lt;p id="f194"&gt;Firstly, supporting more auction sites; Bring a Trailer is by far the biggest at the time of writing 374 of 464! 🚀 but it’s not the only place interesting vehicles are found. I’ve added support for;&lt;/p&gt;&lt;ul&gt;&lt;li id="4f9c"&gt;&lt;a href="https://www.radforsale.com/"&gt;Radforsale&lt;/a&gt; (from Radwood!)&lt;/li&gt;&lt;li id="77dd"&gt;&lt;a href="https://www.zero260.com/"&gt;Zero260&lt;/a&gt;&lt;/li&gt;&lt;li id="28a1"&gt;&lt;a href="https://www.pcarmarket.com/"&gt;PCARMARKET&lt;/a&gt; (as a Porsche fan, I wish I’d found this sooner)&lt;/li&gt;&lt;li id="ba3d"&gt;&lt;a href="https://themarket.co.uk/"&gt;The Market&lt;/a&gt;&lt;/li&gt;&lt;li id="a2e1"&gt;&lt;a href="https://www.collectingcars.com/"&gt;Collecting Cars&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p id="e3ef"&gt;Secondly, making region specific pages showing live AND completed listings, plus geo-locating things nicely. Previously, finding stuff near you was much harder — now likely you can just bookmark one page.&lt;/p&gt;&lt;p id="7e6c"&gt;I’m based in Nevada now; so this &lt;a href="https://autoauction.life/united-states/nevada/"&gt;https://autoauction.life/united-states/nevada/&lt;/a&gt; — makes seeing what’s for sale locally 100x easier:&lt;/p&gt;&lt;figure&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/16585832e89281aec381.png"/&gt;&lt;figcaption&gt;Current / completed listings for Nevada!&lt;/figcaption&gt;&lt;/figure&gt;&lt;p id="d6ac"&gt;And for fun, here are some of the amazing things I found whilst checking it:&lt;/p&gt;&lt;figure&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/a7b1855787bef40c7e56.png"/&gt;&lt;figcaption&gt;A turbine powered street-rail! &lt;a href="https://bringatrailer.com/listing/2018-transturbine-street-rail/"&gt;https://bringatrailer.com/listing/2018-transturbine-street-rail/&lt;/a&gt;&lt;/figcaption&gt;&lt;/figure&gt;&lt;figure&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/67535ed5ce05460107e3.png"/&gt;&lt;figcaption&gt;Sweet looking custom Unimog overland rig &lt;a href="https://bringatrailer.com/listing/1979-mercedes-benz-unimog-416-3/"&gt;https://bringatrailer.com/listing/1979-mercedes-benz-unimog-416-3/&lt;/a&gt;&lt;/figcaption&gt;&lt;/figure&gt;&lt;figure&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/799823102b8795a67f10.png"/&gt;&lt;figcaption&gt;A 355 Challenge Evolution — road legal, in the UK — &lt;a href="https://collectingcars.com/for-sale/1996-ferrari-355-challenge-evolution"&gt;https://collectingcars.com/for-sale/1996-ferrari-355-challenge-evolution&lt;/a&gt;&lt;/figcaption&gt;&lt;/figure&gt;&lt;figure&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/62b8e3680961f43882c8.png"/&gt;&lt;figcaption&gt;A Mercedes 280SL — a classic looking thing and one I’d love to own one day!— &lt;a href="https://themarket.co.uk/listings/mercedes-benz/230sl/8f9906ae-29fa-4465-a592-4c0307ef5318"&gt;https://themarket.co.uk/listings/mercedes-benz/230sl/8f9906ae-29fa-4465-a592-4c0307ef5318&lt;/a&gt;&lt;/figcaption&gt;&lt;/figure&gt;&lt;p id="7d01"&gt;If there are any feature requests or questions, just let me know!&lt;/p&gt;</description><pubDate>Sun, 23 May 2021 19:37:12 +0000</pubDate></item><item><title>Bring a trailer…map.</title><link>https://rsmith.co/bring-a-trailer-map-d5983c0d5bba</link><guid>https://rsmith.co/bring-a-trailer-map-d5983c0d5bba</guid><description>&lt;p id="96f5"&gt;If you’ve not heard of &lt;a href="http://www.bringatrailer.com"&gt;BringATrailer.com&lt;/a&gt;, then you’ll likely not be into cars too heavily. It’s a pretty simple concept — an auction site specifically for cars; they tend to be on the older and more unique end of the spectrum. A couple of examples:&lt;/p&gt;&lt;figure&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/b4d1bb67fc6a980e8770.png"/&gt;&lt;figcaption&gt;&lt;a href="https://bringatrailer.com/listing/1963-morris-traveller-2/"&gt;1963 Morris Minor Traveller&lt;/a&gt; — pretty rare, but I remember seeing a friends mom driving one as a kid&lt;/figcaption&gt;&lt;/figure&gt;&lt;figure&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/bcb3c91eb386afbafe52.png"/&gt;&lt;figcaption&gt;A &lt;a href="https://bringatrailer.com/listing/2009-honda-s2000-4/"&gt;Honda S2000&lt;/a&gt;…with 91 miles; somehow I really want one, and lust after this one. However, it’s too nice and at $70k, I couldn’t justify driving it.&lt;/figcaption&gt;&lt;/figure&gt;&lt;p id="c9e4"&gt;It’s an eclectic mix, but one where most car lovers would find something interesting. However, for me, the lack of a map has been a itch I’ve wanted to scratch (a few other users have asked) for a while.&lt;/p&gt;&lt;p id="70f1"&gt;So, I built one. Every 20m, I pull a single page and then update all of the auctions, generate a &lt;a href="https://www.mapbox.com"&gt;map&lt;/a&gt; and put the latest pricing and title for each listing. The result is a map you can zoom around and easily find interesting local auctions.&lt;/p&gt;&lt;figure&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/3d220fe4fb9ca0cf71e9.png"/&gt;&lt;figcaption&gt;Today I just noticed there is an &lt;a href="https://bringatrailer.com/listing/1991-bmw-m3-16/"&gt;E30 M3&lt;/a&gt; close to me!&lt;/figcaption&gt;&lt;/figure&gt;&lt;p id="a490"&gt;Check it out here: &lt;a href="https://bringatrailermap.rsmith.co/"&gt;https://bringatrailermap.rsmith.co/&lt;/a&gt;&lt;/p&gt;&lt;h2 id="65d8"&gt;How does it work?&lt;/h2&gt;&lt;p id="65bf"&gt;It’s pretty hacky (but, that’s ok):&lt;/p&gt;&lt;ol&gt;&lt;li id="299c"&gt;every 20m, pull the &lt;a href="https://bringatrailer.com/auctions/"&gt;https://bringatrailer.com/auctions/&lt;/a&gt; page&lt;/li&gt;&lt;li id="2344"&gt;use ruby to process it, and split it in to individual auctions and save them in a folder as JSON&lt;/li&gt;&lt;li id="d69c"&gt;separately process those into GeoJSON and build a static page. It uses &lt;a href="https://medium.com/u/5691029a1e6a?source=post_page-----d5983c0d5bba--------------------------------"&gt;Mapbox&lt;/a&gt; for the actual map, and is basically a customized version of &lt;a href="https://docs.mapbox.com/help/tutorials/custom-markers-gl-js/"&gt;this tutorial&lt;/a&gt; they have.&lt;/li&gt;&lt;li id="d51f"&gt;add it all to git, and push to github (so, I can track changes over time to auctions — though I’m doing much with that right now)&lt;/li&gt;&lt;li id="50e7"&gt;&lt;a href="https://medium.com/u/5250f9d9bd2f?source=post_page-----d5983c0d5bba--------------------------------"&gt;Netlify&lt;/a&gt; sees the push to gihub, then deploys the pre-built static site&lt;/li&gt;&lt;/ol&gt;</description><pubDate>Thu, 28 Feb 2019 22:01:31 +0000</pubDate></item><item><title>Bad vs Good metrics</title><link>https://rsmith.co/bad-vs-good-metrics-542f9bd0358</link><guid>https://rsmith.co/bad-vs-good-metrics-542f9bd0358</guid><description>&lt;hr/&gt;&lt;figure id="a30b"&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/e84855fc802e65fe55f7.jpeg"/&gt;&lt;figcaption&gt;Don’t choose bad metrics. &lt;a href="https://www.flickr.com/photos/circasassy/7858155676/"&gt;Image&lt;/a&gt; by &lt;a href="https://www.flickr.com/photos/circasassy/"&gt;CircaSassy&lt;/a&gt;.&lt;/figcaption&gt;&lt;/figure&gt;&lt;p id="b3d2"&gt;&lt;em&gt;This is part of a series of posts taken from me moderating a group for &lt;/em&gt;&lt;a href="https://medium.com/@ycombinator"&gt;&lt;em&gt;Y Combinator&lt;/em&gt;&lt;/a&gt;&lt;em&gt; Startup School. If you’d like more, please follow me.&lt;/em&gt;&lt;/p&gt;&lt;p id="5cf4"&gt;This was originally posted to the forum the school uses. Some background for those of you not in &lt;a href="https://www.startupschool.org/"&gt;Startup School&lt;/a&gt;, the startups in the program have to pick and report on metrics each week.&lt;/p&gt;&lt;hr/&gt;&lt;p id="6c6a"&gt;Picking a good metric to track is important. Bad metrics can let you focus on the wrong thing. Example “weeks til launch” just counts down — 4 or 5 companies in my group are using this; it says nothing about how important what you’re doing is or what the improvement is over time.&lt;/p&gt;&lt;p id="e1a3"&gt;Pick something that matters to your business: generally this will be something revenue focused (ARR, MRR, $, retention, renewal, etc) or customer focused (DAU, MAU, new users, some-activity, etc).&lt;/p&gt;&lt;p id="7858"&gt;If you’re reporting on a metric that doesn’t fit in the above two, you should double check it actually matters, and that you’re using it to focus on the right thing.&lt;/p&gt;&lt;p id="e4d7"&gt;Focus on what improves things for your business.&lt;/p&gt;&lt;p id="d95a"&gt;If you’re tracking weeks until launch, this just means these metrics are likely zero for that period.&lt;/p&gt;&lt;p id="7a2a"&gt;One key thing should &lt;strong&gt;all&lt;/strong&gt; be tracking is your burn rate. You should use this to know if you’re &lt;a href="http://paulgraham.com/aord.html"&gt;default alive or default dead&lt;/a&gt;.&lt;/p&gt;&lt;p id="ff2c"&gt;What metrics are you tracking? How are you going to get your first customers?&lt;/p&gt;&lt;hr/&gt;&lt;p id="009e"&gt;Finally, some picks from the original thread:&lt;/p&gt;&lt;p id="5bcc"&gt;&lt;a href="https://medium.com/@nolimits"&gt;Adora Cheung&lt;/a&gt; suggested —&lt;/p&gt;&lt;blockquote id="d4ae"&gt;If you haven’t launched yet, you should be figuring how to get customer #1 asap. That is, release the most minimal version of your product that will make at least one user happy. This never involves elaborate launch plans.&lt;/blockquote&gt;&lt;p id="8a92"&gt;Also, &lt;a href="https://medium.com/@alexhowlett"&gt;Alex Howlett&lt;/a&gt; raised a great point about focusing on the wrong metric; it can lead you away from your original target:&lt;/p&gt;&lt;blockquote id="01b2"&gt;“When a measure becomes a target, it ceases to be a good measure.”&lt;/blockquote&gt;&lt;blockquote id="fb9f"&gt;&lt;a href="https://en.wikipedia.org/wiki/Goodhart%27s_law"&gt;https://en.wikipedia.org/wiki/Goodhart's_law&lt;/a&gt;&lt;/blockquote&gt;&lt;blockquote id="1429"&gt;To what extent are people’s various metrics vulnerable to Goodhart’s Law? Mine is extremely vulnerable.&lt;/blockquote&gt;&lt;blockquote id="a069"&gt;My metric is the number of subscribers I have for a YouTube channel. It’s only indirectly related to my project, but still an important indicator of how receptive people will be to the kind of stuff I’m working on. If I just tried to push people to subscribe to my YouTube channel, it wouldn’t really tell me much.&lt;/blockquote&gt;&lt;hr/&gt;&lt;p id="e8ea"&gt;Metrics post’s that are good to read:&lt;/p&gt;&lt;ul&gt;&lt;li id="7c7a"&gt;&lt;a href="https://a16z.com/2015/08/21/16-metrics/"&gt;https://a16z.com/2015/08/21/16-metrics/&lt;/a&gt;&lt;/li&gt;&lt;li id="6b18"&gt;&lt;a href="https://neilpatel.com/blog/9-metrics/"&gt;https://neilpatel.com/blog/9-metrics/&lt;/a&gt;&lt;/li&gt;&lt;li id="6591"&gt;&lt;a href="https://techcrunch.com/2017/02/04/12-kpis-you-must-know-before-pitching-your-startup/"&gt;https://techcrunch.com/2017/02/04/12-kpis-you-must-know-before-pitching-your-startup/&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;</description><pubDate>Wed, 05 Sep 2018 01:24:15 +0000</pubDate></item><item><title>Startup School 2018</title><link>https://rsmith.co/startup-school-2018-72dd00207b4c</link><guid>https://rsmith.co/startup-school-2018-72dd00207b4c</guid><description>&lt;p id="348b"&gt;For the second time running, I’m giving time to moderate a group for &lt;a href="https://medium.com/u/cb8adc841a29?source=post_page-----72dd00207b4c--------------------------------" rel="noopener" target="_blank"&gt;Y Combinator&lt;/a&gt;’s Startup School. If you’re unfamiliar, it’s a 10-week online course starting on the 28th of August. This time my group will be Group 58.&lt;/p&gt;
&lt;p id="17b0"&gt;A few things have changed since last time — notably there is now $10k for 100 companies that complete the course, along with some great exclusive deals for credits. Also due to some issues, &lt;a href="https://blog.ycombinator.com/startup-school-every-company-that-applied-is-now-accepted/" rel="noopener ugc" target="_blank"&gt;YC accepted all applicants&lt;/a&gt;!&lt;/p&gt;
&lt;p id="6819"&gt;If you’re in a group, here are some of the things you’re required to do to complete Startup School and be eligible for a chance at the $10k:&lt;/p&gt;
&lt;ol&gt;&lt;li id="e550"&gt;Watch the lectures each week.&lt;/li&gt;&lt;li id="45ed"&gt;Attend most office hours.&lt;/li&gt;&lt;li id="d805"&gt;Submit weekly progress updates. Specifically before 11:59pm PST each Tuesday.&lt;/li&gt;&lt;li id="6251"&gt;Read and abide by the &lt;a href="https://www.ycombinator.com/ethics/" rel="noopener ugc" target="_blank"&gt;Founder Ethics&lt;/a&gt; policy.&lt;/li&gt;&lt;/ol&gt;
&lt;p id="5333"&gt;Things to note for my group specifically:&lt;/p&gt;
&lt;ol&gt;&lt;li id="a177"&gt;Welcome! It’s going to be fun — I’m looking forward to doing this again!&lt;/li&gt;&lt;li id="2650"&gt;All times that I list will be in PST unless explicitly noted otherwise.&lt;/li&gt;&lt;li id="d1e2"&gt;I’m putting in three hours of my time per week — I’m mostly in the PST timezone.&lt;/li&gt;&lt;/ol&gt;
&lt;p id="ce27"&gt;And lastly some general lessons from last batch:&lt;/p&gt;
&lt;ol&gt;&lt;li id="c63f"&gt;It’s not a competition to look good — bring your real issues and the group and I can try to help solve them&lt;/li&gt;&lt;li id="65db"&gt;Speak up — don’t be afraid to jump in with an opinion. Silently lurking on a call isn’t useful to the group. If English isn’t your first language, don’t worry — people will be patient and you’re unlikely to be alone.&lt;/li&gt;&lt;li id="595d"&gt;Use the forum (see: #1 / #2)&lt;/li&gt;&lt;li id="254d"&gt;Actually watch the lectures, attend office hours and send your updates — I won’t (can’t?) fix these retrospectively.&lt;/li&gt;&lt;li id="5f0b"&gt;I’m not going to have much time for 1:1 help, but will of course try. I’m around in PST mainly, from ~7am to midnight.&lt;/li&gt;&lt;/ol&gt;
&lt;p id="ddef"&gt;Finally, a little about me for those that are curious. I’m and English guy, living in San Francisco - I’m co-founder and CTO at &lt;a href="https://medium.com/u/4d3e94ab63a1?source=post_page-----72dd00207b4c--------------------------------" rel="noopener" target="_blank"&gt;Rainforest QA&lt;/a&gt;, we’re working the next generation of Quality Assurance. We’ve raised &amp;gt; $40mm and are ~140 strong team wise. &lt;a href="https://medium.com/u/fc9daa7e0103?source=post_page-----72dd00207b4c--------------------------------" rel="noopener" target="_blank"&gt;Fred Stevens-Smith&lt;/a&gt; and I were in the Summer 2012 &lt;a href="https://medium.com/u/cb8adc841a29?source=post_page-----72dd00207b4c--------------------------------" rel="noopener" target="_blank"&gt;Y Combinator&lt;/a&gt; batch, which at the time was one of the biggest before a restructure; having said that it was still a single (long) demo-day! Personally, I’m in to programming (Crystal, Ruby, and Go mainly), cooking, and racing cars badly.&lt;/p&gt;
&lt;p id="1d84"&gt;Feel free to connect with me:&lt;/p&gt;
&lt;ul&gt;&lt;li id="585c"&gt;&lt;a href="https://github.com/ukd1" rel="noopener ugc" target="_blank"&gt;https://github.com/ukd1&lt;/a&gt;&lt;/li&gt;&lt;li id="50fd"&gt;&lt;a href="https://twitter.com/rhs" rel="noopener ugc" target="_blank"&gt;https://twitter.com/rhs&lt;/a&gt;&lt;/li&gt;&lt;li id="c6c2"&gt;&lt;a href="https://www.linkedin.com/in/russellhowardsmith/" rel="noopener ugc" target="_blank"&gt;https://www.linkedin.com/in/russellhowardsmith/&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;</description><pubDate>Tue, 28 Aug 2018 00:00:00 +0000</pubDate></item><item><title>Compliance Requirements vs Sales Objections</title><link>https://rsmith.co/compliance-requirements-vs-sales-objections-d915f360172c</link><guid>https://rsmith.co/compliance-requirements-vs-sales-objections-d915f360172c</guid><description>
&lt;section&gt;&lt;div&gt;&lt;hr/&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;p id="fe48"&gt;&lt;em&gt;TLDR: don’t solve sales objections with formal compliance standards, it’ll burden your team forever when you can often provide something simpler.&lt;/em&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;&lt;section&gt;&lt;div&gt;&lt;hr/&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;p id="18de"&gt;I recently had a call with a portfolio company of one of our investors — they were interested in hearing about &lt;a href="https://medium.com/u/4d3e94ab63a1"&gt;Rainforest QA&lt;/a&gt;’s journey to become HIPAA compliant. Of course, the first questions I asked was why?&lt;/p&gt;&lt;p id="eb60"&gt;After a few minutes, I realized that this probably wasn’t what they should be doing - it was a sales-objection, not a requirement. Was this common? It turns out yes. I spoke to a friend who runs a well known security consultancy, and they said:&lt;/p&gt;&lt;blockquote id="a15f"&gt;Funny you should ask, I’m in the middle of helping a company in Boston get a SOC 2 that absolutely doesn’t need it yet; they will have to pay to maintain the paperwork for the foreseeable future - essentially blowing $150k/year so a sales person can land a $5k commission.&lt;/blockquote&gt;&lt;p id="d776"&gt;Security, sales objections and compliance are three different things that are often conflated. So, what’s the difference?&lt;/p&gt;&lt;p id="d4c5"&gt;Sales objections are solvable without being compliant. If you step back and think about what a customer is asking, they are usually trying to protect themselves — if your company messes up, gets hacked, loses their data, it’s likely their ass on the line. If they’ve not checked that you treat security properly and something happens, this isn’t good for them — they’ll get fired.&lt;/p&gt;&lt;p id="6ff0"&gt;Why not just implement one standard or another?&lt;/p&gt;&lt;p id="b4b2"&gt;Aside from the (often large) distraction, time and money to get compliant and certified in the first place, the major reason to avoid new standards is the on-going maintenance costs. This comes in two forms:&lt;/p&gt;&lt;p id="87af"&gt;&lt;strong&gt;Process overhead&lt;/strong&gt; — with most formal security compliance requirements, there is a lot of process to put in place, and maintain. This adds overhead to everything involved, will limit who-can-do-what and sometimes when. This slows your team down.&lt;/p&gt;&lt;p id="8d8a"&gt;&lt;strong&gt;Technical requirements&lt;/strong&gt; — similar to process; there are usually technical changes too. Keeping up with the latest of these, making sure no changes break this, reporting any that do is a lot of work — even after your initial implementation.&lt;/p&gt;&lt;blockquote id="c71b"&gt;&lt;strong&gt;Remember:&lt;/strong&gt;&lt;br/&gt;The more things you become complaint for, the more process there is. The more process, the slower and more expensive it is to ship new features, build and maintain your product, and hire.&lt;/blockquote&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;&lt;section&gt;&lt;div&gt;&lt;hr/&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;p id="5002"&gt;So, instead of implementing new certifications — you should try and get to the root of the issue with your customer. Is this a hard compliance requirement — is the customer wanting to store PHI? financial data? — or the customer trying to cover their ass generally. If the latter, try offering security audits, external or not instead.&lt;/p&gt;&lt;p id="cf0f"&gt;Should a sales objection become a hard requirement, be sure to assess the size of the deal at hand and avoid the trap of believing some certification opens up a whole new market. It might, but you should always try and prove it before hamstringing your whole company.&lt;/p&gt;&lt;p id="1cce"&gt;In closing, I’m really not suggesting that you or your company shouldn’t take security or compliance seriously — just that they’re different but related things. Don’t solve security objections or requirements with external compliance certifications, the on-going burdens are only worth it when required and shouldn’t be treated lightly.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;
</description><pubDate>Fri, 08 Dec 2017 23:42:58 +0000</pubDate></item><item><title>Setting up &amp; Testing a Bitcoin Hardware Wallet Properly</title><link>https://rsmith.co/setting-up-testing-a-bitcoin-hardware-wallet-properly-ed2771c9c2fc</link><guid>https://rsmith.co/setting-up-testing-a-bitcoin-hardware-wallet-properly-ed2771c9c2fc</guid><description>
&lt;section&gt;&lt;div&gt;&lt;hr/&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;p id="3719"&gt;I’ve been asked a few times by friends how to setup a hardware wallet for crypto “&lt;em&gt;properly&lt;/em&gt;”. There are many different ways to do this, but this is the best way I’ve found so far. So what’s the aim of doing this?&lt;/p&gt;&lt;blockquote id="9823"&gt;For one to be confident if a hardware wallet is lost or stolen, that the coins are recoverable!&lt;/blockquote&gt;&lt;p id="d0dc"&gt;Stepping back a bit, and to give some background - why would one want a hardware wallet in the first place? Well good question.&lt;/p&gt;&lt;p id="ed0a"&gt;If you have enough coins, then you might want to consider it as a type of &lt;a href="https://en.bitcoin.it/wiki/Cold_storage"&gt;Cold storage&lt;/a&gt;, for more security, over just keeping it on your computer (aka Hot storage). The main reason for this over other methods of cold-storage is that it gives you a lot of the security of an offline wallet (harder to hack compared to one on your computer), but is way more practical to use: i.e. you can use it to send transactions without having to import your whole offline/&lt;a href="https://en.bitcoin.it/wiki/Paper_wallet"&gt;paper wallet&lt;/a&gt; somewhere, or run a totally &lt;a href="https://bitkey.io/"&gt;air-gapped rig&lt;/a&gt; and move the sig over to an internet connected one.&lt;/p&gt;&lt;figure id="587a"&gt;&lt;img alt="" loading="lazy" src="https://rsmith.co/assets/media/a204aa229fccf693555a.jpeg"/&gt;&lt;figcaption&gt;A Ledger Nano S approving (aka signing) a transaction&lt;/figcaption&gt;&lt;/figure&gt;&lt;p id="1a0c"&gt;How secure are hardware wallets? Pretty secure apparently — here is great quote from the bitcoin.it hardware wallet page:&lt;/p&gt;&lt;blockquote id="92c3"&gt;To date there have been no verifiable incidents of Bitcoins stolen from hardware wallets. Hardware wallets are relatively new, but at least for the time being they have maintained a good track record, unlike the numerous incidents of Bitcoin theft from Internet-connected computers.&lt;/blockquote&gt;&lt;p id="1a09"&gt;I’ve also been asked “what happens if you lose your ledger or it’s stolen?”. Well, not much. If someone steals it, they’d also have to guess the pin-code within a few attempts — otherwise it resets and deletes the keys. If you’ve got a backup of your key, all is fine — your funds are safe (though, I would move them and start fresh asap). Interestingly, there are some &lt;a href="http://support.ledgerwallet.com/knowledge_base/topics/how-to-setup-a-passphrase-and-an-alternate-pin"&gt;recent options for having an alternate passphrase&lt;/a&gt;, which could help against someone trying to physically extract your pin from you (i.e. hitting you with a wrench)! From Ledger:&lt;/p&gt;&lt;blockquote id="9308"&gt;Our recommendation is to use your current PIN for your day to day accounts, holding reasonable assets, and your alternate PIN for your savings account, holding higher value assets. This way, not only will your backup seed be protected by the passphrase, but your “duress” PIN will in fact be a real account will real transactions. This would be much more effective in a plausible deniability scenario.&lt;/blockquote&gt;&lt;p id="6160"&gt;If you want to learn more about cold storage and hardware wallets, a good starting point is reading:&lt;/p&gt;&lt;ul&gt;&lt;li id="c208"&gt;&lt;a href="https://en.bitcoin.it/wiki/Cold_storage"&gt;https://en.bitcoin.it/wiki/Cold_storage&lt;/a&gt; — options for cold storage&lt;/li&gt;&lt;li id="1a72"&gt;&lt;a href="https://en.bitcoin.it/wiki/Hardware_wallet"&gt;https://en.bitcoin.it/wiki/Hardware_wallet&lt;/a&gt; — more about the different hardware wallets available&lt;/li&gt;&lt;/ul&gt;&lt;p id="18dc"&gt;So lets get to it. For this post, I’m going to assume you have a &lt;a href="https://www.ledgerwallet.com/products/ledger-nano-s"&gt;Ledger Nano S&lt;/a&gt;, but this general procedure should be applicable to most. Like with backups, if you don’t test them, they may fail you just when you need them most.&lt;/p&gt;&lt;p id="26eb"&gt;The procedure:&lt;/p&gt;&lt;ol&gt;&lt;li id="b829"&gt;If you’re extra paranoid, e.g. you bought from sketchy Amazon reseller or just found one on the street — &lt;a href="http://support.ledgerwallet.com/knowledge_base/topics/how-to-verify-the-security-integrity-of-my-nano-s"&gt;verify it’s the expected hardware&lt;/a&gt;.&lt;/li&gt;&lt;li id="68ef"&gt;Setup the wallet using the &lt;a href="http://support.ledgerwallet.com/knowledge_base/topics/how-to-start-with-ledger-nano-s"&gt;default method&lt;/a&gt; (or &lt;a href="http://support.ledgerwallet.com/knowledge_base/topics/how-to-setup-a-passphrase-and-an-alternate-pin"&gt;alternate-pin-method&lt;/a&gt;), write down your key (paper, or separate offline computer with &lt;a href="https://www.gnupg.org/"&gt;GPG&lt;/a&gt;).&lt;/li&gt;&lt;li id="92b1"&gt;&lt;a href="http://support.ledgerwallet.com/knowledge_base/topics/how-to-receive-payments-on-my-nano-s-where-can-i-find-my-bitcoin-address"&gt;Send a small amount of your chosen coin&lt;/a&gt; to it, say $1.&lt;/li&gt;&lt;li id="e09a"&gt;Verify receipt of said coin.&lt;/li&gt;&lt;li id="daea"&gt;&lt;a href="http://support.ledgerwallet.com/knowledge_base/topics/how-to-erase-my-wallet-or-reset-my-nano-s"&gt;Factory reset your hardware wallet.&lt;/a&gt;&lt;/li&gt;&lt;li id="5870"&gt;Attempt &lt;a href="http://support.ledgerwallet.com/knowledge_base/topics/how-to-import-slash-recover-a-backup-on-a-nano-s"&gt;restore using the key you wrote down&lt;/a&gt; in step 1, then check your balance again. Nothing should have changed.&lt;/li&gt;&lt;/ol&gt;&lt;p id="9e36"&gt;If this all works, you can be confident if you loose your wallet, but don’t loose your key, you can recover it to either a new hardware wallet, or a software wallet using the same key standard.&lt;/p&gt;&lt;p id="e32f"&gt;If it doesn’t, it likely means you didn’t write down your key properly.&lt;/p&gt;&lt;p id="4bcf"&gt;The last step is to store the key securely and periodically test restoring it using the same procedure as above. Personally, I GPG it and then store it in a few places, rather than a paper backup — but this is a personal choice.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;
</description><pubDate>Mon, 18 Sep 2017 23:46:16 +0000</pubDate></item><item><title>The (actual) art of over-engineering your side projects</title><link>https://rsmith.co/the-actual-art-of-over-engineering-your-side-projects-2af6326060bb</link><guid>https://rsmith.co/the-actual-art-of-over-engineering-your-side-projects-2af6326060bb</guid><description>&lt;p id="d3c2"&gt;This morning I read this post — “&lt;a href="https://elsyms.com/the-art-of-over-engineering-your-side-projects/" rel="noopener"&gt;The art of over-engineering your side projects&lt;/a&gt;” — and I think it’s missing a few things. Liam’s post covers (imho) what it takes to have a successful side project that-might-be-a-actual-thing-one-day, but not necessarily a fun one.&lt;/p&gt;
&lt;p id="5ce2"&gt;Think about why you’re doing a side project. Is it for fun? Learning? Shipping something that might be an actual thing? Depending on why you’re doing it depends on how you should approach it. Most of mine are for fun and learning. So with that my rules for side projects;&lt;/p&gt;
&lt;ol&gt;&lt;li id="7ab6"&gt;Keep them fun&lt;/li&gt;&lt;li id="d092"&gt;Keep them simple&lt;/li&gt;&lt;li id="dcd4"&gt;Be different to what you do day to day (aka, an excuse to try that new-shiny-thing no one at work would love you for)&lt;/li&gt;&lt;/ol&gt;
&lt;p id="2dda"&gt;Lets break down Liam’s post a little.&lt;/p&gt;
&lt;h1 id="f2a4"&gt;Mistake 1 — Project managing&lt;/h1&gt;
&lt;p id="8985"&gt;Unless you’re actually trying to ship something, avoid this. It’s a waste of time, and normally not fun.&lt;/p&gt;
&lt;h1 id="ca51"&gt;Mistake 2 — Over-architecting infrastructure&lt;/h1&gt;
&lt;blockquote&gt;&lt;p id="c3da"&gt;&lt;em&gt;So many people are guilty of over-architecting their application’s infrastructure before they even have that application in a state for it to be deployed!&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p id="10cb"&gt;Turns out, this is fun and a good way to experiment with ideas. For instance; if you’re not allowed to use Docker at work yet, why not see what it’s like? It’s not the same as running in production, sure, but next time your boss asks about it, you can give some better feedback about what sucks (or doesn’t). Perhaps you’ll get that project too.&lt;/p&gt;
&lt;h1 id="b2cc"&gt;Mistake 3 — Worrying about “tech stacks”&lt;/h1&gt;
&lt;blockquote&gt;&lt;p id="c320"&gt;The majority of software engineers seem to be under the illusion that potential customers care about the stack they are running. They don’t. A customer will not know or care if you are using Ruby, Go, PHP or any other language as long as what you have written is performant and is fit for purpose (which all modern languages are).&lt;/p&gt;&lt;p id="2d41"&gt;&lt;strong&gt;Solution: Write in a language that suits the task at hand and one that you are comfortable/experienced with.&lt;/strong&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p id="c4af"&gt;If your goal is to get it done fast and on some kinda actual timeline, sure. But where is the fun in that. It’s true, customers don’t likely care what you’re using…(unless it’s downloaded…).&lt;/p&gt;
&lt;p id="3fb3"&gt;For this, I’d encourage you to mix it up once in a while. Using a new language is good for you. I’ve recently fallen in love with Crystal (&lt;a href="https://crystal-lang.org/" rel="noopener"&gt;https://crystal-lang.org/&lt;/a&gt;) through a side project. It was the same with Go a while back, and we now use that extensively in production at &lt;a href="https://medium.com/u/4d3e94ab63a1?source=post_page-----2af6326060bb--------------------------------" rel="noopener" target="_blank"&gt;Rainforest QA&lt;/a&gt;. Same with Elixir. In-fact, even Ruby.&lt;/p&gt;
&lt;h1 id="34da"&gt;Mistake 4 — Creating custom frameworks&lt;/h1&gt;
&lt;blockquote&gt;&lt;p id="cab2"&gt;Bootstrap? Too basic. Materialize? Too fat. Foundation? Nah. Better create my own.&lt;/p&gt;&lt;p id="e777"&gt;A made up statement, but relatively common nevertheless. I have many-a-time started a new project, thought the statement previously and set out writing my own framework. By the time I had completed it, I no longer had any desire to work on the project I had thought of in the first place.&lt;/p&gt;&lt;p id="9a7b"&gt;&lt;strong&gt;Solution: Use frameworks and customise them — only refactor/build your own when absolutely neccessary (and when you have appropriate metrics).&lt;/strong&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p id="d986"&gt;I kinda agree. But; I’ve made this mistake before end turns out it’s fun and you learn stuff. So…eh.&lt;/p&gt;
&lt;h1 id="798b"&gt;Mistake 5 — Continuously delivering nothing&lt;/h1&gt;
&lt;blockquote&gt;&lt;p id="5b18"&gt;Similar to the way you can easily over-architect your infrastructure, it’s extremely easy to over-architect your continuous delivery practices &lt;em&gt;before&lt;/em&gt; you have anything to deliver! Jenkins, Drone, Travis are all great tools — but you shouldn’t spend time configuring them until you have a working MVP.&lt;/p&gt;&lt;p id="e513"&gt;&lt;strong&gt;Solution: Build your project first — then worry about continuous delivery.&lt;/strong&gt;&lt;/p&gt;&lt;p id="d99f"&gt;It’s easy to believe you’re doing the best for your project by doing the above things but you aren’t. The best thing you can do for your project is to market, market, market, and then do a bit of development.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p id="7538"&gt;Meh. CI is super easy to get setup; it’s a one time thing and stops you falling (inevitably) into shitty habits you’ll have to fix later. Just use Circle CI and Heroku unless you can’t or you don’t wanna spend $7/mo.&lt;/p&gt;</description><pubDate>Fri, 01 Sep 2017 00:00:00 +0000</pubDate></item><item><title>Fun with Toshi: Building a Simple Ethereum Faucet Dapp</title><link>https://rsmith.co/fun-with-toshi-building-a-simple-ethereum-faucet-9a9f43aabd0a</link><guid>https://rsmith.co/fun-with-toshi-building-a-simple-ethereum-faucet-9a9f43aabd0a</guid><description>&lt;p id="f8d1"&gt;I’ve been following &lt;a href="https://medium.com/u/b9034df3e57a?source=post_page-----9a9f43aabd0a--------------------------------"&gt;Coinbase&lt;/a&gt;’s &lt;a href="https://medium.com/u/32a7eeb3e4cf?source=post_page-----9a9f43aabd0a--------------------------------"&gt;Toshi&lt;/a&gt; for a while — but never built anything. If you’re unfamiliar with Toshi, it’s a hybrid of a wallet, app platform and secure messenger — available for iOS and Android. Checkout &lt;a href="https://blog.toshi.org/introducing-token-2f2ceeab6d4c"&gt;this post&lt;/a&gt; if you want more detail.&lt;/p&gt;&lt;blockquote&gt;&lt;p id="8b75"&gt;Building simple apps on &lt;a href="https://medium.com/u/d626b3859bc9?source=post_page-----9a9f43aabd0a--------------------------------"&gt;ethereum&lt;/a&gt; has — at least for me — been daunting to get started with. However, it turns out it’s super easy with Toshi.&lt;/p&gt;&lt;/blockquote&gt;&lt;p id="0d76"&gt;How did I get over this daunting-ness? Well of course I started by finding a tutorial. This meant following the &lt;em&gt;pretty great&lt;/em&gt; docs and tutorial over at &lt;a href="https://developers.toshi.org/docs/creating-a-token-app"&gt;https://developers.toshi.org/docs/creating-a-token-app&lt;/a&gt; - I ended up building something, testing it and getting it deployed in about 2 hours end to end!&lt;/p&gt;&lt;p id="00fa"&gt;So, what did I build?&lt;/p&gt;&lt;figure&gt;&lt;img alt="Image for post" loading="lazy" src="https://rsmith.co/assets/media/f329ba71413e4e106f0f.jpeg"/&gt;&lt;figcaption&gt;A faucet I found at &lt;a href="https://pixabay.com/p-113399/"&gt;https://pixabay.com/p-113399/&lt;/a&gt;. Imagine it’s &lt;a href="https://medium.com/u/d626b3859bc9?source=post_page-----9a9f43aabd0a--------------------------------"&gt;ethereum&lt;/a&gt; coming out of it. That’s what I made.&lt;/figcaption&gt;&lt;/figure&gt;&lt;p id="ae16"&gt;A super simple &lt;a href="https://medium.com/u/d626b3859bc9?source=post_page-----9a9f43aabd0a--------------------------------"&gt;ethereum&lt;/a&gt; testnet faucet chatbot. It will send you small amounts of tokens, and also thank you if you send it tokens too!&lt;/p&gt;&lt;figure&gt;&lt;img alt="Image for post" loading="lazy" src="https://rsmith.co/assets/media/623781fe42dad479b571.png"/&gt;&lt;figcaption&gt;I built a thing ^ this is what it does.&lt;/figcaption&gt;&lt;/figure&gt;&lt;figure&gt;&lt;pre&gt;&lt;code&gt;function faucet(session) {
  // send $0.10 USD at current exchange rates
  let amt = 0.1

  let count = (session.get('count') || 0) + amt
  session.set('count', count)

  Fiat.fetch().then((toEth) =&amp;gt; {
    session.sendEth(toEth.USD(amt))
    sendMessage(session, `Sent ${amt} 💰🤑💰`)
    sendMessage(session, `FYI you've recieved ${count} eth from the me so far 😎`)
  })
}&lt;/code&gt;&lt;/pre&gt;&lt;figcaption&gt;&lt;a href="https://gist.github.com/ukd1/2314c6d3350f6e9bece47a1bad91113c"&gt;faucet.js · source&lt;/a&gt;&lt;/figcaption&gt;&lt;/figure&gt;&lt;p id="03aa"&gt;So, lets look at some code — this part sends the current user $0.10 in Eth, records the total amount sent to them and then sends them a little message with some stats.&lt;/p&gt;&lt;p id="ead4"&gt;As you can see it’s pretty simple Javascript.&lt;/p&gt;&lt;p id="f4fd"&gt;A key part is the session object which you pass around and helps you work out who you’re talking to. It allows you to set and get persistent state per toshi user. Checkout the code here: &lt;a href="https://github.com/ukd1/toshi-testnet-faucet/blob/master/src/lib/Session.js"&gt;https://github.com/ukd1/toshi-testnet-faucet/blob/master/src/lib/Session.js&lt;/a&gt;&lt;/p&gt;&lt;p id="8bd3"&gt;To be honest, apart from figuring out where things went, installing things and learning some basics it’s super simple. It’s even deployable easily on my favorite place to deploy things — Heroku.&lt;/p&gt;&lt;p id="d35c"&gt;If you’d like to checkout my bot, you can checkout the code at &lt;a href="https://github.com/ukd1/toshi-testnet-faucet"&gt;https://github.com/ukd1/toshi-testnet-faucet&lt;/a&gt; or interact with it direct on Toshi by scanning this code:&lt;/p&gt;&lt;figure&gt;&lt;img alt="Image for post" loading="lazy" src="https://rsmith.co/assets/media/fb69a31bbe55128e5165.png"/&gt;&lt;/figure&gt;&lt;p id="723e"&gt;It’s got me hooked. What will you build on Toshi?&lt;/p&gt;</description><pubDate>Sat, 12 Aug 2017 04:16:48 +0000</pubDate></item><item><title>How to compose Great Meeting Requests</title><link>https://rsmith.co/four-tips-for-great-meeting-requests-3797f7bcfbb5</link><guid>https://rsmith.co/four-tips-for-great-meeting-requests-3797f7bcfbb5</guid><description>&lt;h2 id="980b"&gt;How to make it as easy as possible for someone to say yes to your meeting or call&lt;/h2&gt;&lt;p id="3ee0"&gt;If you’re trying to meet with someone more important than you, or just want a higher chance of someone taking the meeting, these are four tips I’ve found to work well.&lt;/p&gt;&lt;h2 id="8c04"&gt;Be clear about the purpose of the meeting&lt;/h2&gt;&lt;p id="c52f"&gt;Setting clear expectations around meetings makes it easier to justify spending the time on something. For instance;&lt;/p&gt;&lt;blockquote&gt;&lt;p id="8c19"&gt;“I’d like to show you a 15 minute demo of &lt;a href="https://medium.com/u/4d3e94ab63a1?source=post_page-----3797f7bcfbb5--------------------------------"&gt;Rainforest QA&lt;/a&gt; so you have a good understanding of what we do.”&lt;/p&gt;&lt;/blockquote&gt;&lt;p id="ef26"&gt;is much better than&lt;/p&gt;&lt;blockquote&gt;&lt;p id="1b49"&gt;“Do you have time to chat about &lt;a href="https://medium.com/u/4d3e94ab63a1?source=post_page-----3797f7bcfbb5--------------------------------"&gt;Rainforest QA&lt;/a&gt;?”&lt;/p&gt;&lt;/blockquote&gt;&lt;p id="4b57"&gt;Include what you want to do, what they’ll get out of it and the expected time commitment.&lt;/p&gt;&lt;h2 id="d6bd"&gt;Offer a few times that work for you&lt;/h2&gt;&lt;p id="e281"&gt;Avoid “when works for you?”, as anyone that gets a lot of meeting requests hates having to list times that work for them — avoid asking by suggesting a few that work for you pro-actively:&lt;/p&gt;&lt;blockquote&gt;&lt;p id="3e0d"&gt;“I’m free on Monday at 4pm, Tuesday at 11am and Friday at 5:30pm — do any of these work for you?”&lt;/p&gt;&lt;/blockquote&gt;&lt;h2 id="41c5"&gt;Use their timezone if you know or can guess it&lt;/h2&gt;&lt;p id="b6be"&gt;“I’m free on Monday at 4pm” — cool, but which timezone. If you’re not obviously in the same city or area, it can be a problem to work out which 4pm you mean. Avoid the extra back and forth and just use the persons timezone if you can:&lt;/p&gt;&lt;blockquote&gt;&lt;p id="637f"&gt;“I’m free on Tuesday at 2pm EST and Wednesday at 11:30am EST — do either of these work for you?”&lt;/p&gt;&lt;/blockquote&gt;&lt;h2 id="39b1"&gt;When they accept, send a calendar invite with all the details they need to get in touch&lt;/h2&gt;&lt;p id="0d88"&gt;Nothing is worse than having something booked and then missing it or having to reschedule. Ok, exaggeration, but it’s annoying. It can be easily avoided by sending a calendar invite. Make sure you include all the needed details; how to connect if needed, dial in if it’s many people, or just the cell phone you’ll be calling — I really like to add which number I’ll be calling from as well.&lt;/p&gt;</description><pubDate>Fri, 05 May 2017 21:26:07 +0000</pubDate></item><item><title>What are the top challenges as a QA tester in software or web development?</title><link>https://rsmith.co/what-are-the-top-challenges-as-a-qa-tester-in-software-or-web-development-80bf237ad39c</link><guid>https://rsmith.co/what-are-the-top-challenges-as-a-qa-tester-in-software-or-web-development-80bf237ad39c</guid><description>
&lt;section&gt;&lt;div&gt;&lt;hr/&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;p id="fecb"&gt;From what I’ve seen at &lt;a href="https://medium.com/u/4d3e94ab63a1"&gt;Rainforest QA&lt;/a&gt; and before these are the top 5 most common challenges:&lt;/p&gt;&lt;ol&gt;&lt;li id="b749"&gt;Getting good, solid requirements from product or engineering — this is never easy, as the roles of product and engineering aren’t easy; how much detail is too much? how fast can they deliver? does it include all the changes? is it the latest version?&lt;/li&gt;&lt;li id="44fa"&gt;Always being the bottleneck, so not super loved — unless you find a magical way to go faster, this is inevitable a QA team can always be faster, and as long as the quality is higher this is always better.&lt;/li&gt;&lt;li id="d547"&gt;Getting the right environment when needed — relying on other teams (ops, engineering) to get you a test environment is the common situation; so usually there will be some lag or bottleneck here.&lt;/li&gt;&lt;li id="7c9d"&gt;Getting things in to the right state consistently — the more complex your app, the harder this becomes. Setting up state, seeding QA environments is a never ending task, regardless of using automation or manually testing things.&lt;/li&gt;&lt;li id="a07d"&gt;Reporting things in a way that’s repeatable by the engineers. Getting the right tooling in place, so that you have consistent known-state machines will help you here.&lt;/li&gt;&lt;/ol&gt;&lt;p id="8330"&gt;I originally posted this on &lt;a href="https://www.quora.com/What-are-your-top-challenges-as-a-QA-tester-in-software-or-web-development/answer/Russell-Smith-1"&gt;Quora&lt;/a&gt; and then expanded it here! :)&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;
</description><pubDate>Fri, 28 Apr 2017 20:15:28 +0000</pubDate></item><item><title>What is the cost of hosting a website with Google Cloud?</title><link>https://rsmith.co/what-is-the-cost-of-hosting-a-website-with-google-cloud-74e571d5813f</link><guid>https://rsmith.co/what-is-the-cost-of-hosting-a-website-with-google-cloud-74e571d5813f</guid><description>
&lt;section&gt;&lt;div&gt;&lt;hr/&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;p id="5056"&gt;I’ve been asked this a number of times. It’s another “it depends” question. Hosting a website could be near free these days, especially if you’re just serving some HTML and Javascript. However, if your website is &lt;a href="https://www.quora.com/topic/Netflix-product"&gt;Netflix&lt;/a&gt;, then it’s going to cost a lot.&lt;/p&gt;&lt;p id="58df"&gt;So: &lt;em&gt;It depends&lt;/em&gt;.&lt;/p&gt;&lt;p id="421a"&gt;Presuming you’re not Netflix — You should figure it out by trying; guess based on how much you need locally (memory wise, plus cpu wise), then try with that. If it’s “too fast” (haha) then pick a smaller one. Repeat and load test it.&lt;/p&gt;&lt;p id="31da"&gt;You can &lt;a href="https://www.quora.com/What-is-the-cost-of-hosting-a-website-with-Google-cloud/answer/Russell-Smith-1"&gt;read the original question on Quora&lt;/a&gt;.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;
</description><pubDate>Wed, 26 Apr 2017 14:06:10 +0000</pubDate></item><item><title>How is QA implemented in mobile apps?</title><link>https://rsmith.co/how-is-qa-implemented-in-mobile-apps-3d60b58906aa</link><guid>https://rsmith.co/how-is-qa-implemented-in-mobile-apps-3d60b58906aa</guid><description>
&lt;section&gt;&lt;div&gt;&lt;hr/&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;p id="6f47"&gt;With difficulty. There are two main problems:&lt;/p&gt;&lt;ol&gt;&lt;li id="ae65"&gt;Writing and maintaining the tests&lt;/li&gt;&lt;li id="fc85"&gt;Getting the right devices to run the tests&lt;/li&gt;&lt;/ol&gt;&lt;p id="03c3"&gt;&lt;strong&gt;&lt;em&gt;Writing and maintaining the tests&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p id="77cf"&gt;The first problem, really depends on how you do it. If you choose automation, you need an engineer to write the tests, plus to debug them when they fail. Also, generally the same test may have to be modified per device, depend on the framework.&lt;/p&gt;&lt;p id="83cc"&gt;Should you go the manual testing route, you generally incur a performance bottleneck — you have to hire enough people to be cost effective yet fast, which always ends up being a trade off.&lt;/p&gt;&lt;p id="153d"&gt;&lt;strong&gt;&lt;em&gt;Getting the right devices to run the tests&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p id="a66d"&gt;There are two main routes here too — either building your own lab, or paying for access to a service which provides one. From what I see, very few people are choosing to build their own lab outside of the very small and very large end of the scale spectrum — mainly due to price — you have to physically buy, manage and maintain all the device / device version combinations you require. Outsourcing makes way more sense here unless you’re at an extremely small/large scale, or have an ability to artificially limit device usage (think: Stripe and shipping their kiosk app for iPads only).&lt;/p&gt;&lt;p id="5221"&gt;If you’re interested in this, I’d recommend checking out:&lt;/p&gt;&lt;ul&gt;&lt;li id="f08c"&gt;&lt;a href="https://aws.amazon.com/device-farm/"&gt;Mobile App Testing on Devices — AWS Device Farm&lt;/a&gt; — it allows you to get devices on demand either for automated tests, or more recently manual — you have to write, or bring your own testers.&lt;/li&gt;&lt;li id="d968"&gt;FYI, we built our native-device offering on top of DeviceFarm at &lt;a href="https://www.rainforestqa.com/"&gt;Rainforest QA&lt;/a&gt; — it powers our &lt;a href="https://www.rainforestqa.com/product/mobile-app-testing/"&gt;Mobile App Testing for iOS and Android&lt;/a&gt; — we supply the testers.&lt;/li&gt;&lt;li id="1c1d"&gt;&lt;a href="https://saucelabs.com/enterprise#mobile-testing"&gt;Sauce Labs&lt;/a&gt; mobile testing — you have to bring your own tests or testers&lt;/li&gt;&lt;li id="6705"&gt;&lt;a href="https://www.perfectomobile.com/"&gt;Perfecto&lt;/a&gt; — again, bring your own tests&lt;/li&gt;&lt;/ul&gt;&lt;p id="0563"&gt;Also, if you want to go your own-lab route:&lt;/p&gt;&lt;ul&gt;&lt;li id="52e6"&gt;&lt;a href="https://www.vanamco.com/devicelab/"&gt;Device Lab responsive development stand | Vanamco&lt;/a&gt;&lt;/li&gt;&lt;li id="00a8"&gt;&lt;a href="https://github.com/openstf/stf"&gt;openstf/stf&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p id="e7e9"&gt;p.s. my company, &lt;a href="https://www.quora.com/profile/Rainforest-QA-1"&gt;Rainforest QA&lt;/a&gt;, offers a hybrid human-machine solution; bringing the benefits of automation and humans.&lt;/p&gt;&lt;p id="b6e5"&gt;You can &lt;a href="https://www.quora.com/How-is-QA-implemented-in-mobile-apps/answer/Russell-Smith-1"&gt;read the original question on Quora&lt;/a&gt;.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;
</description><pubDate>Tue, 25 Apr 2017 16:11:02 +0000</pubDate></item><item><title>What is accidental complexity?</title><link>https://rsmith.co/what-is-accidental-complexity-10bf2b66587a</link><guid>https://rsmith.co/what-is-accidental-complexity-10bf2b66587a</guid><description>&lt;p id="dafa"&gt;If you’ve ever heard this phrase, it’s from “&lt;a href="http://worrydream.com/refs/Brooks-NoSilverBullet.pdf" rel="noopener ugc" target="_blank"&gt;No Silver Bullet&lt;/a&gt;”. It proposes two types of complexity, accidental and essential complexity. The author states that;&lt;/p&gt;
&lt;ul&gt;&lt;li id="cc37"&gt;Essential complexity is the problem to be solved — the user must be able to do X things&lt;/li&gt;&lt;li id="fc5a"&gt;Accidental complexity is any complexity outside of that; e.g. the tooling we chose to solve the problem. It may be more complex to solve the same problem in one language over another — but, there is no silver bullet. There will always be accidental complexity.&lt;/li&gt;&lt;/ul&gt;
&lt;p id="0194"&gt;You can read the paper here — &lt;a href="http://worrydream.com/refs/Brooks-NoSilverBullet.pdf" rel="noopener ugc" target="_blank"&gt;http://worrydream.com/refs/Brook...&lt;/a&gt;.&lt;/p&gt;
&lt;p id="aea7"&gt;p.s. I think this is where “&lt;a href="https://www.quora.com/topic/10X-Engineers" rel="noopener ugc" target="_blank"&gt;10X Engineer&lt;/a&gt;” came from.&lt;/p&gt;
&lt;p id="cdbf"&gt;You can &lt;a href="https://www.quora.com/What-is-accidental-complexity/answer/Russell-Smith-1" rel="noopener ugc" target="_blank"&gt;read the original question on Quora&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Tue, 25 Apr 2017 00:00:00 +0000</pubDate></item><item><title>What to do when your AWS access key is compromised</title><link>https://rsmith.co/what-to-do-when-your-aws-access-key-is-compromised-55eb6650c7e5</link><guid>https://rsmith.co/what-to-do-when-your-aws-access-key-is-compromised-55eb6650c7e5</guid><description>&lt;blockquote&gt;Dear AWS Customer,&lt;/blockquote&gt;&lt;blockquote&gt;We have discovered your AWS access key ending with FLFQ along with your secret key available on a public web site. This makes your account vulnerable for unauthorized use.&lt;/blockquote&gt;&lt;p&gt;Uh-oh. If you ever get an &lt;a href="https://gist.github.com/ukd1/86e9bf5b14db78fbaba7"&gt;email like this from AWS&lt;/a&gt;, it can be daunting to figure out what to do next, however it’s actually pretty easy.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Step 1&lt;/strong&gt;, install AWS CLI tools if you don’t have them already. On a Mac this is as simple as using brew, then authenticating:&lt;/p&gt;&lt;pre&gt;brew install awscli&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Step 2&lt;/strong&gt;, find the key by using grep and asking for some lines either side:&lt;/p&gt;&lt;pre&gt;&lt;a href="http://docs.aws.amazon.com/cli/latest/reference/iam/list-users.html"&gt;aws iam list-access-keys&lt;/a&gt; | grep -B5 -A5 FLFQ&lt;/pre&gt;&lt;p&gt;The output should contain something like this:&lt;/p&gt;&lt;p&gt;&lt;a href="https://medium.com/media/3932e5bf16ec6c06bf42cfad656d9f26/href"&gt;View original embedded example ↗&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Step 3&lt;/strong&gt;, then delete the access key:&lt;/p&gt;&lt;pre&gt;aws iam delete-access-key --access-key-id AKIAJYAPIZCXAHBPFLFQ&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Step 4&lt;/strong&gt;, find where the key is used and replace it. This can be the hardest part.&lt;/p&gt;&lt;p&gt;You can also read more here: &lt;a href="https://aws.amazon.com/blogs/security/what-to-do-if-you-inadvertently-expose-an-aws-access-key/"&gt;https://aws.amazon.com/blogs/security/what-to-do-if-you-inadvertently-expose-an-aws-access-key/&lt;/a&gt;&lt;/p&gt;</description><pubDate>Mon, 24 Apr 2017 22:08:59 +0000</pubDate></item><item><title>A rough guide to keeping your website up through catastrophic events (aka.</title><link>https://rsmith.co/a-rough-guide-to-keeping-your-website-up-through-catastrophic-events-aka-fd308de476fa</link><guid>https://rsmith.co/a-rough-guide-to-keeping-your-website-up-through-catastrophic-events-aka-fd308de476fa</guid><description>&lt;h3&gt;A rough guide to keeping your website up through catastrophic events (aka. hosting in a single zone)&lt;/h3&gt;&lt;p&gt;So, you’re hosted in a single zone, and if you’re in US-East presumably &lt;a href="http://news.ycombinator.com/item?id=4180339"&gt;went down last night&lt;/a&gt;. Stop it. AWS has seven regions across the world, three of which are in the US. Each region is split in up to five availability zones. You need to use more than just multiple zones if you want to stay up during one of these outages. Cross region is the answer.&lt;/p&gt;&lt;p&gt;The following is a rough guide to making your website available regardless of ‘catastrophic’ events.&lt;/p&gt;&lt;h3&gt;Static sites&lt;/h3&gt;&lt;p&gt;Simple static sites and assets that don’t change often have an easy option: just use CloudFront. You can do this by setting up a new CloudFront distribution. There are two common ways to use CloudFront for ‘download’ content — the first is S3 backed. This is great if your static content is already on S3.&lt;/p&gt;&lt;p&gt;Assuming so, use the &lt;a href="https://console.aws.amazon.com/"&gt;AWS Console&lt;/a&gt;, click CloudFront, click create distribution, select download, and select your bucket from the dropdown list. If you’ve not set your &lt;a href="http://www.mnot.net/cache_docs/#CACHE-CONTROL"&gt;http caching headers&lt;/a&gt; then you should set the Object Caching to Custom and enter a TTL — aka how long to cache things for.&lt;/p&gt;&lt;p&gt;The second and less oft-used way is to use CloudFront as a forward-proxy. &lt;a href="http://aws.typepad.com/aws/2010/11/amazon-cloudfront-support-for-custom-origins.html"&gt;Custom origins&lt;/a&gt; have been supported for some time now. It’s pretty much the same procedure are above, but you point it at your webserver.&lt;/p&gt;&lt;p&gt;The process for this is more complex as you’ll need to alter your webserver config, DNS and setup the distribution.&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Setup a subdomain called origin.yourdomain.com,&lt;/li&gt;&lt;li&gt;Alter your webserver to serve your website from origin.yourdomain.com (you can also leave it serving from the old domain)&lt;/li&gt;&lt;li&gt;Set your CloudFront distribution’s origin domain name to origin.yourdomain.com&lt;/li&gt;&lt;li&gt;As you are probably not setting your cache headers, you should set your object caching to custom and enter a &lt;a href="http://en.wikipedia.org/wiki/Time_to_live"&gt;TTL&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;If you use &lt;a href="http://en.wikipedia.org/wiki/Query_string"&gt;query strings&lt;/a&gt;, make sure to enable them.&lt;/li&gt;&lt;li&gt;Check origin.yourdomain.com works&lt;/li&gt;&lt;li&gt;Add your old domain name(s) in the the Alternate Domain Names(CNAMEs).&lt;/li&gt;&lt;li&gt;Set a default root object — this is the default file to be served.&lt;/li&gt;&lt;li&gt;Remove the A record for your domain and add a CNAME to your distribution&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Your website will now be significantly faster.&lt;/p&gt;&lt;h3&gt;Dynamic sites&lt;/h3&gt;&lt;p&gt;For most people reading this, those of you serving dynamic content, you’ll need to do something more complex. Migrating to a multi-region setup isn’t the simplest so I’ll outline it — the major parts are:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;DNS&lt;/li&gt;&lt;li&gt;Auto Scaling&lt;/li&gt;&lt;li&gt;Automated configuration &amp;amp; Deployment / AMIs&lt;/li&gt;&lt;li&gt;Using a database or store which copes with network partitions in a sane way and coding your application to take advantage of this&lt;/li&gt;&lt;/ol&gt;&lt;h3&gt;1. DNS&lt;/h3&gt;&lt;p&gt;You want to move to &lt;a href="http://aws.amazon.com/route53/"&gt;Route53&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Route53 is AWS’s DNS offering. It’s awesome. It uses anycast. It has a swanky API. There are libraries for &lt;a href="http://aws.amazon.com/sdkforphp/"&gt;most&lt;/a&gt; &lt;a href="http://aws.amazon.com/sdkforruby/"&gt;commonly&lt;/a&gt; &lt;a href="http://aws.amazon.com/sdkfornet/"&gt;used&lt;/a&gt; &lt;a href="http://aws.amazon.com/sdkforjava/"&gt;langauges&lt;/a&gt; and &lt;a href="https://github.com/search?q=route53&amp;amp;repo=&amp;amp;langOverride=&amp;amp;start_value=1&amp;amp;type=Repositories&amp;amp;language="&gt;more on github&lt;/a&gt;. The most important feature for us is going to be LBR, or Latency Based Routing. This allows you to have DNS records which change depending on the latency in a sepcific AWS region. Think of it as a CDN for DNS: it serves the lowest latency record for each user.&lt;/p&gt;&lt;p&gt;Side note: if you’re not already, you should be using DNS for internal communication. Machines fail, using DNS means you can easy replace them without having to redeploy configuration. Route53 rocks at this due to its API. This is a separate discussion though.&lt;/p&gt;&lt;h3&gt;2. Auto Scaling&lt;/h3&gt;&lt;p&gt;So, you want to be able to cope with a fixed (lol, jk — I mean you’ve guessed your capacity) amount of traffic, but without spending too much monies. You’re engineering for minimal downtime but also want to minimise cost. I.e. you don’t want to run two or more identical copies of your environment (If you do, you are either over provisioned 98% of the time by 2x or you’ve engineered something that will get overloaded for the 2%, which makes it all rather pointless).&lt;/p&gt;&lt;p&gt;The solution is Auto Scaling. Auto Scaling lets you scale the number of machines up or down based on metrics of your choosing. These can be application-specific or the standard metrics from Cloud Watch.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;tl:dr; When a region fails, traffic will mount up on the other one(s) and you’ll need to scale up. Auto Scaling will do this.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;However, it relies on you doing #3.&lt;/p&gt;&lt;h3&gt;3. Automated Configuration &amp;amp; Deployment and or AMIs&lt;/h3&gt;&lt;p&gt;Automation is key for Auto Scaling, otherwise new machines start unconfigured. The easiest and fastest way to make your app work nicely with Auto Scaling is to use AMIs. However, this has one major issue: deployment. Releasing new code means rebuilding an AMI. If your release cycle is quick and your automation bad, this might suck more time than it’s worth.&lt;/p&gt;&lt;p&gt;Using something like Puppet, Chef or CFEngine to manage configuration of your newly started machines is good — the main drawback over baking AMIs is speed — It can take up to 40 minutes to go from boot to usable. This might be too late if your application needs to deal with 100% extra traffic all of a sudden.&lt;/p&gt;&lt;p&gt;Automated deployment is essential if you’re not baking AMIs.&lt;/p&gt;&lt;h3&gt;4. The Crux: Your database&lt;/h3&gt;&lt;p&gt;I’m probably biased, but my current database of choice is &lt;a href="http://www.mongodb.org/"&gt;MongoDB&lt;/a&gt;, so I’ll assume it’s yours too. If you’re using MySQL or PostgreSQL I’ll do a separate article in the future.&lt;/p&gt;&lt;p&gt;If you’re using a single instance of Mongo, shame on you — you should migrate to at least two full machines + arbiter in a replica set. &lt;a href="http://www.mongodb.org/display/DOCS/Replica+Sets"&gt;Replica sets&lt;/a&gt; allow for your app to keep running almost seemlessly to your application should your primary machine fail. They’ve also got pretty neat ways of going read only if nodes can’t see the &lt;a href="http://www.mongodb.org/display/DOCS/Replica+Sets+-+Voting"&gt;majority of the set&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Minimum sane setup:&lt;/p&gt;&lt;p&gt;Primary in one Region, Secondary in another and an Arbiter in a third region. This will allow for your application to keep writing if either of the primary or secondary regions’ fail.&lt;/p&gt;&lt;p&gt;A better setup:&lt;/p&gt;&lt;p&gt;Replace the Arbiter with a full replica set member. This will allow for your application to keep writing if any one region fails. If you have a sharded setup, the key is to make sure your shards are distributed as well as config servers. Should you be super-paranoid, I’d suggest using a mix of EBS backed and Instance Storage, this will help when EBS &lt;a href="http://storagemojo.com/2011/04/29/amazons-ebs-outage/"&gt;goes&lt;/a&gt; &lt;a href="https://forums.aws.amazon.com/thread.jspa?threadID=46277"&gt;south&lt;/a&gt;, however it can be more of a pain to setup.&lt;/p&gt;&lt;p&gt;One downside to all this is that you will have to pay for regional data transfer (but luckily &lt;a href="http://aws.amazon.com/ec2/faqs/#If_I_transfer_data_between_availability_zones_using_public_IP_addresses_will_I_be_charged_twice_for_Regional_Data_Transfer_once_because_its_across_zones_and_a_second_time_because_Im_using_public_IP_addresses"&gt;not twice&lt;/a&gt; and sort out your security (AWS doesn’t currently support cross region Secuirty Groups).&lt;/p&gt;&lt;p&gt;In conclusion, you probably used a single zone because it’s easy (hey — so do we for now!). There will come a point where the pain of getting shouted at by your boss, client or customers outweighs learning how to get your app setup properly yourself.&lt;/p&gt;&lt;p&gt;You can get your app on AWS to stay up even with a region wide failure. Why don’t you?&lt;/p&gt;</description><pubDate>Wed, 19 Apr 2017 18:58:09 +0000</pubDate></item><item><title>Securing application configuration, while still getting shit done</title><link>https://rsmith.co/securing-application-configuration-while-still-getting-shit-done-12948d75a45</link><guid>https://rsmith.co/securing-application-configuration-while-still-getting-shit-done-12948d75a45</guid><description>&lt;p&gt;I’ve moved this to &lt;a href="https://blog.rainforestqa.com/2013-11-15-securing-application-configuration-while-still-getting-shit-done/"&gt;our company blog here&lt;/a&gt;. Sorry everyone!&lt;/p&gt;</description><pubDate>Wed, 19 Apr 2017 18:09:02 +0000</pubDate></item><item><title>Baremetrics SMS</title><link>https://rsmith.co/baremetrics-sms-9a3329208b9b</link><guid>https://rsmith.co/baremetrics-sms-9a3329208b9b</guid><description>&lt;blockquote&gt;I love Baremetrics, but sometimes I’m too lazy to login.&lt;/blockquote&gt;&lt;p&gt;If you don’t know already, &lt;a href="https://www.baremetrics.com"&gt;Baremetrics&lt;/a&gt; is a SaaS product which with a couple of clicks analyses your &lt;a href="https://stripe.com"&gt;Stripe&lt;/a&gt; metrics — trivially giving you a host of key metrics.&lt;/p&gt;&lt;p&gt;I love Baremetrics, but sometimes I’m too lazy to login. So, one evening I decided I’d love a text each day — so started updating &lt;a href="https://github.com/ukd1/baremetrics-cli"&gt;baremetrics-cli&lt;/a&gt; to send a daily sms via twilio. Simple, plus open-source.&lt;/p&gt;&lt;p&gt;So, if you like the sound of that, it takes only a few minutes to get it setup for you and or your team. Checkout the code and installation instructions here — &lt;a href="https://github.com/ukd1/baremetrics-sms"&gt;https://github.com/ukd1/baremetrics-sms&lt;/a&gt;&lt;/p&gt;</description><pubDate>Wed, 19 Apr 2017 18:08:21 +0000</pubDate></item><item><title>Mechanical Turk is Insecure</title><link>https://rsmith.co/mechanical-turk-is-insecure-fa943c70b853</link><guid>https://rsmith.co/mechanical-turk-is-insecure-fa943c70b853</guid><description>&lt;h4&gt;and Amazon doesn’t seem to care.&lt;/h4&gt;&lt;p&gt;Mechanical Turk is one of the last services offered by AWS which is lacking support for IAM, Amazon’s Identity and Access Management service. This means you have to login with your account’s master keys. This is terrifying.&lt;/p&gt;&lt;p&gt;Think about that for a second.&lt;/p&gt;&lt;p&gt;These are literally the keys for your entire AWS account; EC2 servers, load balancers, EBS volumes, S3, Route53 DNS, Databases, plus &lt;a href="http://aws.amazon.com/products/"&gt;everything else on this giant list&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&lt;a href="http://aws.amazon.com/iam/"&gt;IAM&lt;/a&gt;, released in &lt;a href="http://aws.amazon.com/releasenotes/AWS-Identity-and-Access-Management/4092"&gt;late 2010&lt;/a&gt;, allows AWS users to make keys for specific jobs — like uploading to your production S3 bucket, reading (not writing) messages to a queue or starting a new database server.&lt;/p&gt;&lt;p&gt;It’s awesome as it allows one to create keys based on &lt;a href="http://en.wikipedia.org/wiki/Principle_of_least_privilege"&gt;principle of least privilege&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Mechanical Turk doesn’t support it.&lt;/p&gt;&lt;p&gt;The recent &lt;a href="http://status.circleci.com/incidents/z2pbsgg1qldc"&gt;Circle CI&lt;/a&gt; and &lt;a href="http://news.cnet.com/8301-1009_3-57609938-83/mongohq-scrambles-to-address-major-database-hack/"&gt;Mongo HQ&lt;/a&gt; incidents prompted us to look again at our own infrastructure. Mechanical Turk’s lack of support for decent access management turned out to be the biggest flaw — and we can’t fix it.&lt;/p&gt;&lt;p&gt;At &lt;a href="https://www.rainforestqa.com/"&gt;Rainforest&lt;/a&gt; we push a lot of jobs through Mechanical Turk, so I contacted our account manager asking them to find out;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;When IAM is going to be supported&lt;/li&gt;&lt;li&gt;What the current best practice for securing the master keys is&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;I got back —&lt;/p&gt;&lt;blockquote&gt;We don’t currently support IAM, and while it could be something that we add in the future, I’m not able to give you any sort of confirmation or timeframe for when the feature would be available.&lt;/blockquote&gt;&lt;blockquote&gt;Additionally, while we don’t have specific best practices for securing master keys, here are some &lt;a href="http://docs.aws.amazon.com/AWSSecurityCredentials/1.0/AboutAWSCredentials.html#AccessKeys"&gt;best practices&lt;/a&gt; that could be helpful related to key rotation, etc.&lt;/blockquote&gt;&lt;blockquote&gt;If you have more specific questions related to securing master keys, I’m happy to help address them for you.&lt;/blockquote&gt;&lt;p&gt;Key rotation. Yes, it’s a good practice, but no it’s not helpful if your master keys are compromised.&lt;/p&gt;&lt;p&gt;To me this isn’t an acceptable answer, though I’m not sure how I can get an actual answer.&lt;/p&gt;&lt;p&gt;We really want to know if it is planned at all, and if not why a glaring security risk is not a priority to AWS. I’ve written this to make sure everyone using mturk or thinking about it is aware of this glaring vulnerability.&lt;/p&gt;&lt;p&gt;What do you think? &lt;a href="https://news.ycombinator.com/item?id=6656957"&gt;Discuss on HN&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;/cc &lt;a href="https://medium.com/@Werner"&gt;@Werner&lt;/a&gt;&lt;/p&gt;</description><pubDate>Wed, 19 Apr 2017 18:06:13 +0000</pubDate></item><item><title>Docker Language Stacks</title><link>https://rsmith.co/docker-language-stacks-b5c52b8a445d</link><guid>https://rsmith.co/docker-language-stacks-b5c52b8a445d</guid><description>&lt;p&gt;&lt;em&gt;n.b. this is an old post that I forgot to publish — still, might be useful to someone&lt;/em&gt;&lt;/p&gt;&lt;p&gt;Using Docker for containerization has now become easier with the recently released &lt;a href="http://blog.docker.com/2014/09/docker-hub-official-repos-announcing-language-stacks/"&gt;Language Stacks&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Language Stacks are Docker’s official versions of programming language specific base images for your Dockerfile. They give you a head start by providing a stable base, as well as a best-practice way to get started with a large number of languages, all of which are supported officially.&lt;/p&gt;&lt;p&gt;Docker, incase you have missed it, is a developer friendly layer on top of &lt;a href="https://linuxcontainers.org/"&gt;LXC (Linux Containers)&lt;/a&gt; providing an easy way to build and package applications or services in to portable images. Although relatively new — Docker launched March 2013 — it has seen rapid adoption, mainly due to &lt;a href="http://www.zdnet.com/what-is-docker-and-why-is-it-so-darn-popular-7000032269/"&gt;ease of use&lt;/a&gt; along with its build-once run-anywhere advantages over existing techniques.&lt;/p&gt;&lt;p&gt;Previously the only way to do this was to either &lt;a href="http://thenewstack.io/moving-ruby-apps-from-heroku-to-docker/"&gt;create your own Dockerfile&lt;/a&gt; from scratch or to wade through &lt;a href="https://registry.hub.docker.com/search?q=ruby"&gt;a long list of public images&lt;/a&gt; others had written and pushed to the hub. Both of which were painful; writing your Dockerfile meant &lt;a href="http://www.activestate.com/blog/2014/01/using-docker-run-ruby-rspec-ci-jenkins"&gt;significant time and knowledge&lt;/a&gt; of Ubuntu (usually &lt;a href="https://github.com/tcnksm/dockerfile-rbenv/blob/master/Dockerfile"&gt;15+ lines&lt;/a&gt; of commands) was required to install dependancies and Language, as the starting point was a bare base image. Choosing a publicly available image was hit and miss, users ended up facing questions about the author and did they &lt;a href="https://gist.github.com/deepak/5925003#comment-856556"&gt;set it up properly&lt;/a&gt;? These worries are removed and replaced with a single line.&lt;/p&gt;&lt;p&gt;Official support fixes both of the above issues, but what does this mean for you? In short, a significantly easier time putting together an application using Docker:&lt;/p&gt;&lt;p&gt;A Business Wire &lt;a href="http://www.businesswire.com/news/home/20140924005223/en/Docker-Adds-11-Top-Language-Stacks-Docker"&gt;press release&lt;/a&gt; reported this from a Docker executive:&lt;/p&gt;&lt;blockquote&gt;“Dockerized language stacks strengthen the pre-packaged catalog of building blocks freely available to our developers,” said Scott Johnston, SVP of product at Docker. “Developers can instantly assemble applications, while eliminating a sequence of time-consuming workflows previously dedicated to building these stacks.”&lt;/blockquote&gt;&lt;p&gt;In the same announcement, Docker also revealed &lt;a href="https://docs.docker.com/docker-hub/official_repos/"&gt;guidelines for submitting Official Repositories&lt;/a&gt;, covering the basic requirements such as it being stored in Git and having a logo, through to much more technical needs in the Dockerfile itself. Unsurprisingly given the size, the community is already &lt;a href="https://groups.google.com/a/dartlang.org/forum/#!topic/misc/OltSAV4NIzM"&gt;requesting support&lt;/a&gt; and &lt;a href="http://friism.com/mono-docker-language-stack"&gt;working on&lt;/a&gt; new languages themselves.&lt;/p&gt;</description><pubDate>Wed, 19 Apr 2017 18:05:29 +0000</pubDate></item><item><title>RubyConf — why you should go next year</title><link>https://rsmith.co/rubyconf-why-you-should-go-next-year-2f0da4944d9a</link><guid>https://rsmith.co/rubyconf-why-you-should-go-next-year-2f0da4944d9a</guid><description>&lt;h2 id="subtitle"&gt;and how to convince your boss.&lt;/h2&gt;
&lt;p id="5e29"&gt;Let me outline why you should go to Rubyconf next year; I’ll give you three great reasons your boss should send you to the next one, run through the highlights of the talks and why I think the people were awesome.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id="6ec7"&gt;&lt;strong&gt;How to work on your boss&lt;/strong&gt;&lt;/h2&gt;
&lt;p id="9d02"&gt;It can be hard to convince your boss that it’s worth you going to a conference, especially if it’s the other side of the country let alone a different continent. Here are three great reasons;&lt;/p&gt;
&lt;ol&gt;&lt;li id="4279"&gt;If you’re hiring or looking for a job it’s awesome. We are (get in touch via twitter &lt;a href="https://twitter.com/rhs" rel="noopener ugc" target="_blank"&gt;@rhs&lt;/a&gt;) and both the job board — which is free — and talking to people have resulted in &amp;gt; 5 great engineers that we want to work with. Bonus? We’ve hung out with them more than we ever could via most other recruiting methods.&lt;/li&gt;&lt;li id="093b"&gt;Learning? Developers from all ends of experience were here; streaming gigs of geo data? Want to implement a new data type in cruby? Wondering how to do something in your favorite gem? — there was someone to help.&lt;/li&gt;&lt;li id="71fc"&gt;Talking to users. We build a developer tool (&lt;a href="https://www.rainforestqa.com/" rel="noopener ugc" target="_blank"&gt;Rainforest QA&lt;/a&gt;) — if you’re building things that interest developers then this is a great chance to show lots of them (from all over the place!). Put your name down for a lighting talk. Do adhoc demos. Talk to people and companies you respect and show them what you do.&lt;/li&gt;&lt;/ol&gt;
&lt;hr/&gt;
&lt;h2 id="b6be"&gt;&lt;strong&gt;The cost&lt;/strong&gt;&lt;/h2&gt;
&lt;p id="db5b"&gt;It cost under $1,000 USD all in, flights, tickets and accommodation. Here is the breakdown;&lt;/p&gt;
&lt;ul&gt;&lt;li id="e174"&gt;$300 — American Airlines via &lt;a href="http://www.hipmunk.com/" rel="noopener ugc" target="_blank"&gt;Hipmunk&lt;/a&gt;, San Francisco -&amp;gt; Miami&lt;/li&gt;&lt;li id="bce4"&gt;$350 — &lt;a href="http://rubyconf.org/registration" rel="noopener ugc" target="_blank"&gt;Rubyconf tickets&lt;/a&gt;&lt;/li&gt;&lt;li id="6990"&gt;$300 — Airbnb 3 blocks from the hotel, which is much better than $259/night at the recommended hotel&lt;/li&gt;&lt;li id="aeb5"&gt;~$50 — Food was cheap as lunch was provided each day&lt;/li&gt;&lt;/ul&gt;
&lt;p id="1b09"&gt;Total; $1,000 + alcohol. Obviously you can save more by sharing an Airbnb; mine had two double beds. I estimate it would be ~$1,600 for two!&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id="ac87"&gt;Conference highlights&lt;/h2&gt;
&lt;p id="ffd9"&gt;Originally when I looked at the &lt;a href="http://rubyconf.org/schedule" rel="noopener ugc" target="_blank"&gt;schedule&lt;/a&gt; my first thought was ‘damn, annoying’. Rubyconf has three tracks, for most slots I wanted to hear at least two. Thankfully they’re recorded, though not online yet.&lt;/p&gt;
&lt;p id="e3a3"&gt;If you didn’t make it this year, here are the talks I went to which I loved (in no particular order);&lt;/p&gt;
&lt;ul&gt;&lt;li id="5481"&gt;&lt;a href="http://rubyconf.org/program#jason-r-clark" rel="noopener ugc" target="_blank"&gt;Extending Gems — Patterns and Anti-Patterns of Making Your Gem Pluggable&lt;/a&gt; — this was interesting as we make &lt;a href="https://github.com/rainforestapp/rainforest-cli" rel="noopener ugc" target="_blank"&gt;gems&lt;/a&gt; for &lt;a href="https://www.rainforestqa.com/" rel="noopener ugc" target="_blank"&gt;Rainforest&lt;/a&gt;.&lt;/li&gt;&lt;li id="aa0e"&gt;&lt;a href="http://rubyconf.org/program#bryan-liles" rel="noopener ugc" target="_blank"&gt;Thinking about Machine Learning with Ruby&lt;/a&gt; — I’ve seen Bryan talk before (on the internets) and he’s an awesome speaker. He live coded and it worked. Demos worked. He’s smart. He’s funny. I’m jealous.&lt;/li&gt;&lt;li id="d26a"&gt;&lt;a href="http://rubyconf.org/program#jonathan-wallace" rel="noopener ugc" target="_blank"&gt;Effective Debugging&lt;/a&gt; — I learnt about &lt;a href="https://github.com/deivid-rodriguez/byebug" rel="noopener ugc" target="_blank"&gt;Byebug&lt;/a&gt; and how to use it. End of story.&lt;/li&gt;&lt;li id="9896"&gt;&lt;a href="http://rubyconf.org/program#dirkjan-bussink" rel="noopener ugc" target="_blank"&gt;The tricky truth about parallel execution and modern hardware&lt;/a&gt; — Dirkjan explained parallel execution in depth and the problems caused by reordering and smarter CPUs. We learn about &lt;a href="http://en.wikipedia.org/wiki/Memory_barrier" rel="noopener ugc" target="_blank"&gt;memory barriers&lt;/a&gt; and why ruby developers should care. You should watch this.&lt;/li&gt;&lt;li id="03fd"&gt;&lt;a href="http://rubyconf.org/program#team-yamanekko-yurie-yamane-masayoshi-takahashi" rel="noopener ugc" target="_blank"&gt;How to control physical devices with mruby&lt;/a&gt; — I’d never heard of &lt;a href="https://github.com/mruby/mruby" rel="noopener ugc" target="_blank"&gt;mruby&lt;/a&gt; before, but learnt a lot about it. Embeddable and fast, there were some good demos of what it can do on commodity controllers.&lt;/li&gt;&lt;li id="915f"&gt;&lt;a href="http://rubyconf.org/program#jim-gay" rel="noopener ugc" target="_blank"&gt;Unleash the Secrets of the Standard Library with SimpleDelegator, Forwardable, and more&lt;/a&gt; — Ruby’s &lt;a href="http://www.ruby-doc.org/stdlib-2.0.0/" rel="noopener ugc" target="_blank"&gt;standard library&lt;/a&gt; is pretty big. Jim covered some of the more interesting ones commonly missed. It’s pushed me to look deeper into what ships for free!&lt;/li&gt;&lt;li id="3506"&gt;&lt;a href="http://rubyconf.org/program#mark-bates" rel="noopener ugc" target="_blank"&gt;Mangling Ruby with TracePoint&lt;/a&gt; — Mark doesn’t like pants to wear when he talks; luckily the rest of the talk was more complete. He demo’d &lt;a href="http://www.ruby-doc.org/core-2.0.0/TracePoint.html" rel="noopener ugc" target="_blank"&gt;TracePoint&lt;/a&gt; to us and showed how simple it is to get in-depth stats on execution yourself. Did you know a Rails hello world does &amp;gt; 120k calls for a single request?&lt;/li&gt;&lt;/ul&gt;
&lt;p id="9ecf"&gt;I missed these and wish I hadn’t;&lt;/p&gt;
&lt;ul&gt;&lt;li id="a954"&gt;&lt;a href="http://rubyconf.org/program#koichi-sasada" rel="noopener ugc" target="_blank"&gt;Object management on Ruby 2.1&lt;/a&gt;&lt;/li&gt;&lt;li id="d2ff"&gt;&lt;a href="http://rubyconf.org/program#andy-pliszka" rel="noopener ugc" target="_blank"&gt;Extending CRuby with native Graph data type&lt;/a&gt;&lt;/li&gt;&lt;li id="4c67"&gt;&lt;a href="http://rubyconf.org/program#jerry-dantonio" rel="noopener ugc" target="_blank"&gt;Advanced Concurrent Programming in Ruby&lt;/a&gt;&lt;/li&gt;&lt;li id="99e6"&gt;&lt;a href="http://rubyconf.org/program#patrick-van-stee" rel="noopener ugc" target="_blank"&gt;Raft: Consensus for Rubyists&lt;/a&gt;&lt;/li&gt;&lt;li id="9cb5"&gt;&lt;a href="http://rubyconf.org/program#pat-shaughnessy" rel="noopener ugc" target="_blank"&gt;Visualizing Garbage Collection in Rubinius, JRuby and Ruby 2.0&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p id="8a70"&gt;(I’ll update these links when the videos are posted online)&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id="865b"&gt;The People of Ruby(conf)&lt;/h2&gt;
&lt;p id="fe94"&gt;&lt;a href="http://en.wikipedia.org/wiki/Yukihiro_Matsumoto" rel="noopener ugc" target="_blank"&gt;Yukihiro Matsumoto&lt;/a&gt;, better known as Matz the creator of Ruby, is a genuinely nice person. It seems to be infectious. I learnt that a Rubyist coined “MINSWAN”, which stands for Matz is nice, so we are nice. I love this.&lt;/p&gt;
&lt;p id="e640"&gt;It couldn’t be truer; I met wide range of people, from people looking to learn Ruby, through to core committers on cRuby. Each one was friendly.&lt;/p&gt;
&lt;p id="d37d"&gt;You should join us next year. I’d love to see you there.&lt;/p&gt;
&lt;hr/&gt;
&lt;blockquote&gt;&lt;p id="154b"&gt;Matz is nice, so we are nice.&lt;/p&gt;&lt;/blockquote&gt;</description><pubDate>Mon, 11 Nov 2013 00:00:00 +0000</pubDate></item><item><title>MongoDB Gotchas &amp; How To Avoid Them</title><link>https://rsmith.co/mongodb-gotchas-and-how-to-avoid-them-83fd0a0880ec</link><guid>https://rsmith.co/mongodb-gotchas-and-how-to-avoid-them-83fd0a0880ec</guid><description>&lt;p id="8e61"&gt;A lot of people hate on MongoDB. In my opinion they’re misguided — the main reason so many people think &lt;a href="http://diegobasch.com/ill-give-mongodb-another-try-in-ten-years" rel="noopener ugc" target="_blank"&gt;like this&lt;/a&gt; is a lack of understanding. Everyone should be able to benefit from MongoDB’s power and simplicity, and so as a follow up to &lt;a href="http://blog.serverdensity.com/does-everyone-hate-mongodb/" rel="noopener ugc" target="_blank"&gt;David’s article&lt;/a&gt; I have outlined some common and not-so-common things that hackers should know about MongoDB.&lt;/p&gt;
&lt;p id="51c6"&gt;First though, why should you listen to me? I used to be a consultant specializing in Ops and helping companies (The Guardian, Experian) scale large web applications. As well as co-founding the offical &lt;a href="http://www.meetup.com/London-MongoDB-User-Group/" rel="noopener ugc" target="_blank"&gt;MongoDB London User Group&lt;/a&gt;, I am a &lt;a href="http://www.mongodb.org/display/DOCS/MongoDB+Masters#MongoDBMasters-RussellSmith" rel="noopener ugc" target="_blank"&gt;MongoDB Master&lt;/a&gt; and have worked on installations from single servers all the way to projects with 30k queries per second and over a terabyte of active data. I have learnt all of the following from experience.&lt;/p&gt;
&lt;h1 id="f36d"&gt;32-bit vs 64-bit&lt;/h1&gt;
&lt;p id="c705"&gt;Most modern servers are either running &lt;a href="http://en.wikipedia.org/wiki/32-bit" rel="noopener ugc" target="_blank"&gt;32-bit&lt;/a&gt; or &lt;a href="http://en.wikipedia.org/wiki/64-bit" rel="noopener ugc" target="_blank"&gt;64-bit&lt;/a&gt; operating systems. Most modern hardware supports 64-bit operating systems, which are better because they permit more addressable memory space, i.e. more RAM.&lt;/p&gt;
&lt;p id="306f"&gt;MongoDB ships with two versions — 32-bit and 64-bit. Due to the way MongoDB uses &lt;a href="http://blog.mongodb.org/post/137788967/32-bit-limitations" rel="noopener ugc" target="_blank"&gt;memory mapped files&lt;/a&gt; 32-bit builds can only store around 2G of data. For standard replicasets MongoDB only has a single process type — mongod. If you’re intending on storing more than 2G of data you should use a 64-bit build of MongoDB. For setups that are sharded, you can use 32-bit builds for the mongos.&lt;/p&gt;
&lt;p id="6cb9"&gt;tl;dr — Just use 64-bit, or understand the limitations of 32-bit&lt;/p&gt;
&lt;h1 id="cdf8"&gt;Document size limits&lt;/h1&gt;
&lt;p id="b136"&gt;Unlike a Relational Database Management System (&lt;a href="http://en.wikipedia.org/wiki/Relational_database_management_system" rel="noopener ugc" target="_blank"&gt;RDBMS&lt;/a&gt;) which stores data in columns and rows, MongoDB stores data in documents. These documents are &lt;a href="http://en.wikipedia.org/wiki/BSON" rel="noopener ugc" target="_blank"&gt;BSON&lt;/a&gt;, which is a binary format similar to JSON.&lt;/p&gt;
&lt;p id="6498"&gt;Like most other databases, there are limits to what you can store in a document. In older versions of MongoDB, documents were limited to 4M each. All recent versions support documents up to 16M in size. This may sound like an annoyance, but 10gen’s opinion on this is that if you are hitting this limit then either your schema design is wrong or you should be using &lt;a href="http://www.mongodb.org/display/DOCS/GridFS" rel="noopener ugc" target="_blank"&gt;GridFS&lt;/a&gt;, which allows arbitrarily sized documents.&lt;/p&gt;
&lt;p id="e3ee"&gt;Generally, I would suggest avoiding storing large, irregularly updated objects in a database of any kind. Services such as &lt;a href="http://aws.amazon.com/s3/" rel="noopener ugc" target="_blank"&gt;Amazon S3&lt;/a&gt; or &lt;a href="http://www.rackspace.com/cloud/public/files/" rel="noopener ugc" target="_blank"&gt;Rackspace Cloudfiles&lt;/a&gt; are generally a much better option and don’t load your infrastructure unnecessarily.&lt;/p&gt;
&lt;p id="807d"&gt;tl;dr — Keep documents under 16M each and you’ll be fine!&lt;/p&gt;
&lt;h1 id="188c"&gt;Write failure&lt;/h1&gt;
&lt;p id="5354"&gt;MongoDB allows very fast writes and updates by default. The tradeoff is that you are not explicitly notified of failures. By default most drivers do asynchronous, ‘unsafe’ writes — this means that the driver does not return an error directly, similar to INSERT DELAYED with MySQL. If you want to know if something succeeded, you have to manually check for errors using &lt;code&gt;&lt;a href="http://www.mongodb.org/display/DOCS/getLastError+Command" rel="noopener ugc" target="_blank"&gt;getLastError&lt;/a&gt;&lt;/code&gt;.&lt;/p&gt;
&lt;p id="efdf"&gt;For cases where you want an error thrown if something goes wrong, it’s simple in most drivers to enable “safe” queries which are synchronous. This makes MongoDB act in a familiar way to those migrating from a more traditional database.&lt;/p&gt;
&lt;p id="1dcb"&gt;If you need more performance than a ‘fully safe’ synchronous write, but still want some level of safety, you can ask MongoDB to wait until a journal commit has happened using &lt;a href="http://www.mongodb.org/display/DOCS/getLastError+Command#getLastErrorCommand-%7B%7Bj%7D%7D" rel="noopener ugc" target="_blank"&gt;getLastError with ‘j’&lt;/a&gt;. The journal is flushed to disk every 100 milliseconds, rather than 60 seconds as with the main store.&lt;/p&gt;
&lt;p id="84d1"&gt;tl;dr — use safe writes or use &lt;code&gt;getLastError&lt;/code&gt; if you want to confirm writes&lt;/p&gt;
&lt;h1 id="0644"&gt;Schemaless does not mean you have no Schema&lt;/h1&gt;
&lt;p id="300b"&gt;RDBMSs usually have a pre-defined schema: tables with columns, each with names and a data type. If you want to add an extra column, you have to add a column to the entire table.&lt;/p&gt;
&lt;p id="47c8"&gt;MongoDB does away with this. There is no enforced schema per collection or document. This makes rapid development and changes easy.&lt;/p&gt;
&lt;p id="2274"&gt;However, this doesn’t mean you can ignore schema design. Having a properly designed schema will allow you to get the best performance from MongoDB. Read the &lt;a href="http://www.mongodb.org/display/DOCS/Schema+Design" rel="noopener ugc" target="_blank"&gt;MongoDB docs&lt;/a&gt;, or watch one of the many videos about schema design to get started:&lt;/p&gt;
&lt;ul&gt;&lt;li id="f689"&gt;&lt;a href="http://www.10gen.com/video/mongosf2011/schemabasics" rel="noopener ugc" target="_blank"&gt;Schema Design Basics&lt;/a&gt;&lt;/li&gt;&lt;li id="e8f4"&gt;&lt;a href="http://www.10gen.com/video/mongosf2011/schemascale" rel="noopener ugc" target="_blank"&gt;Schema Design at Scale&lt;/a&gt;&lt;/li&gt;&lt;li id="f396"&gt;&lt;a href="http://www.10gen.com/presentations/mongosv-2011/schema-design-principles-and-practice" rel="noopener ugc" target="_blank"&gt;Schema Design Principles and Practice&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p id="c0d4"&gt;tl;dr — design a schema and make it take advantage of MongoDB’s features&lt;/p&gt;
&lt;h1 id="741b"&gt;Updates only update one document by default&lt;/h1&gt;
&lt;p id="1683"&gt;With a traditional RDBMS, updates affect everything they match unless you use a LIMIT clause. However MongoDB uses an equivalent of a ‘LIMIT 1’ on each update by default. Whilst there is no way to do a ‘LIMIT 5’, you can remove the limit completely by doing the following;&lt;/p&gt;&lt;pre&gt;&lt;span id="cd1a"&gt;db.people.update({age: {$gt: 30}}, {$set: {past_it: true}}, false, true)&lt;/span&gt;&lt;/pre&gt;
&lt;p id="b749"&gt;There are similar options in all the official drivers — the option is usually called ’&lt;a href="http://www.mongodb.org/display/DOCS/Updating#Updating-update%28%29" rel="noopener ugc" target="_blank"&gt;multi&lt;/a&gt;’.&lt;/p&gt;
&lt;p id="d70d"&gt;tl;dr — specify multi true to affect multiple documents&lt;/p&gt;
&lt;h1 id="fa10"&gt;Case sensitive queries&lt;/h1&gt;
&lt;p id="e218"&gt;Querying using strings may not quite work as expected — this is because MongoDB is by default case-sensitive.&lt;/p&gt;
&lt;p id="9dd7"&gt;For example, &lt;code&gt;db.people.find({name: 'Russell'})&lt;/code&gt; is different to &lt;code&gt;db.people.find({name: 'russell'})&lt;/code&gt;. The solution is to make sure your data is in a known case - which is the ideal solution. You can also use regex searches like &lt;code&gt;db.people.find({name: /russell/i})&lt;/code&gt; although these aren’t ideal as they are relatively slow.&lt;/p&gt;
&lt;p id="3f50"&gt;tl;dr — queries are case sensitive&lt;/p&gt;
&lt;h1 id="4173"&gt;Type sensitive fields&lt;/h1&gt;
&lt;p id="e9b8"&gt;When you try and insert data with an incorrect data type into a traditional database, it will generally either error or cast the data to a predefined value. However with MongoDB there is no enforced schema for documents, so MongoDB can’t know you are making a mistake. If you write a string, MongoDB stores it as a string. If you write an integer, it stores it as an integer.&lt;/p&gt;
&lt;p id="55ae"&gt;tl;dr — make sure you use the &lt;a href="http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24type" rel="noopener ugc" target="_blank"&gt;correct type&lt;/a&gt; for your data&lt;/p&gt;
&lt;h1 id="9730"&gt;Locking&lt;/h1&gt;
&lt;p id="d6d5"&gt;When resources are shared between different parts of code sometimes locks are needed to ensure only one thing is happening at once.&lt;/p&gt;
&lt;p id="b3ff"&gt;Older versions of MongoDB — pre 2.0 — had a global write lock. Meaning only one write could happen at once throughout the entire server. This could result in the database getting bogged down with locking under certain loads. This was improved significantly in 2.0, and again in the current stable 2.2. MongoDB 2.2 solves this with &lt;a href="https://jira.mongodb.org/browse/SERVER-4328" rel="noopener ugc" target="_blank"&gt;database level locking&lt;/a&gt; and is a big step forward. The next step, which I expect will be another large improvement is &lt;a href="https://jira.mongodb.org/browse/SERVER-1240" rel="noopener ugc" target="_blank"&gt;Collection level locking&lt;/a&gt;, which is planned for the next stable version.&lt;/p&gt;
&lt;p id="e2f9"&gt;Having said this, most applications I’ve seen were limited by the application itself (too few threads, badly designed) rather than MongoDB itself.&lt;/p&gt;
&lt;p id="2efb"&gt;tl;dr — use a &lt;a href="http://www.mongodb.org/downloads" rel="noopener ugc" target="_blank"&gt;current stable&lt;/a&gt; to get the best performance&lt;/p&gt;
&lt;h1 id="fe9e"&gt;Packages&lt;/h1&gt;
&lt;p id="d5fb"&gt;A lot of people have had issues with out of date versions of MongoDB being shipped in the standard repositories of common distributions. The solution is simple: use the offical 10gen repositories which are available for &lt;a href="http://docs.mongodb.org/manual/tutorial/install-mongodb-on-debian-or-ubuntu-linux/" rel="noopener ugc" target="_blank"&gt;Ubuntu and Debian&lt;/a&gt; as well as &lt;a href="http://docs.mongodb.org/manual/tutorial/install-mongodb-on-redhat-centos-or-fedora-linux/" rel="noopener ugc" target="_blank"&gt;Fedora and Centos&lt;/a&gt;.&lt;/p&gt;
&lt;p id="0505"&gt;tl;dr — use &lt;a href="http://www.mongodb.org/downloads#packages" rel="noopener ugc" target="_blank"&gt;official packages&lt;/a&gt; for the most up to date versions&lt;/p&gt;
&lt;h1 id="d25b"&gt;Using an even number of Replica Set members&lt;/h1&gt;
&lt;p id="8cf6"&gt;Replica Sets are an easy way to add redundancy and read performance to your MongoDB cluster. Data is replicated between all the nodes and one is elected as the primary. If the primary fails, the other nodes will vote between themselves and one will be elected the new primary.&lt;/p&gt;
&lt;p id="0484"&gt;It can be tempting to run with two machines in a replica set; it’s cheaper than three and is pretty standard way of doing things with RDBMSs.&lt;/p&gt;
&lt;p id="5220"&gt;However due to the way voting works with MongoDB, you must use an odd number of replica set members. If you use an even number and one node fails the rest of the set will go read-only. This happens as the remaining machines will not have enough votes to get to a quorum.&lt;/p&gt;
&lt;p id="aa94"&gt;If you want to save some money, but still support failover and increased redundancy, you can use arbiters. Arbiters are a special type of replica set member — they do not store any user data (which means they can be on very small servers) but otherwise vote as normal.&lt;/p&gt;
&lt;p id="ae30"&gt;tl;dr — only use an odd number of replica set members and be aware that arbiters can reduce the costs of running a redundant setup&lt;/p&gt;
&lt;h1 id="4c9e"&gt;No joins&lt;/h1&gt;
&lt;p id="4091"&gt;MongoDB does not support &lt;a href="http://en.wikipedia.org/wiki/Join_%28SQL%29" rel="noopener ugc" target="_blank"&gt;joins&lt;/a&gt;; If you need to retrieve data from more than one collection you must do more than one query.&lt;/p&gt;
&lt;p id="291d"&gt;If you find yourself doing too many queries, you can generally redesign your schema to reduce the overall number you are doing. Documents in MongoDB can take any format, so you can de-normalize your data easily. Keeping it consistent is down to your application however.&lt;/p&gt;
&lt;p id="3d76"&gt;tl;dr — no joins, &lt;a href="https://rsmith.co/2012/11/05/mongodb-gotchas-and-how-to-avoid-them/index.html#schemaless_does_not_mean_you_have_no_schema" rel="noopener ugc" target="_blank"&gt;read how to design a schema&lt;/a&gt;&lt;/p&gt;
&lt;h1 id="4e07"&gt;Journaling&lt;/h1&gt;
&lt;p id="5610"&gt;MongoDB uses &lt;a href="http://www.mongodb.org/display/DOCS/Caching" rel="noopener ugc" target="_blank"&gt;memory mapped files&lt;/a&gt; and flushes to disk are done every 60 seconds, which means you can lose a maximum of 60 seconds + the flush time worth of data.&lt;/p&gt;
&lt;p id="2bd5"&gt;To reduce the chance of losing data, MongoDB added journaling -since 2.0 it’s been enabled by default. Journaling records changes to the database to disk every 100ms. If the database is shutdown unexpectedly, this will be replayed before starting up to make sure the database is in a consistent state. This is the nearest thing in MongoDB to a commit in a more traditional database.&lt;/p&gt;
&lt;p id="2e92"&gt;Journaling comes with a slight performance hit — around 5%. For most people the extra safety is well worth the overhead.&lt;/p&gt;
&lt;p id="dd12"&gt;tl;dr — don’t &lt;a href="http://www.mongodb.org/display/DOCS/Journaling" rel="noopener ugc" target="_blank"&gt;disable journaling&lt;/a&gt;&lt;/p&gt;
&lt;h1 id="6be6"&gt;No authentication by default&lt;/h1&gt;
&lt;p id="0371"&gt;MongoDB doesn’t have authentication by default. It’s expected that &lt;code&gt;mongod&lt;/code&gt; is running in a trusted network and behind a firewall. However authentication &lt;em&gt;is&lt;/em&gt; fully supported, if you require it you can &lt;a href="http://docs.mongodb.org/manual/administration/security/" rel="noopener ugc" target="_blank"&gt;enable it really easily&lt;/a&gt;.&lt;/p&gt;
&lt;p id="fca2"&gt;tl;dr — secure MongoDB by using a &lt;a href="http://docs.mongodb.org/manual/administration/security/#networking-risk-exposure" rel="noopener ugc" target="_blank"&gt;firewall&lt;/a&gt; and binding it to the correct interface, &lt;em&gt;or&lt;/em&gt; enable authentication&lt;/p&gt;
&lt;h1 id="043d"&gt;Lost data with Replica Sets&lt;/h1&gt;
&lt;p id="e1e0"&gt;Running a replica set is a great way to make your system more reliable and easier to maintain. An understanding of what happens during a node failure or failover is important.&lt;/p&gt;
&lt;p id="4ab2"&gt;Replica Sets work by transferring the oplog — a list of things that change in your database (updates, inserts, removes, etc) — and then replaying it on other members in the set. If your primary fails and later comes back online, it will rollback to the last common point in the oplog. At any point during this process, newer data that may have existed will be removed from the database and placed in a special folder in your data directory called ‘rollback’ for you to manually restore. If you don’t know about this feature, you may find that data goes missing. Each time you have a failover you should check this folder. Manually restoring the data is really easy with the standard tools that ship with MongoDB.&lt;/p&gt;
&lt;p id="1131"&gt;There is a far more &lt;a href="http://www.mongodb.org/display/DOCS/Replica+Sets+-+Rollbacks" rel="noopener ugc" target="_blank"&gt;detailed explanation in the official docs&lt;/a&gt;.&lt;/p&gt;
&lt;p id="7b83"&gt;tl;dr — ‘missing data’ after a failover will be in the rollback directory&lt;/p&gt;
&lt;h1 id="9cc9"&gt;Sharding too late&lt;/h1&gt;
&lt;p id="15a6"&gt;Sharding is a way of splitting data across multiple machines. This is usually done to increase performance when you find a replica set is too slow. MongoDB supports automatic sharding.&lt;/p&gt;
&lt;p id="a6b6"&gt;MongoDB allows migrating to a sharded setup with very little effort. However if you leave it too late it can cause headaches. To shard, MongoDB splits the collections you choose into chunks based on a ‘shard key’ and distributes them amongst your shards automatically. Splitting them and migrating chunks takes time and resources, and if your servers are already near capacity could result in them slowing to a standstill right when you need them most.&lt;/p&gt;
&lt;p id="f645"&gt;The solution is simple; use a tool to keep an eye on MongoDB, make a best guess of your capacity (flush time, queue lengths, lock percentages and faults are good gauges) and shard before you get to 80% of your estimated capacity. Exampe tools include &lt;a href="https://mms.10gen.com/user/login" rel="noopener ugc" target="_blank"&gt;MMS&lt;/a&gt;, &lt;a href="http://munin-monitoring.org/" rel="noopener ugc" target="_blank"&gt;Munin&lt;/a&gt; (+ &lt;a href="https://github.com/erh/mongo-munin" rel="noopener ugc" target="_blank"&gt;Mongo plugin&lt;/a&gt;), &lt;a href="http://aws.amazon.com/cloudwatch/" rel="noopener ugc" target="_blank"&gt;CloudWatch&lt;/a&gt;.&lt;/p&gt;
&lt;p id="e67b"&gt;If you know you are going to have to shard from the outset, a nice alternative if you’re using AWS or similar is to start off sharded — but on smaller servers. Stopping and resizing machines is much quicker than migrating thousands of chunks.&lt;/p&gt;
&lt;p id="ce64"&gt;tl;dr — &lt;a href="http://docs.mongodb.org/manual/core/sharding/" rel="noopener ugc" target="_blank"&gt;shard&lt;/a&gt; early to avoid any issues&lt;/p&gt;
&lt;h1 id="3f73"&gt;You cannot update a shard key in a document&lt;/h1&gt;
&lt;p id="e654"&gt;For sharded setups, shard keys are what MongoDB uses to work out which shard a particular document should be on.&lt;/p&gt;
&lt;p id="412b"&gt;After you’ve inserted a document you cannot update the shard key. The suggested solution to this is to &lt;a href="https://jira.mongodb.org/browse/SERVER-1893" rel="noopener ugc" target="_blank"&gt;remove the document and reinsert it&lt;/a&gt; — which will allow it to be allocated to the correct shard.&lt;/p&gt;
&lt;p id="fc71"&gt;tl;dr — you can’t update a shard key&lt;/p&gt;
&lt;h1 id="575a"&gt;You cannot shard a collection over 256G&lt;/h1&gt;
&lt;p id="bf4f"&gt;Going back to leaving things too late — MongoDB won’t allow you to shard a collection after it has grown bigger than 256G. This used to be &lt;a href="https://jira.mongodb.org/browse/SERVER-2271" rel="noopener ugc" target="_blank"&gt;a lot lower&lt;/a&gt;. This will eventually be removed completely. There is no solution other than recompiling or avoiding trying to shard collections larger than this.&lt;/p&gt;
&lt;p id="d50e"&gt;tl;dr — shard collections before you reach 256G&lt;/p&gt;
&lt;h1 id="b05a"&gt;Unique indexes and sharing&lt;/h1&gt;
&lt;p id="ba6c"&gt;Uniqueness is not enforced across shards as the enforcement is done per-shard and not globally, except for the shard key itself.&lt;/p&gt;
&lt;p id="bf9d"&gt;tl;dr — Read &lt;a href="http://docs.mongodb.org/manual/tutorial/enforce-unique-keys-for-sharded-collections/" rel="noopener ugc" target="_blank"&gt;this&lt;/a&gt;&lt;/p&gt;
&lt;h1 id="f903"&gt;Choosing the wrong shard key&lt;/h1&gt;
&lt;p id="3432"&gt;MongoDB requires you to choose a key to shard your data on. If you choose the wrong one, it’s not a fun process to correct. What is the wrong shard key depends on your application — but a common example would be using a timestamp for a news feed. This causes one shard to end up ‘hot’ by having data constantly inserted into it, migrated off and queried too.&lt;/p&gt;
&lt;p id="e1a1"&gt;The common process for altering the shard key is simple; &lt;a href="http://www.mongodb.org/display/DOCS/Changing+a+Shard+Key" rel="noopener ugc" target="_blank"&gt;dump and restore the collection&lt;/a&gt;.&lt;/p&gt;
&lt;p id="9823"&gt;MongoDB will support hashing a key for you in the next release (see &lt;a href="https://jira.mongodb.org/browse/SERVER-2001" rel="noopener ugc" target="_blank"&gt;SERVER-2001&lt;/a&gt;) which will make our lives easier if you need to shard on a certain key that happens to be sequential.&lt;/p&gt;
&lt;p id="b3dd"&gt;tl;dr — &lt;a href="http://www.mongodb.org/display/DOCS/Choosing+a+Shard+Key" rel="noopener ugc" target="_blank"&gt;read this before you choose a shard key&lt;/a&gt;&lt;/p&gt;
&lt;h1 id="361a"&gt;Traffic to and from MongoDB is unencrypted&lt;/h1&gt;
&lt;p id="18d8"&gt;The connections to MongoDB by default aren’t encrypted, which means that your data could be logged and used by a third party. If you’re running MongoDB in your own non-public network, this is unlikely to happen.&lt;/p&gt;
&lt;p id="09b7"&gt;However, if you’re accessing MongoDB over a public connection you may want to encrypt the traffic. The public downloads and distributions of MongoDB do not have SSL support enabled; luckily it’s quite easy to compile your own version. Subscribers to 10gen support get this enabled in their build by default. Also, luckily most of the official drivers support SSL out of the box so there should be little hassle there too. Checkout the &lt;a href="http://docs.mongodb.org/manual/administration/ssl/" rel="noopener ugc" target="_blank"&gt;docs here&lt;/a&gt;.&lt;/p&gt;
&lt;p id="8815"&gt;tl;dr — if you connect publicly, be aware stuff is unencrypted&lt;/p&gt;
&lt;h1 id="6d22"&gt;Transactions&lt;/h1&gt;
&lt;p id="9700"&gt;MongoDB only supports single document atomicity, rather than a traditional database such as MySQL which allows &lt;a href="http://en.wikipedia.org/wiki/Database_transaction" rel="noopener ugc" target="_blank"&gt;longer sequences of changes to either completely succeed or fail&lt;/a&gt;. This means it can be hard with out being creative to model things which have shared state across multiple collections. One way of getting around this is by &lt;a href="http://docs.mongodb.org/manual/tutorial/perform-two-phase-commits/" rel="noopener ugc" target="_blank"&gt;implementing two phase commits&lt;/a&gt; in your application…however this is not for everyone; it may be better to use more than one datastore if this is required.&lt;/p&gt;
&lt;p id="fb20"&gt;tl;dr — there is no built in support for transactions over multiple documents&lt;/p&gt;
&lt;h1 id="5d25"&gt;Journal allocation times&lt;/h1&gt;
&lt;p id="6a33"&gt;MongoDB may report to be ready to work, but in fact be allocating the journal still. If you have machines provisioned automatically, as well as a slow filesystem or disks, this may be an annoyance. Normally this won’t be an issue — but if it is, you can use the &lt;a href="https://github.com/mongodb/mongo/blob/e6b9b76748d8051ef6616f7fc0a8e0cfbf38d0d1/src/mongo/db/db.cpp#L721" rel="noopener ugc" target="_blank"&gt;undocumented flag –nopreallocj&lt;/a&gt; to disable pre-allocation.&lt;/p&gt;
&lt;p id="933b"&gt;tl;dr — if you have slow disks or certian file systems, journal allocation may be slow&lt;/p&gt;
&lt;h1 id="9527"&gt;NUMA + Linux + MongoDB&lt;/h1&gt;
&lt;p id="89c8"&gt;“Linux, NUMA and MongoDB tend not to work well together. If you are running MongoDB on numa hardware, we recommend turning it off (running with an interleave memory policy). Problems will manifest in strange ways, such as massive slow downs for periods of time or high system cpu time.”&lt;/p&gt;
&lt;p id="bf57"&gt;tl;dr — &lt;a href="http://www.mongodb.org/display/DOCS/NUMA" rel="noopener ugc" target="_blank"&gt;Disable NUMA&lt;/a&gt;&lt;/p&gt;
&lt;h1 id="57c5"&gt;Process Limits in Linux&lt;/h1&gt;
&lt;p id="c130"&gt;If you experience segfaults under load with MongoDB, you may find it’s beacuse of low or default open files / process limits. 10gen &lt;a href="http://www.mongodb.org/display/DOCS/Production+Notes#ProductionNotes-GeneralUnixNotes" rel="noopener ugc" target="_blank"&gt;recommend setting your limits to 4k+&lt;/a&gt;, however this may need to be varied depending on your setup. Read up on &lt;a href="http://www.linuxhowtos.org/Tips%20and%20Tricks/ulimit.htm" rel="noopener ugc" target="_blank"&gt;ulimit&lt;/a&gt; and its meaning here.&lt;/p&gt;
&lt;p id="e1e2"&gt;tl;dr — Permanently increase hard and soft limits for open files / user processes for Mongo on Linux&lt;/p&gt;
&lt;h1 id="de38"&gt;Thanks to&lt;/h1&gt;
&lt;p id="d4e1"&gt;&lt;a href="https://twitter.com/jonnyeight" rel="noopener ugc" target="_blank"&gt;Alvin Richards&lt;/a&gt;, &lt;a href="http://news.ycombinator.com/item?id=4745157" rel="noopener ugc" target="_blank"&gt;mason55&lt;/a&gt;, &lt;a href="http://news.ycombinator.com/item?id=4745191" rel="noopener ugc" target="_blank"&gt;Pewpewarrows&lt;/a&gt;, &lt;a href="http://news.ycombinator.com/item?id=4745277" rel="noopener ugc" target="_blank"&gt;T-R&lt;/a&gt;, &lt;a href="http://news.ycombinator.com/item?id=4745282" rel="noopener ugc" target="_blank"&gt;rgarcia&lt;/a&gt;, &lt;a href="http://news.ycombinator.com/item?id=4745344" rel="noopener ugc" target="_blank"&gt;stbrody&lt;/a&gt;, &lt;a href="https://news.ycombinator.com/item?id=4745720" rel="noopener ugc" target="_blank"&gt;23david&lt;/a&gt; and &lt;a href="http://news.ycombinator.com/item?id=4745219" rel="noopener ugc" target="_blank"&gt;timdoug&lt;/a&gt;&lt;/p&gt;</description><pubDate>Mon, 05 Nov 2012 00:00:00 +0000</pubDate></item></channel></rss>