14 January 2017

Run Cloud Foundry on a USB drive

Cloud Foundry is an easy-to-use, comprehensive platform as a service (PaaS).  You can write an app locally, cf push it, and have it running in the cloud in seconds.

Pivotal's PCF Dev is a great, simple way to learn and practice using Cloud Foundry.

While you're learning, it enables you to develop and test on a local instance of Pivotal Cloud Foundry.  Then, when you're ready, you can just cf push to Pivotal Web Services (PWS), IBM BlueMix, or wherever your Cloud Foundry is hosted.

It took me about 30 minutes to get PCF Dev running: Download PCF Dev and cf CLI, install them, start the VM, and cf push a simple Python Flask app.

Why develop locally?

Hosted Cloud Foundry costs money.  While I'm in try-and-see mode I'd rather not have to monitor usage or worry about leaving something running that will drain my credit card.

BlueMix, PWS, and others provide a free tier or intro credits.  I'd like to use those up working with those providers' services like Watson, databases, and other integrations.

OK, but .. on a USB drive?

A running VM's swap files and logs can thrash the storage they sit on, wrecking capacity plans and burning out flash.  I'd rather risk that on a good $30 USB drive than on my system drive.

What about performance?

On this laptop the USB flash is a lot slower than the PCIe flash.  This is try-and-see, though, so I'm willing to sacrifice the performance.  When I need my app to run faster or be more highly available I'll cf login to my PWS or BlueMix account and cf push my app there.

Step by step

These steps cover OS X and are similar to Linux.  What did I miss?  Please leave comments!

You'll get used to using the cf commands in a shell anyway, so we'll do our work there.  Ready to go?  Good.

  1. Get a Pivotal Network account; Install or update VirtualBox; Get a good, empty 128GB USB drive.
  2. Pivotal's documentation covers the PCF Dev install really well.  Use it.
    (Check prerequisites; Download the installer; Download and install cf CLI; Install PCF Dev; cf dev start)
  3. Notice where your VM and USB drive are :
    Where's the PCF Dev VM?  ls -d ~/.pcfdev/vms/pcfdev*
    Where's your USB drive mounted?  On a Mac it's like /Volumes/somelabel
  4. Suspend PCF Dev and move it to your USB drive, for example :
    $ cf dev suspend
    $ mv ~/.pcfdev/vms/pcfdev-v0.436.0 /Volumes/somelabel/
    (This move may take a while .. it seems to run 18GB or so)
  5. Link to the new location and resume PCF Dev, for example :
    $ ln -s /Volumes/somelabel/pcfdev-v0.436.0 ~/.pcfdev/vms/pcfdev-v0.436.0
    $ cf dev start -t

A few words about space

tl;dr?  PCF Dev may try to use 60GiB (a little more than 64GB) of space.

What if you want to use a smaller USB drive? or put other things on it besides PCF Dev?  Are those GB? or GiB?  What's the capital of Nebraska?!

The first time I put PCF Dev on USB, I used a 64GB (a little less than 60GiB) drive with 30GiB free.  Then I learned that unmitigated try-and-see will cause Cloud Foundry to download all manner of buildpacks.  And I learned that the .vmdk in PCF Dev will try to grow up to 60GiB.

My PCF Dev .vmdk grew to, any guesses?, 30GiB; At that point PCF Dev seized up and VirtualBox was no longer able to manage the VM.  Want to know more?  Get your storage admin and your VMware admin on a conference call, tell them your VM crashed when it ran out of space in the datastore, ask them why, and demand that it be fixed immediately.

I deleted that PCF Dev and created a new one.  I also emptied my USB drive.  When you delete from a USB drive on a Mac, make sure you're deleting and not just moving to Trash.

Before I moved the new PCF Dev to the USB drive (between steps 3 and 4 above), I did this :
  1. cf dev stop to shutdown PCF Dev
  2. Open VirtualBox, use the PCF Dev VM settings to add the GParted .iso as an optical drive
  3. Boot the PCF Dev VM from the GPartEd .iso
  4. Resize the PCF Dev system partition down to 40GiB (40960MiB)
  5. Apply changes, shut down
  6. Remove the optical disk from the PCF Dev VM
  7. cf dev start -t to start PCF Dev and make sure it's working
The capital of Nebraska is Lincoln.

08 October 2016

