Backcountry Binaries

Climb Mountains & Automate Things

Author: Colin

‘Rungeon’ – A Working Title

My newest project in the game-space is a very faithful recreation of Zelda for the Super Nintendo.

It’s under active development, and the name will absolutely be changing! This is my first time delving into map chunking, A*, and most other specifics of game development that go along with a Zelda-like.

Playable’ here! ‘Playable’ due to the fact that there’s no win condition, and if you let the log bump into you 40x, your character will die! As always, feedback is greatly appreciated and can be sent to rungeon@colinhaley.net

Release: Gemjump

My first game to reach completion is now playable!

Gemjump is a simple endless runner in which you collect “gems” to gain extra points! Built in Unity, using art assets from Kenney, and music by Mattesar. I’ll be adding more project shortly to my “Projects” page.

Albuquerque Outdoors: The Eye of the Sandias

The Albuquerque Open Space is unlike pretty much anywhere else i’ve hiked.

The trails are marked, but only infrequently with signs, no blazes. Beautiful southwestern scenery and lots of loose gravel to hike up and down. I can see how so many people get lost in the foothills each year. I followed the Open Trails route, but would highly suggest downloading the route so you don’t get lost.

Without spoiling too much, the trail totals about 4 miles, with ~1500ft elevation gain. It’s a loop, but like I said, play it safe with routes. Bring plenty of water, some snacks, and prepare to be dazzled by “The Eye”.

Also, make sure your dog is happy and taken care of!

Glacier N.P.: Belly River & Highline Trail Loop

A few friends have asked my process for planning larger backpacking routes successfully, so I figured i’d do a write up of my process. The trail plan below is for an extended, no-refill backpacking trip in Glacier National Park. I’ll go over gear, food, and general preparation in another post.

For now, let’s walk through our route! The whole trip outlined below (with a few modifications, thanks Google Maps) can be seen here.


The Route

  1. Park at Apikunny Falls Trailhead and head East to Poia Lake Campground, totalling 6.2 Miles for day one.
  2. Enjoy the stars that night and sleep soundly at Poia, then the following morning, trek around the lake and over Red Gap Pass to Foot Elizabeth Lake Campground, making day two ~10.1 Miles all in, and +/- of 4,400 feet of elevation.
  3. Next up, we have a casual 3.2 mile, yet incredibly scenic day hiking past Dawn Mist Falls and over a bridge (or ford the river!) to Gable Creek Campground.
  4. Hike along the lake basin for 7.4 miles to Mokowanis Lakes Campground, set up camp and take a quick hike up to Margaret Lake.
  5. Note: Unfortunately, Google Maps didnt play nice for this section, a connector trail appears to be missing. “Mokowanis” and “Lakes Campground” above are different routes with a connector between them. Links (1) here and (2) here as well.

  6. Uphill, through the basin, and to the saddle above Stoney Indian Lake, enjoy the view and take a quick descent to Stoney Indian Campground. This is a tough climb up over ~6.5 miles, pace yourself and take breaks!
  7. Downhill today for 4.8 miles bearing to the right to end up at Kootenai Lake Campground.
  8. Back uphill you go! Head due south along the cliff side and switchbacks over the next ~8 miles to Fifty Mountain Campground.
  9. Next, you’ll get to see one of the most iconic trails in the park, the 11.5 mile long Highline Trail on your way towards Granite Park Campground.
  10. Lastly, the 7.8 miles from Granite Park towards Many Glacier through Swiftcurrent Pass will give you high winds, cold rains and incredible views. Descend slowly and enjoy the rolling hills towards Many Glacer Campground, the final night of your trip!

Submitting the Request

Unfortunately, we can’t just send over the novel above to the NPS to get our permit, there’s a little more legwork involved here. Once you’re comfortable with the itinerary, you’ll want to sign up for a Pay.gov account and open up the Glacier Advanced Reservation form.

Fill out the basic information, being careful about the number of campers that you specify, since the quotas for most sites are very strict. Additionally, before picking your dates, check that all campsites along your route will be open on the requested date on the Backcountry Campsite Map.

On the itinerary page, the more flexible you can be the more likely it is you’ll be granted the permit you want. For the trip above, your “First Choice” should look like this:

If you have a secondary itinerary you have in mind, list it here. If the primary itinerary isn’t allowable, the NPS will attempt to fill the secondary through fourth in order.

The next page is one of the most important ones for determining a flexible itinerary. The firs two checkboxes: “Campground Substitutions” and “Route Reversal” are common and shouldn’t impact your route too intensely. You can specify certain substitutions in the Comments section as well, for example:

