Ketogenic Diet – Week 2

Just an update that I’m on week two of the ketogenic diet with Keto Chow as the base.  I won’t lie and say I’m on a miraculous “only ketochow” meal prep, but it is still the majority of the days.  I have however done studies and found Chipotle taco bowls a great substitute for a meal as well.  Minus rice and beans with just a small touch a salsa and double sour cream with cheese and lettuce, it works great.  I’ve also found burgers with lettuce wraps work great as well since lettuce has very little carbohydrates.

Drinking water to flush your body is a wonderful thing.  I’ve been going through 1/2-1 gallon water per day along with coffee and tea of course.  I have been using decaffeinated tea/coffee to avoid any issues.  As far as sodas, I still drink diet but I try to limit it a bit.  I also try and have decaffeinated when I can.

On to week 2, but this time I’m going to try to use more ketochow through the week, and use outside food as a treat or social thing.  Keeping things keto the whole time, of course.  The sugar ups and downs feel like they are dieing down a bit as well.  I’ve lost 5 lbs since last monday, which I’ll attribute to water.

Advertisements

Ketogenic diet – start week 1

In a nutshell, ketogenic diet is replacing your diet structure with the following:
70-80% fat
20-25% protein
5-10% carbohydrate

Since most people eat much larger carbohydrates and sugars, it’s quite a change.  It takes 3-4 weeks for the body to fully adapt to the diet properly but most people are faster than that.

I’ve studied the human body and it’s digestive and metabolic processes for quite a number of years, superficially.  I’ve also studied the energy distribution when I was working out as a weight lifter 10+ years ago.  Age has a way of losing information it seems, and also throwing a curve ball.  I’m not liking the curve ball I’m being thrown since it seems my metabolism has changed quite a bit.  Being an amputee, I’ve done various other athletics but after a while it damages my leg and makes me take a hiatus which starts a cycle of not working out then working out then not working out… <insert cycle>.  This is not good, and I am gaining weight while eating semi-regularly, and while reducing my food also.  That is scary.
Normally (before being broken) to fix this I would simply increase my cycling and run after work either at the gym or on the road.  I’ve gained weight to the point that it is an issue since the weight causes quicker damages to the limb and is starting to effect internal readings like blood pressure and most noticeably cardio.  Not working your lungs makes them weak, etc.

My goal is to get my blood readings in check, and this will be a foundation to help my body be more prepped for weight loss since lipid levels and various other readings are causing blood pressure increase.  You can really feel it when the blood pressure becomes and issue, and you know when to stop.  It’s a death feeling, not cool.  Since I’m in an office environment 8 hours a day, I figure I’ll use the ketogenic food style.  Since I have more than just that to worry about, I’m going with a tried-and-true method: meal replacement shakes.  Most people are all like “oh, you’re into that fad, I’ll wait til you stop and eat your big mac” or something else ridiculously tacky.  I tried it before as a trial and it was doable but never followed through long-term.  I need to now.

I’ve tried many ways of doing it, including making my own.  Making your own powder mix takes quite a bit of time, so I stopped that idea.  The one that I’ve had success with and will be using is named “Keto Chow”, made by a guy in Utah named Chris Bair.  Well, not just him since it’s a company now, but he’s the founder and his family runs it with him.  He also eats ketogenic, and has for years now with very nice results.  He’s even recently done a real-life study of only eating Keto Chow and drinking only water for 4 weeks during his work trip.  It has helped him quite a bit, and he’s going to soon be doing a press release on this once he gets the final write-up finished.  Here are the informal week blogs posted:
https://www.ketochow.xyz/2017/11/nme-experiment-4-weeks-keto-chow-1st-week-tests-back/
https://www.ketochow.xyz/2017/11/nme-experiment-4-weeks-keto-chow-2nd-week-tests-back/
https://www.ketochow.xyz/2017/11/nme-experiment-4-weeks-keto-chow-3rd-week-tests-back/
https://www.ketochow.xyz/2017/11/nme-experiment-final-results-daves-making/

