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  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 which is the more advanced trading platform owned by Coinbase.  The authentication is the same userid & password as

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, 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 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/ 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” “”&gt;
<plist version=”1.0″>
<string>Checks for and downloads updates to the ClamAV virus database.</string>



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” “”&gt;
<plist version=”1.0″>
<string>Runs a clamscan on the /Users subdirectories</string>



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/ 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.

if [[ -z $1 ]]; then
echo “Converts USD amount to BTC amount”
echo “$0 <USD amount to convert to BTC>”
exit 1
AMOUNT=`curl -s | 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.

if [[ -z $1 ]]; then
echo “Converts BTC amount to USD amount”
echo “$0 <BTC amount to convert to USD>”
exit 1
BTC_VALUE=`curl -s | 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.


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

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
Kinda neat to immediately see where Google Drive is connecting to, that easily.

Macbook Pro external display only while on battery

I haven’t really done this until now, but I figured I’d share how I worked around my issues.

Since I use my new 2017 Macbook Pro as a desktop & laptop, I don’t want to constantly charge the battery while I have it docked.  The problem is that by default MacOS sleeps when the laptop lid is closed.  This is a problem when you don’t want it open & just want to use an external monitor connected via HDMI (through an HDMI -> USB-C adapter) or USB-C directly.  After searching around for a bit, I found a free utility app that helps with this, named “InsomniaX“.  It doesn’t come in a dmg file, just a heads-up.  It’s packaged in a tar.gz tarball which can be decompressed using archive utility.  That’ll drop it into the same directory as the tarball, and you’ll drop and drop it to your Applications folder.

It’s very spartan and almost invisible unless you’re looking for it.  It sits in the tool bar on top, and looks like a crescent moon.  The drop-down menu appears like this when clicked:
Screen Shot 2017-07-15 at 2.31.29 PM

That pretty much sums it up.  As you can see, I selected “Disable Lid Sleep”, and I am operating primarily on my external monitor as I would when plugged in.  The difference when using the power adapter is there is a selection in the Energy Saver section of System Preferences that reads, “Prevent computer from sleeping automatically when the display is off”.  If desired, InsomniaX also has selections in the Preferences area to disable lid sleep while on AC along with starting the application on login.

Screen Shot 2017-07-15 at 2.43.04 PM

Anyway, it’s a neat little utility and does what it’s supposed to do.  Always nice to share those things when you run across them.  Have a great one!

New Set of Apple Airpods Bluetooth Earpieces

I’ve gone through quite a number of bluetooth earpieces.  The one thing I’ve found though is the quality was always subpar compared to normal wired earpieces, and my guess is due to the amount of power required normally to deliver a decent balanced bass.  The market seemed to have fallen on it’s head, and went the route of creating ear inserts and calling them earbuds.  This doesn’t fly in my world, since my ears hurt after using them along with creating compacted ear wax or even collecting on the earbud itself.  They never quite sounded right since it always seemed like they were intentionally pressed closer to the ear drum.

I decided to splurge and get a set of Apple Airpods since they act as headphones along with microphones.  It did hurt to initially purchase them due to the price being artificially high with Apple not officially selling them at their stores since the stock is severely low.  There was a seller on Amazon, and I ordered through them… for $60 more than MSRP.  After a week or two of use, are they worth it to me?  Yes.

Basically, they feel the same as the stock earpods, without wires attached.  Here is a picture of them with Airpod skins protective wraps along with Spigen brand earhooks covers for use on my motorcycle.  I have to say the Spigen earhooks do a great job of containing the Airpods into my ear while riding.

And this is what they look like without the earhooks, which is how I use them when not on a moving motorcycle.


