Thursday, October 15, 2015

My Crystal Ball


1859 - First US commercial drilling

1969 - Peak world oil discovery

2005 - Peak conventional, rising prices

2014 - Saudis remove production restrictions, falling prices


2016 - Major market drop/correction, only affecting the economy in a tangental way (perhaps similar to 1987)

2017 - Oil prices rise again, US shale gets back in the game to some extent

2019 - Peak world production

2017/18-2020/21 - Increased world tensions, regional conflicts, hot wars of the proxy/"peacekeeping" variety, temporary solutions

2020-2030 - Stagflation, social chaos, looking for solutions to energy. High inflation, high energy costs.

2024/25 - Major economic crisis, geopolitical tensions begin to build in response

2028-2032 - world war, which will be rooted in resource issues although the official reason is something else.

2032-2040 - new normal takes hold, either:
1) Widespread nuclear destruction takes society back several hundred years, or
2) The energy problem is being solved and we looking for solutions to problems caused by AGW
Either scenario is equally likely. Ideally we find great replacements for fossil fuels before this, but it is not likely.

If scenario 1:

Population reductions ongoing from disease and malnourishment, successive generations not getting the benefit of modern schooling, mankind regressing, etc. Nuclear winter clears after several decades exposing human population to effects of AGW. If there are untouched, modernized cities, then modern amenities will eventually succumb to the fact that the global supply chain has been destroyed, besides being overwhelmed by refugees. Scenario 2 can't take place if global networks (supply, communications, etc.) and industrial capacity are gone.

If scenario 2:

2040 - this is us on the other side of this thing. Frameworks for long-term economic prosperity are in place. The 40s are a time of development and looking ahead.
2050 - Sustainability is reached. CO2 stops at 550ppm (3 deg. C rise by 2100 baked in), geo-engineering solutions for AGW are taking shape along with human migrations and technological adaptations.
2060 - Complete end of fossil fuels
2070 - Fusion reaches widespread deployment, opening a whole new level of human development.

Wednesday, October 07, 2015

Use Clonezilla with Yosemite / El Capitan

Before creating a Clonezilla backup with Yosemite (10.10) or El Capitan (10.11) you'll need to disable CoreStorage. Instructions here.

Monday, October 05, 2015

Fixing High Upstream Power on a Cable Modem

One cause of random cable modem disconnects is upstream power that is too high. The power levels on most cable modems can be checked by going to and finding the page with the signal levels on it. Signals should be in the following ranges:

Downstream Power (-15dbmV to +15dbmV)
0 is the "optimal" level

Upstream Power (37dbmV to 55dbmV)
Recommended: +35 to +52

Signal/Noise Ratio (SNR , >30dB)
Recommended: =<40 p="">
I was experiencing disconnects and noticed that my upstream power was at 59dbmV. The meant the cable modem was working too hard to communicate upstream. However, the downstream power and SNR were within recommended ranges.

On the end of the cable connecting to my cable modem was an amplifier. Since my downstream and SNR levels were very good, I removed it. This solved the upstream power issue, and upstream power levels moved into the 40s.

When we first had the cable modem, the line outside was not connected properly. The cable tech who came over put on an amplifier. It worked problem free, more or less, for almost three years until an outage. After they fixed that outage the random disconnects began. Evidently whoever fixed the latest outage bumped the signal levels making my amplifier a hindrance rather than a help. It is curious to me; if a cable tech thinks that an amplifier is needed it would be a better choice to fix the line.

Thursday, October 01, 2015

Speed and Size Comparison of Clonezilla Compression Types

Description of tested compression methods from Clonezilla:
 -z1p, --smp-gzip-compress Compress using parallel gzip program (pigz) when saving: fast and small image file, good for multi-core or multi-CPU machine 
 -z2p, --smp-bzip2-compress Compress using parallel bzip2 program (pbzip2) when saving: faster and smallest image file, good for multi-core or multi-CPU machine 
 -z3, --lzo-compress   Compress using lzop when saving: similar to the size by gzip, but faster than gzip. 
 -z5p, --smp-xz-compress Compress using parallel xz when saving: slow but smallest image file, faster decompression than bzip2. 

Testing setup:
Computer: 13in MacBook Pro Mid-2012 / Core i5 2.5Ghz / 4GB RAM / 500GB HDD (5400RPM) / OSX Yosemite
Partition: HFS Plus / 22.9GB used of 498.9GB
Network: SMB NAS share (WD My Cloud EX2) over 100Mbps Ethernet LAN
Clonezilla Live USB [clonezilla-live-20150805-vivid-amd64.iso converted to .img and written out to USB (dd)]
No image encryption
Using final time for partition as reported by Partclone

Time to Save Partition and Compressed Size:
-z1p: 25:38 - 16.5GB BEST
-z2p: 26:36 - 16.1GB +0:58
 -z3: 27:08 - 17.5GB +1:30
-z5p: 33:10 - 15.0GB +7:32

Time to Restore Partition:
-z1p: 26:35 +3:34
-z2p: 24:46 +1:45
 -z3: 28:22 +5:21
-z5p: 23:01 BEST

Save+Restore Times:
-z1p: 52:13 +0:51
-z2p: 51:22 BEST
 -z3: 55:30 +4:08
-z5p: 56:11 +4:49

