curl plus basic http auth? quick fix

You need to test the response on your basic http auth’d dev server.  You want to pass it in the header.  You’re on a real computer…

1) Encode your credentials.  Notice passing -n to echo so we don’t get a trailing newline.

  • $ echo  -n ‘<username>:<password>’ | openssl enc -base64
    • feel free to verify $ echo -n ‘foo:bar’ | openssl enc -base64 | openssl enc -base64 -d

2) Send request

  • $ curl <url> -h “Authorization: Basic <encoded_cred_string>”

Barefooting: It’s mostly fun and games

Lacerations, irregular tear-like wounds caused by some blunt trauma. The term laceration is commonly misused in reference to incisions. (Wikipedia)
Barefoot_Laceration

My left foot after some blunt trauma... photo is misleading as the actually injury occurred on pavement, not gravel.

So as it turns out, bare-footing may have a learning curve… and it might be mostly fun and games, but it’s not all fun and games.  Apparently every 2 miles or so my left foot gets lazy and I get what you might call a little “toe-drag on the up-stroke.”  1st two times on the run it just kinda bruised me, the third time was a charm, however, and caused a blunt force laceration, leaving a pretty red trail all the way home.

But seriously, now that I have your attention, here is the run down on barefoot running, why its better for you, and a few resources.

Barefoot running provides a solution to physiological problem.  As pointed out in “Born to Run,” studies have shown a direct correlation between the price of your running shoe (read “amount of padding therein”) and your chances of getting a running injury.  The idea is that the more padding you have, the more likely you are to run with a high impact gait, and the more trauma is introduced into your feet, ankles, knees, back and neck.  When you take off your shoes, you are forced to adjust your gait in response to an instant feedback mechanism known as “pain.”  You will eventually find your self adjusting the bad habits in your running gait in order to achieve pain free, impact free running.  Just take it slow, as you can see above there is a learning curve.

Barefoot running provides a sustainable hobby.  While most hobbies these days require 500$ worth of start-up gear and at least 100$ maintenance or area use fees per month, barefoot running can be done on the roads for which you already pay your taxes, and the only gear you need is a pair of running shorts and shirt (if thats your thing).  Looking for a minimalist hobby that puts the least amount of trash to the Great Pacific Garbage Patch? This is your gig!

Barefoot running provides a psychological analogy and sandbox.  The major capacity you will learn to use while barefoot running is the ability to 1) listen to the messages your body is sending you and 2) to adjust your behavior in response to these messages.  This lesson can be carried into the emotional/social/psychological realm as well.  Once you experiment with tuning your behavior to bring about physiological peace, balance and homeostasis you can experiment with applying this capacity towards bringing about psychological peace, balance and homeostasis.

So there you have it, barefoot running and some applications in the physiological, social and psychological realms.  Now obviously there are some down sides, such as incurring lacerations, but there again, nothing worth having is free.

Paleo Delight

Leg o' Lamb

Leg o' Lamb

Ingredients: Leg of Lamb, Broccoli, Red Onion, Red Bell Pepper, White mushrooms, Mint, Basil, Ground Black Pepper, Lemon

Lamb: Dice mint  and basil, grind rough black pepper, add lemon juice/pulp and mix.  Rub on lamb, roast covered in oven, remove and switch to broil for last 15 minutes to crisp lamb.

Brocolli: Steam

Veggies: Slice all and stir fry, no need to add flavoring.

Letter to a friend

The following is an email I wrote to a friend who wanted to know what I’ve been doing to get in shape.  I read over it and thought that it may be a good starting point for a FAQs page on my diet… but I thought I would post it here in case others were wondering the same thing. (Name omitted for privacy sake)

_______________________________________________________

Hey ***** good to see you on the road.  So here is the basics of this diet:

No grains (bread, pasta, rice, tortilla, cous-cous, corn), no legumes (beans, peas, soy) and no potatoes.  Also no sugar so no candies, no sodas, etc.  Beer and wine can be drank on the diet but it is going to have to be in moderations (no more than a few drinks a week, at least at first).  What you do eat alot of is vegetables and meat.  The vegetables ought to be colorful (bell peppers, avocado, lettuce, spinach, tomatoes, mushrooms, these are good as salads or stir fry). Basically any and all kinds of meat that you want is ok and encouraged.  Dairy products are also allowed in moderation, but not milk.  So butter/cream and cheese is ok but shouldn’t be a staple. Nuts are also good (macadamia, walnut, pecan, etc) but no peanuts! Peanuts aren’t actually nuts they are actually legumes (beans).  Also fruit is on the diet, but not alot.  Small berry type fruits are better because they are lower in sugar than big sweet fruits like melons, apples, etc.  Basically fruit is ok but should be thought of more as “desert” than the meal itself.

