Bitcoin: How to claim your BitcoinCash after the Hard Fork

Before the August 1st, 2017 hard fork, I moved all of my Bitcoins (BTC) to cold storage on various paper wallets, each protected by BIP0038. The fork itself was relatively uneventful, which is a testament to the technology underlying Bitcoin. The currency has survived, not because it has never yet been attacked, but rather because it is designed to survive DESPITE continuous attacks. This proved true once more after the fork.

And then the truly strange happened: everyone with Bitcoins suddenly got free money. Like, actual free money. The new alt coin BitcoinCash (BCH) emerged and has been trading with steady volume and support at about 7% of BTC’s value at the time of this writing. That is a free 7% return on your holdings.

So how do you actually get that cash? How do you access the coins on the new blockchain?

Who this tutorial is for:

  1. If you had Bitcoins in paper wallet cold storage prior to the fork
  2. If you leverage BIP0038 to encrypt your paper wallet private keys
  3. If you are a USA citizen

There are a thousand combinations of Bitcoin users, but I fell into the above category and had a hard time figuring out how — exactly — to actually do something with my BCH. Thanks to some Reddit users and google searches, I eventually managed and decided to make a quick how-to for anyone in a similar situation. Despite the specificity, other cold-storage forms and other countries of citizenship may find parts of this useful.

A few basics

Things get a little confusing when we start talking about forks and multiple blockchains. It is important to understand what is going on behind the scenes so you do not expose Private Keys or otherwise cause your Bitcoins to be non-secured. Let me summarize the key understanding before we go on.

Bitcoins all exist on the blockchain. There is no way to “download” your coins or to truly take them “offline,” despite terms like hardware wallet or cold storage imply. Every single coin that exists is noted in the blockchain and is owned by a particular public key. In order for a transaction to include a particular coin (e.g., to be spent), the transaction need to have the private key that corresponds to the public key on that coin in order to prove ownership. I can randomly pick a thousand coins and make a transaction sending them all to me, but the Bitcoin network will reject the transaction when I am not able to provide the proper private key needed to unlock the coins in question. Like a password, but orders of magnitude more secure, I won’t be able to get the needed private keys if I am not the true owner, barring theft or hacking or intervention from a deity.

When you talk about cold storage or hardware wallets, you are talking about keeping that unlocking private key offline so it can’t be stolen, but the coins themselves are always still in the chain and are always still publically assigned to your particular key.

When someone comes along and clones the Bitcoin network and gives it a new name (which is the essence of a fork) they will have the same record of all existing coins, and the same record of all coin assignments. This means your same private key works on the new network, just as it did on the old one.

What happened on August 1st, 2017?

A two-year disagreement between developers of Bitcoin came to a parting of ways. When differences could not be reconciled, a portion of the community decided to just go their own direction. They installed an incompatible version of the Bitcoin network code onto their mining platforms and local machines, took a copy of the existing blockchain, and carried on.

This new code was such that it rejected any blocks coming from the old network, and the old network rejected any blocks coming from the new network. As a result, the two immediately went their own way, each blockchain ignoring the other.

The result is that all coins connected to private keys you control were duplicated. One version sat on the old network, and another version sat on the new network. It also meant that spending and receiving money suddenly forked as well, because now transferring money on one chain has no effect on the other chain.

The key here is this: The same private key now unlocks two coins, but those coins are not otherwise linked or connected. Depending which network your wallet/site uses will decide which of those two coins you are handling at a given time.

How do I get BTC or USD from my cold BCH?

If you’ve followed along so far, you probably can anticipate the steps we need to take. I’ll outline them here, then go into detail:

  1. Sweep BTC in cold storage to a new address
  2. Import your Private Keys into a wallet that talks to the BCH network
  3. Transfer your BCH funds to
  4. Trade using BTC/BCC exchange
  5. Send the BTC funds to your normal exchange for cash out, or else back to cold storage

Nice and easy.

Step 1: Sweep

In order to access your BCH, you will need to expose the private key corresponding to the coins you wish to claim. The problem is, as noted above, this same private key will also unlock your Bitcoins on the main chain. Exposing your private key is, therefore, a significant security risk. To get around this, you should first move your existing cold Bitcoins to a brand new address with its own Private Key. This will only affect the coins on the Bitcoin network side, but it will ensure that when you expose your private key in the next step on the BCH network, there is no risk of an attacker trying to unlock corresponding BTC coins. If they do try, they will find a zero balance since that version of the coin has been moved.

