Local Indie Production

0

Hey peoples out there in the grand land of the internet,

A friend of mine is involved in a local indie production. They have met their goal but every extra bit helps a lot.

I wanna date u

Update to the capistrano hack

So a while ago I had posted a hack that lets capistrano deploy code from a git server from behind a firewall.

So in a recent update to SSHKit they changed how they do ssh connections to use Threading and Pools. This broke my hack.

 

So long story short, I’ve updated my hack. This one uses net-ssh directly to make a forward.

Disclaimer: This works for us at $work, but I can’t claim it works anywhere else.

 

 

direnv is one of the coolest tools ever

I’ve always loved the idea of self contained environments but coming from doing perl and c/c++ a long time ago, I’ve never been able to really pull it off. It wasn’t until I encountered virtualenv for python that I finally got this working properly. I had encountered rvm’s gemsets before that, but they always seemed finicky at best.

I started to have complex vim configs, and bash rcs that tried to look at what directory you were in / file you were editing, and change configs accordingly. It never worked well. EditorConfig and vim-editorconfig helped a lot with that. No longer had to have really confusing vim configs. I could specify per project editor settings. I can’t wait till its more uniformly adopted.

That left bash configs though. Enter DirEnv. Its solved the second half for me. Makes all those configurations per project. A simple direnv edit . inside your project directory will open up $EDITOR. This lets you specify all kinds of things about that project. Anything you can do in bash you can do here. It works best with env variables but can do other things. I love the layout functions though.

layout node

adds node_modules/.bin to your path

layout python

Creates a new virtualenv and adds it to your path.
..etc

It makes it easy to work with heroku based apps as well. They do all your configurations as environment variables, its pretty easy to add a bunch of export statements to your direnv and emulate the same thing.

I’ve just submitted a simple patch to add layout perl. This makes local::lib so much easier to use per project.

I have to give Philip Nelson credit for letting me know about this toolset. Its changed how I develop applications. He and I disagree on exactly how to use it, but no matter how you do, it helps out.

Bash prompt linewrap with colors issues

So I’ve been fighting with trying to make a custom color prompt for a while now.

I’ve recently found out about tput to output color codes. That combined with local variables meant prompts became easier to read.

  local BG_RED=$(tput setab 1)

We started to create a custom prompt here for the team. Had all the info needed at a quick glance. Everything was good except long lines didn’t wrap properly. Ctrl+r would just get nutty.

So, after a lot of research and reading various forum posts, I found out that color codes should be wrapped in “\[...\]“. So example:

  local BG_CYAN=$(tput setab 6)
  local FG_GREEN=$(tput setaf 2)
  local RESET=$(tput sgr0)

  export PS1="\[${BG_CYAN}${FG_GREEN}\]\u@\h \[${RESET}\]$"

Note the \[ and \] wrapping the codes. This allows bash to properly figure out the length of the line. Note: I just grabbed random colors, I suspect this example looks bad.

I did find a slight exception

For the TITLEBAR (putty/xterm/screen) support:

case $TERM in
xterm*|rxvt*)
TITLEBAR="\[33]0;\u@\h:\w07\]"
;;
screen*)
TITLEBAR="\[33k\u$\h\]"
;;
*)
TITLEBAR=''
;;
esac

The \[ and \] should wrap the entire block as everything inside is considered part of the control code.

Feb 1st, 2014 – An unique milestone

This will be one of my rare non tech posts on this blog (I think).

As of today, Feb 1st, 2014, It has been now 10 years since my last relationship ended with the infamous words “You can still date me if you want”.

I’ve brought it up with friends, mostly because it’s a weird kind of rare milestone. Most people then ask how I feel about it. It’s taken a while to figure out what to say. I only recently realized it was almost 10 years (sometime in December maybe). I was talking to a friend about school and came across some old albums and realized when things last ended. I feel like being single has not really been a big deal in my life.

Now some people have gone along the lines “have you tried dating?” or “Are you ready now?”. I think that just highlights people don’t really understand. I’ve never avoided it. I even tried online dating several times. Online dating really isn’t for (someone like) me. It puts a lot of pressure on the first encounter. I’m well aware that many meet people from online dating sites and go on to stay friends, but I don’t think that’s the norm. I know when I tried I always tried to made it clear that I was happy enough even just to make new friends but I’m also aware of how many horrible people that frequent on those sites. After meeting and/or chatting with people, I realized it’s not the venue for me. I like getting to know people instead of instantly the comfortable way.

So how do I feel about being single for so long? Overall I don’t think I regret it. Sure there are times when that’s not true, but they pass pretty quickly. It’s usually the moments when you realize you are the only person in a room that hasn’t paired up with someone. I would say none of the people I hang out with regularly has ever held that against me, but it does come up from time to time.

So is my status ever going to change? Who knows. I’m really happy where the path of life has taken me so far. I have some amazing friends. Met some amazing people. I love my job. I’m going to continue to go out, do things, meet new people if I can, and who knows, one day I might find that someone special, but I would never want to force it. It’s not who I am.

(Lets hope this comes across as positive as I wanted)

Capistrano3 – Deploying with internal git server

Edit: I updated my “hack” to work with newer versions of capistrano/sshkit – http://www.halkeye.net/2014/06/06/update-capistrano-hack/

