Thursday, September 4, 2014

Solutions for Vagrant deployment to AWS

Here are a bunch of notes from troubleshooting Vagrant out to AWS:

An active machine was found with a different provider. Vagrant currently allows each machine to be brought up with only a single provider at a time. A future version will remove this limitation. Until then, please destroy the existing machine to up with a new provider. Machine name: default Active provider: virtualbox Requested provider: aws

 ... yep, destroy it

<br /><span style="font-family: Arial, Helvetica, sans-serif;">Here are a bunch of old notes on errors I got while trying to use Vagrant with AWS.</span><br /> The box you're attempting to add doesn't support the provider you requested. Please find an alternate box or use an alternate provider. Double-check your requested provider to verify you didn't simply misspell it. Name: hashicorp/precise64 Address: Requested provider: [:aws] ... change to the dummy box There was an error talking to AWS. The error message is shown below: UnauthorizedOperation =&gt; You are not authorized to perform this operation. ... IAM... had to make user with that key ID have power access

==&gt; default: Warning! Vagrant might not be able to SSH into the instance. ==&gt; default: Please check your security groups settings. /Users/tlarson/.vagrant.d/gems/gems/excon-0.39.5/lib/excon/middlewares/expects.rb:6:in `response_call': The image id '[ami-21e6e964]' does not exist (Fog::Compute::AWS::NotFound) from /Users/tlarson/.vagrant.d/gems/gems/excon-0.39.5/lib/excon/middlewares/response_parser.rb:8:in `response_call' from /Users/tlarson/.vagrant.d/gems/gems/excon-0.39.5/lib/excon/connection.rb:363:in `response' from /Users/tlarson/.vagrant.d/gems/gems/excon-0.39.5/lib/excon/connection.rb:233:in `request' from /Users/tlarson/.vagrant.d/gems/gems/fog-1.23.0/lib/fog/xml/sax_parser_connection.rb:35:in `request' ... had to find an AMI, in the right zone ==&gt; default: Warning! Vagrant might not be able to SSH into the instance. ==&gt; default: Please check your security groups settings. /Users/tlarson/.vagrant.d/gems/gems/excon-0.39.5/lib/excon/middlewares/expects.rb:6:in `response_call': The key pair 'halfpricedgranite-workbook' does not exist (Fog::Compute::AWS::NotFound) from /Users/tlarson/.vagrant.d/gems/gems/excon-0.39.5/lib/excon/middlewares/response_parser.rb:8:in `response_call' from /Users/tlarson/.vagrant.d/gems/gems/excon-0.39.5/lib/excon/connection.rb:363:in `response' from /Users/tlarson/.vagrant.d/gems/gems/excon-0.39.5/lib/excon/connection.rb:233:in `request' from /Users/tlarson/.vagrant.d/gems/gems/fog-1.23.0/lib/fog/xml/sax_parser_connection.rb:35:in `request' ... again, in the right zone ==&gt; default: Waiting for instance to become "ready"... ==&gt; default: Waiting for SSH to become available... ^C ... because networking is restricted: security_groups ... and may want to name it

Saturday, August 16, 2014

Adding tables to Etherpad Lite

So I love the real-time sharing of Google Docs, so I installed our own Etherpad Lite... and then I wanted tables so I installed ep_tables, but it was a bear to try and copy existing tables into there, so I finally exported some tables and found the format and here's what I recommend, in this example of 2 lines:

{"payload":[["This is a sample row on table 1"," "," "]],"tblId":"1","tblClass":"data-tables"}

{"payload":[[" "," "," row 2 column 3"]],"tblId":"1","tblClass":"data-tables"}

... where each row of data is a line of text.  Just paste them in the document and it reformats into a table.
It turns out the plugin doesn't like line breaks (or tabs) in a row, so don't even try... and that's one reason I wouldn't try and put multiple rows inside one payload line like this:
{"payload":[["This is a sample row on table 1","",""],["",""," row 2 column 3"]],"tblId":"1","tblClass":"data-tables"}

Since you can't split each row onto a new line it is pretty unreadable.
Other hints:

  • Only use the 'Table' button at the top to manipulate the table and not the little mouse-overs... they just never did anything reliable for me.
  • I also installed styles and formatting, but I couldn't get them to apply inside the table.
  • I don't see the purpose of the tblId; I put rows with the same tblId in different places and they showed at their location in the document, with line breaks or whatever in between.

Monday, July 7, 2014

The day-of-week for any day this year (and this century)

I came up with this approach to figure out the day-of-week for any day during the current year:

  • Each year, remember the weekday of first day of the year, eg. Wed in 2014  (See below for a formula for this in the 21st century.)
  • Memorize this set of numbers, one for each month: 155274263153 ... which is the date of the first time that day occurs each month

You can probably get it from there... so here's an example: what day is Dec 25 this year?
  • December is month #12, so take the last digit in that set of numbers: 3
  • That means the 3rd is the first time that Wed occurs this December.
  • Add multiples of 7 to get to other Wed that are close: 
    • +7=10
    • +14=17
    • +21 = 24
  • Since Dec 24 is on Wed, Dec 25 must be on Thurs
  • The exception is leap years, and I typically subtract one from the first day in January and February.
This makes it pretty easy, because that first weekday only changes each year and I can remember that day for the whole year.

Now, for the majority of my lifetime (if things don't go as I hope), it's actually pretty easy to find the first day of the year for any year:
  • Take the year without the 2000 part, eg. 14 for 2014
  • Calculate (y + y div 4) mod 7
    • or (y mod 7 + y div 4) mod 7
    • or (y mod 7 + (y div 4) mod 7) mod 7
  • 0=Sun, 1=Mon, etc.
    • except for on leap years (divisible by 4) subtract 1 day for Jan-Feb
Pretty easy to remember for us mathematicians... it starts with Sunday, and then moves one day each year with an extra adjustment on leap years.

The rules get really complicated for previous or future centuries because we don't have leap-years every 100 years but then we do have them every 400 years.  But, like I say, this works for my foreseeable future, in 99.9% of the times I ever need to find a day.

I haven't written this up before because I checked years ago and found people had already written about this algorithm, but I think it's worth mentioning now because it's so easy for the vast majority of cases people use for a while to come.  BTW, if I want a comprehensive algorithm, I'll probably try Conway's Doomsday Algorithm.

Saturday, June 28, 2014

Get on RespectNetwork and get your XRI name.

Just a little motivation for getting involved with RespectNetwork and grabbing one of their "cloud names" (ie. an XRI) at their great one-time price of $25:

For a while there, I was playing with the APIs for "unhosted" and P2P apps quite a bit, just doing things that seemed fun personally.  I played with Kynetx (founded by my BYU professor Phil Windley) and Singly (founded by Jeremie Miller of XMPP fame), both of which are still very worthwhile projects with huge potential (and you can see from my labels that I've posted about them before).  Other related projects are and and  Anyway, the Respect Network in particular is a brainchild of Drummond Reed and it's had a few changes of directions, starting with, though I look on that activity feed and I don't see much happening there; Drummond Reed and Doc Searls and Kaliya Hamlin and Phil Windley (remember?) are big people in the identity space, eg. the conferences, and so I still expect to see big things out of this set of initiatives for owning our own data.  Anyway, my hope is to push for these kinds of tools and protocols to help fight the silos and lock-in of Facebook and even Google... on top of the basic infrastructure tools (eg.

Saying all that, I realize that it's not very widespread at this point.  I think they're laying out the protocols and doing cool stuff, but it's still at the experimentation point, I'd say.  But some of the concepts are sticking, eg. these XRI names... I got my first one a few years ago... so I think they're worth getting now.

Sunday, June 8, 2014

Building Bitcoin & Litecoin, Mac & Linux

I'm trying to build my own altcoins (because I want to understand altcoin creation).

First of all, Litecoin is the best place to begin because most altcoin tutorials (eg. here and here and here) use it as the basis.  So I started just by downloading Litecoin source and building it.

On Mac:
  • I started with Homebrew but couldn't ever get past problems with boost:

Undefined symbols for architecture x86_64: "boost::program_options::to_internal(std::string const&amp;)", referenced from: boost::program_options::detail::basic_config_file_iterator<char>::getline(std::string&amp;) in util.o "boost::program_options::detail::common_config_file_iterator::common_config_file_iterator(std::set<std::string std::less="" std::string="">, std::allocator<std::string> &gt; const&amp;, bool)", referenced from: boost::program_options::detail::basic_config_file_iterator<char>::basic_config_file_iterator(std::istream&amp;, std::set<std::string std::less="" std::string="">, std::allocator<std::string> &gt; const&amp;, bool) in util.o "Db::verify(char const*, char const*, std::ostream*, unsigned int)", referenced from: CDBEnv::Verify(std::string, bool (*)(CDBEnv&amp;, std::string)) in db.o CDBEnv::Salvage(std::string, bool, std::vector<std::pair char="" std::allocator="" std::vector="" unsigned=""> &gt;, std::vector<unsigned char="" std::allocator="" unsigned=""> &gt; &gt;, std::allocator<std::pair char="" std::allocator="" std::vector="" unsigned=""> &gt;, std::vector<unsigned char="" std::allocator="" unsigned=""> &gt; &gt; &gt; &gt;&amp;) in db.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [litecoind] Error 1</unsigned></std::pair></unsigned></std::pair></std::string></std::string></char></std::string></std::string></char>
  • I tried with Bitcoin with Homebrew and finally got it to build, though "make check" failed.
  • I totally switched to MacPorts and got Bitcoin to build again (including "make check").
  • OK, but I want Litecoin... and again I get problems with boost:

llvm-g++ -c -stdlib=libstdc++ -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -g -DMAC_OSX -DMSG_NOSIGNAL=0 -DBOOST_SPIRIT_THREADSAFE -DUSE_UPNP=1 -DUSE_IPV6=1 -I/Users/tlarson/dev/from-elsewhere/litecoin/src/leveldb/include -I/Users/tlarson/dev/from-elsewhere/litecoin/src/leveldb/helpers -DHAVE_BUILD_INFO -I"/Users/tlarson/dev/from-elsewhere/litecoin/src" -I"/Users/tlarson/dev/from-elsewhere/litecoin/src/obj" -I"/usr/local/include" -I"/usr/local/opt/berkeley-db4/include" -I"/usr/local/opt/openssl/include" -MMD -MF obj/alert.d -o obj/alert.o alert.cpp alert.cpp:6:10: fatal error: 'boost/algorithm/string/classification.hpp' file not found #include <boost algorithm="" classification.hpp="" string=""> ^ 1 error generated. make: *** [obj/alert.o] Error 1 </boost>

On Linux (Ubuntu):

  • Worked, though I had to include all optional items, and also build Berkely DB as instructed in the Bitcoin source and use it here (by setting BDB_INCLUDE_PATH and BDB_LIB_PATH).

I haven't tried Windows yet, since that seems even scarier!

Friday, March 14, 2014

SLC Tech Breakfast on Mar 21

SLC Tech Breakfast on Fri Mar 21 8:00-9:30 AM downtown at Newmont U. Bagels provided.

coursera at princeton (Josh recommends)
dynamic programming (same as memoization, sounds like)
spring roo (rails-like quick start for Java, if I remember right)
linq (for allowing SQL-like data queries in language)jlinq, jpropel
"clock of complexity"
malbolge: unreadable programming language

Friday, February 7, 2014

Today's CTO Breakfast

  • Trent Larson mentioned tool for P2P sharing family histories (
  • Sano Inteiligence for a subdermal patch for monitoring the blood stream
  • True Crypt (vs Best Crypt), with hidden volumes
  • BTSync for P2P file distribution
  • "Scrypt" coin using GPUs vs Bitcoin (w/ SHA256)
  • Vivian at Gild & Provo Dojo last night about underappreciated Utah developers
  • SaltStack, which Wade prefers over Puppet
  • Intel Galileo, running Arduino but also Linux, $60 with power on Amazon, including Wifi connector
  • playing music on a dodecahedron, drawn on a ping-pong ball with an egg-bot, then icosahedron, and then she talked about a theramin
  • Espruino, an Arduino-like board using Javascript
  • NodeRed from Google for graphical design of a node program
  • Google's purchase of Nest
  • Scott mentioned using NFC to configure devices, and Kelly Flanagan is doing it
  • power requirements & parasitic power

Thursday, January 16, 2014

Tomorrow's tech breakfast

Tomorrow morning, 8 AM, downtown: above Jason's Deli at the Gateway.

From Garth: There is a parking lot in front of Jason's Deli (you just have to make sure that the parking space says for gateway office) and the doors to the office are to the right of the entrance to Jason's Deli. My office is in suite 230.


Here's other background info.