Systemd + Tshock + Docker

I’ve been diving pretty head long into running services with docker. I’ve ported someone’s mineos and patched it to run in docker with a custom set of users. I have factorio server running. Even openhab running my meager home automation setup. Its the easiest way to run an application and not worry about system depaendancies.

Most of the time its pretty straight forward. docker run, walk away.

Tshock/Terraria gave me a bunch of trouble. It requires a working stdin, which none of my other daemonized processes do.

A bunch of digging and trial and error, I found out about the tty functionality for services. Which worked perfectly, but once I first logged in, it was causing my server to beep endlessly. I suspect tshock was sending terminal control codes.

Did a bit more reading. Found out you can have input from a tty, but output to the journal as normal. SUCCESS!

So for people like me that want to run tshock this way, here’s my systemd service file:

[Unit]
Description=terraria
After=docker.service
Requires=docker.service

[Service]
TimeoutStartSec=0
Restart=always
# needed because tshock crashes when no stdin
StandardInput=tty
# Hijack tty11 for this purpose
TTYPath=/dev/tty11
# all output should stay in the journal though
StandardOutput=journal
ExecStartPre=-/usr/bin/docker stop terraria
ExecStartPre=-/usr/bin/docker rm terraria
ExecStop=/usr/bin/docker stop terraria
ExecStart=/usr/bin/docker run --rm -it \
        -p 7777:7777 \
        -v /storage/games/terraria/world:/world \
        --name terraria \
        ryshe/terraria:latest \
        -autocreate 3  \
        -world /world/Lg-Normal-17-02.wld

[Install]
WantedBy=multi-user.target

High school robotics Compeition

So yesterday I ended up at helping judge a high school robotics competition organized by the local robotics group, but lets rewind a bit.

In september, my friend Daruvin contacted me. He in conjunction with Penguin Robotics was helping to put together workshops to help the high school students learn to program for the robotic systems.

The penguins were past world competitors and had a lot of experience, but they wanted more people to help out the large number of attendees, plus would love people with industry experience to share stories and such.

As I love to mentor and build up people, especially kids, I very quickly signed up. Even got work to sponsor.

Last month due to traveling I wasn’t able to get involved, but when the tournament rolled around and again I was asked if I was up for helping judging I promptly signed up.

We had about 8 people, so that easily allowed us to have pairs. We had 3 groups of 2 setup at tables so the various clubs could come and get reviewed and judged. Some were really amazing and had been doing this for a long while. Others were just starting out and it was a bit better to give them feed back instead of worrying about judges.
20161105_153829.jpg

The other judges were outside watching the games, and watched how the various students/drivers performed.

We all kinda rotated at both sections.

During the afternoon, the teams were no longer random, but instead they got to make alliances and go through playoffs to see who would be allowed to goto the next level. We took this opportunity to get together as judges and compare all of our notes.

Once we were able to compare notes and pick winners for each categories, we were able to go watch the finals.

The finals were absolutely tense. I saw one teacher get so excited she was jumping around. It turned out this was the first year her school got to compete or something. She’s been fundraising a while to get it started. Turns out one of her groups won. She nearly collapsed and was in tears. It was so awesome to watch.

Finally everything was announce. Top winners in playoffs. Top driver in skill challenge, top autonomous robots in skill changes, all 5 judges awards. Some teams played off winning as it was nothing, but you could tell all of theme were excited about winning. I didn’t see any poor losers at all. Even the final game of the playoff you could see the losers thinking about how to improve to next time.

Last bits were the most impressive to me. Everyone of course ran off to clean up the tables and robots of their owns, but as soon as that was over, many kids from many different schools, not just the hosts, came back and helped clean up the event stuff. I mean sometimes it was ridiculous that we had 5 kids doing the simplest tasks, but they were all having fun and things were getting done.

I stuck around till the very end, helped with cleanup wherever I could. I had so much fun. I’ll admit the finals and the cleanup were more fun to me than the actual judging, but i enjoyed all of it and would do it again.