Anyway, I’ve babbled way too much, on to the meat of it.
This is my first week starting the ketogenic diet, primarily with Keto Chow as my food.  Now, I’m not yet going to drink only water since I like tea and coffee.

Today (November 27th) was my first day of the week being keto-only.  It did take a bit to tell my work friends I’m not going to lunch with them to <insert random Mexican restaurant>, but I explained to them later what I was doing.

With Keto Chow, it comes in a week sized bag of pre-made powder that contains everything but the “fat” and water.  Each meal is one scoop (49.52g) of powder with the addition being heavy cream (or heavy whipping cream), avocado oil, coconut oil, etc.  That is varied depending on how many calories you want to have in your meal.  Their website explains it but it’s basic math.  Keto Chow powder has 135 calories per serving/scoop.  Multiply that by the number of meals you want in a day (3), then subtract that number from the number of calories you want in a day.  That’s the number of calories you add in heavy cream. (or alternatives I’ve mentioned)

Making it for the day (or 2 days) is pretty much simple math as well.  You can use blender bottles or any other sealed bottle that will hold 16-20 oz liquid.  An immersion blender (stick blender) is amazing for this.  I make mine by the day, so I have 3 bottles… blender bottles right now, but I have Hydro Flasks coming to keep them cold for the day without refrigeration.  Here’s an example:

  • My day’s calories: 1200 kcal
    • Keto Chow powder (135 calories & 49.52g per serving/scoop):
      • 3 meals so multiply 49.52g by 3 = 148.56g powder for the day which is 405 calories
    • Heavy cream (I’m using Trader Joe heavy cream, 50 calories & 15 ml per serving):
      • Take the day’s calories (1200) and subtract the calories of the Keto Chow powder (405), in this case it is 795 calories
      • Divide that calorie amount (795) by the amount of calories in a heavy cream serving (50), which in this case is 15.9 servings of heavy cream. (or 15 ml times 15.9 = 238.5 ml total)

From the above, we now have our day’s calculated needs for 1,200 calories:
148.56g Keto Chow powder
238.5 ml heavy cream

The next step is to take a gallon (or close) container and mark about 48 oz on it.  How I did was simply pour 16 oz of water into one of the blender bottles 3 times, then used a sharpie.
Now, to measure heavy cream to that amount the blender bottle will help a lot.  The side of the bottle has ml marks, and averaging is fine.  Pour heavy cream until it’s just a touch below the 250 ml mark between 200 ml & 300 ml.  Then pour that heavy cream into the gallon container.

Then, fill about half of the container with water with the heavy cream and also measure the Keto Chow powder on a scale to the nearest whole number.  (149 in this case)
Dump the Keto Chow powder into the water after measuring it out, then blend it until everything is well mixed.  This doesn’t take long, but make sure it’s thorough since some can stick to the sides and the bottom.

Pour the container equally into the 3 blender bottles (or whatever you are using), refrigerate for at least an hour to let everything mix properly naturally, and that’s it!  Keep refrigerated, or if using a Hydro Flask it’s good for the day.

The above measurements can be multiplied by the number of meals you want to use, of course.  If doing 2 days (6 meals), just multiply by 6 and have 6 bottles.  If you want more water in the bottles, it’s fine to add it in after as you wish and shake it up.  Since it’s water, nothing is harmed.

