Tuesday, January 29, 2013

I really do enjoy my family

Let me start off and say I love technology. I am sitting in the back of my sister's Prius writing this on my iPad (have I mentioned my KeyFolio Pro 2 and how much I love it). The ability to write while on the road is really just a blessing. Granted, I know that I do not write all that much but since I am not driving it is a very pleasant distractions from the the road.

As mentioned before I am in the car. Today we have been on the road for 1.75 hours (with many more to go). Two days ago we were in the cart for 10.5 hours. Yeah that was a fun day. This weekend we took a 48 hour trip to Georgia to see my family. In truth we went down to support my cousin who was in a scholarship pageant. It was a pretty big turnout with the family. We had a great time and I am so proud of my cousin.

That is not why I am writing this though. I wanted to express how much I enjoy spending time with my family. We have always been road trip people and now that I am older (some could say adult) I enjoy it even more with family. With my family we talk about everything, we sing to anything, and we laugh. Having 8 hours to spend in the car with my family is something that I look forward to. I know that there are a lot of families out there that can not say that. 

Normally I am the on who is driving and I like it that way. I can participate in the conversations and still be apart of the road trip environment. Though I will take my turn in driving here in a while it is nice to just sit in the backseat and relax.

With my sister being in my up and coming wedding it is nice to listen to the planing done my both Jess and my sister. To listen to them getting excited by details that normally will escape me. It is just fun. being around my family is very relaxing for me.

Wednesday, January 23, 2013

Clean your House like you are selling it

I have never been a very neat person.  Sure there are times when I get the urge and I clean and organized the entire house (or my office at work) but then a few weeks or even days later I start to slip.  The clutter will start to "appear".  I am just not a really neat person.  I get that.

This week I put my house on the market to sell.  Since Jess and I are moving to NC in 5 months it was time.  I mention this because having the mindset that someone could walk into my house, someone could be shown my house, at anytime has given me a new mindset.  I am now always thinking about statehood my of house.  I am always cleaning up anything that I put down.  Making sure that everything is straight before I leave the house.  BEING CONSCIENCE OF DUSTING (something that I never really did).


If it takes a couple months for the house to sell (please let it only be a couple months) then I will spend a great amount a time keeping the house clean.  Enough time that it should become habit.  Becoming more tidy and clean could never a bad thing.  Just like when I spent 11 months saving for Jess' engagement ring and then the next 12 months saving to move (a total of almost 2 years) my habits of saving have changed.  I am still a spender at heart but I am much better about saving and budgeting then I have ever been in my life.


I will chalk this up to a lesson that life has given me.  I will also admit that as I grow I am learning stuff the hard way that my parents tried to teach me over the past two decades.  Don't worry I will try to instill these hard lessons onto my unborn children with the full knowledge that they, like their father before them, will not listen.

Tuesday, January 15, 2013

Setting up daily public IP

Last night I installed Ubuntu on my old laptop, yet again.  In the last 6 months I have installed Linux twice and windows once.  Since I got an iPad for Christmas I wanted to try out ssh through my iPad to a Linux machine (python programming remotely).  One of the issues that I knew I would face sometime was my home ip address was not static.  What would happen if I was out at at a coffee shop and want to finish off some Project Euler problems?  Only to find out my public ip address at home has changed. 

I could pay to have a static ip address but I am not really doing that much work from outside my network.  This is more of just a hobby.  The solution I came up with was to email my public ip address every morning.  Here is how I did it.

There was 2 major problems that I would face here.  The first is getting my public ip address.  I have searched before and had seen all the wget and curl commands with whatismyip.org and the like.  This never really worked for me.  Yes I could get the html page but the ip address would be enbedded in the javascript someplace and I really did not want to spend too much time on it.  Then I came across this snippet of code

curl ifconfig.me


That simple commandline magic will return my public ip address.  It really is that simple.

The second problem was I needed to find a way to email this ip address to myself.  I found a solution from Justin Duke.  He wrote a blog post (here) about using Gmail to send email through python.  Perfect solution as I am working on learning Python as a second language.  Here is the code I am using to send myself the current public ip address at home.

import smtplib
import sys

