terriblecode https://terriblecode.com/ Recent content on terriblecode Hugo -- gohugo.io en-US Sun, 12 Apr 2020 11:21:26 -0700 Hosting your own Minecraft Server with a Custom Map https://terriblecode.com/blog/hosting-your-own-minecraft-server-with-a-custom-map/ Sun, 12 Apr 2020 11:21:26 -0700 https://terriblecode.com/blog/hosting-your-own-minecraft-server-with-a-custom-map/ Is hosting your own minecraft server even a good idea? Short answer: Probably not, but it’s fun… kinda Some context So recently a custom minecraft map came out and I wanted to play co-op with my brother, so being the tech person that I am, I decided to host my own minecraft server. Given my experience with Docker I chose that as my solution for running the server and Digital Ocean as my hosting provider. Locking Package Versions with Apt and Yum https://terriblecode.com/blog/locking-package-versions-with-apt-and-yum/ Tue, 29 Oct 2019 14:36:51 -0700 https://terriblecode.com/blog/locking-package-versions-with-apt-and-yum/ Limiting package versions (especially for updates) is a common pain point most enterprise customers will experience at one point or another. In this blog post I will cover how to do version locking for the 2 most popular enterprise package managers. yum Distributions covered/tested: CentOS 7 RHEL 7.X Instructions There is an official document on how to do this from RHEL but I’ll boil it down to the most important parts. Feature Request: Parallel Stage Generation for Declarative Jenkins Pipelines https://terriblecode.com/blog/feature-request-parallel-stage-generation-for-declarative-jenkins-pipelines/ Tue, 26 Feb 2019 11:03:06 -0800 https://terriblecode.com/blog/feature-request-parallel-stage-generation-for-declarative-jenkins-pipelines/ A bit of context Normally a declarative Jenkins pipeline is pretty simple it can look something like this: pipeline { agent { label "linux&&x86_64" } stages { stage("Building / Testing") { stage("Testing") { steps { sh("make test") } } stage("Building") { steps { sh("make clean && make") } } } } } But what happens when you need to repeat those stages over and over again, accounting for a small difference (in terms of code change) of something like CPU architectures? Extracing RPM Build Dependencies From RPM Spec Files https://terriblecode.com/blog/extracing-rpm-build-dependencies-from-rpm-spec-files/ Wed, 09 Jan 2019 15:07:24 -0600 https://terriblecode.com/blog/extracing-rpm-build-dependencies-from-rpm-spec-files/ Specifying build dependencies for RPM packages Build dependencies in an RPM spec are denoted by BuildRequires: ${DEPENDENCY}. You’ll typically find a random spec file with dependencies like this: Name: foo BuildRequires: make BuildRequires: bar # We're running something on a SuSE distribution %if 0%{?suse_version} BuildRequires: suse-specific-stuff %else BuildRequires: not-on-suse %endif The normal way to extract dependencies So for every tutorial that you see to build an RPM package one tool stands above all the rest when it comes to extract / install build dependencies: Switching to Netlify https://terriblecode.com/blog/switching-to-netlify/ Thu, 03 Jan 2019 15:07:24 -0600 https://terriblecode.com/blog/switching-to-netlify/ So this is kind of a follow up to my blog post that I wrote about hosting your own static site, which is basically to say that I’ve stopped hosting/deploying my own site and I’ve started to use Netlify! Basic Netlify Setup Netlify was very easy to setup, it followed this basic workflow: Login with Github OAuth Add the site as a site to build Add a netlify.toml for deploy previews Add my custom domain (and setup DNS) Features of note Deploy previews for pull requests / drafts One of my biggest gripes from deploying my own site was that when I was collecting feedback from a post that the only real thing I could point to for my editors was a PR that didn’t really signify what the final product was going to look like. How Docker Images Work: Union File Systems for Dummies https://terriblecode.com/blog/how-docker-images-work-union-file-systems-for-dummies/ Tue, 24 Jul 2018 08:50:00 +0000 https://terriblecode.com/blog/how-docker-images-work-union-file-systems-for-dummies/ A lot of things about Docker are mysterious. Even with an inside view Docker internals are foreign. We take for granted the systems that were built before, not intentionally, but in order to promote progress. However I decided enough was enough and I was going to learn about this technology that I help release almost every single day. The first thing that jumped out to me was the idea of the Union File System that enables Docker’s efficient storage of image layers. Easy and Open Website Analytics with Fathom and Docker https://terriblecode.com/blog/easy-and-open-website-analytics-with-fathom-and-docker/ Wed, 11 Jul 2018 09:44:08 -0700 https://terriblecode.com/blog/easy-and-open-website-analytics-with-fathom-and-docker/ Some context first I’ve been using Google Analytics to track traffic for terriblecode for the better part of 2 years and it’s been an alright experience. Google Analytics has got real time analytics, it’ll tell you how much your page is worth ($$), and it’ll even do nice things like provide graphs etc. But honestly, Google Analytics has always felt like a bear, with a UI that rivals AWS’ console for usability. Developing on a remote instance https://terriblecode.com/blog/developing-on-a-remote-instance/ Thu, 28 Jun 2018 16:18:09 -0400 https://terriblecode.com/blog/developing-on-a-remote-instance/ Have you ever been in a meeting that you didn’t really want to be included in? So you’re working and go to compile something and all of a sudden all 3 billion of your laptop’s fans start to fire at full speed. Everyone in the room suddenly looks at you and now they all know you weren’t paying attention What if there was a way to run things without having your laptop sound like it just started its jet engines? Deploying Static Sites With Docker and SSL https://terriblecode.com/blog/deploying-static-sites-with-docker-and-ssl/ Thu, 14 Sep 2017 21:32:17 -0700 https://terriblecode.com/blog/deploying-static-sites-with-docker-and-ssl/ Context SSL is increasingly important in today’s web development workflow. No site, however small, is immune to the pitfalls of ignoring such knowledge - not even personal blogs like this one. When Google announced that its Chrome web browser would begin flagging non-SSL sites as “unsafe”; I knew it would be only be a matter of time before I would need to implement an SSL solution for this blog. Dockerizing Python Test Environments https://terriblecode.com/blog/dockerizing-python-test-environments/ Tue, 04 Apr 2017 19:48:47 -0500 https://terriblecode.com/blog/dockerizing-python-test-environments/ Context It’s every maintainer’s nightmare to see these types of failures on PR’s. Nothing in the code base had changed and tests were passing locally, but almost every build we pushed through was failing. I spent so long trying to figure out why they were failing on Travis CI but not on my local machine, but could not find any reason why it was actually happening. Then, I did what any developer would do in a similar situation: I spun up a virtual machine close to what Travis CI would be like and tried to recreate the steps through there. On not understanding code https://terriblecode.com/blog/on-not-understanding-code/ Thu, 16 Mar 2017 00:00:00 +0000 https://terriblecode.com/blog/on-not-understanding-code/ Figuring out code that seems mysterious We all come across code that seems to not make sense in what it does. Whether it’s new syntax, black hole logic (logic that doesn’t seem to make any sense), or enterprise legacy code, the feeling of not knowing how code works is aggravating. But alas, there are simple things we can do to remedy that. In this post I’ll be going over a function that didn’t make a whole lot of sense to me when I first read through it, how I dissected the function, and how I eventually rewrote it to make more sense to those who come after. Asynchronous HTTP Requests in Python https://terriblecode.com/blog/asynchronous-http-requests-in-python/ Sat, 25 Feb 2017 14:18:57 -0600 https://terriblecode.com/blog/asynchronous-http-requests-in-python/ Overview Asynchronous programming is a new concept for most Python developers (or maybe it’s just me) so utilizing the new asynchronous libraries that are coming out can be difficult at least from a conceptual point of view. The library I’ll be highlighting today is aiohttp. If you’re familiar with the popular Python library requests you can consider aiohttp as the asynchronous version of requests. Usage is very similar to requests but the potential performance benefits are, in some cases, absolutely insane. zplug from a former oh-my-zsh user https://terriblecode.com/blog/zplug-from-a-former-oh-my-zsh-user/ Wed, 14 Dec 2016 21:11:08 -0600 https://terriblecode.com/blog/zplug-from-a-former-oh-my-zsh-user/ What is zplug? zplug is plugin manager for zsh. If you’ve ever used vim-plug it’s pretty much the same idea and it’s made by the same guy. With it you can pull down various git repositories and use them as pluggable items into your own zsh distribution. zplug is nice because it’s light, has an intuitive interface, and it’s extremely fast. As a an everyday zsh user, zplug has shrunk my zshrc and heavily reduced the amount of headaches I have when it comes to how fast my prompt shows up. Why ptpython is the only REPL you will ever need https://terriblecode.com/blog/why-ptpython-is-the-only-repl-you-will-ever-need/ Tue, 13 Dec 2016 22:15:12 -0600 https://terriblecode.com/blog/why-ptpython-is-the-only-repl-you-will-ever-need/ Some backstory For a few months when I first started developing with python I was using ipython for all of my REPL needs for python. At the time nothing really competed with ipython. However I had a few gripes: Multiline editing and history was non-existent (If you defined a function, good luck re-editing it) Auto-completion didn’t function like most text editors do, with completion showing a pop-up of all available options Pulling code in the REPL into a text editor was spotty at best So imagine my surprise when I found a little python REPL named ptpython courtesy of reddit’s own /r/python About Me https://terriblecode.com/about/ Tue, 13 Dec 2016 22:13:19 -0600 https://terriblecode.com/about/ Hi! My name is Eli and I’m a software developer who likes to do a lot of things surrounding automation. The main project that I work on right now is sanic and I’m currently running a few other personal projects like nba_py and retry.it. I really like contributing to open source and managing open source projects as well as interacting with the open source communities. If you need to contact me feel free to tweet at me @_seemethere! https://terriblecode.com/license/ Mon, 01 Jan 0001 00:00:00 +0000 https://terriblecode.com/license/ License Creative Commons Attribution-ShareAlike 4.0 International Public License By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-ShareAlike 4.0 International Public License (“Public License”). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions. Home https://terriblecode.com/home/ Mon, 01 Jan 0001 00:00:00 +0000 https://terriblecode.com/home/ Hi! My name is Eli, you may know me as seemethere, on various different platforms. This site is mostly just my random thoughts when it comes to software and some other stuff. This site is also open source, check it out on Github!