/images/avatar.jpg
DevOps Engineer // Security Enthusiast // Something

Docker and Rails in Production

Last week, I deployed a Rails app in a Docker container onto AWS Elastic Beanstalk. It was an unncessarily time consuming task due to small gaps in my knowledge and unfamiliarity with Docker and Elastic Beanstalk. This blog post is written during my first month working as a junior system administrator (“devops”) and this is a recap of my experience to the best of my memory.

Super helpful links: https://github.com/phusion/passenger-docker https://intercityup.com/blog/deploy-rails-app-including-database-configuration-env-vars-assets-using-docker.html https://intercityup.com/blog/how-i-build-a-docker-image-for-my-rails-app.html https://rossfairbanks.com/2015/03/06/rails-app-on-docker-using-passenger-image.html

Thanks to these blog posts (amongst many others), I was able to cut down a lot of time out of learning how to deploy this rails app.

First thing’s first. I installed docker-machine, which is the new boot2docker, and attempted to run my docker image containing the Rails app locally, in production, on my Macbook.

Setting Up a Webdev Environment on Windows

Developing on OSX is a dream. I love my Macbook and I love developing on it. However, I’ve always been a PC enthusiast and most of my time is spent on my desktop computer. I stick with Windows as my main operating system when I’m not developing because Linux offers a subpar gaming experience, and my entire music library resides on iTunes, which is not supported on Linux. I have happily turned this computer into a Hackintosh before for a few months when I started out web development, but rather than dual-boot into Linux/OSX, I decided to give virtualization a try.

Why use VMs?

Simply put, my Windows machine completely outclasses my Macbook. The screen real estate and dedicated mouse/keyboard really speeds up my development. Futhermore, as a formal avid gamer, I’ve grown very accustomed to Windows and I just prefer to use it as my main OS. Dual booting is a completely viable option, save for the fact that I would have to boot back into Windows to play a game or listen to my music. I already have OSX on my Macbook in case I want to have a dedicated environment, so spinning up a VM seems to be a great choice for my development needs.

Deep Dream

Can robots dream? According to Google, they can. Trippy “deep dream” images like this are recently being posted all over the internet.

What is deep dream?

Google’s image recognition ability is very powerful. Google had become very good at identifying images. Given spicture of a dog, cat, or a bird, Google’s image search will be able to identify the animal properly. The deep dream software uses Google’s image recognition system to identify elements it recognizes, and pronounce it. Basically deep dream is the process of taking an image, finding all known elements of images it recognizes (for example it may associate a shape to a dog), makes that area more dog-like, and feed the results back into itself. After many iterations, the software attempts to make a picture more into the elements it recognizes. Different data-sets produce different results because deep dream is a field of machine learning. Machines learn through the data sets it is given, allowing different patterns to emerge depending on the data set the machine uses to recognize images.

Visual Data of a Relationship Over a Year

My roommate and I were discussing about how we should create a webapp that tells you who is the better boyfriend/girlfriend in a relationship. This reminded me of a reddit post by /u/Prometheus09. Inspired by what he did with his Whatsapp data, I decided to do the same thing using my Skype logs.

My last relationship went from November 2013 to April 2015. Unfortunately my Skype logs start from March 2014, so I’m missing about 4 months worth of data. Still, I had fun doing this and it gave me some insight into our relationship. Here is a relationship in 200,000+ messages over the course of 14 months worth of data.

/posts/2015-05-20-visual-data-of-a-relationship-over-a-year/images/messages-by-month.png
Messages by Month
/posts/2015-05-20-visual-data-of-a-relationship-over-a-year/images/messages-by-hour.png
Messages by Hour

Playing With Friends on Agar.io

Agar.io right now is one of the most popular browser games. You start off as a small blob, eating pieces smaller than you to grow, allowing you to eat other players who have a smaller mass than you. My classmates and I have been playing this game from time to time, however it was pretty difficult to play on the same server. Agar.io allows you to connect to a server in the same region, but you cannot specify which server and you’ll get thrown into a random room. This is incredibly frustrating when you’re trying to play with friends and you have to try over and over again to join the same room as your friends.

Good thing we can easily fix this with some jQuery. Notice when opening the console and picking a region, a websocket opens to ws://45.79.193.74:443. This is the IP and port that we want to give our friends.