I’m so looking forward to next weekend when I’m getting involved with the second workshop Penguin Robotics is putting together. This time they’ll actually have the game field, and two groups going, one for novice and one for advanced. I’m hoping some of my teacher friends can get more involved as well.

I know this is super scattered, but i’m still excited and just thinking of everything, but I learned that a school would need about $1000 to get the basic kit together to field a team. Of course they would still need workspace and teachers/mentors and everything but I figure that’s something more individuals/companies could donate to schools to help them get started. I know I’m going to look into it. Too bad I haven’t kept in touch with my high school at all, it would have been cool to see them there. I think my shop teacher has long since retired too.

Cat plays with new Cat Toy Box

I never know how to start these :)

I’m off on vacation this week so I kinda decided to do a bunch of chores. Among those, I ended up going online and buying a bunch of bulbs, garbage bags, etc. Things I needed but wasn’t in a super rush for. During this little shopping spree I ended up getting the cat something new. A little self groomer you attach to the wall. So far she’s shown no interest, but since it has catnip in it, we’ll give it a bit of time and see how it turns out.

The best part is that it comes in a little box that you are supposed to cut a hole into and put a few treats in to make a quick cat toy. I decided why not….

I had to make the hole a tiny bit bigger before I took this video, she wasn’t having any luck whats so ever. She’s a super smart little one, but when it comes to food, completely dumb :D

She managed to get the handful of treats out in the end, but I thought it was quite awesome.

So next up I put one of her springs (which she absolutely still loves) in the box.

That was less successful, so i eventually took it out for her. I just loved the meow at the end.

Gavin mental health

Since @geekmentalhelp is doing a week of articles talking about mental health, I’ve decided to nudge myself into doing something as well. This is even more scary now that some of my posts are getting tweeted/shared out by work so I’m actually having visitors.

I’m pretty open about my issues, at least the easy to digest versions. I’ve always in the back of my mind (and possibly a bit been told growing up) that I’ll scare people away. Just act normal so people want to be around you. I know I’ve been trying pretty hard to find the right balance of things. I don’t like hiding from me. I also very much like teaching and helping people learn things/grow.

I’ll gladly talk more about what I know, and my experiences, but I’m focusing on high level stuff.

So straight up, the easiest one. ADHD. I was diagnosed with it at approx age 6. I was treated my entire school live until sometime in college. Not ever taking a break from the meds probably stunted me a few ways socially, but I think I manage it really well.
Diagnoses and treatments have come a long way. From what i’ve read online, it has 4 sections now. I fall into the “Inattentive Type”, which lends itself  to anxiety and depression. I think I self sabotage a lot in that area too. I don’t need to be treated special or anything. I’ve long ago learned to handle things. The key thing is that ADHD is all about information overload. You don’t have the traditional filters. I notice a lot. I process a lot. I use headphones and books/movies to blind myself from external stimulus.  So at large events (bars are really bad) with lots of conversations/movement/people/etc, I can get pretty quiet as I expend a lot of energy to stay focused on the people I’m with.

Next official diagnosis is social anxiety. Now this is one I sorta disagree with. I know I have lots of anxiety when it comes to social situations, but I think its more of a symptom than an actual issue. A couple years ago I had a pretty serious breakdown. I was able to keep it together at work, so people didn’t really notice, but that took almost everything I had. I came home, ate lots of junk food, hid in my room and cried, etc etc etc. I eventually managed to get a referral that lead to anxiety medication, and a cognative behavioral therapy class. I highly recommend the class if you think you suffer from it at all. It helps you learn coping techniques, especially to help you get out of that spiral. It also helps you notice those bad/negative thought patterns that help getting you into that spiral.