The science behind the diet is that you are turning your body from a sugar burning machine into a fat burning machine. Grains/beans/potatoes/sugar/sugary drinks basically make your body produce alot of insulin.  Insulin’s job is to take sugar out of your blood and put it somewhere else (either your muscle cells, brain, or fat cells).  If you are not running 100 miles a week, the typical american diet of pastas/breads and sugar is going to have the insulin packing your fat cells full of the extra energy from sugar, making you fat even though you are dedicated to running and going to the gym. So by taking these out of your diet you are turning off the insulin mechanism.  When your body becomes accustomed to receiving very low levels of dietary sugar (from grains/beans/potatoes/sugar) it will stop producing so much insulin and it will start using up dietary fat as well as stored fat.  There will be an adjustment period of 1-2 weeks where your body is still expecting lots of sugar so your will be hungry after you eat a low sugar meal, but thats ok, just eat more meat/fats/vegetables.  Eventually when your body stops making so much insulin you will be fuller faster and longer on the low sugar diet.

Thats it!  No more starches and all the veggies meat and fat you could want.

I’ve arrived at this diet from a few different sources that i’ve listed below if you want to check them out for yourself, but i’ve tried to cover the basics.  Oh yeah, and keep in mind, this diet is made to be a lifetime diet, one that you can enjoy and be on forever without feeling deprived.  The idea is that this is the optimum diet for human being to be on and there is no need to eat anything else… of course the occasional treats from outside the diet are allowed but once you are mainly eating this diet the occasional divergences won’t hurt you.

Sources:

I’d recommend that if you want to try it out, try it out for 30 days before expecting results.  After an initial period of adjustment you should start enjoying the diet.  Let me know if you have any questions!

Later,

Pat

Calcium retention, a lesson in economics?

In The Paleo Diet, Cordain advocates a no dairy diet (correct me if I’m wrong here).  Probably the first thing that pops into your mind, and Cordain prepared for this reaction, was “Hey, what about my calcium?!  Won’t my bones disintegrate like Kevin Costner’s fictitious father when he walks into the corn fields in  “Field of Dreams” if I don’t drink my milk?!!”  No need to re-invent the wheel here, I’ll let Cordain rebut this one:

  • “Most of us have gotten the message about consuming calcium.  But the other part of the equation –how much calcium you excrete– is just as important.  It is quite possible for you to be in calcium balance on a low calcium intake if your calcium excretion is also low.  On the other hand, it’s easy for you to fall out of calcium balance –even if you load up on cheese at every meal– if you lose more calcium than you take in.”

Cordain goes on to explain that an out-of-kilter pH balance will send calcium excretion off the charts, and will require you to consume huge amounts of daily calcium to make up for this loss.  The alternative is to keep your pH in balance by consuming large quantities of fruits and vegetables, and luckily enough those same fruits and veggies contain enough calcium to more than adequately exceed your now very low calcium excretion rate.  In a sense, when you are pumping yourself full of milk in order to keep up with your ridiculous calcium excretion rates, you are likely treating the symptoms, and not the actual cause of your real problem.

Picture trying to keep a bucket with a pin-hole leak full by filling it with a dixie cup instead of trying to keep a bucket with the bottom missing full by filling it with a garden hose!  Wouldn’t it make sense to try to plug up the hole, or at least make it as small as possible, instead of running up your water bill using the hose?

So how does economics come into play here?  Well in a sense, we have just talked about the economy of body calcium levels, so now we’re just going to talk about the economy of money.  What if, just like with calcium, there was a way to bring yourself into monetary balance not by making more money, but instead by “excreting” less?  Now this is hardly a new concept.  Take Thoreau in Walden Pond, Jesus sending out the disciples, the Buddha, Ghandi, etc. for examples.  But the reason I bring this up today is because of its possible implication for the US economy!

I don’t really want to go into this in all that much depth, so I’ll just ask a few questions:

What if, instead of trying to get us out of this economic recession by increasing our monetary intake…. [wait for it, waaaait for it]… we tried to get ourselves out of this recession by decreasing our monetary excretion rates?!  Please bring back that mental image of yourself trying to keep that bucket full with a hose, now pretend there are trillions of dollars coming out of that hose instead of water.  Is the only answer to this recession to create new jobs which create new products and services that we didn’t know we needed, and then create demand for these new products and services by telling people that they need them?

For myself, I’m going to experiment in both realms, physiological and economic.  My guess is that just like the calcium, in money not only will I be able to be in balance by lowering my excretion rate, but I’ll be healthier and happier to boot. What about you?

More is Less, and Less is just right?

