<?xml version="1.0" encoding="utf-8"?><feedxmlns="http://www.w3.org/2005/Atom"><generatoruri="https://jekyllrb.com/"version="4.1.1">Jekyll</generator><linkhref="http://localhost:4000/feed.xml"rel="self"type="application/atom+xml"/><linkhref="http://localhost:4000/"rel="alternate"type="text/html"/><updated>2020-09-13T01:38:20+00:00</updated><id>http://localhost:4000/feed.xml</id><entry><titletype="html">Minesweeper Bomb Generation And Tile Revealing</title><linkhref="http://localhost:4000/2020/09/12/minesweeper.html"rel="alternate"type="text/html"title="Minesweeper Bomb Generation And Tile Revealing"/><published>2020-09-12T00:00:00+00:00</published><updated>2020-09-12T00:00:00+00:00</updated><id>http://localhost:4000/2020/09/12/minesweeper</id><contenttype="html"xml:base="http://localhost:4000/2020/09/12/minesweeper.html"><p>When I was creating a little Minesweeper game, I got confused at some points.
<p>So that’s that, we can put this in a big ‘ol for loop and generate an arbitrary <em>n</em> number of bombs given a width and height of a Minesweeper board.</p>
<p>Happy hacking!</p></content><author><name></name></author><summarytype="html">When I was creating a little Minesweeper game, I got confused at some points. My bomb generation didn’t look quite right, and I for sure didn’t quite get the whole cascading tile reveal thing. With a bit of internet research, I found what I was looking for. I’ll explain it all in one place for my own research purposes.</summary></entry><entry><titletype="html">lamegames.tait.tech</title><linkhref="http://localhost:4000/2020/09/09/lamegames.html"rel="alternate"type="text/html"title="lamegames.tait.tech"/><published>2020-09-09T00:00:00+00:00</published><updated>2020-09-09T00:00:00+00:00</updated><id>http://localhost:4000/2020/09/09/lamegames</id><contenttype="html"xml:base="http://localhost:4000/2020/09/09/lamegames.html"><p>This is an announcement for a new project of mine:
<p>Check out the repository on my <a href="https://github.com/TTWNO/lamegames.io">Github</a>.</p></content><author><name></name></author><summarytype="html">This is an announcement for a new project of mine: lamegames.tait.tech.</summary></entry><entry><titletype="html">How to Solve The Django Deployment Puzzle</title><linkhref="http://localhost:4000/2020/08/18/django-deployment.html"rel="alternate"type="text/html"title="How to Solve The Django Deployment Puzzle"/><published>2020-08-18T00:00:00+00:00</published><updated>2020-08-18T00:00:00+00:00</updated><id>http://localhost:4000/2020/08/18/django-deployment</id><contenttype="html"xml:base="http://localhost:4000/2020/08/18/django-deployment.html"><p>A few days ago I had a Django project I wanted to put on a real server.
<p>The <code class="language-plaintext highlighter-rouge">--reload</code> option says to reload the server if any of the files get updated.
An interesting feature of <code class="language-plaintext highlighter-rouge">gunicorn</code> is that it will gracefully switch from an old to a new deployment,
Yes, that’s right, <code class="language-plaintext highlighter-rouge">gunicorn</code> is paired with <code class="language-plaintext highlighter-rouge">uvicorn</code> to serve my files.</p>
<p>Love it or hate it, the majority of Linux distributions use the <code class="language-plaintext highlighter-rouge">systemd</code> init system.
<code class="language-plaintext highlighter-rouge">Systemd</code> allows me to do this with a file like the following one I stored in <code class="language-plaintext highlighter-rouge">/lib/systemd/system/lamegames.service</code>.</p>
<li>Redirect statically served files (CSS, JS, images) to the directory specified in the STATIC_ROOT variable of my <code class="language-plaintext highlighter-rouge">settings.py</code> file.</li>
<p>Serving the static files from nginx as opposed to the <code class="language-plaintext highlighter-rouge">gunicorn</code> server is necessary.
<p>This enabled my <code class="language-plaintext highlighter-rouge">gunicorn</code> server to run once the server started.
<p>And tada! You now have a working Django project on a production server!</p>
<h4 id="notes">Notes</h4>
<ul>
<li>If using ws:// websockets, change them to wss:// for secure web sockets.</li>
<li>Make sure to use channels.routing.get_default_application() instead of django.get_asgi_application() if your’re wanting to use channels/redis WebSockets.</li>
</ul></content><author><name></name></author><summarytype="html">A few days ago I had a Django project I wanted to put on a real server. This project is still in its infancy, but I thought it would be nice to put it on my resume and show my friends. Little did I know the headache coming my way. Here are some tips to help you not make the same mistakes as me.</summary></entry><entry><titletype="html">BSD Journey, Part 1</title><linkhref="http://localhost:4000/2020/08/15/openbsd1.html"rel="alternate"type="text/html"title="BSD Journey, Part 1"/><published>2020-08-15T00:00:00+00:00</published><updated>2020-08-15T00:00:00+00:00</updated><id>http://localhost:4000/2020/08/15/openbsd1</id><contenttype="html"xml:base="http://localhost:4000/2020/08/15/openbsd1.html"><p>As Linux becomes controlled by corporate sponsors and becomes more full of proprietary blobs, drivers, and even closed-source software like Steam,
<p>Happy hacking!</p></content><author><name></name></author><summarytype="html">As Linux becomes controlled by corporate sponsors and becomes more full of proprietary blobs, drivers, and even closed-source software like Steam, One may wonder if there are other options out there. For me, somebody that is intensely interested in security, there is one option: OpenBSD.</summary></entry><entry><titletype="html">Know How Your Representative Votes In Parliament</title><linkhref="http://localhost:4000/2020/07/30/canadian-parliament.html"rel="alternate"type="text/html"title="Know How Your Representative Votes In Parliament"/><published>2020-07-30T00:00:00+00:00</published><updated>2020-07-30T00:00:00+00:00</updated><id>http://localhost:4000/2020/07/30/canadian-parliament</id><contenttype="html"xml:base="http://localhost:4000/2020/07/30/canadian-parliament.html"><p>As an advocate for openness, I had an idea to make a project out of the government of Canada’s <a href="https://open.canada.ca/en/open-data">Open Data</a>
<p>Both the status of the bill, and a link to a PDF document containing the bilingual text of the bill are visible in the main body of the page.</p>
<p>Thanks, Canada!</p></content><author><name></name></author><summarytype="html">As an advocate for openness, I had an idea to make a project out of the government of Canada’s Open Data initiative to take a look at how my local MP voted on various pieces of legislation. It turns out though that this was not necessary due to how easy it was to find this information on the government’s own website. In this article, I will explain how you can do the same.</summary></entry><entry><titletype="html">Installing MultiCraft on Gentoo Linux</title><linkhref="http://localhost:4000/2020/07/19/multicraft-php-gentoo.html"rel="alternate"type="text/html"title="Installing MultiCraft on Gentoo Linux"/><published>2020-07-19T00:00:00+00:00</published><updated>2020-07-19T00:00:00+00:00</updated><id>http://localhost:4000/2020/07/19/multicraft-php-gentoo</id><contenttype="html"xml:base="http://localhost:4000/2020/07/19/multicraft-php-gentoo.html"><p>In a very odd combination of requirements,
The PHP <code class="language-plaintext highlighter-rouge">USE</code> flags are important so you don’t have to recompile it three times like I did.</p>
<p>In <code class="language-plaintext highlighter-rouge">/etc/portage/package.use/php</code> I placed the following line:</p>
The <code class="language-plaintext highlighter-rouge">cgi</code> option may not be required as <code class="language-plaintext highlighter-rouge">fpm</code> stands for <em>FastCGI Process Managment</em>.
use the following in your server block to deny access to the <code class="language-plaintext highlighter-rouge">/protected</code> directory.</p>
<p>Happy hacking :)</p></content><author><name></name></author><summarytype="html">In a very odd combination of requirements, I needed to install MultiCraft on a Gentoo Linux system. The PHP USE flags are important so you don’t have to recompile it three times like I did.</summary></entry><entry><titletype="html">Independence</title><linkhref="http://localhost:4000/2020/07/12/independence.html"rel="alternate"type="text/html"title="Independence"/><published>2020-07-12T00:00:00+00:00</published><updated>2020-07-12T00:00:00+00:00</updated><id>http://localhost:4000/2020/07/12/independence</id><contenttype="html"xml:base="http://localhost:4000/2020/07/12/independence.html"><blockquote>
<p>“When given a choice between independence and dependence, always choose independence; you will never regret that choice!”—Luke Smith</p>
</blockquote>
<p>Whatever you may believe about the YouTube personality Luke Smith,
the quote above summarizes a core principle of mine.
Much like many people have religious principles, I have <em>Independence</em>.</p>
<p>My choice to use Linux as my primary operating system,
host my own website,
own my own domain name—all of these are directly related to this core principle of independence.</p>
<p>I never want a man, or a company to have too much power over my life.
Just like I would not trust just any person to be able to read my emails,
know where I live, where I am going, who are my friends, what do I believe; in the same way, I do not trust a company with that same information.</p>
<blockquote>
<p>“If you want to find out what a man is to the bottom, give him power. Any man can stand adversity — only a great man can stand prosperity.”—Robert Ingersoll</p>
</blockquote>
<p>Take control of your own digital life:</p>
<ol>
<li>Own your own domain.</li>
<li>Hookup an email and a website to that.</li>
</ol>
<p>That’s it!</p>
<p>Without this, any of your internet privileges can be revoked at any time by Google, Facebook, YouTube, Twitter, or even an angry Twitter Mob. Maybe because they hate your skin colour, maybe they hate your religious/political views, or maybe you got caught on a technicality.</p>
<p>If you own your own domain, however:</p>
<p>Your email provider goes down/bans you: change your provider; keep the email.</p>
<p>Your website is pulled for controversial views: switch hosts.</p>
Why give others that power when you could have it for yourself?</p></content><author><name></name></author><summarytype="html">“When given a choice between independence and dependence, always choose independence; you will never regret that choice!”—Luke Smith</summary></entry><entry><titletype="html">How to use tmux to send and receive things from your Minecraft server</title><linkhref="http://localhost:4000/2020/06/25/tmux-minecraft.html"rel="alternate"type="text/html"title="How to use tmux to send and receive things from your Minecraft server"/><published>2020-06-25T00:00:00+00:00</published><updated>2020-06-25T00:00:00+00:00</updated><id>http://localhost:4000/2020/06/25/tmux-minecraft</id><contenttype="html"xml:base="http://localhost:4000/2020/06/25/tmux-minecraft.html"><p>So recently I had problem.
<p>So for simple things like finding out of the network, CPU, memory or disk usage is my bottleneck, I wrote this really nifty script to connect the world of Minecraft and the Linux shell.</p>
<p>My completed solution for what I needed can be found at <a href="https://github.com/TTWNO/termcraft/">https://github.com/TTWNO/termcraft</a>.</p>
<p>If you want some of the implementation details, stick around.</p>
<p>So to solve this interesting problem, I decided to use <code class="language-plaintext highlighter-rouge">tmux</code>.
<code class="language-plaintext highlighter-rouge">tmux</code> is a <strong>t</strong>terminal <strong>mu</strong>ltiple<strong>x</strong>er.
<p>This is very valuable when running command line applications that need to have an active console connection, like a Minecraft server.</p>
<p>So first I looked at the <code class="language-plaintext highlighter-rouge">tmux</code> command <code class="language-plaintext highlighter-rouge">send-keys</code>.</p>
<p><code class="language-plaintext highlighter-rouge">send-keys</code> allows you to send text, and key presses to a <code class="language-plaintext highlighter-rouge">tmux</code> session.
Now assuming this <code class="language-plaintext highlighter-rouge">tmux</code> session is attached to a Minecraft server,
<p>So in the manual page for <code class="language-plaintext highlighter-rouge">tmux</code> I can see a section recorded below for options I can give to the <code class="language-plaintext highlighter-rouge">capture-pane</code> subcommand.</p>
<p>What it seems to be saying is I can start at line <code class="language-plaintext highlighter-rouge">-S n</code> and end at line <code class="language-plaintext highlighter-rouge">-E n</code>.
Negative numbers start from the bottom, so <em>in theory</em> I can do the following: <code class="language-plaintext highlighter-rouge">tmux capture-pane -S -1</code> should capture only the last line, because I’m starting from the last line. Right?</p>
<p>No. It just doesn’t work. Negative numbers do <em>not</em> work with the <code class="language-plaintext highlighter-rouge">tmux capture-pane</code> subcommand.</p>
<p><code class="language-plaintext highlighter-rouge">steve</code> is the name of the tmux session I’m trying to pull form.</p>
<p>The syntax is like so: <code class="language-plaintext highlighter-rouge">select/somepattern/replacewith/global</code></p>
<p>So the following command is: <code class="language-plaintext highlighter-rouge">s/[&lt;&gt;]//g</code></p>
<p>This shows some pretty fun stuff you can do with a few simple Linux commands and a Minecraft server.</p>
<p>I hope you learned something and found my explanations not horrific haha!</p>
<p>Remember to checkout the git repository to see what I did with it: <a href="https://github.com/TTWNO/termcraft">https://github.com/TTWNO/termcraft</a>.</p>
<p>Happy hacking!</p></content><author><name></name></author><summarytype="html">So recently I had problem. I run a Minecraft server on a big Linux computer I have running in my room. Now, as a system administrator it is very helpful to be able to run some simple commands without needing to login with my key, password, TFA, etc. It is, frankly, a lot of work. Especially when I really just want to be playing games but I just need to check something quickly.</summary></entry><entry><titletype="html">Site Update</title><linkhref="http://localhost:4000/2020/06/04/site-update.html"rel="alternate"type="text/html"title="Site Update"/><published>2020-06-04T00:00:00+00:00</published><updated>2020-06-04T00:00:00+00:00</updated><id>http://localhost:4000/2020/06/04/site-update</id><contenttype="html"xml:base="http://localhost:4000/2020/06/04/site-update.html"><p>I updated the site with some easier to identify information about me and my projects :)</p>
<p>I also posted a new project called <em><a href="https://github.com/TTWNO/caesar-cipher">Caesar Cipher</a></em> in C. It will be an intermediate example of how to use build systems like <code class="language-plaintext highlighter-rouge">make</code>.</p></content><author><name></name></author><summarytype="html">I updated the site with some easier to identify information about me and my projects :)</summary></entry><entry><titletype="html">New Game: Clue (coming soon)</title><linkhref="http://localhost:4000/2020/05/19/clue-announcement.html"rel="alternate"type="text/html"title="New Game: Clue (coming soon)"/><published>2020-05-19T00:00:00+00:00</published><updated>2020-05-19T00:00:00+00:00</updated><id>http://localhost:4000/2020/05/19/clue-announcement</id><contenttype="html"xml:base="http://localhost:4000/2020/05/19/clue-announcement.html"><p>Ooo! Exciting!
Today I want to announce a new project I’ll be working on which should be live within the month of May:
Clue.</p>
<p>The original board game, implemented in an accessible format via the web.</p>
<p>It uses a Node.js backend and standard Javascript/HTML frontend.
Nothing fancy.</p>
<p>All the code will be hosted here: <a href="https://github.com/TTWNO/clue">https://github.com/TTWNO/clue</a></p>
<p>It will be licensed under the BSD-3 license, meaning it can be used for any reason—even commercially and without source-code disclosure—without prior authorization, but it <em>must</em> acknowledge that I helped build the end product.</p>
<p>Once the project is live, it will be located at: <a href="">Lame Games</a> (currently a dead link).</p></content><author><name></name></author><summarytype="html">Ooo! Exciting! Today I want to announce a new project I’ll be working on which should be live within the month of May: Clue.</summary></entry></feed>