I’m pretty sure I don’t actually suffer from anxiety straight up, I actually have clinical depression which can manifest/overlap with anxiety. Luckily the meds tend to treat both so I’m back to a pretty functional state. Once or twice a month I still seem to have really bad days. Especially if I havn’t been sleeping as well as usual. And there are certain topics that can really hit me hard, but overall I have seen a massive improvement.

The biggest problem I face in this department is the years and years of bad habits developing avoidance techniques. I have a farely constant fear of things, especially alone, even silly things like making dinner I just feel sick at the idea of doing and eventually order food. Again I don’t need to be treated special, but do know I am trying as much as I can.

Lastly, unofficially, I’m almost certain I have dyscalculia. I’ve been told I was diagnosed with a “math based learning disability” as a kid but we never went past that. All the symptoms of dyscalculia fit. It is essentially a math based form of dyslexia. It mostly focuses on being unable to judge distance, time, relative numbers, etc. I also have given up and just used calculators and computers for basic math. It takes me way too much time and I get kinda embarrassed. It also explains why I have such trouble with spelling, and even why i have trouble with names/nouns a lot.

I’ve been handling this, sometimes pretty silently, for a long time now, so I’m totally capabile of doing so, but I know I don’t like how much its kept in the dark. How much people shouldn’t talk about it. I know when I had my breakdown, I absolutely felt more alone than I ever have in the past. I didn’t know where to turn. I knew others had problems, but never how they addressed it. I hated it. I felt abandoned, alone, scared. I barely held it together for my doctors appointments. I didn’t know who or how to talk to people. I was afraid of scaring off the few friends I still had.

So I keep saying over and over again. I don’t want to be treated special. But what can you do, if not for me, but for others? Honestly I have no idea, everyone is different. For me, and probably many otehrs, just being patient, just being around, maybe even just being forgiving goes a long way. And with everything else, sometimes all that is needed is a nice distraction to get things going again. But don’t feel like you have to fix things. Or find a solution. Especially don’t try to “fix” things by telling me or others to just be happy, or think positive. Its much more complicated than that, but more than anything else, knowing someone is around makes all the difference.

I think https://imgur.com/a/uVIvv does a way better job at explaining some of the things a lot better.

Oh, totally wanted to mention. Every time I feel like someone praises how awesome, or smart I am, I want to curl up and hide. I am not that good. Stop compairing me to those. I didn’t finish school. I’m alone a lot. I can’t do math. Everyone knows more than me. But I get past it. I know the intention. I know I am actually good at what I do, because I try really hard, and I’m excited about it. I’m not better than anyone else. But I am good. I can do this.

I’ll end it off on a positive mental health poem. A guy speaking about how his OCD is calmed by a love. (Video)

test.allTheThings() at Jenkins World 2016

I CsXFwi9UMAA-2vIspent last week at Jenkins World 2016.

This wsa my second time hanging out at the Sauce Labs booth, the first being Microsoft’s /b/uild event.

I have to say I’m realy enjoying it. I don’t think I could do it full time, but its so much fun to talk to people excited to use your product. There’s that moment in thier eyes you can see when they realized its actually going to make their lives easier.

Jenkins World was actually incredably well done itself. I snuck off to the keynote to check things out on Wed morning. As someone who is lightly attached to the community, I didn’t really find anything all that new, but there was lots of exciting news. He explained why the UI hasn’t really changed in the past, and what they are going to do about it (Blue Ocean) and what they want to do long term, including the sexy sexy configuring Jenkins by Pull requests.

IMG_20160914_074254Our booth was right next to the entrance to a couple of the theaters, and the event had planned it so people would come back to the main hall between talks for food and snacks and stuff. While some of the talks were on, things got pretty slow, but we did have visitors, and I got to talk to some of the other out of town saucers that I normally don’t get to interact with.

In the end, I didn’t end up going to any of the other panels. I realized they were not really designed for me, I’m a very comfortable Jenkins user. They were more targeting people new to it. Instead I would talk to the other vendors, learned about a bunch of awesome products. Talked to some of the other attendies taking breaks.