This whole diet thing has apparently been firing nearby brain cells, and I think i’m starting to narrow in on what the epicenter of this neuro-party is.  Forgive me, my oh so wise bible teachers who i ignored growing up, but I think they were on to something with the concept that Less is More… although i’m wondering is “less” isn’t necessarily “more”, as the “more” we can come to think of as normal is just “too much”, and “less” would actually be “just right”.  I like lists, so the following are the examples from totally different walks of life that seem to be surfacing the same central theme:

  1. Diet
  2. Footwear
  3. Bedding
  4. Possessions

Now each of these topics actually corresponds to a book, or several, that I’ reading. So I’ll expound.

1.  Diet.

I’ve stumbled upon the Paleolithic Diet (The Paleo Diet, The Primal Blueprint, The Atkins Diet?).  The basic philosophy of this diet is as follows:  If human beings evolved to live on hunted game and gathered fruits/veg, and then thived for around 2 million years, then that is the diet under which the human being will perform optimally. Flipped around, the agricultural revolution and all of its spawn (seed-eating, grain-eating, sugar-eating) are the cause of many of modern mans ailments.  But wait! You say.  Wasn’t the agricultural revolution an improvement?  Didn’t it free us from the burden of hunting and gathering?  Well… yes… but it probably is what gave rise to diabetes,heart disease,obesity, 80 work weeks on a farm and 40 work weeks in a grey cubicle.  Sounds like out of the frying pan and into the fire to me.  Or maybe more-so out of the garden of Eden and into the fields to toil and sweat and die of a heart attack.

2. Footwear?

Yes.  Footwear.  Came across this when I thought I should buy new running shoes… thought about Nike Frees, and then ran across a Tim Ferris review of the Vibram FiveFingers.  Bought a pair immediately.  Again, the premise, if human beings evolved to walk on their two bare feet, and then thrived for 2 million years (without plantar fasciitis or heel spurs), then might the modern running shoe be the cause (not the solution) to our modern running injuries?  Then I read Born to Run and was blown away.  Yes… yes it appears that you come out of the womb with the most high tech running suspension system ever created.

3. Bedding

Actually, i haven’t found more than a sentence or two on the whole internet (yes… the whole googlenet, and i fancy myself a pretty quick on the draw googler) regarding simple bedding. [*Update 🙂  Found this link from MDA] But this is more of a personal experiment, taking the less is more idea and trying to apply to other places.  And actually, I’ve had this knot in my back that recurrs whenever I become active over the last 5 years… and after 1 month of sleeping on a futon on the floor, its gone!  Could be a result of diet + exercise change, but who knows!  Anyways, my hypothesis in this area is the same as the others,  if people slept on minimal bedding for two million years… yeah you get the point.

4.  Possessions.

I just cracked open Walden the other day, and I wager to think that it would have been fascinating to discuss a Paleo diet and barefoot running with him.  The man is dead on.  I’m not very far into this book, but already he is comparing the “modern” man of his time to the “savages” he actually had the great pleasure of being able to interact with and observe (at the very least through second person). So far he has spoken to the issues of clothing and housing and how modern man has become a slave to those things which in reality are supposed to liberate him.  “But lo! Men have become the tools of their tools.”  So again I wonder… if man lived and thrived for 2 million years with minimal clothing/possessions (no tvs,bikes,football,sports cars,books)/lodging, did we perhaps take a wrong turn somewhere.  Is it possible that like the carbs, and like the shoes, many/all of the other experiments on improving the human “condition” are also failing/failed?

So thats the question to ponder now.  What other things in my life are  just like the carbs and the shoes in that CV (conventional wisdom) has told me I cannot live without, but reality has demonstrated that not only can I live without, but I can live better without?

Calorie deficit, a love story

Let me start from the beginning. I started dieting 2/12 months ago using the iPhone app LoseIt. The concept was simple enough: a pound of fat = x calories. Divide y (pounds you want to lose) by x and you get h, which is the total calories you will need to lose to lose the weight! Then divide h by w weeks over which you want to lose the weight and you get the magical p which is the calorie deficit you need to incur each week. Further divide by 7 and you get your calorie deficit per day. Subtract that from what you are currently eating to maintain your current weight, and start countin’ those cals!! Oh yeah, and for every “over and above” physical activity (ie weight lifting, running, skiing) you can add back in the appropriate amount of calories to counteract the calories you burned (say hellllllow chessecake!)

So I did that, losing 2 lbs a week for 11 straight week. 22 lbs! Wow, thats 3 short of my target and I was on track to hit my 25 lbs… but something just didn’t seem quite right.  Sure, my waist size went down by about 3 inches and I had to go from the loosest to the tightest loop on my belt, but the numbers on the scale seemed too good to be true. BTW I was also semi-implementing Tim Ferris’ fart diet during this time period but still maintaining my calorie deficit.