#til how the US Supreme Court changes its rules

Today I learned how the US Supreme Court changes its own rules to govern the conduct of trials, appeals, and cases, affecting how our rights are protected and laws enforced.

There are two opportunities for the public to give input in the process: first, participate in the advisory committee's consideration of an amendment; second, support an act of Congress to reject, modify, or defer a pending rule change.


More info ...

What proposed changes are published for review and comment? :
http://www.uscourts.gov/rules-policies/proposed-amendments-published-public-comment

What amendments are pending some review? :
http://www.uscourts.gov/rules-policies/pending-rules-amendments

Who's on these committees? :
http://www.uscourts.gov/rules-policies/about-rulemaking-process/committee-membership-selection

Where can I find more information about what these committees have been doing? :
http://www.uscourts.gov/rules-policies/records-and-archives-rules-committees


How did the process look, for the pending amendment to Rule 41?

(Following 'Summary Of Procedures' on http://www.uscourts.gov/rules-policies/about-rulemaking-process/how-rulemaking-process-works/overview-bench-bar-and-public )

Step 1 : Recommended amendment (Sep 2013)
  http://www.uscourts.gov/rules-policies/archives/suggestions/hon-mythili-raman-13-cr-b
Step 1 : Considered by advisory committee (Jan or Apr 2014?)
  FED. R. CRIM. P. 41, http://www.uscourts.gov/file/15534/download
Step 2 : Public comment 6mo, hearings (Aug 2014, Nov 2014)
  http://www.uscourts.gov/file/1917/download Proposal
  http://www.uscourts.gov/file/17934/download May 2014
  http://www.uscourts.gov/file/document/criminal-rules-hearing-transcript-november-5-2014
  http://www.uscourts.gov/file/17935/download Dec 2014
Step 3 : Advisory committee -> Standing Committee (Dec 2015?)
  http://www.uscourts.gov/file/19123/download May 2015
  http://www.uscourts.gov/file/19125/download Dec 2015
Step 4 : Standing Committee approved? (??? 2016)
Step 5 : Judicial Conference -> Supreme Court (??? 2016)
Step 6 : Supreme Court -> Congress (Apr 2016)
  https://www.supremecourt.gov/orders/courtorders/frcr16_mj80.pdf
  http://www.uscourts.gov/file/document/2016-04-28-final-package-congress
Step 7 : #SMHAct
  https://www.congress.gov/bill/114th-congress/senate-bill/2952/

29 September 2015

Why do we still have this problem?

As a problem solver, you have a limit - a threshold, a tolerance - for how many times you're willing to solve the same problem.

When you tire of solving it, you'll eliminate the cause, or automate the solution.

This is why when you see a problem that's new to you you're tempted to assume no one else has tried to solve it.

If it was a common problem then someone would surely have prevented it by now. Right?

If you assume, instead, that someone *has* solved this type of problem before, then you free yourself up to think right away about how to eliminate it.

28 September 2015

Which kind of ASS are UME?

I tell problem solvers, "Assume there's already a solution."  The first time I tell them this, they say, "You know what happens when you ass-ume haha!"

When you've decided that you need to solve a problem, you can dig in and start creating a solution.

Or you can look for other solutions to learn from.

Either way you're assuming.

Do you assume someone's already tried to solve a problem like this? Or do you assume you're the first?

27 September 2015

1st Grade Algebra

My youngest daughter made a game to examine the number 29. She's in first grade. It's Sunday.


Her: Write a number sentence that makes 29
Me: 7 x 4 + 1 = 29
Her: Daddy, that's 12
Me: What does that "x" mean?
Her: Oh .. "times"?
Me: Good. What's 7 times 4?
Her: 28
Me: That's great! How did you know that?
Her: Because 29 minus 1 is 28

24 September 2015

Listen closely: "I haven't been trained on that."

In every role I've had - from paid work to parenthood - I find a simple, reliable indicator of initiative and engagement.

When asked to perform an unfamiliar task, a person's response can show engagement and initiative :
"I have an opportunity to learn that"

Or it can show a lack of engagement and initiative :
"I haven't been trained on that"

People who are engaged and show initiative are ready to go. Show them where to find the instructions. Give them good examples of the work to be done.

When you hear "I haven't been trained on that", though, listen closely. There's a problem in the way that training won't fix.