The event ran informally on Tuesday, and they capped Tuesday off with a community appreciation night at the Computer History Museum. I was a little too paranoid about my backpack (which they didn’t want to allow inside) for me to wander the exhibits, but I had a blast hanging outside with random people. I managed to met a pair from scotland, and at least one person which high security clearance. Even ran into a buddy of mine I’ve known almost 15 years, but who I havn’t seen in probably 5 years (when was the last pax I went to?).

Wednesday was the longest of everything. I took the first shuttle from the hotel to the convention center at 7am. The actual talks ended around 5pm, but there was a Dev Ops Express party that night, so all the vendors stayed around and socialized with the various attendies. Lots of foods, snacks, even popcorn. The event kinda wound down at 7:30, and I was exhausted and took off about then.

Thursday was a much shorter day, only going to 5pm. Less people came by, but we had one guy who came by, and came back later that afternoon with his boss so things could be re-explained. I think by the end I had her convinced as well :D

IMG_20160914_085904.jpg

Last but not least, Jenkins World had the team (I didn’t know it was a team) behind Commitstrip come by from France. They were producing a mural just outside the main rooms. The plan was that the attendiees would be able to color it in, but they’d draw the thing.

I walked by it a few times. I really wish I had snagged a picture of the colored in one, but it still looks great black and white.

I know at least one of them (Okay I’m not certain there’s a team) was on stage for the keynote on Wed morning. He was live drawing while people were getting steated. It was so much fun to watch. Whoa, whats he doing? Oh, shading, thats probably not needed is it?… oh whoa, zoomed out, Okay I can see how much that adds. Thats amazing.

PANO_20160914_072416.jpg

Overall a blast. I’m going to keep signing up for booth duty in the future. I had a blast.. as I’ve already said. And its so cool to work at a company/for a product you actually believe in and am not ashamed of. I havn’t felt like that since LiveJournal.

My Second Fringe Show: How to Adult

I’m not sure what to say about this one.

I had so much fun at grounded, I figured I would check out another Fringe show when I got back from traveling. Arranged to go with a different friend this time, picked a recommended show, a musical, one that was billed as a comedy, and off we went.

I’ll admit, I felt a bit excited being in line the second time. I knew about the membership thing (based on grounded, and my one viff experience this year), so helped redirect people as we were waiting. Get into the theater, its pretty packed. Managed to find a pair of seats on the side, unlike the giant movie theaters, being on the side really didn’t matter too much.

Show opens with a woman sitting down on a couch, putting headphones on, watching tv on her laptop. Few seconds later, a friend shows up, all sniffling and huffy. Ends up rolling herself up in the carpet (hard to explain). Lastly shows up the third friend. These turn out to be the main cast, with one more guy showing up later rounding out the cast to a total of 4.The main guy’s voice was absolutely amazing, I’m kinda sad he didn’t sing more.

It was a very cute little show. Touched on a lot of stuff, threw in a bunch of humor where they could, but nothing to overshadow things too much. When the characters announced they were all sub 25, I kinda groaned a bit, but thier youngness and naivety helped a lot with the concepts. Worked really well.

A couple things hit really close to home. Probably more than I’d want to talk about. But I found it uncomfortable that as the one characters birthday was coming up, the big two-five, the other two decided it was to go out for drinks and clubbing. The birthday one kept saying teasing no, stay home and watch doctor who. I’ll admit, I still hate that attitude that people can only have fun getting drunk.

But yea, overall well done. Delivered the message that everyone is different. Talking is important. Things won’t just be okay because you want them to. Growing up isn’t all that scary. Etc. I know I felt sad at times, probably unintentional, but I did realy enjoy it. I’ll admit, I even started to crush on at least one character by the end.

Fringe is over, tickets are no longer available, but I do want to link back to the group, so – How to Adult: The Musical

 

 

Grounded

Groundedpromophotolutalicatheatre-768x768.jpgOnly a week later. I’m getting way better at this.