I do this through, but any wallet software will do. In, go to Settings->Addresses, and under Imported Addresses, click [+] Import Address. Here you will enter the public address of you current paper wallet, the one containing coins you need to move.

Once you’ve added this “watch address,” return to the main interface and choose “SEND.” Use the drop-down next to “My Bitcoin Wallet” to select the address you just added, and in the TO field, enter the NEW paper wallet address you want to use.

This TO address should be brand new, and thus using a private key that is not associated with any of your coins on the BCH network. You will need to expose your private key now, but your risk is reduced by 15x since the coin on the BCH side is worth that much less.

Note: supports BIP0038 encryption. If your paper wallet private key is encrypted, as mine are, you will be prompted for the encryption password in order to complete the sweep. This is safe to do.

Repeat this for any other paper wallets you control. At the end of this step, all of your coins will belong to NEW private keys on the main blockchain, but on the new BCH blockchain, all of the same keys we just used still control the corresponding coins there.

2. Import your private keys

Now that your Bitcoins are safe, you want to unlock your BitcoinCash still stored at those old paper wallet addresses. For this, you need a wallet software that knows how to connect to the new network. I used this:

Launch the software and create a new standard wallet. Once that is setup, you will have an empty wallet that is connected to the BCH network. Now you need to import the private keys you just used on blockchain in order to access the corresponding coins on this side.

If you use BIP0038, ElectronCash does not allow you to import the encrypted private key the way does. An extra step is required!

2.a. Decrypt your BIP0038 Private Key

Navigate to

Move the mouse around until the %’s reach 100%, just so the interface doesn’t screw with you. Once that is done, click on “Wallet Details” on the right.

Paste in your Private Key, and provide the passphrase. Click the Decrypt button, and let it spin, then your unencrypted Private Key will be printed down below. You can copy the WIF compressed format or the standard noncompressed format.

Note: entering your private key into a website is typically a bad idea. Since we already secured our Bitcoins and are about to move our BCH from this key, the procedure is relatively safe. The password is not uploaded to the server, but there is always a risk that the site is hacked and manipulated. If you use this same password on other cold wallets or are otherwise security paranoid, you can disconnect your network once the site is loaded. Everything will run with javascript offline, leaving you free to do what you need to do, then wipe out the session/cookies before reconnecting. Even better, get a USB-bootable Ubuntu and complete this step in an offline virgin OS (as you should have done when you created your paper wallets in the first place!). I didn’t bother since my private keys and BIP0038 passwords would both be garbage after this operation anyway.

2.b. Sweep into ElectronCash

Once you have non-encrypted private keys, open your wallet in ElectronCash and go to Wallet->Private keys->Sweep.

Enter your non-encrypted private key in the text box (or multiple, if applicable, one per line). Do not change the “Address” field — that is your local wallet address and is a safe place to receive the contents of the old paper wallet. Complete the sweep and wait for confirmation, and now your coins are safely moved to new/distinct addresses on BOTH chains.

3. Transfer to ViaBTC

I had a lot of trouble finding an exchange for BCH that would let me do anything as a US citizen. Coinbase does not support BCH, Bitstamp does not support BCH, Kraken does not validate US citizens, BTC.COM does not validate US citizens, etc.

ViaBTC, however, does allow you to complete a simple automated ID verification. It requires your actual name and a driver’s license ID number (or passport), as well as set a few passwords (you’ll need to setup the asset password, for instance). Once that is done, you can immediately use ViaBTC as a go-between from BCH to BTC. Create the free account, complete the validation, then you want to transfer your money into the platform. I recommend doing a small amount initially and stepping through the entire process before you send large quantities of funds.

Once you have an account, go to the Asset->Deposit->BCC section. ViaBTC uses the older ticker symbol BCC to represent BitcoinCash, even though the rest of the community has moved to BCH since BCC was used for another alt coin. In any case, on this page, you will see a recipient address that you can use to transfer your BitcoinCash into the system. Copy that address.

In Electron Cash, go to the “SEND” tab. Paste the address in the “PAY TO” field, leave description blank, and then select an “AMOUNT” to send. When you are ready, hit SEND. You will need to SIGN the transaction and hit BROADCAST.