To set the scene. New team has been using capistrano to deploy some of its apps (all internal/behind our firewall). So new POC project comes along. Nothing sensitive but needs to be publicly accessible. I get very excited because this is the first time I’ve setup capistrano from scratch. I follow the getting started guide. Deploy to internal test. No problem there. Go to deploy to the amazon box (Go Free Tier) and fail… Riiight, can’t talk to our git server.

So spend a while scouring the internet for how to solve this problem. Can I just SCP? Its not that important right now. Hrm. That doesn’t seem to work reliably. Lots of solutions, none of which seem very clear and/or work with cap3. So I give up searching. This should be easy right? Just setup a remote tunnel. I open a new window, create  tunnel, edit my config, and bang. Deployed. Yay!

But wait, this is going to get annoying fast. Plus others will have to do that manual process as well. How do I automate this? Scour the internet for a while. Again, no real automation and/or doesn’t work with cap3.

Well fine, I always need the excuse to learn more about ruby, so start digging into the code. Its using pre-existing open source modules so it shouldn’t be that hard. After a bunch of learning, and giving up, I decided to skip on the nice clean solution and just start overriding some things.

So here it is, config/deploy/production in all its glory:

YAOIRPG

tl;dr – http://yaoirpg.halkeye.net is now live again

Yet Another Online Interaction Role Playing Game was a project a group of us at BCIT put together. It was for some of internet studies course (Yea I’m that old / It hadn’t been updated yet). Evan, the guy who named it, was also someone who spent a lot of time online and really enjoyed the idea of an acronym that people probably wouldn’t get.

So YAOIRPG was born. We had to do lots of paperwork. Project Docs, Design Docs, ETC ETC. But we found everyone loved playing it. I actually got killed several times while I was trying to demo the game to the class. It was fully multiplayer. Not bad for a school project. We were not expected to finish it, just document the process. There was only one other team that manged to get something demoable (I think), and they had a simple app that transferred files.

Anyways, it came up in conversation recently, mostly because I still tell the story that the teacher was heard saying he loved yaoi and we in the know at the time were so amused by this.

I realized the code wasn’t backed up, so I dug through some of my old hard drives, found the code and an old DB dump and this morning through a lot of trial and error (And actually minimal work) got it running in a recent version of php and mysql.

http://yaoirpg.halkeye.net now lives on heroku where it should forever run. Backed up to bitbucket ’cause I’m pretty ashamed of the code :D

2013 In Review.

Everyone else has started to do this. I’ve been working on it for a week now for my own reasons. I apologize in advance. Overall I’d say 2013/30 has been an amazing year. (Posting it to the rarely used blog so I don’t have to copy and paste all the text cross social networks.

* Lost like 40 pounds, really gotta work at doing more (Esp since I seem to be finally gaining weight again :(). Got heavily into using the slow cooker which helped a lot with this.
* New job at telus seems to be going amazing so far (I especially can’t wait for any of the prototypes my team are playing with to make it out to the public)
* Awesome friends, especially the new ones i’ve made this year (Reconnecting with noggery, Yvonne, Raine, Katrina, Meeting Roslyn, Justin, and recently Annie. Loads more people I probably forgot it was this year)
* Best birthday in years (lots of room for improvement so can only go up from here)
* Had lots of run doing redditgifts. It keeps giving me big anxiety, but it helps me learn to deal with it in a controlled way, so yay!
* Raine/Alex wedding, Yvonne/Eric wedding
* Salty Stories launched. Didn’t do as well as I had hoped, but it launched I can say I’m an app developer now.
* Nigel (airg Ireland) and Brian (Blizzard) moving away. Boooo
* I’ve had a lot of fun with kickstarter, only real complaint so far is the ouya. I still think pebble should win kickstarted of the year award.
* Went to some events by myself (Including an awesome wedding and a gentlemen hecklers show).
* Started to GM/Run Games.
* Generally focus more on the good, try to get less caught up on the bad.
* Pebble

So much more. Lets see if 2014 can be even better.

Things I wish I had done but didn’t:
* Post more to the blog. I meant to while I was job hunting. Started to clean up older posts thinking I might convert to octopress. Then I just didn’t finish ’cause I spent too long trying to track down old broken image links.
* Finish Projects (See above). When they are personal projects I tend to do the learning/prototype stuff, but not follow through enough. Made a couple android apps. Went “yea, I totally can do it” but didn’t finish the polishing steps as they are just for me.

Oh! Some automated 2013 things:
* https://www.vizify.com/gavin-mogan/twitter-video
* https://plus.google.com/107775609316541886610/posts/VMKeoGGpRNb

Renaming batch of files (with spaces) in linux

I rename a lot of files. Often by hand as it’s just easier. I’ve tried various combinations of find -print0 | xargs -0, and find -exec, without much luck.

Just So I have reference on what does work:

find -type f | while read file; do echo mv \"$file\" \"$(echo $file | sed -e 's/^Old Content/New Content/')\"; done | sh

Yea I could probably drop the echo mv, and the |sh, but it feels safer to do a dry run

Updating WordPress Plugins Helper

I decided a while ago to put pull all the plugin source codes for this wordpress install directly from subversion. This makes it easier when files need manual patching or more likely, a file gets deleted.

So I created this little helper script that I can use to do a mass update when I get too out of date.

https://gist.github.com/halkeye/6288018

Go to Top