“For night 3 of my itinerary, any of the following campgrounds are acceptable: GAB, COS, GLF”

Specify any other requirements such as “Max Mileage per day”, “Max elevation change per day”, “Avoid this campground”, etc.

Lastly, if you’re filling this out prior to March 15, 2018 at 8AM PDT, hit save and then come back to submit it on that date!


Do you have any other parks or permit processes you’d like me to break down like this? Let me know in the comments!

Permits and Preparation

Backpacking and dayhiking have blown up. Seeing so many people exploring the outdoors is fantastic! However, the huge popularity of a few specific locations or trails makes visiting them a challenge. I’ve gathered a bunch of information on some big name parks and trails below to hopefully make visiting a possibility for anyone interested! This post got way longer than I intended, so i’ve added the following table of contents.

Zion NP Wonderland Trail Half Dome Mt. Saint Helens
Havasupai Rae Lakes Loop Teton Crest Trail John Muir Trail
The Enchantments Mt. Whitney Coyote Buttes Kalalau

Zion National Park

Zion National Park in Utah requires a permit for any overnight trips, as well as any hikes through The Narrows, The Subway, and Left Fork. Permits must be picked up at a ranger station in person no earlier than the day before the hike.

The fees associated with Zion vary based on group size (Prices in USD):

  • 1-2 People: $15
  • 3-7 People: $20
  • 8-12 People: $25

There are a few ways to secure permits for Zion:

3 Months in Advance
Lottery Reservations
Last Minute Reservations (2-7 days in advance)
Walk Up Permits
Zion Express Membership

Wonderland Trail

Mount Rainier NP is home to the Wonderland Trail, a 93 mile long trail encircling the massive mountain.
Unfortunately, due to the massive number of requests received for full circuit Wonderland Trail permits, the NPS has stopped accepting advanced reservations, opting to only accept walkups for this trail. This is new as of 2016, so if you’ve been before, or are planning to visit, get there at least a day or two early!

Half Dome

Half Dome is a name that most outdoorsfolk will know. Located in Yosemite, Half Dome is one of the most popular outdoors activities in the park. Generally, the “cable route” is available from late May through October/early November. The park issues 300 permits per day, 75% of which (225) are reservable in advance in the preason lottery, March 1-31. Your maximum group size is 6 for these permits.

Alternatively, pick up one of the remaining 75 Wilderness Permits and include a route on Half Dome in your reservation.

Mount Saint Helens

Mount Saint Helens, located in Southern Washington State, requires a permit from the USDA. Permits can be purchased online with a minimum of 24hr advance – don’t wait until the day of to purchase!

Permits are limited for Mount Saint Helens depending on peak season or not with the following limits:
April 1st – May 14th: 500 persons/day
May 15th – October 31st: 100 persons/day

For both, permits are required and go on sale on February 1st at 9am.

Mount Whitney

Mount Whitney is on the eastern boundary of Sequoia & Kings Canyon NP. Permits are required, including day hikes.

Permits for Mt. Whitney are initially distributed via lottery, held February 1 – March 15. After April 1st, any permit times that haven’t already been reserved/permitted are available for sale online, first come, first served.

The last chance to snag a permit for the year takes place on May 1, when any unclaimed permits from the first round and cancelled and made available for purchase.

Get more information on the Mt. Whitney lottery and processes on the Forest Service’s website.

Enchantments

The Enchantments are another beautiful area in the Pacific Northwest. High alpine lakes, incredible fishing opportunities and scenic hikes draw thousands of people every year. Permits are required for all overnight trips. Meaning, if you’d like to day hike through the area, you can do so without worry!

As of 2016, the permit season in The Enchantments has been extended by 6 weeks. Now, in order to stay the night, you’ll need a permit from May 15th – October 31st.

The permit lottery opens on February 15th and runs through March 2nd and takes place on recreation.gov. Check out the Forest Service’s Website for more information.

Havasupai

Located on the Havasupai Indian Reservation within the Grand Canyon, there are are many beautiful waterfalls. and good hiking!

You must have a permit to hike, even for day hikes. The total cost for a single person is $85 (+tax) for one night. Permits go on sale on February 1 each year, you’ll need one at least a week in advance, and they must be reserved via phone (9am – 5pm) during the week.

More information can be found on the Havasupai tribe’s website and reservations can be requested at 928-448-2121.

Rae Lakes Loop

Another hard-to-get permit in the Sierras, Rae Lakes loop is 41.4 miles long, and gains 5035′ of elevation from the trailhead to Glen Pass. In late spring to early summer, there may be unavoidable high water fords required. There are a few unique restrictions on this particular loop:

  • Bear cannisters must be carried by all hikers
  • Camping only at designated campsites
  • Two night maximum in Paradise Valley
  • Two night maximum at Charlotte Lake
  • Two night maximum at Kearsarge Lakes
  • One night per lake in Rae Lakes
  • No camping at Bullfrog Lake
  • No fires over 10,000′
  • No pets allowed

If you’re looking to hike during the quota season of May 25th – September 22, you’ll need to acquire your permit at least two weeks in advance using this PDF.

More information is available on the NPS website.

Teton Crest Trail

Located, as one would expect, within Grand Teton National Park, the Teton Crest Trail permits are available for reservation between early January through mid-May.

Sending in an application via Fax will typically yield the fastest results, as only one third of available permits are available for early reservation. After those permits have been reserved, the remainder are available for walk-ups up to a day early.

John Muir Trail

The John Muir Trail is, unsurprisingly, challenging to get a permit for. Totaling 210 miles in length, the popularity of the trail has exploded since 2002, tripling in usage.

Permits headed southbound from Happy Isles and Lyell Canyon need to be applied for 24 weeks in advance. Sending in your permit via fax is recommended. Apply early, as the NPS reports that the vast majority of these permits are declined.

Alternatively, you can request a different trailhead along the route, such as Glacier Point or Tuolumne Meadow, which helps ease the daily quota limitations.

Lastly, you can try for a walkup — these permits are open for the taking at 11am the day before you intend to hit the trail.

Coyote Buttes

Coyote Buttes is one of the hardest day hike permits to obtain.

The buttes are in the southwestern sandstone hills of northern Arizona and southern Utah, within the Paria Canyon-Vermillion Cliffs Wilderness. No overnight hiking is allowed in either the northern or southern portions of the buttes, due to lack of water and supplies.

Daily, only 10 permits are available via lottery, four months in advance. The other 10 permits are walk-up only, the day prior to your day hikes, at the Staircase-Escalante Visitors Center.

Kalalau

The Kalalau Trail totals 11 miles along the Na Pali Coastline on Kauai island in Hawaii.

Camping is only allowed at Hanakoa and Kalalau, and permits are absolutely required – not having one will get you cited, followed by a mandatory court appearance!

Permits run $20 per person, per day and can be sold out as early as a year in advance. They can be applied for through the DLNR website.

Additional details can be found on the Kalalau Trail website.

Admincraft – Setting up a Minecraft Server

This tutorial will teach you how to set up a dedicated Minecraft instance. I’ll be doing this on a Debian 7.11 x64 VPS from DigitalOcean. My goal in writing this tutorial is to give a quick, step-by-step walkthrough that will let you get a secure “Vanilla” Minecraft server up and running in under 30 minutes.

To follow along, you’ll need an SSH client. For the quickest and easiest, i’d highly suggest puTTy. If you really want to immerse yourself in a Linux environment even from Windows, check out Cygwin – i’ll make a walkthrough on how to configure it later on.

ssh as root :(

Root puTTy connection


Let’s get started. Open up puTTy or your preferred SSH client and enter your connection details. Initially, we’ll be connecting as the root account to get things configured.
 
Your screen should look similar to to the image to the right.

 
 
 

connected over ssh as root! for shame!

After password reset, you should see this screen.

Next, hit enter, and you’ll get a prompt telling you that the hosts key is not cached in the registry. We’ll come back to this in the future, but for now, click “Yes” and you’ll end up with a login screen. Enter the password for your root account and hit enter, then follow the prompts to change your password.

Finally, you’re on your server. Now the fun stuff begins.

Let’s run a few commands (the parts in bold):

First, update all existing (system default) repositories and programs to the most recent version available in your repositories.
root@1:~# apt-get update
root@1:~# apt-get install nano

Next, we’ll install Python 3. We won’t actually use it in this tutorial, but we’ll come back to it!
root@1:~# apt-get install python3

Once that’s completed, we need to add some new repositories, then install Java 8.
root@1:~# echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee /etc/apt/sources.list.d/webupd8team-java.list
root@1:~# echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list
root@1:~# apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
root@1:~# apt-get update
root@1:~# apt-get install oracle-java8-installer
root@1:~# java -version
java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)

Assuming the output of the java -version command looks good, we’ll install tmux (equivalent to “screen”).
root@1:~# apt-get -y install tmux

Now that all of our software prerequisites are installed, we’ll want to get off of the root account. Before we can do that, let’s add a group for our admin accounts and other accounts.
root@1:~# sudo groupadd MinecraftAdmins

Add a few users here, one for yourself and one dedicated to running the Minecraft server. You may want to add individual accounts for each of your admins
root@1:~# adduser minecraft
root@1:~# adduser colin
root@1:~# sudo usermod -a -G MinecraftAdmins minecraft
root@1:~# sudo usermod -a -G MinecraftAdmins colin

Add elevated rights for the Minecraft user with visudo.
root@1:~# visudo
# Add this line to the visudo page.
Minecraft ALL=(ALL:ALL) ALL

At this point, disconnect as root, and reconnect as your new ‘minecraft’ user.

Now the fun stuff! We’ll organize and download the minecraft server executable. We’ll be downloading version 1.12.2
minecraft@1:~# mkdir ~/servers
minecraft@1:~# mkdir ~/servers/vanilla
minecraft@1:~# cd ~/servers/vanilla
minecraft@1:~# wget https://s3.amazonaws.com/Minecraft.Download/versions/1.12.2/minecraft_server.1.12.2.jar -O minecraft_server.jar

So close! Just a few more steps. Let’s set up a basic launcher script.
minecraft@1:~# nano startServer.sh
You can copy and paste the following into the script, or type it out if you want to!
#!/bin/bash
java -Xms1G -Xmx2G -jar minecraft_server.jar -o true