That’s about it.  It might look semi-complicated with how I describe it, but once read a couple of times it will make sense.  The Keto Chow website (http://www.ketochow.xyz) is a better site to read about it, and find other links to sites with more information there.

I’ll post weekly about my results and anything I find out along the way.  Wish me luck.

Bitcoin & How To Buy Easily

I’m not a huge Bitcoin fan, I just enjoy dabbling in playing with it.  I know it’s a bit convoluted in how to get into it, and I also know it seems like it’s built to absorb money in fees.  With research, it’s possible to not only avoid fees (mostly), but to dictate your trade exactly as you wish.

I personally try to keep everything I do on the K.I.S.S. method.  (keep it simple, stupid)
I do complicate things at times, but only when it makes other things easier.  This we’ll keep it simple.  There are many bitcoin exchanges, but this will rotate around one named Coinbase.  Coinbase exchanges various cryptocurrencies including bitcoin, litecoin, and ethereum.  This will deal strictly with bitcoin, but could be applied to other cryptocurrencies.

What will be needed is a bank account, and signing up for a free account on Coinbase.com.  Once an account on Coinbase is created, on their website once logged on go into the Settings tab at the top and choose the Linked Accounts sub-tab.  Add your bank account by choosing the “Link a new account” button and walk through the steps.  After everything is complete, the account will be available to trade currency with.

Next will be going to the website http://www.gdax.com which is the more advanced trading platform owned by Coinbase.  The authentication is the same userid & password as Coinbase.com.

While the interface may seem VERY complicated, the parts we will be focusing on are as follows:

  • The top bar holds “Last trade price”, “24 hour price”, and “24 hour volume”.
    The last trade price is the current price of 1 bitcoin on the market at that current time.  The 24 hour volume is simply a percentage (positive or negative) price change throughout the last 24 hours that the market price of bitcoin has changed.
  • The lefthand vertical bar holds balance information on your current gdax wallets (USD along with bitcoin BTC), and the tool below it to perform the trades.
  • In the center is the dynamic chart of trades being performed.  It may seem complicated at first, but is used as a general high view of the trends.
    The first thing is to know what the colors mean.

    • green = Trades being sold
    • red = Trades being purchased
  • The rest is great for information while researching trends, such as the Order book which holds more details on the trades in the general center chart, along with the Trade History which holds information on the historic purchases on the market. (If you want to view it, I never worry about it).

Before doing anything, simply watching the graph change for a bit and getting a feel for the flow of buys/sells is best.  It will give you an idea of how at times sudden surges in buying and selling occurs, along with the patterns that can evolve at times.  That is useful if you intend on using this for sudden purchases.

If you are like I am and intend to buy/sell at a particular price on the market, the way to handle that is with simple math before making any trades.  The first thing you will need to know is how much money you are wanting to use for this trade.  In this example, I will use $100.00.  Then, the price that 1 bitcoin would be during your purchase.  For this example, I will use $6500.00.

  • First, we will break down the current market price of 1 bitcoin into the how much $0.01 would buy in bitcoins
    • 1/$6,500.00 (1 divided into 6500.00) which is “0.00015384”.  This is the amount of bitcoins $0.01 will buy currently.
  • Second, multiply the money you’re using with the value we calculated last
    • $100.00 * 0.00015384 = 0.01538400  This is the amount of bitcoins that your money will be purchasing.

We now know we will be using $100 to purchase 0.01538400 bitcoins (BTC).

The next step is to move money from your bank account to Coinbase.  Once logged into coinbase.com, select the “Accounts” tab at the top, then next to “USD Wallet” is “deposit”.  Select that, choose which account to withdraw from if you have more than one bank account inserted, type the amount, then “continue”.  Bank account transfer is free, however it takes 5-7 days to complete.  Once that is complete…

The next step is to move money from your Coinbase account to your GDAX USD wallet.
This is done by first logging onto dgax.com and on the top of the left bar under Balance, choose the Deposit button.  In the popup, select “Coinbase Account” in the top bar, then choose “USD account” in the dropdown, then insert the amount to be used and select the “deposit funds” button.  The transfer will be instant, since it is within the Coinbase network.

The final step is the trade!
Within GDAX, ‘limit’ trades are free.  This will be a non-immediate trade that will occur once the bitcoin market price reaches the price chosen.  In our calculations above we will be using $100 and trading with the market price at $6,500.  That’s all we need to know to perform the trade.
To set the limit trade in place, on the left bar saying “Market” “Limit” and “stop”, choose “Limit”.
Select “Buy” underneath the Limit button.  Now we enter the information into the fields below.  Within “Amount”, place the amount of bitcoins to purchase.  In our case, it will be “0.01538400”.  Within “Limit Price”, place the market price you want the purchase to occur at.  In our case, it will be “6500.00”.  With the information entered, underneath will show the total amount of cash that will be used.  Select “place buy order”, and the trade is set.

This will not instantly trade until the market reaches the amount chosen.  If it did instantly meet that, there would be a fee applied so it’s best to give it a little room for motion.  The same technique is used on selling, except you are selling existing bitcoins within the BTC wallet.

After all transactions are performed and you have BTC, they can be moved to your Coinbase wallet with the “withdraw” button and choosing “UTC Wallet” under coinbase account”.  If the vault is used, there will be more time needed to withdraw since it is meant as long-term storage and also meant to be harder to access to avoid theft.

That’s the basics.  If you wish to withdraw from gdax directly to your bank account, this can be performed as well.  I did it this way and it was a free movement of ~
$2,200, so it bypassed any fees Coinbase did show.

Hope all this helps.

Crontab Not Working in MacOS Sierra

Having used Linux and Unix since 1995, I find myself pretty much locked at the hip with crontab to keep my jobs working on a given schedule.  Go figure, as soon as I update my MacOS machine to Sierra and at the same time want to get Clam antivirus configured to auto-scan, I find out it’s not working in there.  It was a bit of a rabbit hole situation, where one thing lead to another.  In the end, I found out that cron has been deprecated in OS X/MacOS, and now Launchd is default and supported.  One of those things that rubs me the wrong way, but it is what it is since it’s not designed to be a server or a Unix system really.

I found /usr/lib/cron to be symlinked to /var/at, and /var/at has a cron.allow file (/var/at/cron.allow).  ‘At’ is also disabled by default.  ‘Atrun’ controls it.  I vi’ed /System/Library/LaunchDaemon/com.apple.atrun.plist and found out that cron was deprecated.

Here’s the skinny on Launchd.  plist files handle the applications that will run within it.  It’s an XML based file which tags a string name for it, the program application that will run, arguments, when it will run, and how frquently.  A description and logs are designated in there as well.  Once one is seen, it’s relatively simple to edit and create your own for any script or application you’d like to run.  That’s what I did.

/Library/LaunchDaemons – holds plist files for global services running as root
/Library/LaunchAgents – Holds plist files only used while users are logged on. (Run as ‘root’)
$HOME/Library/LaunchAgents – Hold plist files used when users are logged on. (run as the userid)

And on to the commands to control launchd… which kinda reminds me of systemd on newer Linux systems, disturbingly.
  • launchctl list – view currently registered plists
  • launchctl load -w <plist file> – adds and registers plist file, starting it.
  • launchctl unload -w <plist file> – remove and deregister plist file.

So, I wanted to have freshclam (clam antivirus script that updates clamav) run regularly.  I created this plist file (/Library/LaunchDaemons/net.clamav.freshclam.plist):

<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE plist PUBLIC “-//Apple Computer//DTD PLIST 1.0//EN” “http://www.apple.com/DTDs/PropertyList-1.0.dtd”&gt;
<plist version=”1.0″>
<dict>
<key>Label</key>
<string>net.clamav.freshclam.plist</string>
<key>LowPriorityIO</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/freshclam</string>
<string>–quiet</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>ServiceDescription</key>
<string>Checks for and downloads updates to the ClamAV virus database.</string>
<key>StartCalendarInterval</key>
<dict>
<key>Minute</key>
<integer>60</integer>
</dict>
<key>StandardErrorPath</key>
<string>/tmp/freshclam.err</string>

<key>StandardOutPath</key>
<string>/tmp/freshclam.out</string>
</dict>
</plist>

 

And a script I wrote that uses clam antivirus to scan my directories is run by this plist (/Library/LaunchDaemons/net.clamav.clamscan.plist):

<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE plist PUBLIC “-//Apple Computer//DTD PLIST 1.0//EN” “http://www.apple.com/DTDs/PropertyList-1.0.dtd”&gt;
<plist version=”1.0″>
<dict>
<key>Label</key>
<string>net.clamav.clamscan.plist</string>
<key>LowPriorityIO</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/clamscan.sh</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>ServiceDescription</key>
<string>Runs a clamscan on the /Users subdirectories</string>
<key>StartCalendarInterval</key>
<dict>
<key>Minute</key>
<integer>60</integer>
</dict>
<key>StandardErrorPath</key>
<string>/tmp/clamscan.err</string>

<key>StandardOutPath</key>
<string>/tmp/clamscan.out</string>
</dict>
</plist>

 

After all is said and done, Launchd runs clam antivirus to scan my /Users subdirectories on a regular basis just in case I have something on here I shouldn’t.

It’d be nicer if there would just be an integrated scheduler with the Apple clam antivirus that would translate the scheduling into something that wouldn’t require learning how to build a Launchd script from the beginning.  I can see why they didn’t since it started on Linux and it’s easier to just toss something like this into crontab:

*/60 * * * * freshclam 2>&1 > /tmp/freshclam.log

US Dollar amount to Bitcoin Dollar amount

I found myself needing to calculate how much Bitcoin I’d get for a certain US dollar amount, and I grew tired of checking websites.  I made a quick and easy (OS X) bash shell script that takes US dollar amount as parameter, and returns the current bitcoin value per $1 USD along with the amount of Bitcoin the amount of USD given in the parameter would purchase.  The code below only works properly on OS X, but for Linux if you remove ‘$’ (including the single quotes) from the sed sections it will function properly.  The output is as follows:

MBP:~ danlund$ ./scripts/btc_amount.sh 200
Current BTC Value per USD: 3796.03
Answer: 200 will currently buy 0.05268600 BTC

Without any further adieu, here’s the script.  Feel free to edit as you wish, I’m just looking to share it.  This will not unfortunately function without a working internet connection since it pulls current BTC data from Coinbase.

#!/bin/bash
if [[ -z $1 ]]; then
echo “Converts USD amount to BTC amount”
echo “$0 <USD amount to convert to BTC>”
exit 1
fi
DOLLARS=$1
AMOUNT=`curl -s https://api.coinbase.com/v2/prices/BTC-USD/spot | sed ‘s/,/\’$’\n/g’ | sed ‘s/{/\’$’\n/g’ | grep amount | sed ‘s/”//g’ | sed ‘s/:/\’$’ /g’ | sed ‘s/}}//g’ | awk ‘{ print $2 }’`
BTC_PER_DOLLAR=`bc <<< “scale=8;1/${AMOUNT}”`
BTC_QUANTITY=`bc <<< “scale=8;x=${DOLLARS} * ${BTC_PER_DOLLAR}; if(x<1) print 0; x”`
echo “Current BTC Value per USD: ${AMOUNT}”
echo “Answer: ${DOLLARS} will currently buy ${BTC_QUANTITY} BTC”

 

EDIT August 22nd, 2017:
Of course I found myself wanting to convert Bitcoins to US dollars, so I wrote a script (based on the above one) that does that.  I figured I’d share it, even though it’s relatively simple.  It saves a a bit of time for those that want to use this.

NOTE: This was created using bash & utils on MacOS with OpenSSL 0.9.8zh 14 Jan 2016.  I tested this on Ubuntu 5.2.1 and the version of Openssl (OpenSSL 0.9.8g 19 Oct 2007) was an issue.  I tested on CentOS 7 with a different version of Openssl (OpenSSL 1.0.1e-fips 11 Feb 2013) and there were no issues.

#!/bin/bash
if [[ -z $1 ]]; then
echo “Converts BTC amount to USD amount”
echo “$0 <BTC amount to convert to USD>”
exit 1
fi
BTC=$1
BTC_VALUE=`curl -s https://api.coinbase.com/v2/prices/BTC-USD/spot | sed ‘s/,/\’$’\n/g’ | sed ‘s/{/\’$’\n/g’ | grep amount | sed ‘s/”//g’ | sed ‘s/:/\’$’ /g’  | sed ‘s/}}//g’ | awk ‘{ print $2 }’`
BTC_PER_DOLLAR=`bc <<< “scale=8;1 / ${BTC_VALUE}”`

USD_QUANTITY=`bc <<< “scale=2;x=${BTC} / ${BTC_PER_DOLLAR}; if(x<1) print 0; x”`
echo “Current USD Value per BTC: ${BTC_VALUE}”
echo “Answer: ${BTC} will currently return ${USD_QUANTITY} Dollars”

 

Updated November 19, 2017:
I change the code to work with some changes in Coinbase’s return information.  It was throwing parsing errors.

Missing my parents

I know I’m an adult of many years.  I have many things in my life that require my responsibility, and many people require it as well.
Lately, I’ve been a child inside.

I miss my parents, and their love.  I miss the look of my father as I told him about my life.  I miss my mother talking about how she felt about current news.  I miss the only stable thing in my life.  I’ve been trying to stay quiet but it’s honestly very hard: I miss my parents more than anything in this world and I never knew I’d say that in my lifetime.

This is a tribute to you dad, you bastard.  You taught me how to keep my nose to the grindstone, and you taught me it’s okay to laugh and enjoy life as you do that.
Mom, you taught me how to love people that don’t deserve it, along with tolerating without end.

Anyway, I’m sorry this isn’t normal for me but it’s needed.  I miss you Mom & Dad.  I love you.

MacOS / OS X – App that makes an app for your scripts

If you’re anything like I am, you have scripts that call do random things, or call other apps behind the scenes to set environments to do other things, etc etc.  The issue I run into is it doesn’t seem pretty to have aliases in my Applications folder.  You can’t set Icons for aliases, and it just sits there as a plain white Icon.  Not cool, man, not cool.  As I was studying Swift code tonight I ran across a gem I thought I’d share which helps amazingly with this problem!  It’s called Platypus, and it creates an app that will run scripts (bash, csh, tcsh, ksh, zsh, Perl, Python, Ruby, Applescript, Tcl, Expect, PHP, Swift, and others) that you set the name for and environment.  Details below.

Platypus1

It’s fairly straight forward, which is nice.  The app name is free form, and so is the author name.  The script path you can type in yourself or find it with ‘select script…’.  If you’re adventurous, the “new” button can be used to create your script right there.
For me, the great part is the interface dropdown which allows you to pick how the called script will be interfaced with.  I pick ‘none’ so it runs in the background out of view.  I have a few ‘wine’ scripts that I call with this, and allows it to run out of sight and out of mind.  As far as icons, I’ve used jpg and ico files by selecting the gear under the picture and choosing ‘select image file…’.  The ones that are able to be used are not shaded out, which is great.

When you click ‘create app’, it will ask you where you want to save it along with the name of the app.  There are other development related selections underneath that can be chosen which I don’t have any experience with.
Screen Shot 2017-07-19 at 9.22.17 PM

I’ve so far used this to call ‘Microsoft Money 2002’ via Wine, along with calling ‘Notepad++’ via Wine.  It works nicely, for me.  It’s available for free (you can donate if you enjoy it) at http://sveinbjorn.org/platypus.

The dude made an awesome app.

For those interested, he also makes another app called “Sloth” that acts as a visual version of the cli tool ‘lsof’.  Kinda neat, I just started looking at it about 10 minutes ago.  It’s available off of his main page, just remove “platypus” from the URL and you’ll see links. (or just go to http://sveinbjorn.org/sloth)
Kinda neat to immediately see where Google Drive is connecting to, that easily.