What didn’t feel right was that I had lost close to 25 lbs, and sure I “looked” better whilst standing naked in front of my full length mirror, but the man-boobs were still sagging, the “tire-around-the-waist” was still there, and the general fat level was still significant. So I did some research.

As it turns out, your body is marvel of survival engineering!! You see it is not a dumby, it has evolved (or been created, pick your flavor) in the toughest of tough conditions over the history of mankind to react to low calorie situations. Duh! So here is the “problem” (actually its not a problem when is comes to survival, just when it comes to getting that six-pack). When you start incurring a calorie deficit your body does the same thing you would do if your salary was cut to a level below what you are spending, it cuts things out of its “budget” that it considers non-essential and too expensive to keep around. Guess what is one of the most expensive body tissues to keep around? You guessed it, prime steak, muscle. Apparently, although they look great and do a fantastic job of attracting the opposite sex, muscle tissues are incredibly expensive for the body to keep around. Fat, on the other hand, is a pretty cheap reserve.  (Interesting note unrelated to muscle’s caloric costs: just as you would turn down the heat in your house to keep a tight budget, my body actually turned down my internal heat (metabolism) to keep my calorie burning to a minimum.  I have literally been colder than anyone else in the same room as me for the last 2 months!)

Let me put it this way, with our salary analogy, fat would be the checking account in your bank, while muscle would be the sweet new Jeep Wrangler you just bought for off-roading! The cost of keeping your checking account is what… 20 bucks a year? The cost of keeping your Wrangler could be over thouasands a year!  Let me ask you this: If your salary was cut (and you aren’t an idiot), would you A) start spending the money in your checking account in some fiendish attempt to save 20 bucks a year OR B) sell your Jeep for cash in order to pay your bills until you get back on your feet (hey if you start making more money you can always go buy another one right?). Well, if you were most people’s bodies you will spend a little banked money but you are definitely gonna get rid of that Jeep! Get it?

So, allll this to say that the calorie deficit diet accomplishes losing lbs, but the body is way too amazing/complex to reduce a diet to a simple “calories in/calories out” equation. There are amazing built in mechanisms of engineering marvel which attempt everything they have been programmed to do in order to keep you fat! And its a good thing too, or your ancestors would have died in the wild 😉

So apparently a straight up calorie deficit will make your body smaller and weigh less, and yes it will burn off fat, but it will also burn off muscle, and I can confirm this for you by looking in the mirror.

So, the new question is “Is there a better way to burn fat?” Could a better way to burn fat actually be “buy a few more Jeep Wranglers.” I mean, that should drain the bank account pretty quick right? And supposedly that is our goal.

So as of this past week, I’ve abandoned my calorie deficit weight loss plan, and started to incur a calorie surplus on the premise that if I can build more lean muscle tissue, my BMR will go up and I can use the fat stores in my body to maintain muscle mass.  BTW (You need strength training in combo with calorie surplus to build muscle, otherwise that calorie surplus goes straight to the bank account).

So the plan is for the next month or so… to not be hungry! However, I am going to keep a few tenents that I’ve learned:

1) Keep processed grains to a minimum (whole grains are like those slow release laundry detergent balls, where processed grains are like dumping bleach straight onto your clothes. Too much sugar in the blood = more fat build up and higher likelihood of diabetes). If you really want this junk, eat it after intense exercise.
2) Don’t drink calories. Caloric beverages do the same as processed grains. IMHO they should be treated as a once in a while “treat”, not as a staple.
3) Eat more veggies! Man i have been missing out all these years. Veggies are a great way to introduce flavor and filler into your otherwise boring meals of beans/eggs/chili/whatever. Throw in a couple of shrooms, peppers and onions and its nearly-gourmet.
4) Drink water often. If you are a cubicle monkey, a good way to accomplish this (i’ve found) is with caffeine free black tea or mint tea in the afternoons.
5) Bear in mind that fruits are very high in sugar. Don’t exclude them, just keep that in mind.
6) Keep it interesting. I don’t know about you but I’m not living to suffer. Eat some pizza every once in a while, break the rules, go to Wendy’s, eat out with friends and family, have that delicious IPA. Life is for the living, and a diet that isn’t a lifelong lifestyle isn’t a diet, its recreation.

BTW, at first I had all intentions to let the pendulum swing strong, and eat lots and lots and work out like a fiend… but I had to stop and check my motivations. When I remembered the reason I began dieting, i realized that doing this would not be in line with my goals, so I decided to try to fall somewhere in the middle. I think that concept merits its own blog post, but I’ll leave you with a few questions to ponder?

Question 1:
What are your motivations for dieting?

Question 2:
Is it possible that the key to better health is moderation?