# The below code never changes, though obviously those variables need values.
session = smtplib.SMTP('smtp.gmail.com', 587)
session.ehlo()
session.starttls()
session.login(GMAIL_USERNAME, GMAIL_PASSWORD)

headers = "\r\n".join(["from: " + GMAIL_USERNAME,
    "subject: Public IP Address",
    "to: " + recipient,
    "mime-version: 1.0",
    "content-type: text/html"])

# body_of_email can be plaintext or html!
body_of_email = sys.argv[1]
content = headers + "\r\n\r\n" + body_of_email
session.sendmail(GMAIL_USERNAME, recipient , content)


Again BIG thanks for Justin Duke for providing the Gmail code.  This is simply using the second argument as the body of the email.  When I run this script I use the newly found ip address as the second argument.

The last bit to finish this project was to add an entry in the crontab to run this once a day at 8am. Easy enough, just crontab -e and add the following.

0 8 * * * /usr/bin/python /home/jason/python/dailyIP.py $(curl ifconfig.me) >/dev/null 2>&1


This again is not a complete solution.  If my ip address gets changed in the middle of the day then I am hosed.  This will at least keep me in the loop if it happens on a day when I am not connecting in from the outside.

In case you were wondering, using iSSH I spent a good hour in bed programming on my iPad (well technically it was on the laptop).  With the Bluetooth keyboard I have for the iPad it worked perfectly.  I am pretty excited to be able to do this and it makes me love this iPad just that much more. 

**UPDATE** I changed the crontab entry to send the email twice a day.  Just found out I could do that
Code:
0 8,12 * * * /usr/bin/python /home/jason/python/dailyIP.py $(curl ifconfig.me) >/dev/null 2>&1

Wednesday, January 9, 2013

Writing short stories

Every night I struggle to fall asleep.  I think I just have too much going on in my head.  There are some things that I do to help me fall asleep.  I take over the counter meds and I listen to audiobooks at a very low level (the first Harry Potter book is my favorite).

The idea behind the the audio book is my mind can focus on the story and I can concentrate on trying to listen to the story that my mind is allowed to drift off to sleep.  This works pretty well, but I tend to wake up entangled in the headphones.  Not a great solution.

There is another method that I will sometimes use.  The idea is that I create stories in my mind.  Most of the time I am playing the main character. These stories, or scenarios, are always fiction and mostly tend to be science fiction.  There are times when I can  control time or time stops when I sleep.  There are stories when I am an undercover agent of some ancient deity, who as bestowed upon me special powers.  There are stories when I am a computer hacker, playing the part of a modern day robin hood.


The point being that I have a mind full of these ideas.  Yes they are pretty rough but they still exist.  So I want to put them on paper (or what counts for paper these days).  The answer: short stories.  I want to write some short stories. Simple right?


Now we come to one of the major flaws of my personality.  Well really there are two that are coming to play.  The first being I tend to not finish large projects.  I will start them and then lose interest and not finish them.  The second being that I tend not to try new things if I think there is a chance I might fail.  Yes I know those are both pretty silly things to stop me from trying something new.


That is why I am making a promise here in this blog post.  I will add this to my New Years post.  The promise being I will write one short story a month for 2013.  That means 12 short stories.  Feel free to ask me about my monthly story.  The goal will not to create a series of master pieces but to get some practice in.


I have the creativity in me.  I has always been there. I just need to exercise it a bit.  Let it get out and straight the legs.  Flex the muscles if you will.  I am headed out of town at the end of the month to see some family (nice long family road trip) and I will probably be finishing the first then.  Look for it at the end of the month.


**Update** I was doing some research on short stories and I will define my short stories being between 4000-7500 words.  I have to set this guideline so I do not get in the habit of writing short short stories (or flash fiction)

Saturday, January 5, 2013

Things I like and things I would like to do

There is a difference between the things I like to do and the things I would like to do.  If you reread that sentence more then once or you started this sentence with your brows squeezed together in confusion, let me clarify.  There things that I like to do and am currently and actively doing those things, then there are those things that I would like to do but have not started or have not finished (playing the guitar will show up in this list).  Just like most things in life this is not just black and white.  There is also the grey list.  I hope you will understand when you read it.

Things I do list
  • World of Warcraft
  • Cooking
  • Photography 
  • Netflix (I really spend too much time playing WoW and watching Netflix)
  • Watch movies with Jess (love a good movie in the theater with my girl)
  • Play volleyball
Things I would like to do list
  • Backpack
  • Become a runner (I REALLY don't like running, tough I do it from time to time)
  • Be a more active reader
  • Do It Yourself person (I am seriously not too handy)
  • Tighty
  • Multilingual 
  • Writer
Things I kind of do, sometimes, maybe
  • Programming for fun, Currently learning Python
  •  Exerciser (I am so on and off on this that it had to make the grey list)
  • Guitar player
What are you? What are your white/black/grey list?  If I was being more honest I would say that the grey list would hold most of the things on the white list and a few things on the black list, but then my list would look to puny.

It is worth noting that this blog post will foreshadow what you will read in the future.  I mean the point of a personal blog is to write about those things that I like and are personal to me.  I know right, I am groundbreakingly deep.  You will read about photography, you will read about World of Warcraft (from now on known as WoW), you will read cool things about Python code, and you will see me start and stop running/exercising.  That is just the nature of who I am.

Thursday, January 3, 2013

We all just want to be cool



This is from the opening scenes of “The Social Network”. I am just going to go with the idea that everyone has seen it. If you have not then there is shame upon your entire family.

All kidding aside watch the clip. In it Mark creates a website which photos of undergraduate females rated against each other. So to get all the photos he does a little “hacking”. I will be honest here and tell you that I have probably watched that opening scene at least 75 times. I like the idea that I could do that. It has got me thinking that at some point and in some place, every programmer wants to be hacker.

It does not have to be illegal so much as able to do cool things with the powers we have. Namely computers. I think think that it is this drive to find cooler stuff to do or to find new, exciting,  and challenging things drive ourselves to learn.

Amir Rachum wrote an awesome blog post about "Flow" (here).  I think anyone who has ever worked on a problems know this feeling.  It does not have to be programming related for this to work.  Hell I will often find myself getting into a "flow" when I am cleaning my house (assuming I have a list of chores to get done and am ROCKING the iPod).  The idea of flow and hacking I think have their fingers locked together in a familiar embrace.  Yes a lot of productive programming takes place in this ethereal flow or zone.

I ran into a lot of this at the beginning of last summer.  I started a project where I was trying to data-mine horse racing post and results from the "Daily Racing Forums" website and store them into a simple database.  At the same time I was writing everything in Python at language which I had never worked with before.  So while I was trying to write up some html parsing code I was also trying to learn the language I was writing in.  It was during this time that I would be super focused and slip into the "zone".  We all know the feeling of setting down to add a couple of lines of code and the next thing we know 3 hours have past and it is WAY past your bedtime.  Yeah that was my last May.

Tuesday, January 1, 2013

Happy New Year

Happy New Year!!!  I hope you all are ready to ring in 2013 like I am.  As we all take the morning to wake up, cure hang overs, and resolve any bad decisions we made the night before I wanted to post my New Year's Resolutions here for the world to see.  It is not a fancy list nor am I going to try to conquer the world with it.  I just wanted it to be public so that I can be held accountable for it.


  • Get married
  • Sell the house
  • Blog on both the personal and “J and J” blogs at least once a week *
  • Finish a total of 100 project Euler problems
  • Safe 10k in cash
  • Project 365
  • Lose 10lbs **
  • Send birthday notes for every birthday
  • Send thank you notes
  • Play guitar everyday
  • *(Updated from here) One short story a month for 2013
    • Yeah I am totally changing this to ever other month.  With planning a wedding (well help my Jess), selling my house, and planning a move the first 6 months will only get 3 stories

* J and J blog will be very sporadic until it gets closer to the move. This can be put on hold until then (though there will be some post)
** I will be okay with not loosing 10lbs as long as I am staying active and working out.  That is the real goal.

Please feel free to ask me about the items listed above as 2013 moves along.  Ask me how my Project 365 is going or ask why you have not received your birthday card.  Basically feel free to harass me because I will feel free to ignore you! ;-)  Happy New Year!!