You can track the progress of the deposit using any blockchain browser for BCH. I prefer Blockdozer since it is most similar to The address is this format:

It takes some time to get confirmations since the hash power on the BCH network is much lower than the main BTC network, so be patient. Wait until you get 20 confirmations since ViaBTC prevents you from withdrawing prior to that anyway (even though they let you trade earlier).

4. Trade BCH to BTC

When you have your confirmations, you can go to the Trading tab and select BCC/BTC. Select your full balance by clicking on the “Available balance: xxxx” label, and hit “Sell BCC”.

In my experience, selling was instant. If you return to the Asset tab, you should now see no BCC, but some lesser amount of BTC depending what exchange rate you received.

5. Withdraw your BTC

Now that you have BTC funds, you can withdraw them to your normal exchange, such as Coinbase, or else send them to your paper wallet. You need to configure a recipient address, which is done from the Asset->Card/Address menu.

Under “BTC Address Settings” heading add a new address:

Provide the address of your paper wallet, or else the recipient address from your exchange. Save this then return to the Asset->Withdraw->BTC tab. Here you can send the funds you traded out to the address you just added above:

And that is it! Be patient — the withdrawal will sit in the “processing” state for a short time, then go to “verified” and sit there for a while… all without broadcasting to the Bitcoin network. But within the hour, it will change to “Sent,” at which time you can track it on the normal blockchain.

And that is it! You just collected your free money.


Or, maybe you cheated yourself out of a fortune if BCH gains dominance and BTC falls by the wayside. Nobody can predict what might happen. In any case, if you decide not to sell some (or all) of your BCH, you should still sweep it to a new address, just like we did for the BTC.

If you followed steps 1 & 2 above, your BCH should be safely moved to an address in your ElectronCash software wallet, so if you take the proper backup/password precautions, that is a safe place to retain the funds. Otherwise, you can use ElectronCash to send the coins to a new paper wallet, created the same way you would for a normal Bitcoin paper wallet. The process is the same as outlined in the latter half of step 3, but replace ViaBTC’s recipient address with your own.

Hope this helped to demystify some of the confusion around BCH and BTC of late. Happy trading, fellow crypto hodl’er.

Readback with Scrivener on iOS

On the Mac, text-to-speech is built into the operating system. This means you can highlight just about anything in most programs, right click, and go to Speech->Start Speaking and at once a flat Skynet robot will begin reading to you. As mechanical as the voices tend to be, I’ve found readback an indispensable part of my editing process. I catch spelling errors, strange phrasing, and all sorts of things that just don’t stand out on the written page.

Furthermore, writing is currently a backseat passenger in this runaway train that is my life, so I am often trying to squeeze it in amidst other things. The fact the computer can read to me while my attention is (ostensibly) on other things is fantastic and it lets me get some actual utility out of various chores, such as cleaning the dishes, cooking, etc.


I’ve kicked out a couple blogs about Scrivener for iOS. Long story short, most of my writing is on mobile (iPad specifically). Were it not for the mobile app, I’d get hardly a word down these days. For a long time this has meant no more readbacks, or so I thought!

Turns out the same functionality is available on iOS, it just takes a few steps to turn on.

To begin, navigate to your Settings -> General -> Accessibility

Then find the menu item called Speech

Turn on “Speak Selection” then click on “Highlight Content.”

Here, choose to highlight both sentences and words. This is very helpful when you hear your device read something wrong and you need to see where it is in the text to correct it.

Finally, you can click on voices if you want to adjust how the robot sounds. I’m reasonably happy with Samantha Enhanced (which is a separate download, all managed right from the voices screen. The enhanced version has a bit more natural tonal variation as she speaks).

How to use it

Ok! Your iPad or iPhone is ready to go. Using the feature is simple. Pull up Scrivener and press and hold to get the context menu, then select all for the chapter/scene you want to hear (or highlight just the part you need).

Now you may notice a new option comes up in the context menu called “Speak.” Go ahead and give that a tap, and you’re off to the races:

As you can see it highlights the sentences as it goes, with the currently spoken word in blue.


I found one other cool trick with this feature. I noticed it doesn’t say some of my made up words properly — an unsurprising problem, in a fantasy book. If you return to the “Speech” screen under Settings->General->Accessibility, you will notice at the bottom is a section called “Pronunciation.” Click into there.

What this lets you do is enter words and provide a phonetic spelling for the readback to use instead. I did it for one of my main characters, as well as an in-world term I created for doctors, both of which the default voice botches.

To add one of your own, hit the little (+) icon and you get a screen like below. Put the word as it will be found in your Manuscript in the “phrase” section, then under substitution, enter the same word phonetically. Use the “Play” button in the upper right to test it out until you get it right. Once this is setup, the readback will use these pronunciations automatically as it moves through your Scrivener documents. Quick aside: I’ve noticed the sentence highlighting sometimes gets quirky when it hits a word for which you’ve defined a replacement. I’d keep this feature’s use to a minimum.

Hopefully someone out there finds this helpful.

All right then, back to procrastinating!

Scrivener Sync Conflicts

I’ve been absent for a couple weeks, thanks to the adventure unfolding beyond the page with my new son Evan. He is doing great and fatherhood is proving a most unexpected delight.

What little writing I have managed in the last few weeks (and I actually have strapped on a couple thousand words) has been *almost* entirely on my iPhone, using the mobile Scrivener app I wrote about a couple months ago. Typing on a phone is far from an ideal experience, but it is working for me, and letting me use free minutes here and there in a more productive way.

Sync Problems

Today I hit my first issue. I don’t know exactly what happened, but I fired up Scrivener on my laptop and was met with a dire warning: the Mobile Sync encountered conflicts! Scrivener then closed out my project, made backups, did who knows what, and popped back up with a new folder down at the bottom called CONFLICTS.


Eeek. I have plenty of experience resolving conflicts with source control frameworks and diff utilities, but what can I do with Scrivener?

It’s okay! Nothing is lost!

So I did some research and eventually figured this out. The first thing to do is take a deep breath and realize that nothing was deleted. When Scrivener is unable to merge changes together, it just saves the two conflicting copies of the file. All your words are there, you just need to figure out which file they live in. In some cases you will need to compare the two versions and manually merge the differences together, if they both contain some new changes and some old changes. It takes a little patience, but rest assured it can be done without losing any valuable words.


This is a cool feature in Scrivener that I’ve not really played with before. Basically, you can save versions of individual files and keep track of the changes as you go, including the ability to roll back to older versions. This is the functionality we’ll use to quickly figure out how to merge our files.

What you want to do is pull up one of the conflicted files, then choose Document->Snapshots->Take Snapshot

This will save a copy of this particular version off to the side for us to compare to later. If it doesn’t open the snapshots sidebar, you can click the camera icon next to the notes area, or choose Document->Snapshots->Show Snapshots.


What you should see on the right is a list of all your snapshots for this file, in particular, the one we just made:


Copy & Paste

Believe it or not, that was the hard part. Now we are going to use a little trick to let us see the specific changes and decide what is the correct version, without missing anything.

My naming convention, as you can see in that first screenshot, is not the clearest. However, from looking at the text I know what chapter each of those files comes from. I just made a snapshot of the first one in that list, which happens to be my chapter 1. Now I scroll up and find the real version of chapter 1 under my Manuscript:


Once there, I do Edit->Select All, then Edit-> Copy

No, go on back to your conflicted version, the one you just took a snapshot of. Once there do, Edit->Select All, Edit->Paste.

This changes the contents of the conflicted file to match the contents of the Manuscript file, but because we have a snapshot saved, we can drill in to see exactly what those differences are. To do this, click the “Compare” button (no need to save a new snapshot).


Now on the right you will see a version of the document with blue writing indicating new text that was not in the snapshot, and red strikethrough indicating text that was in the snapshot, but has now been deleted by the manuscript version. You can use the arrows to jump from difference to difference, and manually copying the right bits back up to the Manuscript version of the file.


So in this case, I can see my “Conflicted” version had an extra line, which has been deleted in the “Manuscript” version (e.g., it is in red). In this case that line was supposed to be deleted, so I don’t have to do anything, my manuscript version is right.

You can go one by one until you have them all resolved. When you are all done, right click on the Conflicts folder and move it to the trash.

*whew.* Crisis averted.

Scrivener on iOS

One week ago, Scrivener launched an iPhone app and updated their desktop application to support syncing projects between devices through DropBox. I tried it out and figured I’d help you do the same.

Getting Setup