The reason they have sold themselves to me so heavily after using them is for several reasons.  One is that each earpiece senses when inserted into the ear, and alerts the device it is paired with.  This has been very helpful while listening to music and talking on the phone, since as soon as the earpiece is removed the music application senses the change and pauses as if the headphones were unplugged.  This also is helpful while on speaker – as soon as the bluetooth earpiece is inserted, the phone automatically switches over.  The integration with icloud is awesome, if you use it.  Using icloud, the Airpods can be migrated between iPhone to Macbook Pro to iPad to anything else using icloud.  Once the Airpods are added to one of the devices on icloud, it’s added to icloud and instantly added to everything else while being managed by icloud.  I’ve used this to migrate my Airpods between my iPhone to my Macbook Pro, then back to my iPhone after using them for what I needed.

The ability to switch between earpieces is a nice feature as well, and I use this feature while on long production-related calls now.  Using a single earpiece, Once I notice the battery getting low on power, I pull the other one out of the charging case and put it into my ear.  Then, I put the one I’d been using into the case to charge.  The battery in the case I’ve yet to entirely use through the day, and each earpiece I’ve gotten about 2-3 hours of active use (not standby) from between charge.  I’ve also noticed if used as simply a headset, the battery lasts much longer, usually 4-5 hours.

The container holds the earpieces perfectly, since it’s molded to fit and there is a magnetic holder at the base of the container to pull down and secure them.  This makes holding them in your pocket very stable.  The sticker skin that I have around it is mostly to break up the white color.

Until another business decides to make something that has the same ease of use, quality, and integration, I’d buy this again in spite of it being outrageously priced simply because nothing else offers it that I have seen.

EDIT July 29th 2017
I gotta say, these are my favorite set of bluetooth earpieces I’ve ever owned.  I’ve used them for conference calls, listening to music, listening for notifications while at work, etc.  One of my favorite features is being able to pull them out of my ears on an instant, and the music just pausing.  That’s great at work when someone walks up, and I can pull the earpiece from my ear and talk without fiddling with my phone.  The other thing I love is that I’m able to use them when I ride my motorcycle.  With the Spigen brand earhooks, I’ve been able to ride many times to and from work without the earpieces slipping out of my ears.  Now granted I have a windshield on my cruiser which cuts wind quite a bit, but not completely when at 70+ MPH on the freeway.  Also, the noise cancellation works awesome I’ve found.  You’d think with the microphone (on the bottom of the earpiece stem) being so far from your mouth that it would be a problem, but it does just fine when I’m talking normally to someone and there’s noise around me from others talking in the office.  I’ve used it out of the office too, and I haven’t had anyone have issues with hearing me.  In fact, most don’t think I’m on bluetooth, which in itself means a lot.  When I’ve been on long conference calls, I’ve been using one earpiece, and after 2 or so hours when the charge gets to 30-35% I put the other earpiece in my ear then charge the one I’d been using without any interference with the call.  The earpiece recharge only takes 10 or so minutes, and the charging container lasts for quite a few charges.  I went without charging the container for a week or so, only charging once in its life so far when it reached 40%.

The only complaint I have so far is how oddly my phone won’t connect with the airpods even when they are paired.  I turn off bluetooth and turn it back on, and all is well.  I spoke with an Apple store “Genius” (I hate that term), and she said the same as what I’d been doing.  Not sure why, but it’s a quick fix.

EDIT September 15th 2017
I still absolutely love the quality of the Airpods.  I do think Apple needs to work on the bluetooth pairing detection, however.  One thing I notice quite a bit is how iOS at times detects them immediately and other times I have to manually turn them on in the “settings -> bluetooth” area.  I still notice turning off bluetooth and turning it back on helps at times, so it’s definitely an iOS subsystem quirk that more than likely will be fixed as the audience gets larger.  I thought I lost my main Airpod set because I was in a rush and couldn’t find them in the morning, so I picked up another set at the Apple store. (NOT liking to buy them again, btw).  Ended up finding them at home, so now I have two sets and I’m using one set for my personal phone and the other set for my work phone.  With that being said, I’m using the work cell phone for nearly all work calls now, and it’s amazing during meetings.