Last weekend my friend Joanna Gaskell stared in this fringe festival play called Grounded. Other than knowing it was about a female fighter pilot, I went in not knowing anything else about it. I’ve been finding the more I do it, the more I enjoy the entire experience. This would also be my first experience with anything fringe festival related.

So a friend and I got tickets for opening night, arrive at this tiny little theater. Once I got inside, realized its was this tiny little theatre and had a moment of panic. What did I get myself into. Buuuut, right from the opening sequence, all the way to the end, it was such an amazing experience. It turns out she was in was in this (mostly) one woman dramatic play. I’ve never seen anything like this before. I had worked on big productions as a teen, but this was just a simple set, one and a half costumes, and Joanna.

I was constantly surprised how emotional I felt throughout the performance. Joanna really nailed everything. She starts off describing her emotional state as a pilot, flying through the sky, being a god in the sky, to meeting someone awesome, having a kid, all the way to the roller coaster ride that was being turned into a drone pilot.

I don’t really want to say much more, other than I laughed at parts, felt uncomfortable at parts, even cried at parts. Was such an amazing ride.

There’s a few more shows this upcoming weekend. I highly recommend grabbing tickets.

I liked it so much I’m actually going to check out another fringe show. Look at me. Two whole fringe shows in one year.

My GoPro experiments

My mom got me a GoPro last year for my birthday, and as the weather has gotten a lot nicer, I’ve been using it for various projects.

About a month ago now, I picked up this really cheap accessory pack off amazon. Its been a lot of fun to play with the various attachments and components.

Yesterday on my bike ride to work, I decided it might be fun try out the chest harness. I put it on. Checked that it all worked. Everything seemed to work just fine. I didn’t really think about how on a bike you are at least slightly bent over. The results? 45 min of looking at my handle bars. Its kinda fun to try to figure out where I am from the various peices you can see.

My next favourite experiement would be the suction cup mount. I stuck it to my outer window, and let it run for a little bit. Then timelapsed/sped up the 20 minute video down to 15 seconds.

I think it turned out pretty cool

Talk on Testing – Code and Coffee YVR

One of my personal goals for this year is to start getting more comfortable sharing knowledge and talking infront of large crowds. As such, I volunteered to give a quick talk on testing, as its always been something I love doing, and ion the new job I thought it would be pretty appropriate.

This is my second Code and Coffee talk ever, and I can see I’m still pretty nervious giving the talk, but I think other than a few technical glitches (which were thankfully edited out) it went really well.

I have so much fun doing them. I love the fact that people come up to you afterwards and walk to talk about topics.

Totally open for more ideas on what to talk about. So far I’ve done Vagrant and now Testing in general. I’d love more suggestions.

Jenkins docker Image + prefix

I’m probably going to need this again sometime.

 

Upstart

# cat /etc/init/jenkins.conf
description "Jenkins"
author "Gavin Mogan"
start on filesystem and started docker
stop on runlevel [!2345]
respawn
script
   /usr/bin/docker stop jenkins || true
   /usr/bin/docker rm jenkins || true
   /usr/bin/docker run --rm --name="jenkins" -p 8080:8080 -p 50000:50000 -v /var/lib/jenkins:/var/jenkins_home jenkinsci/jenkins:2.0-rc-1 --prefix=/jenkins
end script

Systemd

$ cat /etc/systemd/system/jenkins-docker.service
[Unit]
Description=Jenkins
After=docker.service
Requires=docker.service

[Service]
TimeoutStartSec=0
Restart=always
ExecStartPre=-/usr/bin/docker stop jenkins
ExecStartPre=-/usr/bin/docker rm jenkins
ExecStart=/usr/bin/docker run --name="jenkins" -p 8080:8080 -p 50000:50000 -v /home/jenkins:/var/jenkins_home jenkinsci/jenkins:2.0-rc-1 --prefix=/jenkins

[Install]
WantedBy=multi-user.target