In order to work on your existing projects on-the-go, you will need a few things. First you will need a free DropBox account. If you are new to cloud storage, here is the cliff-note version: DropBox is easy to use, they’ve been around a long time, and they keep your files safe and encrypted. Signup for a free account then mosey on over to their download page and get the desktop version of the application. Once installed, this will create a new folder on your computer (Mac in my case):


Screen Shot 2016-07-27 at 17.08.36

Only the stuff you put in this folder gets synced up with the cloud, so you don’t have to worry about accidentally uploading all those nude selfies you keep on your desktop. Oh, that’s just me who does that?

Well in any case, once installed, grab your iPhone and give this link a nice press. The Scrivener iOS app costs $19 (here in the USA at the time of this post), but well worth the money if–like me–ideas hit you at random times and demand attention.

Once the app is installed, fire it up and hit the sync icon in the upper left, next to the plus icon:

Screen Shot 2016-07-27 at 17.14.15

Choose to sync from Dropbox, login to your account, and let the app do its thing. When it finishes, you will notice a brand new folder appeared on your computer in the DropBox folder called:


Screen Shot 2016-07-27 at 17.16.26

Nothing else happened on the iPhone, but that is okay.

Syncing your first project

On the computer, go ahead an open Scrivener to your work in progress. Then choose File->Save As… and navigate your way into the Dropbox/Apps/Scrivener folder, and save your project there.

You could just move the project file manually, but I am of the school of thought that having extra backups is never a bad thing. Just remember your working copy (and your synced copy) is now in the Dropbox folder, and the old one is just your backup.

Close down Scrivener and wait until you see the little green check in your Dropbox folder, like in the image above. This indicates everything is synced up to the cloud.

Now switch over to your iPhone and open the Scrivener mobile app. Hit that sync icon one more time, and you are done! From here on out, everything syncs automatically, or at the push of a single button.

The Scrivener mobile app

The app is absurdly easy to use. Once you pick a project, you basically start with a mobile view of the left-hand menu from the desktop app, and you are free to drill down to look at your characters, locations, notes, everything.


If you drill into Manuscript, you can access your chapters and start working away. They keyboard has a cool left/right sliding toolbar that gives you quick access to some of the advanced style features you would expect on a computer:


Congratulations, you are ready to go!

Once you have made changes on the mobile app, just tap the sync button and modified files will make their way back up to dropbox, and then down to your computer again, all in a matter of seconds. The next time you open your Scrivener project file (the one in the Dropbox/Apps/Scrivener folder), you will see the changes ready to go.


As with all multi-device syncing, it is a good idea not to edit things in multiple places at once, as this has a tendency to confuse even the best synchronizing software. The safest use case is to have your Scrivener project open in only one place at a time. Leaving your computer? Save and quit. Made a change on your phone? Exit back out before you sit in front of your computer. This way you only ever have your project open in one place.

If you do happen to leave Scrivener open on your desktop then make changes on your phone, be sure to press they manual sync button (the one on the right) before you carry one with further changes on the Desktop:

Screen Shot 2016-07-27 at 22.06.43

Likewise, if you have Scrivener open on your phone but made changes on your computer, you should make your way back to the app start screen and hit the sync button.

Pro tip

If you are like me, about half of your ideas strike you while you are lying in bed, lights out, sleeping wife beside you. I am a big fan of the accessibility feature on the phone that lets you invert the screen colors, and I’ve linked it up to the triple-click on the home button (Settings->General->Accessibility->Accessibility Shortcut). When an idea strikes in the dead of night, a quick triple-click later and I have a great nightvision-preserving non-wife-awakening editor:


Lastly, if you have one of the new iPhones (6, 6S, or later) that supports the “3d touch,” make ample use of this trick. Force touch anywhere on the keyboard, and suddenly you get a mouse-like cursor that you can steer around with your thumb, helping you jump around with ease.

Mercurial on Yosemite

Mercurial is a great source control system… it is light and easy to use, and versatile enough for a professional environment. When I started my current company I worked extensively on Ubuntu with a local Mercurial server, and so when I switched to OS X (Lion at the time) I brought my same setup with me. Unfortunately, after upgrading to Yosemite, I found some tweaks were necessary. Here is how I got Mercurial setup with SSL on Yosemite for command line use.

1) Install Mercurial from MacPorts

$ sudo port install mercurial

2) Create a repository… I use /var/depot for the config and /var/depot/repos for the actual source.