-z2p, or parallel bzip2, is the all around winner. Parallel xz (-z5p) restores very fast but it's backup time is very long, so it seems to be best suited for images that will be used often to restore lots of machines. The other options tested don't show any particular strengths.

So which to use?

Consider an image that gets updated quarterly and restored 24 times in one year. Total Clonezilla times would be:
-z1p: 740.53 minutes
-z2p: 700.80 minutes
 -z3: 789.33 minutes
-z5p: 685.07 minutes

So then it makes more sense to use -z5p in that scenario. However, -z2p has the edge if you change that scenario to using the image only 15 times per year. -z2p also is better is you change the scenario for 7 updates per year and 24 uses. But I've never updated images more than 4 times a year without a good reason. So if you are going to use an image a whole lot, -z5p is the way to go. For occasional use or if you plan to update the image on a frequent basis, -z2p is better.

Wednesday, September 30, 2015

Cloning Macs using Recovery Mode (or a USB Boot Drive) over a Network

Cloning Macs using Recovery Mode or a USB boot drive involves using Disk Utility to create an image of the drive. Where this gets complicated is when you need to do this over a network. Now let me stop here and say that in my testing, Clonezilla seems to be a faster option. However, you can do this with just the tools in OSX.

A prerequisite is that your file server must be configured to allow AFP or NFS protocols. You can't mount an SMB/Samba share in Recovery Mode because the Samba libraries aren't loaded. But AFP and NFS are core to OSX. A NAS is really great here because most NAS boxes allow you to enable many different file sharing protocols. Be aware that if you use NFS, your server might have a separate option to allow writing over NFS.

With that set up, boot to recovery mode or the USB boot drive, then go to the terminal. Enter the following command to set up a mount point:

mkdir /Volumes/Server

"Server" could be anything you want, it's just a name.

Now mount the network share:

For NFS:
mount -t nfs (ip address of the server):(share, such as /nfs/images or /images) /Volumes/Server
example: mount -t nfs /Volumes/Server

For AFP:
mount -t afp afp://(username):(password)@(ip address of the server)(share, such as /images) /Volumes/Server
example: mount -t afp afp://username:password@

Now quit Terminal and go into Disk Utility. Select the drive you want to create an image for, and click New Image. Find the down arrow next to the location drop down that gives you the Finder view. In some versions of OSX your Share will show here. Otherwise, drop down the "Look in" box and choose the computer. Then you will be able to select the share.

Friday, September 18, 2015

Hiding the Wi-Fi password on a Mac

You can only hide the Wi-Fi password from non-administrative users.

1. Login as the user you want to hide from and remove the password from Keychain Access.
2. Login as an administrator and connect to the Wi-Fi network in question.
3. Open Keychain Access and drag the Wi-Fi password to the System chain.

All users will authenticate to the Wi-Fi network using the password in the System chain. They will even be able to see the username, if applicable. What they will NOT be able to do is show the password without administrative credentials.

Two Commandments after Cloning a Mac

1. Set the startup disk in System Preferences so the firmware doesn't take forever to find your boot drive.
2. Do a safe mode boot and login so it can clear system caches.

Thursday, September 17, 2015

Make a Clonezilla Live USB Stick for Mac

I spent days trying to make a bootable USB of Clonezilla to use with Macs in my organization. I tried a number of USB makers as well as trying to put it together myself. Finally, I found the solution.

1. Download the alternative-stable AMD64 Clonezilla ISO.
2. Follow the instructions at, referencing your Clonezilla ISO instead.

I have reproduced the steps here.

1. Open the Terminal (in /Applications/Utilities/ or query Terminal in Spotlight).

2. Convert the .iso file to .img using the convert option of hdiutil e.g.,
hdiutil convert -format UDRW -o ~/path/to/isoname.img ~/path/to/isoname.iso
(Where "isoname" is the name of the downloaded Clonezilla ISO)
Note: OS X tends to put the .dmg ending on the output file automatically.

3. Run
diskutil list
to get the current list of devices.

4. Insert your flash media.

5. Run
diskutil list
again and determine the device node assigned to your flash media (e.g. /dev/disk2).

6. Run
diskutil unmountDisk /dev/diskN
(replace N with the disk number from the last command; in the previous example, N would be 2).

7. Execute
sudo dd if=/path/to/downloaded.img of=/dev/rdiskN bs=1m
(replace /path/to/downloaded.img with the path where the image file is located; for example, ./ubuntu.img or ./ubuntu.dmg).

If you see the error dd: Invalid number '1m', you are using GNU dd. Use the same command but replace bs=1m with bs=1M
If you see the error dd: /dev/diskN: Resource busy, make sure the disk is not in use. Start the 'Disk' and unmount (don't eject) the drive

8. Run
diskutil eject /dev/diskN
and remove your flash media when the command completes.

9. Restart your Mac and press alt/option key while the Mac is restarting to choose the USB stick.

If your external USB drive does not show up in Clonezilla, instead of choosing the local dev option, choose shell. Enter the following command to list your drives:
sudo fdisk -l
Your drive will be /dev/sdx, and the partition will be /dev/sdxn, such as /dev/sdb1.
Mount the partition to partimag with the following command:
mount -t auto /dev/sdxn /home/partimag
Then the following command to get back to Clonezilla: