Los Leones Hiking Trail

Los Leones Hiking Trail

Went for a hike today in the Pacific Palisades at the Los Leones (or Los Liones) hiking trail.

It was relatively easy and definitely worth the (~1 mile) climb to the first lookout. The trail does zig-zag a lot, but there’s ample shade and rest areas along the way. The only part where it gets a little sunny and uncovered is just before you reach the 1st outlook. There isn’t really any shade or covering there (there is a lower outlook near this one with shaded area that was good for picnicking), but you wouldn’t want to miss the view. It’s a great way to see very far down the pacific coastline (Venice, Santa Monica Pier, and Manhattan Beach), out towards LA (the city skyline is smoggy, but it’s there) and of course out into the shimmering pacific ocean.

Parking: 2 lots, plenty of street parking, prepare to do some parallel parking if necessary.

Scenery: as I mentioned: worth it.

Difficulty: Medium, the path is narrow and there are inclines going up, but it isn’t too difficult.

There’s a lot more information on the Yelp page, and I won’t drag on with anymore detail except it’s a worthwhile hike with great scenery.

Dayone/Tumblr to WordPress Migration

I have used Dayone Journaling app on and off since 2012, but ever since I got my home server running, I have been trying to consolidate my data under my own control (dropbox to own cloud, iPhotos/Flickr to Plex, evernote to mediawiki, etc.).

Tumblr is another story as I created a tumblr for the JOH2013 trip to post my progress for the public, but I now realize I don’t want it out there that much anymore. Not to mention a lot links to my data are breaking as I have moved away from Flickr to iPhoto and now to Plex Photos (photo curation is just a whole other beast).

WordPress seemed like a good options for consolidating journal entries and blogs in one convenient (and actually secure) location. Not only do I control where the data is at, but how it is accessed and posted.

The failings of security behind Dayone are just too good to not mention…the whole password/passcode setup for all of their applications are just a UI facade for security. The Dayone journal files are actually just in a flat text file format. These files are then just shuffled around (depending on storage medium: iCloud, Dropbox, local) and manipulated by the application. Also, if you forget your passcode/password to that file, Dayone support (used to)¬†basically shows you how to basically wipe the password from the file by deleting the “security.plist”. Really basic and no encryption what-so-ever.

Tumblr on the other hand, I have decided to just move my personal blogging “home” and to a platform I can’t fine tune and have complete control over.

The point of this post was to¬†“admire” my nifty script that scraped the exported Dayone journal, (which was supposed to be in some markdown form, but turned out to simply be a text file with a lot spaces and returns), organized the post in sections, then utilized a WordPress command base to automatically create posts from that content.

#!/bin/bash

DATE=""
TITLE=""
LOCATION=""
WEATHER=""
TAGS=""
CONTENT=("")
TEMPFILE="TEMP.txt"
parseTags()
{
	for word in $1
	do
		TEMP="$(echo $word | sed 's/,//')"
		TAGS="$TAGS #$TEMP"
	done
}
parseDate()
{
	MONTH=""
	DAY=""
	YEAR=""
	for word in $1
	do
		case $word in
			"January")
				MONTH="01"
				;;
			"February")
				MONTH="02"
				;;
			"March")
				MONTH="03"
				;;
			"April")
				MONTH="04"
				;;
			"May")
				MONTH="05"
				;;
			"June")
				MONTH="06"
				;;
			"July")
				MONTH="07"
				;;
			"August")
				MONTH="08"
				;;
			"September")
				MONTH="09"
				;;
			"October")
				MONTH="10"
				;;
			"November")
				MONTH="11"
				;;
			"December")
				MONTH="12"
				;;
			"1,")
				DAY="01"
				;;
			"2,")
				DAY="02"
				;;
			"3,")
				DAY="03"
				;;
			"4,")
				DAY="04"
				;;
			"5,")
				DAY="05"
				;;
			"6,")
				DAY="06"
				;;
			"7,")
				DAY="07"
				;;
			"8,")
				DAY="08"
				;;
			"9,")
				DAY="09"
				;;
			*",")
				DAY="$(echo $word | sed 's/,//')"
				;;
			"20"*)
				YEAR="$word"
				;;
			*)
				;;
		esac
	done
	DATE="$YEAR-$MONTH-$DAY"
}
parseFile()
{
	CONTROL=0
	cat $1 | while read line
	do
		case $line in
			"Date:"*)
				if [ $CONTROL -eq 1 ]; then
					createPosts
				else
					CONTROL=1 #Indicate start of entry
				fi
				TEMP="$(echo $line | sed 's/Date://')"
				parseDate "$TEMP"
				;;
			"Tags:"*)
				TEMP="$(echo $line | sed 's/Tags://')"
				parseTags "$TEMP"
				;;
			"Location:"*)
				LOCATION="$line"
				;;
			"Weather:"*)
				WEATHER="$line"
				;;
			"Photo:"*)
				;;
			*)
				CONTENT=("${CONTENT[@]}" "$line")
				;;
		esac
	done
}

createPosts()
{
	touch "$TEMPFILE"
	TITLE="\"${CONTENT[2]}\""
	TITLESIZE=${#TITLE}
	if [ $TITLESIZE -gt 60 ]; then
		TITLE="\"RENAME ME - $DATE\""
	fi
	for LINE in "${CONTENT[@]}"
	do
		echo "$LINE" >> "$TEMPFILE"
	done
	if [ -n "$LOCATION" ]; then
	echo "$LOCATION" >> "$TEMPFILE"
	fi
	if [ -n "$WEATHER" ]; then
		echo "$WEATHER" >> "$TEMPFILE"
	fi
	if [ -n "$TAGS" ]; then
		echo "$TAGS" >> "$TEMPFILE"
	fi
	eval sudo -u apache /usr/local/bin/wp post create $TEMPFILE --user=cgomez --post_title="$TITLE" --post_date="$DATE" --post_category=116 --post_status=private
	eval rm -f $TEMPFILE
	DATE=""
	LOCATION=""
	WEATHER=""
	TAGS=""
	CONTENT=("")	
}

if [ -z $1 ]; then
	echo "No File Detected. Exiting."
	exit 1
fi

if [ ! -f $1 ]; then
	echo "File doesn't exist. Exiting."
	exit 1
fi

parseFile $1

exit 0

Raspberry Pi Adventure Begins

Finally took the plunge into the “micro-computing” world and purchased a Raspberry Pi 2.

The primary reason for buying one is to automate my esxi backups to an external disk. At the moment I am sort of a sitting duck in that I have no (easy) external back up solution in place for all my virtual machines. My esxi host is on RAID 1, but that could sideways really fast, so for months (or at least since last year when I setup my server) I have been mulling over possible backup solutions…you know, in the event of “catastrophic disk failure”. Can you tell I am paranoid?

My original plan was the use my C3700 Netgear Router’s NAS Functionality, but it turns out the disk options are limited to a select few Western Digital and Seagate models.  I suspect the reasoning behind this is that some of the NAS “work” is passed to the disk as opposed to the router doing all the heavy lifting. The downside is that I bought the wrong model, but the upside is I got it for really cheap on Black Friday (no I didn’t stand in any lines, I ordered online from my bed). So this left me with a backup disk, but no way to get the backups onto the disk…Rapsberry Pi to the rescue!

Now months later I am just getting around to buying a pi. Its one of those purchases that seemed simple but once I started “down the rabbit hole” of parts required to run a pi I was soon inundated with too many browser tabs just to compare things like cases. This eventually caused me to be overwhelmed and put the whole purchase on hold, until last night when I just jumped in. 

I settled on Amazon as the vendor because of Prime free shipping, and a kit (which was definitely more economical than the piecemeal route). The only thing I needed to buy extra was the MicroSD card, but that was very reasonable at $10.99 for 32GB.

Now its a waiting game with the post office…