Save and quit (if you used nano, it’s , then Y.

Make the script you created executable and run it!
minecraft@1:~# chmod +x startServer.sh
minecraft@1:~# ./startServer.sh

The first time we run this, it will fail since we haven’t accepted the EULA yet. Edit the file that was generated in the ~/servers/vanilla directory called “eula.txt”
minecraft@1:~# nano eula.txt
eula=true

Let’s create a new tmux session and start up the server!
minecraft@1:~# tmux new-session -n vanilla -s vanilla
minecraft@1:~# ./serverStart.sh

And it’s up! In the next sections we’ll go over making our server more secure, automating some tasks, backups and a bunch of other stuff.

Thanks for reading and I hope this was helpful, leave a comment if you have issues with any of the steps!

Beef Jerky – Chef’s Cut

Chipotle Cracked Pepper

I’m always on the hunt for a new delicious brand of jerky to snack on, either on the road or on the trail. Making beef jerky is one of my favorite things to dehydrate. It’s such a versatile way to bring a huge amount of flavors with you where ever you go. I’m definitely making some this weekend. For now, I picked this one up on sale for a dollar off the other day, let’s see how it fares.

Overall: 3/5
Price: $5.99
Weight: 2.5oz
Calories (bag): 250

Flavor: Initially sweetness is short lasted and some nice heat comes through pretty early on. It’s not very salty, but the meat itself is not flavorful either, only the chipotle. The heat lingered for about a minute after each piece. I can’t believe i’m saying this.. but, more salt would be nice!

Texture: Very soft, not chewy at all. Dissolves pretty quickly after a few chews. Red pepper flakes on the meat are a nice contrast from the meat itself. Feels more like shredded beef jerky.

Chipotle Cracked Pepper

Taking the above into account, I think this is an alright jerky to pick up if you see it on sale, but I wouldn’t go out of my way to take it on the road or trail with me.

Trail Meals – Ingredients

Trail Cooking is a unique skill. Finding the perfect balance of calories to weight, ease of preparation, and most of all – deliciousness, is not easy. To complicate matters more, extended backpacking trips require a lot of food. Livestrong estimates that on average, 200 calories are burnt per hour of hiking.

Let’s look at some quick and easily mixable ingredients! Many of these can be eaten exactly as they are, or mixed together to get some calorie packed meals.

Food Calories/Ounce
Almonds 160
Peanuts 170
Walnuts 183
Sunflower Seeds 173
Peanut Butter 165
Almond Butter 165
Flour Tortillas 90
Muesli 100
Powdered Milk 150
Olive Oil 240
Peanut M&M’s 140
Salmon Packets 70/packet
Powdered Hummus 100
Banana Chips 160
Dark Chocolate 180
Pre-cooked Bacon 150
Powdered Potatoes 110
Pitted Dates 100
Macadamia Nuts 215
Pine Nuts 210
Dried Cranberries 100
Dried Apricots 75
Dried Prunes 72
White Chocolate Chips 140
Summer Sausage 100
Beef Jerky 80

I’ll be updating this list often, adding to it as I come across more backcountry cooking staples and meal ideas. My next post will focus on taking some of the ingredients listed above and creating meals with them.

I’d love it if you left a comment if you have ideas on how to use these ingredients or others, or shared your backcountry meals!

Automating Audit Additions

…With alliteration.

Hey there and thanks for reading. Today I wanted to talk about a few recent additions I made to one of the SQL schemas I run! I was tired of manually adding a LastWriteTime and LastModifiedBy column to each table as they were created in the database, so naturally, I wanted to automate it.

This is a two part process, and it might be a little hacky but it works well enough in development and staging databases. I’ll need to see what the overhead is like in production, but I don’t anticipate any issues.

First up, we need a stored procedure to add 2 columns to a table. Nice and easy:

USE Development;
GO

ALTER PROCEDURE AddAuditColumns
@TableName VARCHAR(MAX)

AS
BEGIN
SET NOCOUNT ON;
DECLARE @sql VARCHAR(MAX)
BEGIN
SET @sql = 'ALTER TABLE ' + @TableName + 'ADD LastWriteTime smalldatetime NOT NULL DEFAULT GETDATE()'
-- Change to NOW() for MySQL instead of SQLServer
EXEC(@sql)

SET @sql = 'ALTER TABLE ' + @TableName + 'ADD LastModifiedBy VARCHAR(60) NULL'
-- For purposes of the demo i'll allow null values
EXEC(@sql)
END
END

All of the code in this demo is available on my github page.

Cool, so that’s the easy part, you can execute that by passing any table in your schema to it and it’ll add the columns. LastWriteTime will have a default value of the time of execution or row addition. LastModifiedBy has no default due to how we use it, but you could set it to a value if you so choose.

The next part was a bit more challenging to figure out, I needed to parse event data from the CREATE_TABLE event and determine how to get the name parameter passed to it.

Event data is captured in a trigger by assigning EVENTDATA() to an XML variable. The data comes in a pretty easy to consume XML structure (i’ve formatted this one to make it look pretty, it’s normally displayed without whitespace or linebreaks).

The below event data is captured from the simple line:
CREATE TABLE MyTable (Integer int);

<EVENT_INSTANCE>
    	<EventType>CREATE_TABLE</EventType>
    	<PostTime>2015-09-22T15:40:15.827</PostTime>
    	<SPID>53</SPID>
    	<ServerName>SQLDEV01</ServerName>
    	<LoginName>Domain\Colin</LoginName>
    	<UserName>dbo</UserName>
    	<DatabaseName>Development</DatabaseName>
    	<SchemaName>dbo</SchemaName>
    	<ObjectName>MyTable</ObjectName>
    	<ObjectType>TABLE</ObjectType>
    	<TSQLCommand>
        		<SetOptions ANSI_NULLS="ON" ANSI_NULL_DEFAULT="ON" ANSI_PADDING="        ON" QUOTED_IDENTIFIER="ON" ENCRYPTED="FALSE" />
        		<CommandText>CREATE TABLE MyTable (Integer int);</CommandText>
    	</TSQLCommand>
</EVENT_INSTANCE>

As you can see, we have a lot to work with in this data set. In this example, we’re going to be particularly interested in the <ObjectName> object, since that contains the table name that we’ll want to pass to our stored procedure. Let’s create a trigger to do just that!

Use Development;
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TRIGGER [TRIG_ADD_AUDIT_ON_TABLE_CREATE] ON DATABASE
	FOR CREATE_TABLE

AS
BEGIN
	DECLARE @data XML
	DECLARE @tablename varchar(max)

	SET @data = EVENTDATA()
	SET @tablename = CONVERT(varchar(max), @data.value('(/EVENT_INSTANCE/ObjectName)[1]','nvarchar(100)'))
	EXEC AddAuditColumns(@tablename)
END

GO

SET ANSI_NULLS OFF
GO

SET QUOTED_IDENTIFIER OFF
GO

ENABLE TRIGGER [TRIG_ADD_AUDIT_ON_TABLE_CREATE] ON DATABASE
GO

That trigger above will snag the EVENTDATA() from the CREATE_TABLE event and add the columns defined in the stored procedure. This is a very extensible way to add columns on create and the best I could come up with on the fly.

Worth noting! If you want to enable this audit creation on the entire schema, you’ll need to modify the Trigger create a little bit, change:

ON DATABASE
to
ON SCHEMA

If there’s feedback or issues with the above scripts i’d love to see some pull requests on Github or just leave a comment.