$ cd /var
$ sudo mkdir depot
$ sudo mkdir depot/repos
$ sudo chown -R _www:_www depot/repos

3) To setup the Mercurial web server we first create some needed files to run the web interface, then we will need to modify apache. To start create hgweb.cgi. Note that I’ve modified the Python path on the first line… the default is /usr/bin/env, which is the wrong version of Python for HG.

# An example hgweb CGI script, edit as necessary
# See also
# Path to repo or hgweb config to serve (see 'hg help hgweb')
config = "/var/depot/hgweb.config"
from mercurial import demandimport; demandimport.enable()
from mercurial.hgweb import hgweb, wsgicgi
application = hgweb(config)

4) Create hgweb.config

/var/depot/repos = /var/depot/repos

5) Create the hgwebdir.cgi file, and again update the python path:

# An example CGI script to export multiple hgweb repos, edit as necessary
# enable importing on demand to reduce startup time
from mercurial import demandimport; demandimport.enable()
from mercurial.hgweb.hgwebdir_mod import hgwebdir
import mercurial.hgweb.wsgicgi as wsgicgi
application = hgwebdir('hgweb.config')

6) Create the users file to allow people to submit to your repo. I created the username mike. Repeat for all users you need:

$ htpasswd -m hgusers mike

7) To setup Apache and SSL you need to do a few things. I am assuming you already have Apache started. To make the needed changes, open /etc/apache2/httpd.conf. Make sure the following modules are included (some additional config is necessary if you want your webroot to run out of the user dirs… I put mine in /var/www/ so I skip those steps):

LoadModule authz_core_module libexec/apache2/
LoadModule authz_host_module libexec/apache2/
LoadModule cgi_module libexec/apache2/
LoadModule userdir_module libexec/apache2/

8) In the <directory> directive for your web root, make sure after “Options” you have “ExecCGI”. Mine looks like this:

Options FollowSymLinks Multiviews ExecCGI

9) Also in that same directive, add a handler for CGI:

AddHandler cgi-script .cgi

10) Finally, make sure near the bottom the following line is uncommented:

Include /private/etc/apache2/extra/httpd-ssl.conf

11) Save that file. One more step to setup Mercurial, then we can configure the SSL certificate and a few other things. Create and open this file: /etc/apache2/other/httpd-hg.conf

ScriptAlias /hg "/var/depot/hgweb.cgi"
<Location /hg>
Options ExecCGI
Order allow,deny
Allow from all
AuthType Basic
AuthName "Your Authentication Prompt Message Goes Here"
AuthUserFile /var/depot/hgusers
Require valid-user

12) Now to configure the SSL certificate return to the /etc/apache2/ directory and do the following. This will create a private key, a signing request, and finally a usable (non password locked) public key:

$ openssl genrsa -des3 -out server.key 1024
$ openssl req -new -key server.key -out server.csr
$ cp server.key server.key.orig
$ openssl rsa -in server.key.orig -out server.key
$ openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

13) Now setup Apache to use the certificate you just setup. Edit /etc/apache2/extra/httpd-ssl.conf, and make sure the following are uncommented and pointing to the files we just setup:

SSLEngine on
SSLProtocol all -SSLv2
SSLCertificateFile '/private/etc/apache2/server.crt'
SSLCertificateKeyFile '/private/etc/apache2/server.key'

14) Ok that is the bulk of the server setup. Now we can configure a repository and try setup our user (mike). Let’s first create a quick repository to use.

$ cd /var/depot/repos
$ sudo mkdir example; cd example
$ sudo hg init

15) This is a quirk that seems to be necessary for Yosemite only. Go into the freshly created .hg directory inside this repo, and create an hgrc file.

$ cd /var/depot/repos/example/.hg
$ sudo nano hgrc

Enter the following:

allow_push = *

Now make sure this whole directory is owned by _www;
$ cd ../../
$ sudo chown -R _www:_www example

16) Nearly there. Restart apache, and make sure a few things are working.

$ apachectl restart

17) If you have a problem, try apachectl configtest. Now visit https://localhost/hg. It will alert you of a certificate error, again because the cert is self signed, but you can select to trust it. Then it should ask you to login using the name and password we created in step 6. You should be able to get in and see the example repository.

18) The last piece of configuration we need is for the user that will be cloning/pulling/pushing from the command line. Go to your home directory and create an .hgrc file with the following content:

default.prefix = https://localhost/hg/
default.username = mike
default.password = <>
default.schemes = https
username = mike <[email protected]>
cacerts = /etc/apache2/server.crt
allow_push = *
push_ssl = true
description = localhost/hg

19) This won’t work quite yet because our SSL cert is self signed, which will fail most security checks. We can fix this — go to your webroot (/var/www in my case) and follow these steps.

$ hg clone https://localhost/hg/example
$ cd example
$ touch test
$ hg addrem; hg ci -m testing; hg push

This is going to fail with a message something like this:

(configure hostfingerprint XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX or use --insecure to connect insecurely)

20) Copy all the numbers for the fingerprint above, and paste that into your ~/.hgrc file in the [hostfingerprints] section we left blank above:


21) You are done! Mercurial works, the web utility works, and SSL works.

How to regain access to your FiOS router

Forgot your FiOS router password?

I stumbled across this one recently, and figured I would share my results.  I forgot my password to my router, and had to change some settings — facing the prospect of a factory reset, I spent some time digging.

If you are locked out of your FiOS router, give this a try:

  • Navigate to your router:
  • Notice the query string varible: active_page=9091

Whoever designed the web interface on these things make a bunch of rookie mistakes, which we can leverage to gain access.

Change the URL slightly to tell the router to serve you a different page (ID 9090 in this case):

fios interface

The router now serves up it’s “login setup” page.  You are free to reset your password without ever providing your current one.  Major security hole? Yes.  Can this be done from outside? I haven’t tried it… But probably.

In any case, you now have your router back in your control!

Calculating N-Spheres

As a result of my years studying String Theory at the undergraduate level, I eventually developed a method for determining the properties of N-Spheres, with the ambition and then-enthusiastic hope of finding the required testing distance over which the strength of gravity would need to be measured to determine the number of physical dimensions there are in space.  While I did eventually come up with an equality that might produce an experimental setup, the choices I made with my career after my undergraduate degree obviated the need for further investigation.  In any event, I thought I would share what original research I did develop, so here is goes.

Why Spheres?

Gravity is weak.  This is well known and endlessly recited, but the explanations for why it might be weak are often too esoteric to delve into.  One proposal  comes out of string theory research (now several decades old), and revolves around the properties of the graviton.  Although presently undetected, the graviton is a proposed member of the complete standard model, and serves as the carrier of the force of gravity.  These particles are theoretically exchanged by massive objects and thereby guide their attraction to one another.

But why is the strength of gravity so far out of whack from the other forces?  Employing an example of this weakness from Brian Green, think about a common refrigerator magnet.  Here we have a competition — a battle of strength against a few ounces of iron on the magnet, and the gravitation pull of the entire planet Earth.  Were gravity and electromagnetism on equal footing, the magnet would fall straight to the ground (and weight much more than a few ounces for that matter).  But that is not what we actually see.  In fact, the few ounces of iron have no trouble at all resisting the pull of the Earth’s gravity, and the magnet sticks resolutely to your refrigerator.

In string theory, there are more than three dimensions in real space, but those extra degrees of freedom are only accessible to certain types of string configurations, one of which is the graviton, and only over very small distance scales.  In normal 3-space, a force emanating from a point will expand as a spherical wave, thereby experiencing a flux density that drops in proportion to R squared.  Why squared?  Because the total flux emitted by this point must spread itself over the surface of a sphere growing  with time, therefore the density is the total flux divided by the surface area of a sphere.  This can be clearly seen built into the common equations of force.  Take for instance Gravitation:


‘G’ is the gravitation constant, and being a constant it can accurately be rewritten as any combination of constants, leading to the unusual but entirely accurate formulation:


And there we have it, a flux (numerator), divided over the surface area of a sphere.  This is visible again in Coulomb’s Law, and here the constant is often defined in terms of 4π:


Again the flux (numerator) is divided by the surface of a three-dimensional sphere.  So if you are dealing with these forces, you are dealing with spheres, and if you are dealing with three dimensions, you are dealing with ordinary looking “2-spheres” described by their usual properties.

Moving to N-Sphere

Without going into too much detail, the string theory explanation is pretty simple.  If string theory is correct about the true makeup of space-time, then over very small distances the force of gravity is much stronger.  As gravitons emit from a source, many of them drift off into extra dimensions.  The pieces that stay in our coordinates then move along and obey normal 2-sphere propagation attenuation, but appear as if they were very weak to begin with, as so many gravitons have already disappeared.  What I sought to accomplish was to determine what the force of gravity should actually look like in small scales, if space-time has more than three dimensions.  Clearly a 2-Sphere no longer describes the real “surface” that the net flux is distributed over.  The theoretical test, once a n-sphere formulation of gravity is identified, would be to find a means of balancing gravity against electromagnetism (a force that cannot see the extra dimensions, and is therefore 2-spherical all they way down) and see where they balance.

So one last time, the gravitational FLUX is described by the numerator in the equation above, and we are searching for the new surface to distribute it over.  Let psi-g represent the flux, and the constant k-g will be defined as follows (or merely the gravitational constant divided by 4π):



When trying to imagine N-Spheres, like many before me, I work on analogy starting from lower dimensions.  Lets bear in mind the definition of a circle (a 1-Sphere) to help extrapolate: the set of all points equal distance from one center point.  In the case of a 0-Sphere, (a “sphere” that exists on a single line), the “set of all points” would refer to only two points.  The point R away from me along the line in one direction, and the point R away from me along the line in the other direction.  The “volume” of this sphere can be calculated by doing a “shadow integral” over an identity function running between R and -R.  As with any sphere, the surface area is then the derivative of the volume.


These answers make some sense intuitively.  If you have two points, separated by 2r then the “volume” of your 1-d enclosure is simply the length of line between them, or 2r.  The “surface” is really the sum of two points, which is harder to visualize, but expressed in the math.  Lets move ahead to 1-Spheres… commonly called circles.  We already know what to expect from these results, but lets test it.  Now I am going to do a “shadow” integral over an identity function, first describing a circle, and then from -r to r once again:


Lets do the last familiar case, so the pattern in the equation can emerge.  Here is the 2-Sphere:


Whenever you want to determine the “volume” of the next dimensional sphere, you need to first integrate over a circle that contains all of the degrees of freedom in question, and then treat that as your “shadow” and integrate up each dimension in the chain.  As expected, each dimension adds an extra power to the radius, which each time extends into a new degree of freedom.  Here are the results of the next several N-Spheres, arriving ultimately at a 9-Sphere whose surface can describe the flux distribution in an 11-dimensional string theory (special thanks to the TI-89 Titanium, and several sets of batteries!):


Here are the final order ones that matter for String theory.  These took hours to verify on my TI-89, although I originally determined these using an expansion I derived from the previous 5.


And there we have it.  String theory calls for at least 11 dimensions, meaning one time dimension and 10-spatial dimensions.  A ten dimensional sphere, or a 9-Sphere (9 because the numbering indicates the number of dimensions that makeup the bounding surface), therefore describes the needed volume and surface.  Of course I make no claim of having inventing the concept of shadow integrals, but I can take credit for deciding to use them to solve for N-Spheres in this way.  Just to cap this off, here is my formula (fully original, deduced only from my previous calculations) for finding the volume of an N-Sphere.  I have not proven this formula mathematically, but I have verified its predictions up to 10-Spheres:


New equivalence

If string theory is correct and gravity is very strong on a small scale, the relative strength of gravity compared to electromagnetism should change drastically on those scales.  I surmised that a test could be undertaken, attempting to find an equilibrium between the attractive force an electron’s gravity, and its repulsive force of its electromagnetism.  Let see on what scale such an equilibrium could be found:


Now we can solve this equation with the known values for an electron, and we find:


So when two electrons are brought to a halt about one thousandth of a millimeter from one another, we should be able to get them to balance IF a) string theory’s proposition of 11-dimensions is correct, and 2) if the wrapped up dimensions described in the theory are on the order of 1000ths-of-millimeters or more.

In other formulations of string theory that require more dimensions, this equilibrium shrinks.  Unfortunately, current experiments have only been able to probe the strength of gravity on scales two orders of magnitude greater (tenths of millimeters), which suggests an answer will not be forthcoming for at least a couple years.  But in any case, lack of any finding is insufficient to falsify string theory because either of the two premises leading to the above equivalence may be wrong without string theory itself necessarily being wrong.

Avoiding the slippery slope that is my personal dislike of string theory, let me leave this entry alone as only a commentary on N-Spheres.  Well, now I can’t say my undergraduate degree in physics was a complete waist!  At least I got one Blog entry out of it.