add all files

main
Tait Hoyem 2 years ago
parent 5a1334f7fb
commit c055e94b85

@ -0,0 +1,96 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Padding And Margin | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Tait Hoyem">
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<div id="wrapper">
<header>
<h1>tait.tech</h1>
<nav>
<a href="/" class="nav-link" >Home</a>
<a href="/blog/" class="nav-link" >Blog</a>
<a href="/ideas/" class="nav-link" >Ideas</a>
<a href="/links/" class="nav-link" >Links</a>
<a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer" >Github</a>
</nav>
</header>
<main>
<article>
<header>
<h1 class="post-title">Padding And Margin</h1>
<time datetime="20-01-22" class="post-date">Wednesday, January 22 2020</time>
</header>
<hr>
<p>Many people have expressed confusion over how padding and margins work in HTML/CSS. I have been one of those people. In this short article I will explain what the differences are between the two, and how it may affect the functionality of your site.</p>
<p>Here is an image from the World Wide Web Consortium (W3C) who sets the standards for the web.</p>
<p><img src="/assets/img/w3c-padding-margin.png" alt="The W3C standard for padding, margin, borders and width. Width encompases the inner element + padding; the border then encompases it. The margin is the space beyond the border and in between other elements." title="W3C border, padding, margin standard." /></p>
<p>Now although this image shows all the different types of spacing as equal, the majority of the time these will mostly be padding (inner) and margin (outer). Padding is the inner space between the element and its border; margin is the outer space between two different elements.</p>
<p>Within the margin the user is unable to press any links or execute any javascript code. It is <em>empty</em> space. If each <code class="language-plaintext highlighter-rouge">&lt;link&gt;</code> on your navigation bar has 10 pixels of margin, then there would be 20 pixels in between each <code class="language-plaintext highlighter-rouge">&lt;link&gt;</code> that would <em>not</em> be clickable by the user.</p>
<p>If you have <code class="language-plaintext highlighter-rouge">&lt;link&gt;</code>s on your navigation bar with <em>padding</em> set to 20 pixels, however, then there will be 20 pixels on each side of the <code class="language-plaintext highlighter-rouge">&lt;link&gt;</code> text where the user <em>is</em> able to click.</p>
<p>If that part is confusing, try thinking about it in terms of whether <code class="language-plaintext highlighter-rouge">background-color</code> would apply.</p>
<table>
<thead>
<tr>
<th>Attribute</th>
<th><strong>Padding</strong></th>
<th><strong>Margin</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td>Spacing</td>
<td>within element</td>
<td>between elements</td>
</tr>
<tr>
<td><code class="language-plaintext highlighter-rouge">background-color</code> applies</td>
<td>Yes</td>
<td>No</td>
</tr>
</tbody>
</table>
<p>In summary:</p>
<ul>
<li><strong>Padding</strong>: the space within a tag which is still part of the same tag. <code class="language-plaintext highlighter-rouge">background-color</code> applies.</li>
<li><strong>Margin</strong>: the space in between two seperate tags. <code class="language-plaintext highlighter-rouge">background-color</code> does not apply; it is empty space.</li>
<li><strong>Border</strong>: the space in between the two; it surrounds the padding, but is not the margin. It looks nice somtimes, but it has no non-visual function. <code class="language-plaintext highlighter-rouge">background-color</code> does not apply.</li>
</ul>
<p>I hope this covers the basics of margin and padding! Happy coding!</p>
</article>
</main>
<hr>
<footer>
This page will be mirrored on <a href="https://beta.tait.tech/2020/01/22/padding-and-margin/">beta.tait.tech</a>.
</footer>
</div>
</body>
</html>

@ -0,0 +1,102 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Is Encryption Worth It? | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Tait Hoyem">
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<div id="wrapper">
<header>
<h1>tait.tech</h1>
<nav>
<a href="/" class="nav-link" >Home</a>
<a href="/blog/" class="nav-link" >Blog</a>
<a href="/ideas/" class="nav-link" >Ideas</a>
<a href="/links/" class="nav-link" >Links</a>
<a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer" >Github</a>
</nav>
</header>
<main>
<article>
<header>
<h1 class="post-title">Is Encryption Worth It?</h1>
<time datetime="20-01-26" class="post-date">Sunday, January 26 2020</time>
</header>
<hr>
<p>What is the most embarassing thing you have typed into Google search? What is the most personal secret you told a friend in confidence? What is your bank password? What is your businesss secret to stay ahead of the competition?</p>
<p>Now at first these questions may seem not completely related. There is a point though: You likely sent all of this information over the internet.</p>
<p>When you send that messege to your friend or business partner, why is it that any person cant just listen to the signals coming from your phone or laptop and know what you sent to your friend or colleague? The answer: encryption.</p>
<p>First, some background about internet privacy. You cant have a conversation about internet encryption and privacy without discussing the man himself:</p>
<h3 id="snowden">Snowden</h3>
<p><a href="https://en.wikipedia.org/wiki/Edward_Snowden" target="_blank">Edward Joseph Snowden</a> is an ex-NSA, ex-CIA employee who felt the <a href="https://en.wikipedia.org/wiki/Fourth_Amendment_to_the_United_States_Constitution" target="_blank">United States 4th Ammendment</a> was being violated by their programs of msas survailence.
Snowden was raised a staunch establishmentarian conservative; his girlfriend Lisndey however, slowly started changing his mind. Snowden became very influenced by the ideology of <a href="https://en.wikipedia.org/wiki/Populism" target="_blank">populism</a>.
His populist thinking is shown very clearly when he explains his reasoning for his disclosure of humongous troves of NSA documents.</p>
<blockquote>
<p>“My sole motive is to inform the public as to that which is done in their name and that which is done against them.”
<a href="https://www.theguardian.com/world/video/2013/jun/09/nsa-whistleblower-edward-snowden-interview-video" target="_blank">Edward Snowden</a></p>
</blockquote>
<p>Snowdens first set of leaks went public in <a href="https://www.theguardian.com/world/2013/sep/05/nsa-gchq-encryption-codes-security" target="_blank">The Gaurdian</a>, <a href="https://www.nytimes.com/2013/06/10/us/former-cia-worker-says-he-leaked-surveillance-data.html" target="_blank">The New York Times</a>, and <a href="https://www.propublica.org/article/the-nsas-secret-campaign-to-crack-undermine-internet-encryption" target="_blank">ProPublica</a> in late 2013;
people started to realize that their governments and internet service providers (ISPs) <strong>are</strong> listening. People understood there might be more sinister motives than “national security” at play.</p>
<p>Personally, I have seen a lot of non-tech-savy individuals using security-conscious software when I am helping them fix a problem.
In fact, there was one time I saw a collage student from rural Alberta who had a VPN running on her phone. This impressed me!</p>
<h3 id="encryption-on-the-web">Encryption on The Web</h3>
<p>The type of encryption used on the web is called: HyperText Transfer ProtocolSecure (HTTPS).
This kind of encryption stops two things from happening: A) it stops the information you are sending and recieving online from being seen by easvesdroppers and criminals, and B) stops those same third-parties from tampering with the data.</p>
<p>Without HTTPS it is possible for sombody to listen in and change the data being sent between you and a server.</p>
<p>Only in recent years has HTTPS become near-universal across the web. It is used even on the simplest sites these days: this one included. After 2013, people became weary of government, criminal, and ISP interference with their web traffic.
This can be backed up by statistics:
The level of encrypted web traffic around the time of the Snowden leaks was around 30 percent. It was mostly used by banks, email providers, government, and journalists.
At the turn of the 2020s however, this has risen to nearly 90 percent among U.S. users of Firefox.
Japan lags slightly behind with 80 percent encrypted traffic.</p>
<figure>
<img src="/assets/img/encrypted-web-traffic.png" alt="Use of encrypted web traffic incresing over time." />
<figcaption>
More at: <a href="https://letsencrypt.org/stats/" target="_blank">Let's Encrypt</a>
</figcaption>
</figure>
<p>This is just the data we know of. You can disable the <a href="https://en.wikipedia.org/wiki/Telemetry#Software" target="_blank">telemetry</a> settings in Firefox, and it is very likely that hardcore privacy advocates would disable this data collection, so perhaps the amount of encrypted web traffic is slightly higher.</p>
<h3 id="what-about-rsa">What about RSA?</h3>
<p>RSA is an encryption method named after the initials of the inventors sir names: Ron <strong>R</strong>ivest, Adi <strong>S</strong>hamir, and Leonard <strong>A</strong>dleman. It uses the mathematical “factoring problem” to secure communication. The details of this specific type of encryption will be discussed in an article soon to come.</p>
</article>
</main>
<hr>
<footer>
This page will be mirrored on <a href="https://beta.tait.tech/2020/01/26/rsa1/">beta.tait.tech</a>.
</footer>
</div>
</body>
</html>

@ -0,0 +1,194 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>How Does Encryption Work, in Theory? | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Tait Hoyem">
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<div id="wrapper">
<header>
<h1>tait.tech</h1>
<nav>
<a href="/" class="nav-link" >Home</a>
<a href="/blog/" class="nav-link" >Blog</a>
<a href="/ideas/" class="nav-link" >Ideas</a>
<a href="/links/" class="nav-link" >Links</a>
<a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer" >Github</a>
</nav>
</header>
<main>
<article>
<header>
<h1 class="post-title">How Does Encryption Work, in Theory?</h1>
<time datetime="20-02-19" class="post-date">Wednesday, February 19 2020</time>
</header>
<hr>
<p>There are many kinds of encryption used in our everyday communication. Online and offline, over the internet and in person. In this article, I will explain the basics of how encryption should work in theory. I explain in <a href="/2020/01/26/rsa1/">this article</a> why encryption is important, and why <em>you</em> should care about it.</p>
<p>We will start by looking at in-person, offline encryption.</p>
<h2 id="cryptography-we-do-everyday">Cryptography We Do Everyday</h2>
<p>We encrypt things all the time without even thinking about it.
If you spend a significant amount of time with the same group of friends, you will tend to develop common codes that may not make sense to others outside the group.
For example: for years, my family called sombody falling from a sitting position “doing a Don”. There is a story of course—We knew a guy named Don who fell from his plastic beach chair in a rather hilarious way; “doing a Don” was born.</p>
<p>These types of minor dialects in speech are cryptographic in their own way. The truth is though, that we use cryptography much more than that!</p>
<blockquote>
<p>“Is cryptography any different than talking?
We say something other than what we mean, and then expect everyone is able to decipher the true meaning behind the words.
Only, I never do…” — Adapted from a scene in <a href="https://www.benedictcumberbatch.co.uk/wordpress/wp-content/uploads/ScreenplayTIG.pdf">The Imitation Game (p. 39-40)</a></p>
</blockquote>
<p>How many times have you hinted, flirted, and innuendoed to try to say “I find you very physically attractive”?
Have you told your friend that always stinks to wear more deodorant?
Have you ever had someone say the words “Im fine” when you know <em>for certain</em> that they are indeed not okay?</p>
<table>
<thead>
<tr>
<th>Words Said</th>
<th>Meaning</th>
</tr>
</thead>
<tbody>
<tr>
<td>What can you do?</td>
<td>I dont want to talk about this anymore.</td>
</tr>
<tr>
<td>I dont want to overstay my welcome.</td>
<td>I want to go home now.</td>
</tr>
<tr>
<td>I dont like them and dont know why.</td>
<td>They threaten my ego.</td>
</tr>
<tr>
<td>Creepy</td>
<td>Unattractive and friendly</td>
</tr>
</tbody>
</table>
<p>All of these scenarios are perfect examples of <del>lies</del> encryption! If we have the key to these codes, we can start to understand what people really mean.
Hopefully I have convinced you that you use <del>deceit</del> cryptography on a regular basis in your life, so let us consider what a basic encryption method might be:</p>
<h2 id="grade-school-encryption">Grade-School Encryption</h2>
<p>Back when I was in middle school I used to pass notes like these:</p>
<figure>
<img alt="A message I would have sent in middle school. ROT5: Xfwfm hx hzy" src="/assets/img/ceasar1.jpg" />
<figcaption>
The kind of message I would have sent in middle school. A ROT5 Ceasar cipher.
</figcaption>
</figure>
<p>This is a message encrypted using the Caesar cipher. This encryption technique was used by Julius Caesar during the reign of the Roman Empire to “encrypt messages of military significance.”<a class="citation-link" href="https://en.wikipedia.org/wiki/Caesar_chipher/">[1]</a>
This is one of the oldest and simplest methods of encryption known to us today.</p>
<figure>
<img alt="A diagram of a Ceasar Shift algorithm. A &lt;-&gt; N, B &lt;-&gt; O, et cetera." src="/assets/img/ceasar13.png" />
<figcaption>
A diagram of a ROT13 Ceasar shift algorithm. A &lt;-&gt; N, B &lt;-&gt; O, et cetera.
</figcaption>
</figure>
<p>You can try this out yourself by moving some letters forward in the alphabet.
An A turns into a B, B into C, C into D, et cetera.
In this case, “Hello!” would become “Ifmmp!”
That is just using a shift of one. You can use a shift of seven, for example, and then you would shift letters like so:</p>
<ul>
<li><code class="language-plaintext highlighter-rouge">A -&gt; +7 -&gt; H</code></li>
<li><code class="language-plaintext highlighter-rouge">Q -&gt; +7 -&gt; X</code></li>
<li><code class="language-plaintext highlighter-rouge">T -&gt; +7 -&gt; A</code></li>
</ul>
<p>When you reach the end of the alphabet, wrap around to the beginning to find the encrypted letter.</p>
<h2 id="example-of-a-caesar-cipher">Example of a Caesar Cipher</h2>
<p>Lets setup a little story to illustrate the problems of encryption. We will have three characters:</p>
<ul>
<li>Alice, young lady with feelings for Bob</li>
<li>Bob, a young lad with an addiction to pancakes</li>
<li>Eve, a wee jealous girl scout who sits between Bob and Alice</li>
</ul>
<p>Alice really likes Bob and wants to tell Bob her feelings, so she writes “I love you, Bob! Please eat healthier!” on a sticky note.
She passes it to Eve, so Eve can pass it to Alices love interest.
However, in an unfortunate turn of events Eve reads the note herself, and decides not to give it to Bob.</p>
<p>Oh the horror! Alice is without young love! How could she remedy this so that Bob can read her message, but evil Eve can not?
Lets use the Caesar cipher to fix this problem.</p>
<p>Let us assume that Alice and Bob already have a shared key, 7 for example. To encrypt this message, she should shift her letters seven letters forward in the alphabet—just like the example above.</p>
<figure>
<img alt="A longer Ceasar cipher encrypted message: ROT2: Wpeng Vgf ku dqqogt ogog]" src="/assets/img/ceasar2.jpg" />
<figcaption>
A longer Ceasar cipher encrypted message using ROT2.
</figcaption>
</figure>
<p>Now Alices message reads “P svcl fvb, Ivi! Wslhzl lha olhsaoply!”</p>
<p>Now, when Alice sends her Romeo a little note, all he has to do is decrypt the text by shifting the letters down by 7.
<a href="https://www.xarg.org/tools/caesar-cipher/">Here is a site</a> which can do longer pieces of text for you instead of doing it manually.</p>
<h2 id="problems">Problems</h2>
<p>Before the two love-birds start smooching on the branch of a big pine tree in the schoolyard, perhaps we should consider some problems with the Ceasar cipher.</p>
<h4 id="it-is-very-easy-to-break">It is Very Easy to Break</h4>
<p>Even Eve with her measly grade 4 math skills could easily start going through this message with pen and paper and figure out any combination in a couple hours at maximum.
Imagine how easy this is for a computer?
This could be broken in a few microseconds even on an older processor like the Intel Core 2 Duo.</p>
<h4 id="no-secure-way-of-sharing-keys">No Secure Way of Sharing Keys</h4>
<p>We assumed in our previous example that Bob and Alice already have a shared key (seven) to encrypt and decrypt all of their messages.
If Bob and Alice did not have a previous friendship and time to share secrets of this sort, there is no way to share their key with eachother without Eve also knowing.
This would defeat the entire purpose of obscuring the message in the first place.</p>
<h4 id="universal-vulnerability-of-messages">Universal Vulnerability of Messages</h4>
<p>Every message sent between the two parties uses the same code to encrypt and decrypt. If someone finds out the code once, all previous communications are comprimised.</p>
<h2 id="better-encryption-methods">Better Encryption Methods</h2>
<p>To combat the issues with easily breakable, shared-key cryptography, we can turn to the beautiful beast that is <a href="https://en.wikipedia.org/wiki/Public-key_cryptography">Asymetric Cryptography</a>.
I will discuss this more in another article, but for the technically inclined:</p>
<ol>
<li><a href="https://en.wikipedia.org/wiki/RSA_(cryptosystem)">RSA</a>/<a href="https://en.wikipedia.org/wiki/Elliptic-curve_cryptography">EC</a> provides <em>very</em> large cryptographic keys. It would be impossible for a human to encrypt or decrypt a message manually.</li>
<li><a href="https://www.youtube.com/watch?v=GSIDS_lvRv4">Asymetric cryptography</a> provides four keys, instead of just one; stopping evesdroppers from listening in on your secret conversations—even if you do not have the chance to exchange keys in advance.</li>
</ol>
</article>
</main>
<hr>
<footer>
This page will be mirrored on <a href="https://beta.tait.tech/2020/02/19/rsa2/">beta.tait.tech</a>.
</footer>
</div>
</body>
</html>

@ -0,0 +1,193 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>How Asymetric Encryption Works | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Tait Hoyem">
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<div id="wrapper">
<header>
<h1>tait.tech</h1>
<nav>
<a href="/" class="nav-link" >Home</a>
<a href="/blog/" class="nav-link" >Blog</a>
<a href="/ideas/" class="nav-link" >Ideas</a>
<a href="/links/" class="nav-link" >Links</a>
<a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer" >Github</a>
</nav>
</header>
<main>
<article>
<header>
<h1 class="post-title">How Asymetric Encryption Works</h1>
<time datetime="20-04-02" class="post-date">Thursday, April 02 2020</time>
</header>
<hr>
<p>In a few previous articles I have explained <a href="/2020/01/26/rsa1/">why encryption may be important to you</a> and <a href="/2020/02/19/rsa2/">how the theory behind encryption works</a>. I did not yet explain the system of asymetric cryptography, however. That is what this article is for.</p>
<p>Previously, we talked about how <em>symetric</em> encryption works. This is by having a shared key that both parties use to simultaniously encrypt, and decrypt the data. (See Ceasar Cipher for example).</p>
<h2 id="public-key-or-asymetric-encryption">Public-key, or Asymetric Encryption</h2>
<p>Asymetric encryption is based on the idea of having multiple keys instead of only one shared key.
For example: instead of encrypting with one key, and decrypting with that same key (like our ROT ciphers we talked about previously), we can use one key to <em>encrypt</em> the information, and a different key to <em>decrypt</em> the information.</p>
<figure>
<img src="/assets/img/alice-to-bob.png" alt="Alice sending her message to Bob using Bob's public key. Bob decrypts the message with his private key." />
<figcaption>
Alice sending her message to Bob using Bob's public key. Bob decrypts the message with his private key.
</figcaption>
</figure>
<p>In the picture above, see how Alice uses Bobs public key to encrypt some data,
then sends it to Bob for him to decrypt with his private key?
That is the essense of public-key encryption.</p>
<p>The great thing about public-key encryption is that your public key is <em>public</em>! There is no need to be afraid of sending this everywhere!
You can attach it at the end of all your emails, the end of your forum posts, <a href="/public-key.asc">a link to it on your low-power webserver</a> (wink).
There are even things called <a href="http://keys.gnupg.net/">keyservers</a> that will save your public key on them for retrival in case somebody wants to verify your public key.</p>
<p>Anything encrypted with your public key can only be decrypted with your private key.
Provided you never, <em>NEVER</em> share your private key with anyone ever, we can assume that all messages sent to you encrypted with your public key will never be read by anyone else.</p>
<p>Asymetric encryption, however, often contains four keys instead of two. Why is this?</p>
<h4 id="verification-of-author">Verification of Author</h4>
<p>One interesting thing about keys pairs is that not only can the private key decrypt anything the public key encrypts,
but the public key can decrypt anything the private key encrypts.</p>
<p>Now why would one want to encrypt a message that can be decrypted by anyone?</p>
<figure>
<img src="/assets/img/alice-sign-to-bob.png" alt="Alice sending a message to bob which is 'signed' with her private key. This allows Bob to know only Alice could have sent it!" />
<figcaption>
Alice sending a message to bob which is 'signed' with her private key. This allows Bob to know only Alice could have sent it!
<br />
<br />
Note: Although the picture shows otherwise, the text is not sent in the plain. It is encrypted with Alice's private key.
</figcaption>
</figure>
<p>This is how you can verify that the person who says they wrote the message really did indeed write the message!
If their private key was never shared with anyone else, then the message must have come from them!</p>
<p>For maximum security, these methods are often layered.
First, signing with the senders private key,
ensuring only they could have sent it—
then encrypted with the recipients pulbic key,
making sure only the reciever can read it.</p>
<p>Note that both sides must first have eachothers public keys to do this.
This is easy if they communicate often, but when first contacting somebody,
people will generally send their encrypted message along with the their own pulbic key attached in a seperate file.</p>
<h3 id="what-this-means">What This Means</h3>
<p>Notice neither Alice nor Bob had to share any comprimsing information over the network?
This is why public-key encryption is so powerful!</p>
<p>Alice and Bob can both safely send their public keys in the open.
They can even send them over the insecure HTTP, or FTP protocols.</p>
<p>Whilst not sending any encryption-breaking messages,
Alice and Bob now have a way to communicate securely.
If you trust nothing and no one, this is your perfered method of security.</p>
<p>Check out this <a href="https://www.youtube.com/watch?v=GSIDS_lvRv4">Computerphile video</a> if you want the simplified explaination.</p>
<h3 id="the-algorithms">The Algorithms</h3>
<p>The two biggest “implementations” of public-key cryptography vary only in the mathamatical equations used to generate the numbers,
and how the numbers are <a href="https://en.wikipedia.org/wiki/Trapdoor_function">“trapdoored”</a> to decrypt if you have the correct key.</p>
<p>I will discuss the differences in approach here.
If you want to skip to the next article where I show you how to encrypt your own documents using RSA, see <a href="/2020/04/06/rsa4/">this link</a>.</p>
<h3 id="rsa">RSA</h3>
<p>The mathamatic center of the RSA system was developed over the course of a year or so.
Three men were involved. Ron Rivest, Adi Shamir, and Leonard Aldeman.
They worked as a kind of “team”: Each idea by Rivest and Shamir were critisized by the mathamatician on their team: Mr. Aldeman.</p>
<p>One night, after consuming
<a href="https://www.math.uchicago.edu/~may/VIGRE/VIGRE2007/REUPapers/FINALAPP/Calderbank.pdf">“liberal quantities of Manischewitz wine”</a>
Rivest had trouble sleeping.
After taking long gazes into the abyss of his math textbook, he came up with an idea which would change cryptography forever.
By the next morning, an academic mathamatical paper was nearly finished.
He named it after himself and the two others that had been helping him along this whole time. <em>Rivest, Shamir, Aldeman</em>.</p>
<p>Key sizes of RSA range from 1024-bit to 4096-bit.
1024-bit keys are considered somewhat insecure.
However,
it should be noted that every bit doubles the complexity of the key,
so 2048 is <a href="https://www.wolframalpha.com/input/?i=2%5E1024">2^1024</a> times more complex than 1024.</p>
<h3 id="eliptic-curve-ec">Eliptic-Curve (EC)</h3>
<p>Eliptic-Curve (EC) is a family of algorithms that use the <a href="https://en.wikipedia.org/wiki/Elliptic_curve">Eliptic curve</a> mathamatical structure to generate the numbers for the keys.
EC can effectivly provide the security of an RSA key <a href="https://www.youtube.com/watch?v=NF1pwjL9-DE">one order of magnitude larger</a> than an RSA key.</p>
<figure>
<img src="/assets/img/ec.png" alt="A picture of an eliptic curve." class="small-image" />
<figcaption>
An eliptic curve structure.
</figcaption>
</figure>
<p>Its fast; its secure! Perfect right?</p>
<p>Of course not!</p>
<p>One problem is that due to the smaller key size,
it can more easily be broken by brute-force.
This is why EC is mostly used for temporary communication (like HTTPS), not permenant communication (like having an encrypted email conversation with a journalist).</p>
<p>The other problem is that a certain EC algrorithm called P-256 is suspected to be introduced with malice to National Institute of Standards and Technology (NIST)
<a href="https://www.schneier.com/essays/archives/2007/11/did_nsa_put_a_secret.html">by the NSA</a>.
Supposedly, the NSA is able to crack anything encrypted with this algorithm.
I will let the experts argure about that.</p>
<p>Other well-known EC algorithms that are more-or-less trusted as secure do exist though.
The premeire one being Curve25519.
The reference implementation of <a href="https://cr.yp.to/ecdh.html">this algrorithm</a> is also <a href="https://fairuse.stanford.edu/overview/public-domain/welcome/">public-domain</a>,
so it is easy for devlopers to work into their own applications without worrying about copywrite.</p>
<h2 id="conslusion">Conslusion</h2>
<p>In this article we went over some basic points:</p>
<ol>
<li>Public-key encryption enables secure communication over insecure networks.</li>
<li>RSA is considered the standard for extra-seure communication.</li>
<li>EC is a newer, faster, more transient encryption method.</li>
</ol>
<p>To learn how to use RSA keys to encrypt your own communications, check out <a href="/2020/04/06/rsa4/">this other aritcle I wrote</a>.</p>
</article>
</main>
<hr>
<footer>
This page will be mirrored on <a href="https://beta.tait.tech/2020/04/02/rsa3/">beta.tait.tech</a>.
</footer>
</div>
</body>
</html>

@ -0,0 +1,392 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>How To Encrypt Your Own Documents Using gpg | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Tait Hoyem">
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<div id="wrapper">
<header>
<h1>tait.tech</h1>
<nav>
<a href="/" class="nav-link" >Home</a>
<a href="/blog/" class="nav-link" >Blog</a>
<a href="/ideas/" class="nav-link" >Ideas</a>
<a href="/links/" class="nav-link" >Links</a>
<a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer" >Github</a>
</nav>
</header>
<main>
<article>
<header>
<h1 class="post-title">How To Encrypt Your Own Documents Using gpg</h1>
<time datetime="20-04-06" class="post-date">Monday, April 06 2020</time>
</header>
<hr>
<p>If you have ever wanted to garuntee the utmost security of your emails and documents, then this is the guide for you!
It should be noted that in some circles the tools used are more common than in others.
These are the everyday tools of many privacy advocates and computer nerds.</p>
<p>If you have never used Linux however, then the method of doing this will be rather unfamiliar.
This tutorial will be done on an <a href="https://archlinux.org/">Arch Linux</a> machine,
but it should be the same on Ubuntu, Fedora, CentOS, Debian,
OpenBSD, FreeBSD, MacOSX, etc.
The only operating system that does not include these tools by default (or easily accessible) is Windows.</p>
<p>This tutorial makes heavy use of the terminal.
You have been warned.</p>
<p><em>Let us…begin!</em></p>
<h2 id="glossary">Glossary</h2>
<ul>
<li><a href="https://en.wikipedia.org/wiki/Binary-to-text_encoding#ASCII_armor"><strong>ASCII armour</strong></a> — A way to encode <strong>OpenPGP</strong> documents so they are readable by humans. These files end in .asc</li>
<li><strong>(Open)PGP</strong> — An open standard for encoding pulbic keys and encrypted documents.</li>
<li><strong>GPG</strong> — GNUPrivacyGaurd is an implementation of <strong>OpenPGP</strong>. It is installed by default on most Linux distrobutions.</li>
</ul>
<h2 id="step-0-setup">Step 0: Setup</h2>
<p>We will be using the utility <code class="language-plaintext highlighter-rouge">gpg</code> for this tutorial.</p>
<p>The other thing to note: The character $ (dollar sign) is usually not typed when shown in a command.
It simply indicates that you do not need administrative privilages to run these commands.</p>
<p>Test to see if you get this output in your terminal.</p>
<pre class="terminal">
$ gpg --version
gpg (GnuPG) 2.2.20
libgcrypt 1.8.5
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later &lt;https://gnu.org/licenses/gpl.html&gt;
...
</pre>
<p>If this is not successful look into how to install these tools on your system.</p>
<h2 id="step-1-getcreate-a-public-key">Step 1: Get/Create A Public Key!</h2>
<h3 id="get-somebody-elses">Get Somebody Elses</h3>
<p>Step one is having somebody to send your encrypted message to. Maybe this is a friend, a journalist, or a whistleblower.</p>
<p>To encrypt a document with somebodys public key, you need to first obtain it.
My public key is available <a href="/public-key.asc">at this link</a>, and you can use it to send me encrypted stuff.</p>
<p>If you are on a linux terminal, you can use the <code class="language-plaintext highlighter-rouge">curl</code> or <code class="language-plaintext highlighter-rouge">wget</code> command to download it.</p>
<p>wget:</p>
<pre class="terminal">
$ wget https://tait.tech/public-key.asc
</pre>
<p>Curl:</p>
<pre class="terminal">
$ curl https://tait.tech/public-key.asc -o public-key.asc
</pre>
<h3 id="make-your-own-optional">Make Your Own (optional)</h3>
<p>The following section is quite long,
so if you dont want to create your own keypair,
then feel free to skip to <a href="#step-2-import-public-key">Step #2</a>.</p>
<p>If you want to encrypt your own documents,
or you want others to be able to send you encrypted messages,
then you can create your own public/private key pair.
You can use these to encrypt your documents,
and you can send our public key to others so that they can securely communicate with yourself.</p>
<p>Run the following command in your terminal, and follow the steps I outline to get you started.</p>
<pre class="terminal">
$ gpg --full-gen-key
</pre>
<p>This will produce the following dialog:</p>
<pre class="terminal">
gpg (GnuPG) 2.2.20; Copyright (C) 2020 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Please select what kind of key you want:
(1) RSA and RSA (default)
(2) DSA and Elgamal
(3) DSA (sign only)
(4) RSA (sign only)
(14) Existing key from card
Your selection?
</pre>
<p>Select the option <code class="language-plaintext highlighter-rouge">1</code>. You want two keys, both RSA.</p>
<p>Next we will select the key size:</p>
<pre class="terminal">
RSA keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048)
</pre>
<p>Type the number 2048.</p>
<p>Next it will ask you how long you want the key to be valid.</p>
<pre class="terminal">
Requested keysize is 2048 bits
Please specify how long the key should be valid.
0 = key does not expire
&lt;n&gt; = key expires in n days
&lt;n&gt;w = key expires in n weeks
&lt;n&gt;m = key expires in n months
&lt;n&gt;y = key expires in n years
Key is valid for? (0)
</pre>
<p>Type the number 1. This will enable you time to test it,
but it will make the key expire within 24 hours so that if you accidentally
share your private key, or delete your VM and no longer have access to it, you will be fine.</p>
<p>It will ask your if you are sure about the expiry date.</p>
<pre class="terminal">
Key expires at Tue Apr 7 02:24:23 2020 UTC
Is this correct? (y/N)
</pre>
<p>Type <code class="language-plaintext highlighter-rouge">y</code> to confirm your choice.</p>
<p>Now <code class="language-plaintext highlighter-rouge">gpg</code> is going to ask you to create a user id to indetify this key.
Use some test data for now.
User input is in bold, feel free to follow along or to put your own test data in.</p>
<p>Once you are more comfortable with the tools,
then you can create a public/private keypair that you will keep for some time.</p>
<pre class="terminal">
GnuPG needs to construct a user ID to identify your key.
Real name: <b>Mr. Tester</b>
Email address: <b>test@test.org</b>
Comment: <b>for testing only</b>
You selected this USER-ID:
"Mr. Tester (for testing only) &lt;test@test.org&gt;"
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? <b>O</b>
</pre>
<p>It will then ask you for a password.
If you are simply using this for test purposes,
then you can feel free to set it to something like “test”.
When create a long-term use pulbic key make sure to make the password <em>very</em> secure.</p>
<p>During the process of creating your key, <code class="language-plaintext highlighter-rouge">gpg</code> may warn you with this message:</p>
<pre class="terminal">
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
</pre>
<p>If this happens, feel free to smash your keyboard (lightly),
watch a YouTube video on the machine,
browse the web with <a href="http://w3m.sourceforge.net/">w3m</a>,
etc. until the key is generated.</p>
<p>You will know it is done when you see this message (or something similar):</p>
<pre class="terminal">
gpg: key EACCC490291EA7CE marked as ultimately trusted
gpg: revocation certificate stored as '/home/tait/.config/gnupg/openpgp-revocs.d/FFA7D7525C6546983F1152D8EACCC490291EA7CE.rev'
public and secret key created and signed.
pub rsa2048 2020-04-06 [SC] [expires: 2020-04-07]
FFA7D7525C6546983F1152D8EACCC490291EA7CE
uid Mr. Tester (for testing only) &lt;test@test.org&gt;
sub rsa2048 2020-04-06 [E] [expires: 2020-04-07]
</pre>
<p>Tada! You have your own public/private keypair!</p>
<p>Sharing a keypair that will expire soon is not a good idea,
however, if you are ready, then you can use this command to generate a public key file to share with others.</p>
<p>Feel free to substitute “Mr. Tester” for any other identifying part of your key.
Remember that to use the email, you must enclose it in &lt; and &gt;.</p>
<pre class="terminal">
$ gpg --export --armour "Mr. Tester" &gt; public-key.asc
</pre>
<p>To use the email as the identifier:</p>
<pre class="terminal">
$ gpg --export --armour "&lt;test@test.org&gt;" &gt; public-key.asc
</pre>
<h2 id="step-2-import-public-key">Step 2: Import Public Key</h2>
<p>This list of keys that <code class="language-plaintext highlighter-rouge">gpg</code> keeps on tap so to speak, is called our “keyring”.
Your will need to import a new public key to encrypt files with <code class="language-plaintext highlighter-rouge">gpg</code>.</p>
<p>If you already created your own public key, then this step is not necessary unless you want to also encrypt something for me :)</p>
<figure>
<img src="/assets/img/keyring.jpg" alt="A keyring holding eight allen keys." />
<figcaption>
A keyring holding eight allen keys.
</figcaption>
</figure>
<p>To import a public key to use for encrypting files, use the <code class="language-plaintext highlighter-rouge">--import</code> option of <code class="language-plaintext highlighter-rouge">gpg</code>. Like so:</p>
<pre class="terminal">
$ gpg --import public-key.asc
gpg: key 64FB4E386953BEAD: public key "Tait Hoyem &lt;tait.hoyem@protonmail.com&gt;" imported
gpg: Total number processed: 1
gpg: imported: 1
</pre>
<p>Now that we have imported a public key, we can make a message to send!</p>
<h2 id="step-3-have-a-message-to-encrypt">Step 3: Have A Message To Encrypt</h2>
<p>You can make a new file which holds some important, secret data.
Feel free to use a graphical editor if you have one, if not, <code class="language-plaintext highlighter-rouge">nano</code> works alright too.</p>
<pre class="terminal">
Rules Of A Good Life:
1. Wash your hands!
2. Work hard!
3. Be firm.
5. Have good friends!
</pre>
<p>Save this file as something like <code class="language-plaintext highlighter-rouge">test-pgp.txt</code>, and well use that name later.</p>
<h2 id="step-4-encrypt-a-message">Step 4: Encrypt A Message</h2>
<p>Now that we have a message to send and person to send to,
all we have to do is encrypt this message and itll be on its merry way!
To do so, we must specify two new options to <code class="language-plaintext highlighter-rouge">gpg</code>.</p>
<p>The first is <code class="language-plaintext highlighter-rouge">--recipient</code>.
This tells <code class="language-plaintext highlighter-rouge">gpg</code> to encrypt using a certin public key that we have in our keyring.
You can use the persons name, email address, or the keys uid.</p>
<p>The second is <code class="language-plaintext highlighter-rouge">--encrypt</code>.</p>
<p>You will also specify the <code class="language-plaintext highlighter-rouge">--armour</code> option to use ASCII armoured files. Put this option after <code class="language-plaintext highlighter-rouge">--encrypt</code>, and put the file name after <code class="language-plaintext highlighter-rouge">--armour</code>. See below.</p>
<p>You can either use your own public key name to encrypt a document (allowng only you to decrypt it),
or you can use my public key that we imported earlier (allowing only me to decrypt it).
Either way works fine.</p>
<p>This is the big one!</p>
<pre class="terminal">
$ gpg --recipient "Tait Hoyem" --encrypt --armour test-gpg.txt
</pre>
<p>“But there is no output!” you might say!
Yes, that is because our new (encrypted) file has already been saved.
Lets look at it with cat.</p>
<pre class="terminal">
$ cat test-gpg.txt.asc
-----BEGIN PGP MESSAGE-----
hQIMA2mJuYb8vkIlAQ/9FDmXJgW2vI7p9sznKvHhQk7uTZvoWC3hCeqHoO3BSElP
XR1BNAkJ+bykB30M+9u+XDyRtTwazjvNPmYfQnIh0Q+BQZigDWbEd1R47jbzm7Tu
0eZKKapgEidfecULtaECX1sR3qPt1m9oZjyUR1rzNd8tezZlCu2pjdNZrkta2Bdm
Hh1xDS43Bw7PMQqraJsHwqr0M1GLDbMzPes2ZU5y4jEmXZ0PZdJ7kgjR8dvhLBfi
MU+4kYnnemQEztXBOjKidhyOntKiLjenvD00tVHrOuQoWuWCHGiqR24qSwVjeb9G
079gqH1VWi3fk2cwFA9f3TLvJqUwatyE0Hcba0U1d2Voz/C9JEQjT6FHuaCqQL6b
p7B7m2DwpywFGJpAn6ksrEYqHaLVWiEGmdMmHYuHxMw8+cqoSwbYymCZTwMBAuJe
Pr1VO9uNo+Vj5r8IX7ACcSsrjf0XkVzfX6ySsPbyOlGXnwzWSOM3Dk2Z9MqDORbj
0/7vJTnDctPuc91Rlp3YnJlZKWMcNfPMKMtvpljd2XuVwub+C4vGWXa9XLbRXmJo
cnEFT6SB11AKjytE2Urt62CCrYjJPBneabxbCztnBs+vQSx7Fj0LK6v4Euik/Xm/
9aKmZZW8306c9Zwgpp9glWjLMCDNxJRGdKRjZsnkt9hOEYsP1irTegystK6u4eHS
mwHX931ENOJsnPfQZCZ9b41Q9doZQ/N/WHstQO8MtA3HIN1sW3wYkGzOLKj4gJfm
bqR/TzQmXyLT1xZa+/yTscaV0P4OlI4vcii/k4DgeSeQVWp9o9DbZFxSCsdYVvPu
jaDMzZnIKoax1GFz/coUAHFQub2rLzaQ5DDbvrkX++UrAjuUtRcSFH0TKhahZmCF
nv117moLfK22Mst/
=bw8T
-----END PGP MESSAGE-----
</pre>
<h2 id="step-5-decryption-optional">Step 5: Decryption (optional)</h2>
<p>If you created your own public/private keypair in step 1,
and you encryped using <code class="language-plaintext highlighter-rouge">--recipient "Your Test Name"</code>,
then you can decrypt your document as well!</p>
<p>You will need to specify <code class="language-plaintext highlighter-rouge">--decrypt</code>, and thats all folks!</p>
<pre class="terminal">
$ gpg --decrypt test-gpg.txt.asc
</pre>
<p>A password dialog will then come up asking for your previously created password.
As long as you remember your password from before and enter it correctly: voila!</p>
<pre class="terminal">
gpg: encrypted with 4096-bit RSA key, ID 6989B986FCBE4225, created 2020-01-02
"Tait Hoyem &lt;tait.hoyem@protonmail.com&gt;"
Rules Of A Good Life:
1. Wash your hands!
2. Work hard!
3. Be firm.
5. Have good friends!
</pre>
<h2 id="step-6-finale">Step 6: Finale!</h2>
<p>Ladies and gentleman, you have done it!
You have encrypted our very own document.
(And maybe even decrypted it yourself too :)</p>
<p>If you encrypted using my public key,
feel free to send it to <a href="mailto:tait@tait.tech">my email</a>.
I am happy to verify if it worked.</p>
<p>For more information on this subject, check out <a href="https://www.gnupg.org/gph/en/manual/c14.html">gnugp.orgs guide</a> on using GPG.
They are the ones that make these tools available,
and the <a href="https://www.gnu.org/">GNU Project</a> has been instrumental in creating the open-source world as it exists today.
Give em some love, eh!</p>
<p>Thank you so much for sticking through this whole thing!
Let me know if there is anything that doesnt make sense.
I am happy to improve this guide as time goes on if that is necessary.</p>
<p>Happy hacking :)</p>
</article>
</main>
<hr>
<footer>
This page will be mirrored on <a href="https://beta.tait.tech/2020/04/06/rsa4/">beta.tait.tech</a>.
</footer>
</div>
</body>
</html>

@ -0,0 +1,102 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>NAS Part 1: Theorize | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Tait Hoyem">
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<div id="wrapper">
<header>
<h1>tait.tech</h1>
<nav>
<a href="/" class="nav-link" >Home</a>
<a href="/blog/" class="nav-link" >Blog</a>
<a href="/ideas/" class="nav-link" >Ideas</a>
<a href="/links/" class="nav-link" >Links</a>
<a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer" >Github</a>
</nav>
</header>
<main>
<article>
<header>
<h1 class="post-title">NAS Part 1: Theorize</h1>
<time datetime="20-04-12" class="post-date">Sunday, April 12 2020</time>
</header>
<hr>
<p>New Project, phase one:
Theorize.</p>
<p>I want to build a NAS server to store a bunch of data on. Current problem is lack of a computer to accept multiple SATA connections.</p>
<h3 id="problem-1-sata-connectors">Problem 1: SATA connectors</h3>
<p>This can be solved by an HBE card. Although they tend to be quite expensive (250+).
One decent model that isnt that much is the <a href="https://www.amazon.ca/SAS9211-8I-8PORT-Int-Sata-Pcie/dp/B002RL8I7M/ref=sr_1_2?keywords=9211-8i&amp;qid=1586699707&amp;sr=8-2">LSI 9211-8I</a>.
This is ideal for future expansion.</p>
<p>A cheaper option is a PCIe multi-SATA connector <a href="https://www.amazon.ca/Rivo-Controller-Expansion-Profile-Non-Raid/dp/B0836MKFCR?ref_=ast_slp_dp">like this</a>.</p>
<p>Either work, but one is cheaper and the other is more expandable.
The 9211-8I uses two SAS ports, which can be expanded indefinetely. SAS supports splitting.
SATA can be connected in a 4:1 ratio to SAS connectors with some <a href="https://www.amazon.com/Cable-Matters-Internal-SFF-8087-Breakout/dp/B012BPLYJC">cheap cables</a>.</p>
<h3 id="problem-2-drives">Problem 2: Drives</h3>
<p>I do not have enough drives to make this work right now.
For the setup I want it would require 5 or 6 drives.
I will get 4-5 drives worth of space as one drive worth of space is dedicated to “parity”, making you able to:</p>
<ol>
<li>Verify data integrity. If anything goes wrong with a write, it will be fixed automatically.</li>
<li>If <em>one</em> drive dies, the system can stay online with no problem. Two drives and Im eff-you-see-kay-ed-dee.</li>
</ol>
<p>My other option is to use two drives worth of space for partiy.
This would only have me 3-4 drives of space, but
this system can withstand the failure of <em>two</em> drives.</p>
<h3 id="problem-3-computer-system">Problem 3: Computer System</h3>
<p>I currently have 5 computers.</p>
<ol>
<li>Celery Stick. An old grey HP laptop with a Braille stickered keyboard. <em>Does not work right now; bad thermal paste job.</em></li>
<li>A Dell laptop lent to me by my school during my studies.</li>
<li>Houston. A 21-inch 2011 iMac for which the screen does not work under Linux (excep with the <code class="language-plaintext highlighter-rouge">nomodeset</code> kernel option enabled).</li>
<li>An Old Toshiba laptop (circa 2010) that I got for $50 to test with OpenBSD (works….sometimes).</li>
<li>Main Rig. My main laptop is an ASUS-705 TUF gaming laptop.</li>
</ol>
<p>None of these have PCIe expansion slots with a case that can handle the new drives.</p>
<p>I think its reasonable to say that for hard-drives and low-end tower PCs,
I will likely have luck on a place like <a href="https://kijiji.ca">Kijiji</a> (Canadian Craigslist).</p>
<p>The search continues :)</p>
<p>Im in for a fun ride…. and a few monnies.</p>
</article>
</main>
<hr>
<footer>
This page will be mirrored on <a href="https://beta.tait.tech/2020/04/12/nas1/">beta.tait.tech</a>.
</footer>
</div>
</body>
</html>

@ -0,0 +1,68 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>rfi: A Simple Linux utility to get a random file from a directory | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Tait Hoyem">
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<div id="wrapper">
<header>
<h1>tait.tech</h1>
<nav>
<a href="/" class="nav-link" >Home</a>
<a href="/blog/" class="nav-link" >Blog</a>
<a href="/ideas/" class="nav-link" >Ideas</a>
<a href="/links/" class="nav-link" >Links</a>
<a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer" >Github</a>
</nav>
</header>
<main>
<article>
<header>
<h1 class="post-title">rfi: A Simple Linux utility to get a random file from a directory</h1>
<time datetime="20-04-21" class="post-date">Tuesday, April 21 2020</time>
</header>
<hr>
<p>I made a <a href="https://lbry.tv/@tait:7/rfi:5">little video</a> about this script I wrote:</p>
<pre class="terminal">
$ rfi
</pre>
<p>This program gets a random file from your current directory
if you do not specify one;
it gets a random file from the specified directory if you give it one like so:</p>
<pre class="terminal">
# rfi /etc/wireguard
</pre>
<p>Which is very useful if you want to start a random VPN configuration :)</p>
<p>The code, comments, etc. are on the <a href="https://github.com/TTWNO/scripts">Github</a>.</p>
</article>
</main>
<hr>
<footer>
This page will be mirrored on <a href="https://beta.tait.tech/2020/04/21/rfi/">beta.tait.tech</a>.
</footer>
</div>
</body>
</html>

@ -0,0 +1,147 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>What is XSS? | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Tait Hoyem">
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<div id="wrapper">
<header>
<h1>tait.tech</h1>
<nav>
<a href="/" class="nav-link" >Home</a>
<a href="/blog/" class="nav-link" >Blog</a>
<a href="/ideas/" class="nav-link" >Ideas</a>
<a href="/links/" class="nav-link" >Links</a>
<a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer" >Github</a>
</nav>
</header>
<main>
<article>
<header>
<h1 class="post-title">What is XSS?</h1>
<time datetime="20-04-25" class="post-date">Saturday, April 25 2020</time>
</header>
<hr>
<p>I found a cross-site scripting (XSS) attack
in a well-known quiz hosting website.
I disclosed the vulnerability to them years ago, so I thought
now might be a good time to write about it.</p>
<p>In this first article I will explain what XSS is.</p>
<p>In the next article I will explain how I found this attack.</p>
<h2 id="what-is-cross-site-scripting-xss">What is cross-site scripting (XSS)</h2>
<p>Cross-site scripting, XSS for short,
is a technique to execute arbitrary Javascript code on a user visiting a website
by linking to Javascript code stored on another server.</p>
<p>So for example:</p>
<p>I have a file on my website called <a href="/assets/js/hacked.js">hacked.js</a>.
If I was able to run this javascript file on anybody visiting a certain website <em>that is not mine</em>, this would be called cross-site scripting.</p>
<p>Click the above <code class="language-plaintext highlighter-rouge">hacked.js</code> link to view the code I use to “hack” this website.
Its safe, I promise ;)</p>
<p>Now, how can we get this code to execute when a user visits this site?
To explain, I will start with some of the underlying technologies.</p>
<h3 id="escape-characters">Escape Characters!</h3>
<p>No, this is not a Sherlock Holmes novel!</p>
<p>If we suppose that a website is built with sequences like these (called “tags”):
<code class="language-plaintext highlighter-rouge">&lt;body&gt;</code>, <code class="language-plaintext highlighter-rouge">&lt;p&gt;</code> (for paragraph), <code class="language-plaintext highlighter-rouge">&lt;link&gt;</code> and <code class="language-plaintext highlighter-rouge">&lt;b&gt;</code> for bold,
then why can you <em>see</em> the left and right angle bracket characters?
Dont they mean something? Shouldnt they be telling the browser:
<em>“Hey! Make me bold!”?</em>
Why <em>doesnt</em> everything after me typing <code class="language-plaintext highlighter-rouge">&lt;b&gt;</code> turn bold?</p>
<p>The answer is:</p>
<p>There are special characters in HTML to type a visible left (&lt;)
and visible right angle bracket (&gt;) in a website.
If I use the left and right brackets on my keyboard however,
things will indeed <b>show up bold</b>.</p>
<p>This is the code for the sentence I wrote above:</p>
<pre class="terminal">
There are special characters in HTML to type a visible left (&amp;lt;)
and visible right angle bracket (&amp;gt;) in a website.
If I use the left and right brackets on my keyboard however,
things will indeed &lt;b&gt;show up bold&lt;/b&gt;.
</pre>
<p>Notice how all visible left angle brackets use an <code class="language-plaintext highlighter-rouge">&amp;lt;</code> to show them?</p>
<p>These are called <a href="https://en.wikipedia.org/wiki/Escape_character">escape characters</a>.
They tell a system, in this case your web browser:
<em>“Hello! Please show me off! I dont want to be hidden.”</em></p>
<h4 id="sanitization">Sanitization</h4>
<p>Most of the time XSS attacks are done using poorly sanitized HTML <code class="language-plaintext highlighter-rouge">&lt;input&gt;</code> elements.</p>
<p>Sanitization is when a program (usually on the server side),
will remove characters like <code class="language-plaintext highlighter-rouge">&lt;</code> and replace them with the aforementioned “escape characters”.
Internally this would be something like <code class="language-plaintext highlighter-rouge">&amp;lt;</code>,
but they would show up to a user as <code class="language-plaintext highlighter-rouge">&lt;</code>.</p>
<p>When inputs are not properly sanitized <em>and</em> the input is shown to the user in another part of the website,
then a malicous user can type in HTML that will run whenever anybody tries to look at what they typed.
For example: a name for a quiz website (input) and the leaderboard for said quiz (display).</p>
<p>HTML, by itself is not very dangerous.
The worst thing you could do is probably put a link on your name,
and then point it to a porn site.
Make your name bold, italic. Maybe make the background a funny color.
Although this may annoy your victim it is not dangerous security wise.</p>
<p>There is one tag however, that <em>is</em> scary…</p>
<h2 id="script"><code class="language-plaintext highlighter-rouge">&lt;script&gt;</code></h2>
<p>The <code class="language-plaintext highlighter-rouge">&lt;script&gt;</code> tag allows you to write code that can:</p>
<ol>
<li>Change the page contents.</li>
<li>Redirect the user to a new page automatically.</li>
<li>Get a users location.</li>
<li>Open a users microphone/webcam.</li>
<li>With the <code class="language-plaintext highlighter-rouge">src</code> <a href="https://www.w3schools.com/htmL/html_attributes.asp">attribute</a> you can also load a script from another site. (This is XSS)</li>
</ol>
<p>Those last two will ask for permission from the user (if their browser isnt insanely insecure).</p>
<p>In my next article Ill talk about a website I found which is vulnerable to this attack.
And, show you how you can run your own XSS attack.</p>
</article>
</main>
<hr>
<footer>
This page will be mirrored on <a href="https://beta.tait.tech/2020/04/25/xss/">beta.tait.tech</a>.
</footer>
</div>
</body>
</html>

@ -0,0 +1,109 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>How to use NGINX as a reverse-proxy server for a Node.js application using socket.io | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Tait Hoyem">
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<div id="wrapper">
<header>
<h1>tait.tech</h1>
<nav>
<a href="/" class="nav-link" >Home</a>
<a href="/blog/" class="nav-link" >Blog</a>
<a href="/ideas/" class="nav-link" >Ideas</a>
<a href="/links/" class="nav-link" >Links</a>
<a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer" >Github</a>
</nav>
</header>
<main>
<article>
<header>
<h1 class="post-title">How to use NGINX as a reverse-proxy server for a Node.js application using socket.io</h1>
<time datetime="20-05-01" class="post-date">Friday, May 01 2020</time>
</header>
<hr>
<p>Despite the long name of the article, I have a feeling this may apply to more people than I might think.
If you have a Node.js application which needs socket.io connections that you want to pass throgh nginxs <code class="language-plaintext highlighter-rouge">reverse_proxy</code> directive then this is the article for you!</p>
<p>You <em>must</em> seperate the socket.io sockets and the static resources.</p>
<ul>
<li>The socket connections can be routed through the default <code class="language-plaintext highlighter-rouge">$host/socket.io</code> if you want to ease modifications to the source code.</li>
<li>The connections to your main npm Node.js application can be routed through the relevant directory.</li>
</ul>
<p>Here is the relevant part of my <code class="language-plaintext highlighter-rouge">projects.tait.tech.conf</code> file:</p>
<pre class="terminal">
location /socket.io {
proxy_pass http://localhost:8080/socket.io/;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
}
location /ttrpg {
proxy_pass http://localhost:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
</pre>
<h3 id="explaination">Explaination:</h3>
<p>For this application,
I needed the <code class="language-plaintext highlighter-rouge">/ttrpg</code> directory to connect to my main Node.js instance. This was going to be the root of a ttrpg project.
It was to have static files served form my Node.js application.</p>
<p>I also needed <code class="language-plaintext highlighter-rouge">/socket.io</code> to conenct to my running <code class="language-plaintext highlighter-rouge">npm</code> instance.
When I tried to route all the traffic through the <code class="language-plaintext highlighter-rouge">/trrpg</code> location directive
I had no luck whatsoever;
<code class="language-plaintext highlighter-rouge">$host/ttrpg/socket.io/*</code> calls <em>always</em> failed with a 404.</p>
<p>Having two seperate blocks forwarding in different ways seems to fix this.
I am not knowledgable enough to understand how.</p>
<p>For now, the project is alive!!!</p>
<p>Happy hacking!</p>
<p><em>P.S. I forgot to mention I also symbolically linked the <code class="language-plaintext highlighter-rouge">socket.io.js</code> file (that node is supposed to serve automatically) to the static client dir.
For some reson the node instance would not serve this file without that.</em></p>
<pre class="terminal">
$ pwd
/home/user/ttrpg.co/client
$ ln -s ../server/node_modules/socket.io-client/dist/socket.io.js .
</pre>
<p><em>Happy hacking 2.0!</em></p>
</article>
</main>
<hr>
<footer>
This page will be mirrored on <a href="https://beta.tait.tech/2020/05/01/nginx-socket-io-projects/">beta.tait.tech</a>.
</footer>
</div>
</body>
</html>

@ -0,0 +1,66 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>New Game: Clue (coming soon) | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Tait Hoyem">
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<div id="wrapper">
<header>
<h1>tait.tech</h1>
<nav>
<a href="/" class="nav-link" >Home</a>
<a href="/blog/" class="nav-link" >Blog</a>
<a href="/ideas/" class="nav-link" >Ideas</a>
<a href="/links/" class="nav-link" >Links</a>
<a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer" >Github</a>
</nav>
</header>
<main>
<article>
<header>
<h1 class="post-title">New Game: Clue (coming soon)</h1>
<time datetime="20-05-19" class="post-date">Tuesday, May 19 2020</time>
</header>
<hr>
<p>Ooo! Exciting!
Today I want to announce a new project Ill 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>
</article>
</main>
<hr>
<footer>
This page will be mirrored on <a href="https://beta.tait.tech/2020/05/19/clue-announcement/">beta.tait.tech</a>.
</footer>
</div>
</body>
</html>

@ -0,0 +1,57 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Site Update | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Tait Hoyem">
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<div id="wrapper">
<header>
<h1>tait.tech</h1>
<nav>
<a href="/" class="nav-link" >Home</a>
<a href="/blog/" class="nav-link" >Blog</a>
<a href="/ideas/" class="nav-link" >Ideas</a>
<a href="/links/" class="nav-link" >Links</a>
<a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer" >Github</a>
</nav>
</header>
<main>
<article>
<header>
<h1 class="post-title">Site Update</h1>
<time datetime="20-06-04" class="post-date">Thursday, June 04 2020</time>
</header>
<hr>
<p>I updated the site with some easier to identify information about me and my projects :)</p>
<p>Also, Clue has been delayed due to my partner in crime on the project wokring too many hours.</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>
</article>
</main>
<hr>
<footer>
This page will be mirrored on <a href="https://beta.tait.tech/2020/06/04/site-update/">beta.tait.tech</a>.
</footer>
</div>
</body>
</html>

@ -0,0 +1,182 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>How to use tmux to send and receive things from your Minecraft server | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Tait Hoyem">
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<div id="wrapper">
<header>
<h1>tait.tech</h1>
<nav>
<a href="/" class="nav-link" >Home</a>
<a href="/blog/" class="nav-link" >Blog</a>
<a href="/ideas/" class="nav-link" >Ideas</a>
<a href="/links/" class="nav-link" >Links</a>
<a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer" >Github</a>
</nav>
</header>
<main>
<article>
<header>
<h1 class="post-title">How to use tmux to send and receive things from your Minecraft server</h1>
<time datetime="20-06-25" class="post-date">Thursday, June 25 2020</time>
</header>
<hr>
<p>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.</p>
<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>
<h2 id="solution">Solution</h2>
<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.
This allows you to run a terminal session, then detach fromc it while it still runs in the background.</p>
<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>
<h4 id="send-keys"><code class="language-plaintext highlighter-rouge">send-keys</code></h4>
<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,
there is no reason you could not run a command like this:</p>
<pre class="terminal">
$ tmux send-keys "tell @a This is a Test" Enter
</pre>
<p>This will send the text “tell @a This is a Test” to the Minecraft server.
Then, it will hit the newline character, this will execute the command.</p>
<p>So now we can send information to the server and have it tell the users something.</p>
<p>But how do we get information about who is typing what in the Minecraft chat?</p>
<h3 id="tmuxs-capture-pane-is-painful"><code class="language-plaintext highlighter-rouge">tmux</code>s <code class="language-plaintext highlighter-rouge">capture-pane</code> is painful</h3>
<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>
<pre class="terminal">
-S and -E specify the starting and ending line numbers,
zero is the first line of the visible pane and negative
numbers are lines in the history. - to -S is the start
of the history and to -E the end of the visible pane. The
default is to capture only the visible contents of the pane.
</pre>
<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 Im starting from the last line. Right?</p>
<p>No. It just doesnt work. Negative numbers do <em>not</em> work with the <code class="language-plaintext highlighter-rouge">tmux capture-pane</code> subcommand.</p>
<p>So I did some simple UNIX piping, like so, to get just the last thing in the chat.</p>
<pre class="terminal">
$ tmux capture-pane -p -t steve | tail -n1
[SERVER] [ExtraDebuggingInfoHere]: &lt;TaterTheTot&gt; MY_MESSAGE
</pre>
<p>TaterTheTot is my Minecraft username :)</p>
<p><code class="language-plaintext highlighter-rouge">-p</code> prints the result to the terminal/stdout.</p>
<p><code class="language-plaintext highlighter-rouge">steve</code> is the name of the tmux session Im trying to pull form.</p>
<p>So thats done! Beauty!</p>
<p>Now that we have that, how can we extract the username and the message from the latest line?</p>
<h3 id="grep"><code class="language-plaintext highlighter-rouge">grep</code></h3>
<p><code class="language-plaintext highlighter-rouge">grep</code> is a command to find patterns of text.
<code class="language-plaintext highlighter-rouge">grep</code> has an option to only show a matching pattern of text.
This option is <code class="language-plaintext highlighter-rouge">-o</code>.</p>
<p>Lets see how we can use this in conjunction with our latest line of server output to get our results.</p>
<pre class="terminal">
$ echo "[DEBUG] [SERVER] blah blah: &lt;TaterTheTot&gt; MY_MESAGE" | grep -o "&lt;.&ast;&gt;"
&lt;TaterTheTot&gt;
</pre>
<p>Now, thats my name with the &lt; and &gt; attached. Not bad!
We can use the <code class="language-plaintext highlighter-rouge">sed</code> command to clean it up a bit.</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>Select any characters that are either &lt; or &gt;.
Replace with nothing.
Do so globally (as in, dont stop after you replace only one character).</p>
<p>Take two!</p>
<pre class="terminal">
$ echo "[DEBUG] [SERVER] blah blah: &lt;TaterTheTot&gt; MY_MESAGE" | grep -o "&lt;.&ast;&gt;" | sed 's/[&lt;&gt;]//g'
TaterTheTot
</pre>
<p>Beautiful!</p>
<p>Now what about that pesky message?</p>
<h3 id="more-grep-more-sed">more <code class="language-plaintext highlighter-rouge">grep</code>; more <code class="language-plaintext highlighter-rouge">sed</code></h3>
<p>Simple: capture everything after the &gt;. Leaving the users message entirely in tact.</p>
<pre class="terminal">
$ echo "[DEBUG] [SERVER] blah blah: &lt;TaterTheTot&gt; MY_MESAGE" | grep -o "&gt;.&ast;$" | sed 's/&gt; //'
MY_MESSAGE
</pre>
<p>So now we have a way to get the username of someone typing in the Minecraft server chat.
We have a way to find out what they said.
And, we have a way to respond.</p>
<p>You can imagine how these might go together for your own use case.</p>
<h3 id="conclusion">Conclusion</h3>
<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>
</article>
</main>
<hr>
<footer>
This page will be mirrored on <a href="https://beta.tait.tech/2020/06/25/tmux-minecraft/">beta.tait.tech</a>.
</footer>
</div>
</body>
</html>

@ -0,0 +1,90 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Independence | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Tait Hoyem">
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<div id="wrapper">
<header>
<h1>tait.tech</h1>
<nav>
<a href="/" class="nav-link" >Home</a>
<a href="/blog/" class="nav-link" >Blog</a>
<a href="/ideas/" class="nav-link" >Ideas</a>
<a href="/links/" class="nav-link" >Links</a>
<a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer" >Github</a>
</nav>
</header>
<main>
<article>
<header>
<h1 class="post-title">Independence</h1>
<time datetime="20-07-12" class="post-date">Sunday, July 12 2020</time>
</header>
<hr>
<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>Thats 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>
<p>Protect yourself; give yourself choices.
Why give others that power when you could have it for yourself?</p>
</article>
</main>
<hr>
<footer>
This page will be mirrored on <a href="https://beta.tait.tech/2020/07/12/independence/">beta.tait.tech</a>.
</footer>
</div>
</body>
</html>

@ -0,0 +1,145 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Installing MultiCraft on Gentoo Linux | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Tait Hoyem">
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<div id="wrapper">
<header>
<h1>tait.tech</h1>
<nav>
<a href="/" class="nav-link" >Home</a>
<a href="/blog/" class="nav-link" >Blog</a>
<a href="/ideas/" class="nav-link" >Ideas</a>
<a href="/links/" class="nav-link" >Links</a>
<a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer" >Github</a>
</nav>
</header>
<main>
<article>
<header>
<h1 class="post-title">Installing MultiCraft on Gentoo Linux</h1>
<time datetime="20-07-19" class="post-date">Sunday, July 19 2020</time>
</header>
<hr>
<p>In a very odd combination of requirements,
I needed to install <a href="https://multicraft.org">MultiCraft</a> on a Gentoo Linux system.
The PHP <code class="language-plaintext highlighter-rouge">USE</code> flags are important so you dont have to recompile it three times like I did.</p>
<p>Here are some useful tips I came across:</p>
<h3 id="php-use-flags">PHP <code class="language-plaintext highlighter-rouge">USE</code> flags</h3>
<p>In <code class="language-plaintext highlighter-rouge">/etc/portage/package.use/php</code> I placed the following line:</p>
<pre class="terminal">
dev-lang/php cgi mysql mysqli fpm pdo gd truetype
</pre>
<p>This should give you enough for a mysql backended MultiCraft installation.
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>.
I dont know for sure though.</p>
<h3 id="paper">Paper</h3>
<p>This will grab the latest version of the Paper jar file using <a href="https://yivesmirror.com">YivesMirror</a>.
Im not sure how reputable it is,
but my buddy who works with this stuff more often than me seemed to recognize it.</p>
<pre class="terminal">
## See the default craftbukkit.jar.conf for a detailed documentation of the
## format of this file.
[config]
name = Paper 1.16.1 Latest
source = https://yivesmirror.com/files/paper/Paper-1.16.1-latest.jar
category = Mods
[encoding]
#encode = system
#decode = system
#fileEncoding = latin-1
[start]
command = "{JAVA}" -Xmx{MAX_MEMORY}M -Xms{START_MEMORY}M -XX:MaxPermSize=128M -Djline.terminal=jline.UnsupportedTerminal -jar "{JAR}" nogui
</pre>
<h3 id="other-tips">Other Tips</h3>
<p>Do not use the option to setup a separate user for each server.
This completely stalled any work getting done with a ton of permission denied errors.</p>
<h4 id="security">Security</h4>
<p>If the panel is in the root directory of your NGINX web server,
use the following in your server block to deny access to the <code class="language-plaintext highlighter-rouge">/protected</code> directory.</p>
<pre class="terminal">
location /protected {
deny all;
return 404;
}
</pre>
<h5 id="mysql">MySQL</h5>
<p>It is always good practice to separate privileges.
The MultiCraft daemon should have one SQL login,
with one database allocated to it.
The MultiCraft panel should have a separate SQL login,
with a separate database allocated to it.</p>
<p>You can do this with the following commands in your MySQL prompt:</p>
<pre class="terminal">
sql&gt; CREATE DATABASE multicraft_daemon_database;
Query OK, 0 rows affected (0.01 sec)
sql&gt; CREATE DATABASE multicraft_panel_database;
Query OK, 0 rows affected (0.01 sec)
sql&gt; CREATE USER 'muilticraft_daemon'@'localhost' IDENTIFIED BY 'strong password here';
Query OK, 0 rows affected (0.01 sec)
sql&gt; CREATE USER 'multicraft_panel'@'localhost' IDENTIFIED BY 'different strong password here';
Query OK, 0 rows affected (0.01 sec)
sql&gt; GRANT ALL PRIVILEGES ON multicraft_daemon_database . * TO 'multicraft_daemon'@'localhost';
Query OK, 0 rows affected (0.01 sec)
sql&gt; GRANT ALL PRIVILEGES ON multicraft_panel_database . * TO 'mutlicraft_panel'@'localhost';
Query OK, 0 rows affected (0.01 sec)
</pre>
<p>During setup, make sure the proper credentials are used for each step.
Database 1 is the panel database.
Database 2 is the daemon database.</p>
<p>Happy hacking :)</p>
</article>
</main>
<hr>
<footer>
This page will be mirrored on <a href="https://beta.tait.tech/2020/07/19/multicraft-php-gentoo/">beta.tait.tech</a>.
</footer>
</div>
</body>
</html>

@ -0,0 +1,96 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Know How Your Representative Votes In Parliament | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Tait Hoyem">
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<div id="wrapper">
<header>
<h1>tait.tech</h1>
<nav>
<a href="/" class="nav-link" >Home</a>
<a href="/blog/" class="nav-link" >Blog</a>
<a href="/ideas/" class="nav-link" >Ideas</a>
<a href="/links/" class="nav-link" >Links</a>
<a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer" >Github</a>
</nav>
</header>
<main>
<article>
<header>
<h1 class="post-title">Know How Your Representative Votes In Parliament</h1>
<time datetime="20-07-30" class="post-date">Thursday, July 30 2020</time>
</header>
<hr>
<p>As an advocate for openness, I had an idea to make a project out of the government of Canadas <a href="https://open.canada.ca/en/open-data">Open Data</a>
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 governments own website.
In this article, I will explain how you can do the same.</p>
<h3 id="1-find-your-representative">1. Find Your Representative</h3>
<p>The first step in this process is to find who your representative is.
To do so, go to the governments own website
<a href="https://www.ourcommons.ca/Members/en">ourcommons.cas search tool</a>.</p>
<p>Simply type in your postal code in the search box to find out who your MP is.</p>
<h3 id="2-their-voting-record">2. Their Voting Record</h3>
<p>Every MPs voting record is public knowledge,
and it is available nice and simple in a table on that MPs page.
For example, this is a link to
<a href="https://www.ourcommons.ca/Members/en/pierre-poilievre(25524)/votes">Pierre Poilievres voting record</a>.</p>
<p>To find your MPs voting record, do step one, then:
After the <strong>Overview</strong>, and <strong>Seat in The House</strong> sections,
there are three tabs, <strong>Roles</strong>, <strong>Work</strong>, and <strong>Contact</strong>.
Click on work.
At the bottom of that tab is a link which says <strong>Chamber Votes</strong>.
This will open a small window with some recent votes by this politician.
If you want to see all their votes, there is a button at the bottom named <strong>All Votes by This Member</strong>.</p>
<p>Tada! You can now keep your local MP accountable for anything you do or do not support.</p>
<h3 id="3-bill-details">3. Bill Details</h3>
<p>If you want to get into the nitty gritty,
once you open a specific bill, you can actually find out the status of said bill,
or read the actual text by clicking the <strong>View this Bill on LEGISinfo</strong> button.</p>
<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>
<h4 id="conclusion">Conclusion</h4>
<p>I thought this was pretty cool!
It was <em>way</em> simpler than I thought it would be.</p>
<p>Thanks, Canada!</p>
</article>
</main>
<hr>
<footer>
This page will be mirrored on <a href="https://beta.tait.tech/2020/07/30/canadian-parliament/">beta.tait.tech</a>.
</footer>
</div>
</body>
</html>

@ -0,0 +1,85 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>BSD Journey, Part 1 | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Tait Hoyem">
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<div id="wrapper">
<header>
<h1>tait.tech</h1>
<nav>
<a href="/" class="nav-link" >Home</a>
<a href="/blog/" class="nav-link" >Blog</a>
<a href="/ideas/" class="nav-link" >Ideas</a>
<a href="/links/" class="nav-link" >Links</a>
<a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer" >Github</a>
</nav>
</header>
<main>
<article>
<header>
<h1 class="post-title">BSD Journey, Part 1</h1>
<time datetime="20-08-15" class="post-date">Saturday, August 15 2020</time>
</header>
<hr>
<p>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.</p>
<p>Now, my interest in OpenBSD has been going on for a long time.
I started poking around for Linux alternatives way back a few years ago when Linus Torvalds decided to leave after he got in trouble for some
<a href="https://arstechnica.com/information-technology/2013/07/linus-torvalds-defends-his-right-to-shame-linux-kernel-developers/">unprofessional behaviour</a>.
That said, Linus did come back to Linux development,
but I knew that his abrasive style is what brought good code to the Linux kernel.
I also knew that his ability to be critical would be hurt by the new
<a href="https://itsfoss.com/linux-code-of-conduct/">code of conduct</a>.
It would become a tool for the SJW types to hammer on Linus for being a “white male, et al.”;
It would become a tool for the easily offended to use to get their dumb code into Linux;
It would become a tool for the corporatization, the HR-ification of Linux.
Frankly, this does not interest me.</p>
<p>Now Im sure that OpenBSD has its own internal policies that I disagree with.
That said, Theo De Raadt is still at least known for calling Firefox an “amorphous peace of garbage” due to its lack of privilege separation.
And, in their <a href="https://openbsd.org/goals.html">project goals</a> page, they specifically mention:</p>
<blockquote>
<p>Be as politics-free as possible; solutions should be decided on the basis of technical merit.</p>
</blockquote>
<p>Now thats something I can get behind!
Bet you thats not in the Linux COC?</p>
<p>He also went to university in my hometown, so thats pretty cool!
I can support a local madman who thinks he can make a better operating system than all those corporations.
Maybe he was right, maybe not. What I know is I am excited to find out!</p>
<p>Wish my luck on my OpenBSD journey. I will post updates here along the way.</p>
<p>Happy hacking!</p>
</article>
</main>
<hr>
<footer>
This page will be mirrored on <a href="https://beta.tait.tech/2020/08/15/openbsd1/">beta.tait.tech</a>.
</footer>
</div>
</body>
</html>

@ -0,0 +1,172 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>How to Solve The Django Deployment Puzzle | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Tait Hoyem">
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<div id="wrapper">
<header>
<h1>tait.tech</h1>
<nav>
<a href="/" class="nav-link" >Home</a>
<a href="/blog/" class="nav-link" >Blog</a>
<a href="/ideas/" class="nav-link" >Ideas</a>
<a href="/links/" class="nav-link" >Links</a>
<a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer" >Github</a>
</nav>
</header>
<main>
<article>
<header>
<h1 class="post-title">How to Solve The Django Deployment Puzzle</h1>
<time datetime="20-08-18" class="post-date">Tuesday, August 18 2020</time>
</header>
<hr>
<p>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.</p>
<h3 id="asgi-servers">ASGI Servers</h3>
<p>Because my project used the ASGI (Asynchronous webServer Gateway Interface),
I needed to find a good production ASGI server to handle all the incoming requests.
The best thing I found was <a href="http://www.uvicorn.org/">uvicorn</a>.
It focuses on speed, which is a priority, especially when using the ASGI protocol.</p>
<p>To run uvicorn on the command line for testing purposes, use something like the following:</p>
<pre class="terminal">
$ uvicorn --reload myapp.asgi:application
</pre>
<p>The <code class="language-plaintext highlighter-rouge">--reload</code> option says to reload the server if any of the files get updated.
This is not recommended in production.
Sadly, I thought this meant I would need to do a hard shutdown of the server process every time I wanted to update.
This turned out to not be the case.</p>
<h3 id="workload-managers">Workload Managers</h3>
<p>There is another equine-named program called <a href="https://gunicorn.org/">gunicorn</a>
which can hold a number of processes under its control.
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,
replacing the subprocesses one-by-one and eventually having only the new deployment active on all subprocesses.
The greatest part? Zero down time.
The server keeps any old processes open if there is communication with them,
then shift and new connections to the new deployment.
This was a very cool feature I wanted to take advantage of.</p>
<p>“Now hold on!” you might protest.
“gunicorn is a WSGI server!” … oh you got me there!
Yes, thats 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>
<h3 id="systemd">systemd</h3>
<p>Love it or hate it, the majority of Linux distributions use the <code class="language-plaintext highlighter-rouge">systemd</code> init system.
I decided it would be very convenient to have a .service file for my Django application to run automatically at boot.
<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>
<pre class="file">
[Unit]
Description=Gunicorn/Uvicorn (lamegames.io)
[Service]
WorkingDirectory=/home/lame/lamegames.io
Type=simple
RemainAfterExit=yes
ExecStart=/home/lame/lamegames.io/env/bin/gunicorn lamegames.asgi:application -w 2 -k uvicorn.workers.UvicornWorker
ExecStop=/bin/kill -HUP $MAINPID
Restart=always
[Install]
WantedBy=multi-user.target
</pre>
<h3 id="nginx">nginx</h3>
<p>NGINX (pronounced engine-X) is a performance web server designed for speed and simplicity.
For the front facing side of the site, I do need a production web server like nginx.
Gunicorn simply doesnt need all the features that nginx provides, but I do.
To configure my nginx installation, I used the following few directives to:</p>
<ol>
<li>Redirect most traffic towards the gunicorn server.</li>
<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>
<li>Use TLS to enable https://</li>
</ol>
<p>Serving the static files from nginx as opposed to the <code class="language-plaintext highlighter-rouge">gunicorn</code> server is necessary.
Gunicorn and other production A/WSGI web server will not set the proper MIME type over TLS.
This will cause your browser to not load the Javascript/CSS.</p>
<p>This is the important part of my nginx config.</p>
<pre class="file">
server {
location / {
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# these two lines ensure that WebSocket, and HTTP2 connection are forwarded correctly
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_redirect off;
proxy_buffering off;
# this forwards all traffic to the local server on port 8000
proxy_pass http://localhost:8000;
}
# This forwards all static requests to Django's STATIC_ROOT set in settings.py; it is generated using the collectstatic command.
location /static {
autoindex on;
alias /home/lame/lamegames.io/static_generated;
}
}
</pre>
<h3 id="setup">Setup</h3>
<p>After all that, I was able to do the following:</p>
<pre class="terminal">
# systemctl enable lamegames
</pre>
<p>This enabled my <code class="language-plaintext highlighter-rouge">gunicorn</code> server to run once the server started.
NGINX is that way be default.</p>
<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 yourre wanting to use channels/redis WebSockets.</li>
</ul>
</article>
</main>
<hr>
<footer>
This page will be mirrored on <a href="https://beta.tait.tech/2020/08/18/django-deployment/">beta.tait.tech</a>.
</footer>
</div>
</body>
</html>

@ -0,0 +1,60 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>lamegames.tait.tech | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Tait Hoyem">
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<div id="wrapper">
<header>
<h1>tait.tech</h1>
<nav>
<a href="/" class="nav-link" >Home</a>
<a href="/blog/" class="nav-link" >Blog</a>
<a href="/ideas/" class="nav-link" >Ideas</a>
<a href="/links/" class="nav-link" >Links</a>
<a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer" >Github</a>
</nav>
</header>
<main>
<article>
<header>
<h1 class="post-title">lamegames.tait.tech</h1>
<time datetime="20-09-09" class="post-date">Wednesday, September 09 2020</time>
</header>
<hr>
<p>This is an announcement for a new project of mine:
<a href="https://lamegames.tait.tech">lamegames.tait.tech</a>.</p>
<p>This is something Im really excited to work on!</p>
<p>Right now, Ive just got a rock-paper-scissors game.
A chat function, and a few simple card games to come.</p>
<p>Check out the repository on my <a href="https://github.com/TTWNO/lamegames.io">Github</a>.</p>
</article>
</main>
<hr>
<footer>
This page will be mirrored on <a href="https://beta.tait.tech/2020/09/09/lamegames/">beta.tait.tech</a>.
</footer>
</div>
</body>
</html>

@ -0,0 +1,144 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Minesweeper Bomb Generation And Tile Revealing | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Tait Hoyem">
<meta name="keywords" content="">
<meta name="description" content=""><link rel="stylesheet" href="/assets/css/katex.css">
<link rel="stylesheet" href="/assets/css/highlight.css">
</head>
<body>
<div id="wrapper">
<header>
<h1>tait.tech</h1>
<nav>
<a href="/" class="nav-link" >Home</a>
<a href="/blog/" class="nav-link" >Blog</a>
<a href="/ideas/" class="nav-link" >Ideas</a>
<a href="/links/" class="nav-link" >Links</a>
<a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer" >Github</a>
</nav>
</header>
<main>
<article>
<header>
<h1 class="post-title">Minesweeper Bomb Generation And Tile Revealing</h1>
<time datetime="20-09-12" class="post-date">Saturday, September 12 2020</time>
</header>
<hr>
<p>When I was creating a little Minesweeper game, I got confused at some points.
My bomb generation didnt look quite right, and I for sure didnt quite get the whole cascading tile reveal thing.
With a bit of internet research, I found what I was looking for.
Ill explain it all in one place for my own research purposes.</p>
<h2 id="bomb-generation">Bomb Generation</h2>
<p>When I started this project I attempted to use a random bomb generator.
By this I mean on each square, before it gets generated, give it a one in 15 change of being a bomb.
Personally, Im not sure why this never looked right.
Something about the layout of the bombs did not mimic the classic Minesweeper game.</p>
<p>After looking at some open source Minesweeper examples, I started to get the idea.
I wrote some mathematical statements describing the generation of bombs and how to get their x,y position from an appropriate number.
For those non-mathy people, dont leave just yet;
there will be code equivalents to the math.</p>
<p>W and H are the width and height of the board respectively.</p>
<p><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn mathvariant="italic">0</mn><mo></mo><mi>r</mi><mo></mo><mtext>W</mtext><mo>×</mo><mtext>H</mtext></mrow><annotation encoding="application/x-tex">
\it 0 \leq r \leq \text W \times \text H
</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8193em;vertical-align:-0.13597em;"></span><span class="mord"><span class="mord mathit">0</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel"></span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mord mathit">r</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel"></span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mord text"><span class="mord">W</span></span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">×</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mord text"><span class="mord">H</span></span></span></span></span></span></span>
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi><mo>=</mo><mi>r</mi><mtext></mtext><mo lspace="0.22em" rspace="0.22em"><mrow><mi mathvariant="normal">m</mi><mi mathvariant="normal">o</mi><mi mathvariant="normal">d</mi></mrow></mo><mtext></mtext><mtext>W</mtext></mrow><annotation encoding="application/x-tex">
\it x = r \bmod \text W
</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.69444em;vertical-align:0em;"></span><span class="mord"><span class="mord mathit">x</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mord mathit">r</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mspace" style="margin-right:0.05555555555555555em;"></span><span class="mbin"><span class="mord"><span class="mord mathrm">m</span><span class="mord mathrm">o</span><span class="mord mathrm">d</span></span></span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mspace" style="margin-right:0.05555555555555555em;"></span><span class="mord text"><span class="mord">W</span></span></span></span></span></span></span>
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi><mo>=</mo><mrow><mo fence="true"></mo><mfrac><mi>r</mi><mtext>H</mtext></mfrac><mo fence="true"></mo></mrow></mrow><annotation encoding="application/x-tex">
\it y = \left\lfloor\frac{r}{\text H}\right\rfloor
</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.8359999999999999em;vertical-align:-0.686em;"></span><span class="mord"><span class="mord mathit">y</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size2"></span></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.10756em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord text"><span class="mord">H</span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathit">r</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.686em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size2"></span></span></span></span></span></span></span></span></p>
<p>The code equivalent to this in Python is below:</p>
<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kn">import</span> <span class="nn">random</span>
<span class="c1"># r &lt;= 0 &lt;= W*H
</span><span class="n">r</span> <span class="o">=</span> <span class="n">random</span><span class="p">.</span><span class="n">randint</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">W</span><span class="o">*</span><span class="n">H</span><span class="p">)</span><span class="o">-</span><span class="mi">1</span>
<span class="c1"># x = r mod W
</span><span class="n">x</span> <span class="o">=</span> <span class="n">r</span> <span class="o">%</span> <span class="n">W</span>
<span class="c1"># y = floor(r/H); note the special syntax python has for this operation
</span><span class="n">y</span> <span class="o">=</span> <span class="n">r</span> <span class="o">//</span> <span class="n">H</span>
</code></pre></div></div>
<p>So thats 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>
<h2 id="cascading-tile-revealing">Cascading Tile Revealing</h2>
<p>This one is hard to describe;
I am adapting this from <a href="https://leetcode.com/problems/minesweeper/">leetcode.com</a>.
Whenever a player clicks a tile, the following logic should be used:</p>
<ol>
<li>If a mine is revealed, the game is over. (obviously)</li>
<li>If a tile with <em>no</em> adjacent mines is revealed, recursively reveal all eight adjacent tiles.</li>
<li>If a tile with one or more adjacent mines is revealed, display the number of mines next to it.</li>
</ol>
<p>Here is the code in Python for this algorithm.</p>
<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">def</span> <span class="nf">reveal_square</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">board</span><span class="p">,</span> <span class="n">alread_revealed</span><span class="p">):</span>
<span class="c1"># if already checked
</span> <span class="k">if</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">)</span> <span class="ow">in</span> <span class="n">already_revealed</span><span class="p">:</span>
<span class="k">return</span>
<span class="c1"># if it's a bomb
</span> <span class="k">if</span> <span class="n">board</span><span class="p">[</span><span class="n">x</span><span class="p">][</span><span class="n">y</span><span class="p">]</span> <span class="o">==</span> <span class="s">'B'</span><span class="p">:</span>
<span class="n">you_lose</span><span class="p">()</span>
<span class="k">return</span>
<span class="c1"># if the bomb number is more than 0
</span> <span class="n">already_revealed</span><span class="p">.</span><span class="n">append</span><span class="p">((</span><span class="n">nx</span><span class="p">,</span> <span class="n">ny</span><span class="p">))</span>
<span class="c1"># from -1 to 1
</span> <span class="k">for</span> <span class="n">xd</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">):</span>
<span class="k">for</span> <span class="n">yd</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">):</span>
<span class="c1"># skip if it is this the center tile
</span> <span class="k">if</span> <span class="n">x</span><span class="o">+</span><span class="n">xd</span> <span class="o">==</span> <span class="n">x</span> <span class="ow">and</span> <span class="n">y</span><span class="o">+</span><span class="n">yd</span> <span class="o">==</span> <span class="n">y</span><span class="p">:</span>
<span class="k">continue</span>
<span class="c1"># recursively check the adjacent square
</span> <span class="n">reveal</span><span class="p">(</span><span class="n">x</span><span class="o">+</span><span class="n">xd</span><span class="p">,</span> <span class="n">y</span><span class="o">+</span><span class="n">yd</span><span class="p">,</span> <span class="n">board</span><span class="p">,</span> <span class="n">already_revealed</span><span class="p">)</span>
<span class="k">return</span> <span class="n">already_revealed</span>
</code></pre></div></div>
<p>This has no checks for valid squares, but its the general idea.
This function returns an array of tile coordinates which should be revealed.</p>
<h2 id="conclusion">Conclusion</h2>
<p>I wrote this because in the first place because I was writing my own Minesweeper game.
I hope that this helps you with getting the general idea of a Minesweeper game.
The completed version of this game is available on my <a href="https://lamegames.tait.tech/">lamegames</a> site.
Let me know what you think!</p>
<p>Happy hacking!</p>
</article>
</main>
<hr>
<footer>
This page will be mirrored on <a href="https://beta.tait.tech/2020/09/12/minesweeper/">beta.tait.tech</a>.
</footer>
</div>
</body>
</html>

@ -0,0 +1,123 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Curiosity | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Tait Hoyem">
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<div id="wrapper">
<header>
<h1>tait.tech</h1>
<nav>
<a href="/" class="nav-link" >Home</a>
<a href="/blog/" class="nav-link" >Blog</a>
<a href="/ideas/" class="nav-link" >Ideas</a>
<a href="/links/" class="nav-link" >Links</a>
<a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer" >Github</a>
</nav>
</header>
<main>
<article>
<header>
<h1 class="post-title">Curiosity</h1>
<time datetime="20-10-26" class="post-date">Monday, October 26 2020</time>
</header>
<hr>
<p>Curiosity is fundamental to a deep understanding of any subject.
Masters, Ph.Ds, and other fancy name suffixes will never help you
if you dont have the spirit of curiosity burning inside of you.</p>
<p>I was speaking to someone from a journalism major at my school when the subject of hacking arose.
I expected her to know nothing about it, being a journalism student and all, but surprisingly she had something to say about it:</p>
<blockquote>
<p>“The best hackers are the ones who are curious.”</p>
</blockquote>
<p>That struck a cord with me.
It seems to me she has nailed down the difference between the students who care about grades,
and those who want to learn.
These are not necessarily mutually exclusive, but in my experience they often are due to the way education is structured.</p>
<h2 id="my-anecdote">My Anecdote</h2>
<p>In my second semester at SAIT Polytechnic, I took a class entitled <em>Emerging Trends In Technology</em>.
This class was probably the best class I have ever taken.
We had to combine two things:</p>
<ul>
<li><strong>Hard skills</strong>: learning a new hard skill like Angular, Django, or GPG encryption.</li>
<li><strong>Soft skills</strong>: public speaking and presentation of our ideas.</li>
</ul>
<p>Soft skills are not usually my area, but I can do public speaking.
I grew up quite religious, so public speaking was drilled into me young.
I liked to go off script and talk about interesting things I found along the way to the actual point.
My creativity was not usually encouraged.
That said, going off script is useful when teaching and presenting ideas;
it gives a natural air to your breath and an unquestionable confidence in your speech.</p>
<p>This is how we learn: in relationships.
Try explaining ancient Japanese history to a computer science major, or UNIX sockets to an English major and youll see what I mean.
If there is nothing for us to connect the knowledge to, it dissipates.</p>
<p>So why did I do so well in this class?</p>
<p>Our task for the semester was as follows:</p>
<ol>
<li>Learn a new subject (any <em>emerging trend in technology</em>) which you find fascinating.</li>
<li>Give a one minute introduction by week three.</li>
<li>Give a 10 minute non-technical overview by week 8.</li>
<li>Give a 20 minute technical explaination and demo by week 13.</li>
</ol>
<p>This is the only course I have ever taken which lets students imagination run wild.
Their presentation, their rules.
They treated the students like adults who know what they are doing.
What happened? Everyone stopped coming because “Oh no! Presentations!”?</p>
<p>No, exactly the opposite.
There was never more than one student missing.
Every single presentation was at least moderately interesting,
and most students were excited to come to that class.
You could see it in their faces, the way they carried themselves.
Every student picked something unique to their tastes, leaving every student more educated than before.</p>
<p>This class, unlike many others, encouraged the curiosity of the students.
It rewarded those who had unique interests and an ability to sell others on their ideas.</p>
<p>The curiosity and the grades were one.</p>
<h2 id="conclusion">Conclusion</h2>
<p>Although its nice to have a course where these goals align here and there, anyone who has been to collage or university can tell you that is far from the norm.</p>
<p>On the other hand, I never would have started this site if it wasnt for that class alone.
So I thank you, Kitty Wong, for getting me started running my own “research blog” (?)</p>
</article>
</main>
<hr>
<footer>
This page will be mirrored on <a href="https://beta.tait.tech/2020/10/26/curiosity/">beta.tait.tech</a>.
</footer>
</div>
</body>
</html>

@ -0,0 +1,145 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>ZFS NAS Box, Part 2 | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Tait Hoyem">
<meta name="keywords" content="">
<meta name="description" content="How to get ZFS working on a Linux machine and how to try it yourself!">
</head>
<body>
<div id="wrapper">
<header>
<h1>tait.tech</h1>
<nav>
<a href="/" class="nav-link" >Home</a>
<a href="/blog/" class="nav-link" >Blog</a>
<a href="/ideas/" class="nav-link" >Ideas</a>
<a href="/links/" class="nav-link" >Links</a>
<a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer" >Github</a>
</nav>
</header>
<main>
<article>
<header>
<h1 class="post-title">ZFS NAS Box, Part 2</h1>
<time datetime="20-11-15" class="post-date">Sunday, November 15 2020</time>
</header>
<hr>
<p>Back in <a href="/2020/04/12/nas1/">part one of my NAS project</a> I discussed how I wanted to set up my hardware.
Today, I set up the NAS (almost).</p>
<p>There were some hiccup along the way, like learning that M.2 slots can disable some of your SATA ports or waiting a month for a host bus adapter to come in from China.</p>
<h2 id="why-did-it-take-so-long">Why Did It Take So Long</h2>
<p>So it turns out I was going to spend a lot more on this project than I originally anticipated.
I ended up getting a server machine instead of a sleek NAS box.
Here are some of the quick specs:</p>
<ul>
<li>Standard ATX case by Thermaltake.</li>
<li>LSI 9211-8i.</li>
<li>The cheapest HDMI graphics card I could find on Kijiji.</li>
<li>6x 3TB Segate HDDs.</li>
<li>1x 250G Kingston SSD.</li>
<li>AMD Ryzen 5 3600.</li>
<li>MSI B450 Gaming Plus Max.</li>
<li>2x 8GB FlareX 3200Mhz RAM.</li>
<li>1x 16GB Kingston 3200Mhz RAM.</li>
</ul>
<h2 id="zfs">ZFS</h2>
<p>This is how I decided to configure my storage pools.
In hindsight, this was not the best choice for upgrading.
I may change it in the future to a 0+1 setup, but it works for now.</p>
<p>I have 5x 3TB in a RAIDZ2 with one drive not attached for redundancys sake.
How does one setup a ZFS pool. Check this out:</p>
<pre class="terminal">
# zpool create poolname raidz2 \
/dev/by-id/blahblahblah1 \
/dev/by-id/blahblahblah2 \
/dev/by-id/blahblahblah3 \
/dev/by-id/blahblahblah4 \
/dev/by-id/blahblahblah5
</pre>
<p>And zippidy-doo! Weve got a ZFS pool!
We can check its status with <code class="language-plaintext highlighter-rouge">zpool status</code>.</p>
<pre class="terminal">
$ zfs status
pool: raid
state: ONLINE
scan: scrub in progress since Wed Nov 18 18:41:41 2020
1.84T scanned at 8.51G/s, 121G issued at 562M/s, 1.84T total
0B repaired, 6.45% done, 0 days 00:53:25 to go
config:
NAME STATE READ WRITE CKSUM
raid ONLINE 0 0 0
raidz2-0 ONLINE 0 0 0
ata-HGST_HUS724030ALA640_PN2234P8JTNMYY ONLINE 0 0 0
ata-HGST_HUS724030ALA640_PN2234P8JVSXTY ONLINE 0 0 0
ata-HGST_HUS724030ALA640_PN2234P8JXAS8Y ONLINE 0 0 0
ata-HGST_HUS724030ALA640_PN2234P8JXBARY ONLINE 0 0 0
ata-HGST_HUS724030ALA640_PN2234P8JXP77Y ONLINE 0 0 0
errors: No known data errors
</pre>
<p>I had run a scrub right before this, so theres some extra detail in that.
This is really fun! I will be doing more home storage projects soon.
Perhaps Raspberry Pi NAS using all 4 USB ports to load SATA drives on it.
Now that would be fun!</p>
<h2 id="so-i-kinda-have-a-nas-now">So I Kinda Have A NAS Now…?</h2>
<p>So right now I can only copy files with <code class="language-plaintext highlighter-rouge">rsync</code>, <code class="language-plaintext highlighter-rouge">scp</code> and moving data via a physical drive.
The one major disadvantage this has is speed.</p>
<p>Due to this machine being connected directly outside my network and pulling DHCP like a normal router would, I need to send my data through the WAN connection to get my files to it.
This is rather unfortunate as my upload speed is capped at 20 megabits per second, despite my upload being in the 300+ range.</p>
<p>Part 3 will involve a LAN card so I can connect both to the DHCP server of my ISP and my local router.
This way my transfer speeds should be in the range of 1 gigabit per second.
This will make my life much easier, at least on the local network.</p>
<h2 id="fun-fact">Fun Fact!</h2>
<p>Do not try to use the M.2 slot on a consumer motherboard where you are also using all the SATA ports.
On my consumer gaming motherboard, the SATA ports next to the M.2 slot became <em>disabled</em> when I attached the M.2 SSD.
I found this out form my motherboard documentation, which I read only after a week of thinking my motherboard itself was defective, and sending it in for repairs that did absolutely nothing.</p>
<h2 id="thoughts">Thoughts</h2>
<p>I like having all this space. I plan on using it up pretty fast, so Im already looking at how to expand.
Hopefully that gives a decent overview of how I set up my drives.</p>
<p>Happy hacking!</p>
</article>
</main>
<hr>
<footer>
This page will be mirrored on <a href="https://beta.tait.tech/2020/11/15/nas2/">beta.tait.tech</a>.
</footer>
</div>
</body>
</html>

@ -0,0 +1,127 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Getting Pacaur Working on a Raspberry Pi 4 with Manjaro ARM or Arch Linux | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Tait Hoyem">
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<div id="wrapper">
<header>
<h1>tait.tech</h1>
<nav>
<a href="/" class="nav-link" >Home</a>
<a href="/blog/" class="nav-link" >Blog</a>
<a href="/ideas/" class="nav-link" >Ideas</a>
<a href="/links/" class="nav-link" >Links</a>
<a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer" >Github</a>
</nav>
</header>
<main>
<article>
<header>
<h1 class="post-title">Getting Pacaur Working on a Raspberry Pi 4 with Manjaro ARM or Arch Linux</h1>
<time datetime="20-12-01" class="post-date">Tuesday, December 01 2020</time>
</header>
<hr>
<p>I recently installed Manjaro ARM (based on Arch Linux ARM) on a Raspberry Pi 4.
I used some standard commands to start to add the <code class="language-plaintext highlighter-rouge">pacaur</code> package so I can easily retrieve <a href="https://wiki.archlinux.org/index.php/Arch_User_Repository">AUR packages</a> without needing to do it manually.
Unfortunately, there is a small problem with compiling this on ARM.</p>
<h2 id="always_inline">always_inline</h2>
<p>To setup the install for <code class="language-plaintext highlighter-rouge">pacaur</code>, I first needed to download <a href="https://aur.archlinux.org/packages/auracle-git">auracle-git</a> AUR package manually.
I ran into an error when compiling this package.</p>
<p>But first, my setup:</p>
<pre class="terminal">
$ git clone https://aur.archlinux.org/auracle-git
$ cd auracle-git
$ makepkg -sri
</pre>
<p>Around half way through compiling this project, I got this cryptic message telling me there was a “target specific option mismatch”…Whatever that means.
The full error is below, hopefully that helps my chances on the search engines.</p>
<pre class="terminal">
In file included from ../subprojects/abseil-cpp-20200225.2/absl/random/internal/randen_hwaes.cc:225:
/usr/lib/gcc/aarch64-unknown-linux-gnu/9.3.0/include/arm_neon.h: In function 'Vector128 {anonymous}::AesRound(const Vector128&amp;, const Vector128&amp;)':
/usr/lib/gcc/aarch64-unknown-linux-gnu/9.3.0/include/arm_neon.h:12452:1: error: inlining failed in call to always_inline 'uint8x16_t vaesmcq_u8(uint8x16_t)': target specific option mismatch
12452 | vaesmcq_u8 (uint8x16_t data)
</pre>
<p>Luckily, there is a very easy fix for this.
The user redfish <a href="https://aur.archlinux.org/packages/auracle-git#comment-762117">helpfully pointed out</a>
on the <code class="language-plaintext highlighter-rouge">auracle-git</code> package page that you need to add a special make option to your <code class="language-plaintext highlighter-rouge">/etc/make.conf</code> file to make this work.</p>
<p>His solution, as commented is like so:</p>
<blockquote>
<p>If you get this error when building for ARM aarch64:</p>
<p>(insert error message from before)</p>
<p>Then check that in /etc/makepkg.conf CFLAGS and CXXFLAGS have the +crypto suffix in -march flag, like -march=armv8-a+crypto (the base identifier may very depending on your hardware)</p>
</blockquote>
<p>Basically, there is a file on Linux: <code class="language-plaintext highlighter-rouge">/etc/makepkg.conf</code> which tells your computer how to compile <em>all</em> programs on the system.
By default the Manjaro ARM (RPi4) edition has the following relevant lines in <code class="language-plaintext highlighter-rouge">makepkg.conf</code>.</p>
<pre class="file">
CFLAGS="-march=armv8-a -O2 -pipe -fstack-protector-strong -fno-plt"
CXXFLAGS="-march=armv8-a -O2 -pipe -fstack-protector-strong -fno-plt"
</pre>
<p>What Mr. redfish is telling us is that we must add +crypto to the end of the -march compiler flag so that our compiler will know how to inline that pesky vaesmcq_u8 function.</p>
<p>So in the end, your <code class="language-plaintext highlighter-rouge">makepkg.conf</code>s relevant lines will look like so:</p>
<pre class="file">
CFLAGS="-march=armv8-a+crypto -O2 -pipe -fstack-protector-strong -fno-plt"
CXXFLAGS="-march=armv8-a+crypto -O2 -pipe -fstack-protector-strong -fno-plt"
</pre>
<h2 id="why">Why?</h2>
<p>Redfish continues:</p>
<blockquote>
<p>Build of abseil-cpp package works because it uses CMake which adds the correct -march flag regardless of makepkg.conf, whereas when abseil-cpp is build as a subproject within this package, it uses meson, which does not add the flag and thus fails with the above error.</p>
</blockquote>
<p>In other words, one of the dependencies pulled in with auracle is not compiling without this special compiler flag enabled.</p>
<h2 id="conclusion">Conclusion</h2>
<p>Thanks to redfish for posting this solution to the forums!
Wouldve been quite the rabbit hole for me to figure out how to do that.
In fact, it is very likely I would have never figured that one out.</p>
<p>After this issue is resolved, the installation of <code class="language-plaintext highlighter-rouge">pacaur</code> goes as expected. Nice and easy!
Pacuar will compile on any architecture so its smooth sailing from here.</p>
<p>Happy hacking!</p>
</article>
</main>
<hr>
<footer>
This page will be mirrored on <a href="https://beta.tait.tech/2020/12/01/pacaur-rpi/">beta.tait.tech</a>.
</footer>
</div>
</body>
</html>

@ -0,0 +1,234 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Orca, Emacspeak and Chromium Accessibility on A Raspberry Pi Running Manjaro ARM | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Tait Hoyem">
<meta name="keywords" content="orca linux raspberry-pi rpi raspberry pi screen reader screen-reader 64 bit 64-bit 64bit aarch64 emacs emacspeak manjaro manjaro-arm manjaro-aarch64">
<meta name="description" content="">
</head>
<body>
<div id="wrapper">
<header>
<h1>tait.tech</h1>
<nav>
<a href="/" class="nav-link" >Home</a>
<a href="/blog/" class="nav-link" >Blog</a>
<a href="/ideas/" class="nav-link" >Ideas</a>
<a href="/links/" class="nav-link" >Links</a>
<a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer" >Github</a>
</nav>
</header>
<main>
<article>
<header>
<h1 class="post-title">Orca, Emacspeak and Chromium Accessibility on A Raspberry Pi Running Manjaro ARM</h1>
<time datetime="20-12-14" class="post-date">Monday, December 14 2020</time>
</header>
<hr>
<p>I wanted to get a gift for my blind friend who has been interested in learning Linux for a while now.
Just when I was about to start looking for something I decided to take a look at <a href="https://lbry.tv/@Lunduke:e/raspberry-pi-400-looks-rad:c">Brian Lundukes newest video</a> featuring the <a href="https://www.raspberrypi.org/products/raspberry-pi-400/?resellerType=home">Raspberry Pi 400</a>.
The Raspberry Pi 400 has come full circle in terms of computing.
It is a keyboard. All the computing is done from within the keyboard.
Much like the Comodore64, this computer comes without a screen but is still technically fully functional without one.
I had my Aha! moment, and decided that the Raspberry Pi 400 would be a very cool present.</p>
<h2 id="no-headphone-jack">No Headphone Jack</h2>
<p>My first problem was that the Raspberry Pi 400 does not come with a headphone jack,
even though every other Raspberry Pi A/B/B+ board with the exception of the compute modules and Zero series have included one.
That said, the Raspberry Pi audio jacks are also known to crackle and pop due to either bad drivers or cheap manufacturing.</p>
<p>To compensate, I got an external USB audio card.
I ended up going with the <a href="https://www.amazon.ca/DuKabel-ProSeries-Mic-Supported-Headphone-External/dp/B07RS11M1T/">DuKabel USB to 3.5mm Jack Adapter (Amazon)</a>.</p>
<p>There are cheaper options for sure, but when I was looking around Raspberry Pi forums and Amazon reviews, this specific model seemed to come out on top in terms of performance.
It costed me around 40 Canadian dollars.
I figure this isnt too bad considering my friend doesnt need a screen, haha!</p>
<h2 id="distribution">Distribution</h2>
<p>I wanted to choose something which will age well, and run the latest and greatest.
For visually impaired users, the most important piece of software is the screen reader. If the screen reader doesnt work, the rest of the work is toast!
Some Raspberry Pi Orca installation guides <a href="https://techesoterica.com/getting-the-orca-screen-reader-working-on-a-raspberry-pi-4-with-raspbian-buster-and-the-mate-desktop/">like this one</a>,
have actually asked the user to <em>compile Orca from source</em> to get the latest version due to how out-of-date Debians package repositories are.
A distribution which has none of these fusses was top priority,
especially because Orca receives frequent updates.</p>
<p>I decided to go with <a href="https://manjaro.org/download/#raspberry-pi-4-xfce">Manjaro ARM Xfce</a>:</p>
<ul>
<li>Xfce is lightweight.</li>
<li>Runs a 64-bit kernel.</li>
<li>Is based on Arch Linux, so receives very frequent package updates.</li>
<li>Has the AUR (<a href="#aur">with some effort</a>, as well see).</li>
</ul>
<p>The only downside of Manjaro ARM, and likewise other Aarch64 (ARM 64-bit) architecture kernels is that it did not have HEVC nor H264 hardware decoding available.
Apparently, support for the Raspberry Pis VC4 graphics is getting mainlined <a href="https://www.debugpoint.com/2020/12/linux-kernel-5-10-features/">in Linux kernel 5.10</a>.
Unfortunately, running the release candidate (RC) kernel did not make the Raspberry Pi 400 use hardware decoding.
Perhaps other applications like <code class="language-plaintext highlighter-rouge">ffmpeg</code> and Chromium need to add support as well before this works.</p>
<h2 id="orca">Orca</h2>
<p>As stated before, minimum requirement for a visually impaired desktop Linux user is a screen reader.
The most used screen reader for Linux is Orca, headed by the <a href="https://wiki.gnome.org/Projects/Orca">GNOME Project</a>.
This is relatively easy to install with a standard <code class="language-plaintext highlighter-rouge">pacman</code> command.</p>
<pre class="terminal">
# pacman -S orca
</pre>
<p>If logged in via SSH, you can start Orca with the <code class="language-plaintext highlighter-rouge">orca</code> command. This will start reading the screen to you so you can do the next parts.</p>
<p>To activate Orca on login with LightDM, enable it in the LightDM GTK+ Greeter Settings application. The Misc. tab will have a drop-down for asking which screen reader you want to use.
This will start Orca when the LightDM login system starts.</p>
<p>LightDMs Orca will not help us once we are logged in however.
To activate Orca on login, open the Session And Startup application program, then add Orca to the “startup” list of apps.</p>
<p>And now Orca will be activated on boot and login.</p>
<h2 id="aur">AUR</h2>
<p>The AUR, or the Arch User Repository has community maintained and distributed packages.
Basically, you download a file which will tell your computer how to download, build and install a package for you.</p>
<p>To get the AUR working in a more automatic way, we need to install the <code class="language-plaintext highlighter-rouge">pacaur</code> helper.
This merited its own article, so check that out here:
<a href="/2020/12/01/pacaur-rpi/">How to Install Pacaur on Manjaro ARM</a></p>
<p>The TL;DR is that we need to open the <code class="language-plaintext highlighter-rouge">/etc/makepkg.conf</code> file and replace any mention of <code class="language-plaintext highlighter-rouge">-march=armv8-a</code> with <code class="language-plaintext highlighter-rouge">-march=armv8-a+crypto</code>.</p>
<p>This can be done as a oneliner, thanks to the <code class="language-plaintext highlighter-rouge">sed</code> command.</p>
<pre class="terminal">
# sed -i 's/-march=armv8-a/-march=armv8-a+crypto/' /etc/makepkg.conf
</pre>
<h2 id="emacspeak">Emacspeak</h2>
<p><a href="https://www.gnu.org/software/emacs/">Emacs</a> is a scriptable document editor run by the <a href="https://gnu.org/">GNU Project</a>.
Infamous for its high learning curve though it may be,
there is a very extensive speech extension for it called <a href="http://emacspeak.sourceforge.net/">Emacspeak</a>.
Emacspeak is built entirely by <a href="https://tvraman.github.io/vita/resume.html">T. V. Ramen</a> and has been freely available since its inception in 1999.
Due to its age (and thus maturity), Emacspeak is an important tool in any “eyes-free” software developer toolkit.</p>
<p>Lucky for me, Emacspeak appears to not only to be available in the AUR,
but also compilable with the Aarch64 architecture—the architecture of the Raspberry Pi 400.
So this is as easy to install as:</p>
<pre class="terminal">
$ pacaur -S emacspeak
</pre>
<h2 id="web-browsers">Web Browsers</h2>
<p>Ill cover a couple web browsers here based on how they worked.</p>
<h3 id="firefox">Firefox</h3>
<p>Firefox will run in accessibility mode with <a href="https://en.wikipedia.org/wiki/Caret_navigation">caret browsing</a> enabled automatically when it detects Orca is running.
This makes Firefox <em>by far</em> the best browser for the job.</p>
<h3 id="chromium">Chromium</h3>
<p>Chromium… Ugh. So it works, sort of.
You need to enable two special flags, and add an environment variable.</p>
<p>To do this, I suggest editing the main profile in <code class="language-plaintext highlighter-rouge">/etc/profile</code>.
Add the following line to the end of that file:</p>
<pre class="file">
export ENABLE_ACCESSIBILITY=1
</pre>
<p>Next, add two flags to the <code class="language-plaintext highlighter-rouge">$HOME/.config/chromium-flags.conf</code> file.</p>
<pre class="file">
--force-renderer-accessibility
--enable-caret-browsing
</pre>
<p>You will need to relog to set the ENABLE_ACCESSIBILITY environment variable. Now Chromium should work with Orca.</p>
<h3 id="badwolf">Badwolf</h3>
<p>The <a href="https://www.mankier.com/1/badwolf">Badwolf browser</a>
is based on the WebkitGTK engine, as opposed to Firefoxs Gecko and Googles Blink engines.
It <em>almost</em> works out of the box. It is really fast compared to the other two,
but it lacks some features like announcing a page is done loading and it doesnt appear to support caret browsing,
which will cause some other problems.
Interesting though for such a young browser to have a minimal level of accessibility so early!</p>
<p>I would be interested where this goes in the future.</p>
<h2 id="ps">P.S.</h2>
<p>Somehow I forgot that you would need to setup the dummy display driver to work with the graphics without a display attached.
To do this, install the <code class="language-plaintext highlighter-rouge">xf86-video-dummy</code> pacakge:</p>
<pre class="terminal">
# pacman -S xf86-video-dummy
</pre>
<p>Next, override any <code class="language-plaintext highlighter-rouge">/etc/X11/xorg.conf</code> you may have with this:</p>
<pre class="file">
Section "Monitor"
Identifier "Monitor0"
HorizSync 28.0-80.0
VertRefresh 48.0-75.0
# https://arachnoid.com/modelines/
# 1920x1080 @ 60.00 Hz (GTF) hsync: 67.08 kHz; pclk: 172.80 MHz
Modeline "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync
EndSection
Section "Device"
Identifier "Card0"
Driver "dummy"
VideoRam 256000
EndSection
Section "Screen"
DefaultDepth 24
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
SubSection "Display"
Depth 24
Modes "1920x1080_60.00"
EndSubSection
EndSection
</pre>
<p>Now, when you boot, you should head Screen reader on.</p>
<h2 id="conclusion">Conclusion</h2>
<p>It took a bit of messing around to get this working, but Im glad I did!
Now I can nerd out with another Linux friend and given how well they seem to find problems with accessibility, hopefully a few upstream patches can be made.</p>
<p>Happy hacking, for everyone!</p>
</article>
</main>
<hr>
<footer>
This page will be mirrored on <a href="https://beta.tait.tech/2020/12/14/orca-raspberry-pi-manjaro/">beta.tait.tech</a>.
</footer>
</div>
</body>
</html>

@ -0,0 +1,148 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>How to Deploy Lichess's Lila With Nginx | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Tait Hoyem">
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<div id="wrapper">
<header>
<h1>tait.tech</h1>
<nav>
<a href="/" class="nav-link" >Home</a>
<a href="/blog/" class="nav-link" >Blog</a>
<a href="/ideas/" class="nav-link" >Ideas</a>
<a href="/links/" class="nav-link" >Links</a>
<a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer" >Github</a>
</nav>
</header>
<main>
<article>
<header>
<h1 class="post-title">How to Deploy Lichess's Lila With Nginx</h1>
<time datetime="20-12-20" class="post-date">Sunday, December 20 2020</time>
</header>
<hr>
<p>I was getting ready to have a public test of some changes I made to <a href="https://lichess.org">lichess.org</a>s <a href="https://lichess.org/source">open source chess platform</a>.
In preperation, I got my Lets Encrypt certificates and nginx configurations setup…
and it wouldnt work.
Here are some tips for myself and future Lichess developers.</p>
<h2 id="reasoning">Reasoning</h2>
<p>My pull request involves accessibility.
It will extend Lichesss NVUI (Non-Visual User Interface) to be more accessible to beginner level chess players.
At the time of writing this, Lichesss NVUI only supports searching pieces by type, rank and file.
It does not support any kind of interactive board.</p>
<p>I wanted to play chess with a friend of mine who uses a screen reader.
Even though Lichess does indeed have a separate rendering of the page for visually impaired users,
I have heard from a few people that it is not the best.</p>
<p>I dont use a screen reader myself, so I thought having a public latest changes deployed server would work better for testing.
It would certainly work better than getting some of my less computer literate friends to connect to me via VSCode/VPN and view my local repository.</p>
<p>So here is how to deploy it:</p>
<h2 id="setup-a-development-environment">Setup a development environment</h2>
<p>This is described <a href="https://github.com/ornicar/lila/wiki/Lichess-Development-Onboarding">in Lichesss documentation itself</a>.
I will not elaborate further as it is not necessary.</p>
<h2 id="setup-nginx">Setup nginx</h2>
<p>This is the part that stumps most people.
Getting a local development server usually works alright, but once you want to reverse proxy it for security and professionalism purposes, it get more interesting.</p>
<p>Here is the relevant portion of my nginx configuration for lila:</p>
<pre class="file">
server_name chess.tait.tech;
location / {
proxy_pass http://127.0.0.1:9663;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_set_header X-Real-IP $remote_addr;
}
</pre>
<p>This is the config for the lila-ws websocket subdomain:</p>
<pre class="file">
server_name ws.chess.tait.tech;
location / {
proxy_pass http://127.0.0.1:9664;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
</pre>
<p>You will need to deploy these on two virtual hosts.</p>
<h2 id="lila">Lila</h2>
<p><a href="https://github.com/ornicar/lila/">Lila</a> is the name for the main chess server, we need to change a few settings. Here is my git diff for the <code class="language-plaintext highlighter-rouge">conf/base.conf</code> file:</p>
<pre class="file">
- domain = "localhost:9663"
- socket.domains = [ "localhost:9664" ]
+ domain = "chess.tait.tech"
+ socket.domains = [ "ws.chess.tait.tech" ]
asset.domain = ${net.domain}
- asset.base_url = "http://"${net.asset.domain}
+ asset.base_url = "https://"${net.asset.domain}
asset.minified = false
- base_url = "http://"${net.domain}
+ base_url = "https://"${net.domain}
</pre>
<h3 id="lila-ws">Lila-ws</h3>
<p><a href="https://github.com/ornicar/lila-ws/">Lila-ws</a> is the websocket component of Lila.</p>
<p>The most common complaint amongst aspiring Lichess developers is websockets not working.
They constantly get these 101 responses from the websocket,
and it also seems that the websocket returns instead of staying in the pending state as it should be.</p>
<p>Here is how to fix that (in diff format):</p>
<pre class="file">
-csrf.origin = "http://127.0.0.1:9000"
+csrf.origin = "https://chess.tait.tech"
</pre>
<p>You need to tell lila-ws where the websocket requests will be coming from. This is how to do that.</p>
<h2 id="conclusion">Conclusion</h2>
<p>This is not a long article, but just some notes for future me and Lila developers.</p>
</article>
</main>
<hr>
<footer>
This page will be mirrored on <a href="https://beta.tait.tech/2020/12/20/deploy-lichess/">beta.tait.tech</a>.
</footer>
</div>
</body>
</html>

@ -0,0 +1,116 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Lichess Accessibility | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Tait Hoyem">
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<div id="wrapper">
<header>
<h1>tait.tech</h1>
<nav>
<a href="/" class="nav-link" >Home</a>
<a href="/blog/" class="nav-link" >Blog</a>
<a href="/ideas/" class="nav-link" >Ideas</a>
<a href="/links/" class="nav-link" >Links</a>
<a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer" >Github</a>
</nav>
</header>
<main>
<article>
<header>
<h1 class="post-title">Lichess Accessibility</h1>
<time datetime="21-01-31" class="post-date">Sunday, January 31 2021</time>
</header>
<hr>
<p>I wanted to play chess with somebody who used a screen reader, without requiring a screen reader myself;
some sites, like QuintenCs Playroom have a rather poor visual interface for anyone who would like the play the game visually.
<a href="https://lichess.org">Lichess</a> is an free and open-source website for chess players;
it bridges this gap by having two “modes” on the site:
standard mode and accessibility mode.</p>
<h2 id="accessibility-mode">Accessibility Mode</h2>
<p>Accessibility mode is far from perfect on lichess.org.
That said, the idea to separate the sites into different modes was a good call.
It stops the inevitable “this would work well for screen readers but cause visual issues” shenanigans,
or, vice-verse “this looks great but it might be weird with a screen reader”.
This way all the things which affect the visual interface are in one place,
and all things which affect the non-visual user interface (NVUI) are written in another.</p>
<p>In my quest to play chess with visual and non-visual players with both having optimal experiences, I tried Lichess with my friend from <a href="https://melly.tech/">melly.tech</a>.
She pointed out that the method to interface with the board previously was rather poor.
This is because it required an “enter” at the end of each command and the commands tended to read out a row or column of a chessboard not just an individual square.</p>
<p>For example, to list all pieces (or lack thereof) on the e file, I would type the command:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>s e
</code></pre></div></div>
<p>Although this seems good in theory, and its great when you need an entire file, there was no way to get only one square.
In addition, imagine typing to navigate around the board:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>s e1
s f1
s e2
</code></pre></div></div>
<p>For the inexperienced player, it seems to be more convenient to bind some keys and have the user bounce to various buttons, which they can push to say “I want to move this piece”.
This is what I was told anyway.
So I want to work making a system so you could use the following basic keys:</p>
<ul>
<li>left/right/up/down arrow: move on the board.</li>
<li>k/q/r/b/n/p: move to next piece represented by its character in chess notation.</li>
<li>shift + k/q/r/b/n/p: move back to the last piece represented by its character in chess notation.</li>
<li>click/enter/space: select piece to move.</li>
<li>click/enter/space again: move piece here.</li>
<li>m: show where I can move with this piece.</li>
<li>shift+m: show where I can capture with this piece.</li>
<li>1-8: move to rank 1-8; stay on same file.</li>
<li>shift + 1-8: move to file a-h; stay on same rank.</li>
</ul>
<p>This gives a pretty solid basis for playing the game.
One caveat is after you have moved a pawn all the way to the farthest rank, only the destination tile will accept your promotion choice.
Therefore, all the other keys still work on other square, but if you are on the destination square of a promotion q/r/b/n will promote your piece, not jump you to the next/previous one.</p>
<p>This pull request was merged earlier this month:</p>
<h2 id="more-to-come">More To Come</h2>
<p>Next thing I want to do is implement the analysis board.
Right now it is not accessible whatsoever.</p>
<h2 id="help-me">Help Me</h2>
<p>If you are a screen reader user or know about accessibility and want to help make Lichess an awesome chess site for sighted and unsighted players alike,
then send me an email at <a href="mailto:tait@tait.tech">tait@tait.tech</a> and Ill BCC you once I start testing the analysis board.</p>
<p>Happy hacking, yall!</p>
</article>
</main>
<hr>
<footer>
This page will be mirrored on <a href="https://beta.tait.tech/2021/01/31/lichess/">beta.tait.tech</a>.
</footer>
</div>
</body>
</html>

@ -0,0 +1,160 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>The "Quiz Your Friends" XSS Exploit | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Tait Hoyem">
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<div id="wrapper">
<header>
<h1>tait.tech</h1>
<nav>
<a href="/" class="nav-link" >Home</a>
<a href="/blog/" class="nav-link" >Blog</a>
<a href="/ideas/" class="nav-link" >Ideas</a>
<a href="/links/" class="nav-link" >Links</a>
<a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer" >Github</a>
</nav>
</header>
<main>
<article>
<header>
<h1 class="post-title">The "Quiz Your Friends" XSS Exploit</h1>
<time datetime="21-04-04" class="post-date">Sunday, April 04 2021</time>
</header>
<hr>
<p>Note: I have alerted the administrators of this site multiple times about this vulnerability.
One email was sent many years ago, which is more than enough time for <a href="https://en.wikipedia.org/wiki/Responsible_disclosure">responsible disclosure</a>.</p>
<p>Update: They have fixed the vulnerability as of the day of release for this article.</p>
<h2 id="background">Background</h2>
<p>In early 2014, when my “programming” skills consisted of editing web pages with inspect element, I was sent a link from an old friend in a town about 3 hours away.
This was a link to a quiz about them.
I had to answer as many questions right as I could about them and I got a score at the end based on my answers.
It seemed fun enough, so I went for it.
In the following weeks this quiz website became quite a trend amongst my friend group as we all started making quizes to see how well we all knew eachother.</p>
<p>A few weeks into this trend, I was staying at a friends place and told him about this site,
so he goes and creates his own quiz and sends it to all his friends, group chats, Google Plus groups, et cetera.</p>
<h2 id="hackerman">Hackerman</h2>
<p>While filling in my friends survey I thought it would be
funny for them to know it is me without anyone else knowing.
We were young and had <code class="language-plaintext highlighter-rouge">Inspect Element</code>ed a few things together,
so it was a safe bet that an HTML joke would let them know.</p>
<p>I decided to write my name like so: <code class="language-plaintext highlighter-rouge">&lt;b&gt;Steve&lt;/b&gt;</code>.
Steve is in reference to the <a href="https://minecraft.gamepedia.com/Player">main character</a> in the video game Minecraft.</p>
<figure>
<img src="/assets/img/qyf-xss/2-bold.png" />
<figcaption>
<p>Me typing in my name as <span class="mono">&lt;b&gt;Steve&lt;/b&gt;</span>.</p>
</figcaption>
</figure>
<p>Now in theory this should have shown in in the leaderboard as: “&lt;b&gt;Steve&lt;/b&gt;
However, to my horror and excitement, I saw this in the leaderboard:</p>
<figure>
<img src="/assets/img/qyf-xss/3-steve-board.png" />
<figcaption>
<p><span class="mono">&lt;b&gt;Steve&lt;/b&gt;</span> displaying in the leaderboard as bold text: <b>Steve</b></p>
</figcaption>
</figure>
<p>The text “Steve” showed up <strong>in bold</strong> on the leaderboard.
This told me all I needed to know.
How did this happen? You might wonder.</p>
<h3 id="server-side-validation">Server-Side Validation</h3>
<p>Here is a great demonstration why you should do most of your validation on the server side.
As a user, I can edit any of the HTML, CSS, or Javascript your server serves to me.</p>
<p>Quiz your friends uses the <code class="language-plaintext highlighter-rouge">maxlength=20</code> HTML attribute on the name input field.
Imagine trying to fit in a script tag doing anything useful with 20 characters! Dont forget that includes the <code class="language-plaintext highlighter-rouge">&lt;script&gt;</code> tag.
That would leave 13 characters for Javascript.
Although Im sure a genius would be able to <a href="https://code.golf/">code golf</a> that, I know I couldnt.</p>
<p>Now obviously I can edit any HTML that a server has sent to me.
If I open up my inspect element window, I can go ahead and change that <code class="language-plaintext highlighter-rouge">maxlength</code> attribute to anything I want.
Lets change it to 100!</p>
<figure>
<img src="/assets/img/qyf-xss/5-maxlength.png" alt="An image of the Quiz Your Friends name input field with inspect element. THe code reads: &lt;font class=&quot;style6&quot;&gt;&lt;input class=&quot;inputbutton&quot; name=&quot;takername&quot; type=&quot;text&quot; id=&quot;takername&quot; maxlength=&quot;20&quot; width=&quot;425&quot; placeholder=&quot;Your First Name&quot; style=&quot;text-align: center; text-decoration:inherit; font-size:38px;&quot; tabindex=&quot;-1&quot;&gt;&lt;/font&gt;" />
<figcaption>
Manually changing the maxlength attribute.
</figcaption>
</figure>
<p>In theory, there is a way that a site can stop people from just putting in their name of any length: server-side validation.
The server <em>could</em> check to see if the input is too long and reject it if it is.
The Quiz My Friends server has <em>no such checks in place</em>.
Therefore, I can send an almost arbitrary load to them.
Being able to send something potentially very large (more than a few megabytes) is a vulnerability of its own.
Imagine being able to send entire executable programs as your “name” in one of these quizzes?</p>
<h2 id="javascript">Javascript</h2>
<p>So I went on my merry way thinking about ways to use malicious javascript.
Then, I thought that might be mean, so I decided to warn users instead.
I filled in the name with a script tag and a call to <code class="language-plaintext highlighter-rouge">alert()</code> to warn the user about this site.
I edited the max-length attribute to allow me to type a long string like this:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>&lt;script&gt;alert("Don't use this site. It is not secure!");&lt;/script&gt;
</code></pre></div></div>
<p>Sure enough, I got a text from my friend saying: “Tait! I know this is you, why would you do that!”
A bit salty, but who wouldnt be.</p>
<h2 id="cross-site-scripting-xss">Cross-Site Scripting (XSS)</h2>
<p>As my final act, I decided to use a cross-site script that I could edit and have it load with new changes at any time.</p>
<p>I set this as my name:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>&lt;script src="https://tait.tech/assets/js/hacked.js"&gt;&lt;/script&gt;
</code></pre></div></div>
<p>This script pops up a warning, telling the user that the site is insecure and it is now redirecting to an article about the attack.
This script redirects to an <a href="https://tait.tech/2020/04/25/xss/">older post I made</a> about how XSS works.</p>
<h2 id="conclusion">Conclusion</h2>
<p>Watch out for sketchy websites that may be vulnerable to malicious or insecure sites which are ripe for abuse.
Always check that you are using an encrypted connection, HTTPS.
And if you see any messages warning you that a site is not secure and redirecting you to some random site…
Take their info with a grain of salt.</p>
<p>Happy Hacking, literally :)</p>
</article>
</main>
<hr>
<footer>
This page will be mirrored on <a href="https://beta.tait.tech/2021/04/04/quiz-your-friends-xss/">beta.tait.tech</a>.
</footer>
</div>
</body>
</html>

@ -0,0 +1,183 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>UEFI Development On x86 With EDK2 | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Tait Hoyem">
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<div id="wrapper">
<header>
<h1>tait.tech</h1>
<nav>
<a href="/" class="nav-link" >Home</a>
<a href="/blog/" class="nav-link" >Blog</a>
<a href="/ideas/" class="nav-link" >Ideas</a>
<a href="/links/" class="nav-link" >Links</a>
<a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer" >Github</a>
</nav>
</header>
<main>
<article>
<header>
<h1 class="post-title">UEFI Development On x86 With EDK2</h1>
<time datetime="21-04-18" class="post-date">Sunday, April 18 2021</time>
</header>
<hr>
<p>I made this blog so I could remember how to do stuff that had instructions spread around the internet.
So here is how I setup my environment for developing EFI applications.</p>
<h2 id="requirements">Requirements</h2>
<p>On Artix or other Arch-based distros like Manjaro I installed the following packages: <code class="language-plaintext highlighter-rouge">gcc nasm iasl</code></p>
<p>Here is what the packages do:</p>
<ul>
<li>GCC is obviously the GNU Compiler Collection and it allows us to compile C code to machine code.</li>
<li>NASM stands for Netwide Assembler. It is an assembler and disassembler for 32 and 64 bit Intel x86 platforms.</li>
<li>IASL stands for the ACPI Source Language Compiler/Decompiler. This will compile any ACPI calls to our local machines code.</li>
</ul>
<p>We need all these packages to start our (U)EFI journey.
Now that these are installed, lets setup our environment.</p>
<h2 id="building-edk2">Building EDK2</h2>
<p>I used the stable/202011 branch as that is latest stable version of the EDK2 project.</p>
<p>So first lets pull the project:</p>
<p><code class="language-plaintext highlighter-rouge">git clone https://github.com/tianocore/edk2.git</code></p>
<p>Now, lets fetch the tags and switch to the latest stable version:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cd edk2
git fetch
git checkout stable/202011
</code></pre></div></div>
<p>Perfect! Were on stable now! Lets grab all our submodules: <code class="language-plaintext highlighter-rouge">git submodule update --init</code></p>
<p>This will take a bit the first time you do it. But no fear, once thats done, we can finally build the base tools.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>make -C BaseTools
export EDK_TOOLS_PATH=$HOME/Documents/edk2/BaseTools
. edksetup.sh BaseTools
</code></pre></div></div>
<p>Notice we source a file with <code class="language-plaintext highlighter-rouge">.</code> before continuing. This is needed to load some tools and options into our shell for later. The environment variable <code class="language-plaintext highlighter-rouge">EDK_TOOLS_PATH</code> is set so that EDK knows where to find itself later. Now that everything is loaded up, we can modify a config file located at <code class="language-plaintext highlighter-rouge">Conf/target.txt</code>.</p>
<p>The most important options are these, feel free to append them to the end of the file; there is no default value for them.</p>
<pre class="file">
ACTIVE_PLATFORM = MdeModulePkg/MdeModulePkg.dsc
TOOL_CHAIN_TAG = GCC5
# for 64-bit development
TARGET_ARCH = X64
# for 32-bit development
TARGET_ARCH = IA32
# for 32 and 64-bit development
TARGET_ARCH = IA32 X64
# set multithreading to 1 + (2 x # of cores)
MAX_CONCURRENT_THREAD_NUMBER = 9
</pre>
<p>There are other options, but I dont know about them much, so Im just sticking with this for now.</p>
<p>Finally, after all this work, we can build some .efi files. Lets compile the <code class="language-plaintext highlighter-rouge">Helloworld.efi</code> file!
Simply run the <code class="language-plaintext highlighter-rouge">build</code> command in the terminal.
You can find your compiled EFI files by running this <code class="language-plaintext highlighter-rouge">ls</code> command:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ls Build/MdeModule/DEBUG_*/*/HelloWorld.efi
</code></pre></div></div>
<p>This will show all HelloWorld.efi files for all architectures and toolchains (if you decide to change them).</p>
<h2 id="running-in-uefi-shell">Running In UEFI Shell</h2>
<p>Once all this is complete, you will want to run your EFI files.
To do so, lets first add an EFI shell to use at boot.
This will appear as an option in your bootloader, like GRUB, which is what I will show documentation for in this article.</p>
<p>So, first thing is first,
<a href="https://github.com/tianocore/edk2/blob/UDK2018/ShellBinPkg/UefiShell/X64/Shell.efi?raw=true">download and EFI shell file</a>.
Second, move it to a partition (FAT formatted) which can be used for the UEFI.
On my Linux system, this is /boot. On others there may be no FAT filesystem so attach a USB and format it as FAT.
Third, add the <code class="language-plaintext highlighter-rouge">EFI Shell</code> option to your grub boot file.
Substitute hdX with the right hard drive (I did it with trial and error) as when it doesnt work I would hit e on grub and add the <code class="language-plaintext highlighter-rouge">ls</code> GRUB command.
Substitute the gptX with the correct partition, or msdosX if it is a DOS formatted partition table.
My <code class="language-plaintext highlighter-rouge">Shell.efi</code> was placed in /boot/EFI/.</p>
<p><label>/etc/grub.d/40_custom</label></p>
<pre class="file">
menuentry "EFI Shell" {
insmod part_gpt
insmod chain
insmod fat
set root='(hd4,gpt2)'
chainloader /EFI/Shell.efi
}
</pre>
<p>Now regenerate your grub configuration file with <code class="language-plaintext highlighter-rouge">grub-update</code> (Debian-based) or <code class="language-plaintext highlighter-rouge">grub-mkconfig -o /boot/grub/grub.cfg</code> (Other).</p>
<p>Youll know if your shell is working if you see the following text on boot into the EFI shell:</p>
<pre class="terminal">
UEFI Interactive Shell v2.1
EDK II
UEFI v2.4 (EDI II, 0x000100000)
Mapping table:
...
Shell&gt;
</pre>
<h2 id="running-hello-world">Running Hello World</h2>
<p>When we run our <code class="language-plaintext highlighter-rouge">ls</code> command from earlier, remember we saw our <code class="language-plaintext highlighter-rouge">HelloWorld.efi</code> file.
Lets move this file somewhere useful, like for me, <code class="language-plaintext highlighter-rouge">/boot</code>.
Then, once were in our UEFI shell we can run commands:</p>
<pre class="terminal">
Shell&gt; .\HelloWorld.efi
UEFI Hello World!
Shell&gt;
</pre>
<p>And that… All that is how you set up a UEFI development environment.</p>
<h2 id="conclusion">Conclusion</h2>
<p>This took me a long time to figure out.
I needed to scrounge resources from around the internet,
and I had to look at my config files for hours to make sure that I hadnt missed a step that I did without thinking.
I hope this will be useful to you and my future self.</p>
<p>Happy UEFI hacking :)</p>
</article>
</main>
<hr>
<footer>
This page will be mirrored on <a href="https://beta.tait.tech/2021/04/18/uefi-development-environment/">beta.tait.tech</a>.
</footer>
</div>
</body>
</html>

@ -0,0 +1,191 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Pinebook Pro, The Ultimate ARM Laptop | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Tait Hoyem">
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<div id="wrapper">
<header>
<h1>tait.tech</h1>
<nav>
<a href="/" class="nav-link" >Home</a>
<a href="/blog/" class="nav-link" >Blog</a>
<a href="/ideas/" class="nav-link" >Ideas</a>
<a href="/links/" class="nav-link" >Links</a>
<a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer" >Github</a>
</nav>
</header>
<main>
<article>
<header>
<h1 class="post-title">Pinebook Pro, The Ultimate ARM Laptop</h1>
<time datetime="21-06-02" class="post-date">Wednesday, June 02 2021</time>
</header>
<hr>
<p>I recently got my Pinebook Pro.
It was more expensive than I was expecting, coming in at (including shipping and handling) C$335.
I always forget the exchange rate and assume its similar to the U.S. dollar, but it never is, haha!
Anyway, this is just my first impressions and what I did to fix a few issues.</p>
<h2 id="initial-impressions">Initial Impressions</h2>
<p>My first impressions of this are quite good.
I like the keyboard; it is firm and not mushy for the price.
It actually has a similar keyboard to my school-supplied Dell, which I quite enjoyed typing on.
The shell is aluminium and doesnt feel <em>too</em> cheap, but I should note that it sure doesnt feel like a Macbook if thats what youre expecting.
All in all build quality seems pretty good for a product in this price range.
Im actually using it right now to write this article, and Im actually typing faster than I would on my desktop.</p>
<p>The screen is bright enough and has anti-glare applied to it. I can use it with moderate light behind me, but not a sunset. Decent, and I cant even use my phone with a sunset right on it, so thats not a huge loss at all as I think my phone costs more than this haha!</p>
<p>The trackpad is fine.
I dont use the mouse very often, and if I need it Im more likely to bring an external one.
It works for what I need though.
I cant seem to get the glossy protector off the trackpad though so maybe it would be better if I did haha!</p>
<p>The temperatures are okay. I would consider them not ideal.
The left side closer to the hinge can get quite warm when I push it.
To be expected in some respects, but the metal case certainly makes the heat come out fast and hot!
It is also passively cooled, so a bit of heat makes sense and is reasonable.
I wonder if I could mod this to have an active low-profile fan?
A project for later, I suppose.</p>
<p>The keyboard is pretty standard for a 14-inch laptop.
No numpad (except with function key), has F1-12 and media keys using function+F1-12.
Screen brightness, sound up, down and mute, and num and scroll lock.
These seem to work no matter what distribution you have (Ive used Manjaro KDE and Manjaro Sway).
Perhaps this would react differently on Arch for ARM with no key bindings.
Im not sure if this is implemented in software or hardware.</p>
<p>The speakers and very tin-y and do not sound good at all.
That said, they look very replaceable, so Ill look into a mod in the future.
The Pinebook Pro comes with a headphone port, so you could just use that if the sound bothers you.</p>
<h2 id="some-suggestions">Some suggestions</h2>
<p>I had some issues when it first arrived.</p>
<ol>
<li>Reboot did not work. The display would glitch out and show horizontal lines. It would only work after a full shutdown.</li>
<li>Booting would sometimes not work at all. My SD card would sometimes boot, sometimes not. eMMC would sometimes work and sometimes not. Sometimes I would even get to the login screen, or fully logged in before it decided to freeze/hang. I could “drop to console” (Ctrl+Alt+Fx), but it only made my mouse stop showing, it would not actually display a console. This problem was worse when not plugged in.</li>
<li>Performance was not stellar, even for the RK3399.</li>
<li>I dont like the Manjaro logo that displays during boot.</li>
</ol>
<h3 id="dont-use-kde">Dont use KDE</h3>
<p>KDE for me is a bit slow.
It is not a keyboard-driven desktop.
To give it some credit though, it does at least have zoom support built in; this is something I wish other desktops would have enabled by default.
Im looking at your, Xfce.</p>
<p>I switched to Manjaro Sway, which is a Wayland-based i3-like tiling window manager.
Ive used this on my Raspberry Pi 4, and it is by far my preference among other default distro configurations.</p>
<p>This can be done by flashing an SD card with any random Linux distro, then download <a href="">Manjaro Sway ARM for the Pinebook Pro</a>.</p>
<p>Quickly, we should prepare the eMMC. Open <code class="language-plaintext highlighter-rouge">fdisk</code> with your eMMC module and remove all partitions.
If you have issues with this, check if any partition is mounted, unmount it, then try again.
<code class="language-plaintext highlighter-rouge">fdisk</code> is well documented elsewhere, so I wont cover it here.</p>
<p>Once your .xz file is downloaded, <code class="language-plaintext highlighter-rouge">unxz</code> the .xz file downloaded.</p>
<pre class="terminal">
$ cd ~/Downloads
$ unxz Manjaro-Sway-ARM-pbp-20.10.img.xz
</pre>
<p>Not exactly those commands, but close.</p>
<p>Once you have that, flash your eMMC by using <code class="language-plaintext highlighter-rouge">dd</code>.</p>
<pre class="terminal">
# dd if=./Manjaro-Sway-ARM-pbp-20.10.img of=/dev/mmcblkX bs=1M conv=fsync
</pre>
<p>Now remove your SD card.
U-Boot will prefer your SD card over your eMMC, so if you leave it in, it <em>will</em> boot to your SD card.</p>
<h3 id="flash-your-u-boot-bsp">Flash Your U-Boot (BSP)</h3>
<p>U-Boot appeared to be the solution to my other two issues.
I was able to flash a new U-Boot program by using the following commands.
Be sure to run <code class="language-plaintext highlighter-rouge">lsblk</code> beforehand to know which <code class="language-plaintext highlighter-rouge">/dev/emmcblk</code> to write to.
Replace <code class="language-plaintext highlighter-rouge">X</code> with the correct number for your system.</p>
<pre class="terminal">
# pacman -S uboot-pinebookpro-bsp
# dd if=/boot/idbloader.img of=/dev/mmcblkX seek=64 conv=notrunc
# dd if=/boot/uboot.img of=/dev/mmcblkX seek=16384 conv=Notrunc
# dd if=/boot/trust.img of=/dev/mmcblkX seek=24576 conv=notrunc
</pre>
<p>The <code class="language-plaintext highlighter-rouge">dd</code> instructions are printed out after installing the <code class="language-plaintext highlighter-rouge">uboot-pinebookpro-bsp</code> package, so make sure to follow what is printed there if it is different that what I have provided.</p>
<p>After doing this, not only have I since booted 100% of the time,
but my display now works correctly after a reboot without a full shutdown.</p>
<p>Whew! Looking good!!!</p>
<h3 id="maybe-get-some-of-the-accessories">Maybe get some of the accessories</h3>
<p>I didnt buy any accessories from Pine64.
I regret this somewhat.
For one thing, without an accessory to read the eMMC over USB, you need to have a working Linux distro on the SD card to get anywhere with it.
Flashing directly to the eMMC would have saved me a <em>lot</em> of time.</p>
<p>The other accessory I could see the occasional use for is the Ethernet adapter.
When downloading a big update (1GB+), it could be useful to wire in just temporarily.
Not a huge deal, but worth mentioning.</p>
<p>I would also be interested in the other batteries they have available.
Even though it comes with a battery, and I also dont think you can install a second one, I would be interested to see if I could get more life out of it with an improved battery.
If this is a standard battery (Pine64 tends to use standard parts), then I would consider getting it from a supplier as well.</p>
<p>The Pinebook Pro does not come with any HDMI ports.
It comes with a USB type-C port that can be adapted to HDMI.
Or you can get a display that supports USB type-C.
I do not have a display that supports USB type-C, so it might be worth it for me to buy an adapter or find a compatible one more locally.
Shipping from Hong Kong aint cheap.</p>
<h3 id="replace-the-boot-logo">Replace the boot logo</h3>
<p>The boot splash screen can be replaced, but I havent figured out how yet.
I will post an update to the blog when I do find out.</p>
<h2 id="conclusion">Conclusion</h2>
<p>I really want to use the Pinebook Pro more.
Pine64 do a lot for the open-source community and they do their best to use only open hardware.
They do fail in some respects, but they do much better than the mainline distributors like Dell, HP or ASUS.</p>
<p>Thanks, Pine64! Im excited to use your products!</p>
<p>Happy ARM hacking :)</p>
</article>
</main>
<hr>
<footer>
This page will be mirrored on <a href="https://beta.tait.tech/2021/06/02/pinebook-pro/">beta.tait.tech</a>.
</footer>
</div>
</body>
</html>

@ -0,0 +1,105 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>UEFI Audio Protocol & UEFI BIOS Accessibility | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Tait Hoyem">
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<div id="wrapper">
<header>
<h1>tait.tech</h1>
<nav>
<a href="/" class="nav-link" >Home</a>
<a href="/blog/" class="nav-link" >Blog</a>
<a href="/ideas/" class="nav-link" >Ideas</a>
<a href="/links/" class="nav-link" >Links</a>
<a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer" >Github</a>
</nav>
</header>
<main>
<article>
<header>
<h1 class="post-title">UEFI Audio Protocol & UEFI BIOS Accessibility</h1>
<time datetime="21-06-21" class="post-date">Monday, June 21 2021</time>
</header>
<hr>
<p>Good news about the state of accessibility in the BIOS!</p>
<h2 id="preamble">Preamble</h2>
<p>On my <a href="/ideas/">ideas page</a>, I have always had up the idea of an accessibility layer for blind people to be able to use their BIOS.
Although it targets a very small percentage of the population,
computer programming is often at least a hobby of visually imapired individuals as it is (mostly) a text-based job:
You write code in plain text, then run it to get either plain text or some kind of HTML output.
Mostly an accessible career for those who cannot see.
That said, there has always been an issue with low-level computer infrastructure (i.e. the BIOS/UEFI).
These menus—which let you edit your boot order, RAM timings, CPU and GPU overclocking and sometimes even fan speed—they were completely inaccessible to those who could not see them.
Well, until… soon. I had a talk with one of the big bois working on EDK2, the UEFI implementation which is used by most motherboard vendors to create their firmware.
I thought I would share the info I understand, and the conversation in full.</p>
<h2 id="news">News</h2>
<p>Here is what I know:</p>
<ol>
<li>This year, the GSoC (Google Summer of Code) project had <a href="https://summerofcode.withgoogle.com/projects/#6499615798460416">a submission of Ethin Probst</a> to implement VirtIO audio drivers for EDK2.</li>
<li><a href="https://qemu.org">QEMU</a>, the emulator that was chosen to test for this project does not have VirtIO support (yet). I havent found info on when this will be done.</li>
<li>Because of 2, Ethin and his mentors for his project, Ray Ni and Leif Lindholm decided to first implement USB-dongle audio support first, as this is a) supported in QEMU, and b) is good enough to start squashing bugs at the audio level.</li>
<li>Because GSoC is usually over around September, there will likely be some more news coming soon!</li>
</ol>
<h2 id="the-irc-chat">The IRC Chat</h2>
<p>Here is the log of the IRC chat for anyone who is interested in anything I might have missed:</p>
<pre class="terminal">
tait_dot_tech: Hello there, I'm new to IRC so just checking my messages are coming through.
tait_dot_tech: Looks light it's alright. Ok so I have a question: does anyone know of an active project looking at making UEFI accessible to the blind (i.e. speec) [sic] from within the UEFI environment? Main concern is having blind users be able to boot Linux USBs (I know, very niche thing), but depending on how good it is, could potentially be used to allow blind individuals to change their overclocking,
tait_dot_tech: hardware RAID, boot order, RAM timings, etc. all on their own. Just wondering if there is any project doing this? I have tried my best to find anything, and am just trying not to duplicate effort. Thanks :)
leiflindholm: tait_dot_tech: we have a google summer of code project running this year, prototyping a standard for audio output. To hopefully be added to the UEFI specification in the future.
leiflindholm: once we have a standard for audio output, we can work on adding support for audio output to the Human Interface Infrastructure
leiflindholm: which is the thing that lets menus be loaded and displayed independent of specific graphical implementation
tait_dot_tech: Oh wow! Glad to hear there is progress on this! Is there a link to the Google summer of code project, or anything else where I can keep tabs?
leiflindholm: tait_dot_tech: there isn't much yet, we're only on week 3 of GSoC.
leiflindholm: https://summerofcode.withgoogle.com/projects/#6499615798460416 is the link if it's something you want to point others to, but any discussion/reporting is likely to hapen [sic] on our mailing lists
tait_dot_tech: By "our" mailing list, do you mean GSoC, or Edk2?
leiflindholm: edk2
leiflindholm: although, on average, at least 99% of edk2-devel will *not* be about audio support
leiflindholm: When we have anything interesting to say, we'll also post to edk2-discuss/edk2-announce
tait_dot_tech: Sweet! I'll join that one just in case! I'd be happy to test anything in beta-ish state and report back with any device I can get my hands on. Is that the right list to watch for hepling test it out?
leiflindholm: I'd say so.
leiflindholm: The original plan was to start with wirtio [sic] audio support, so anyone could help out anywhere, but that support is not yet upstream in qemu. So for now we're working on an [sic] USB audio class driver. That will certainly be useful to have more people testing with different equipment once we have something working.
tait_dot_tech: Ahh! So if I want to test, I should get a USB audio dongle. Gotcha! Thank you so much! You've been super helpful!
leiflindholm: np :)
</pre>
<p>Things are (slowly) looking up for audio (and eventually screen-reader support) in UEFI!
Phew! Glad Im not the only one thinking about this!</p>
<p>Happy UEFI hacking :)</p>
</article>
</main>
<hr>
<footer>
This page will be mirrored on <a href="https://beta.tait.tech/2021/06/21/uefi-audio/">beta.tait.tech</a>.
</footer>
</div>
</body>
</html>

File diff suppressed because one or more lines are too long

@ -0,0 +1,335 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>How To Produce Semantically Correct MathML From XaTeX/LaTeX (and other accessibility ideas) | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Tait Hoyem">
<meta name="keywords" content="">
<meta name="description" content=""><link rel="stylesheet" href="/assets/css/katex.css">
</head>
<body>
<div id="wrapper">
<header>
<h1>tait.tech</h1>
<nav>
<a href="/" class="nav-link" >Home</a>
<a href="/blog/" class="nav-link" >Blog</a>
<a href="/ideas/" class="nav-link" >Ideas</a>
<a href="/links/" class="nav-link" >Links</a>
<a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer" >Github</a>
</nav>
</header>
<main>
<article>
<header>
<h1 class="post-title">How To Produce Semantically Correct MathML From XaTeX/LaTeX (and other accessibility ideas)</h1>
<time datetime="21-09-18" class="post-date">Saturday, September 18 2021</time>
</header>
<hr>
<p>During a recent run-in with the Simon Fraser Fraser University accessibility department,
I learned that theyre writers are so well-trained as to write “image” where a simple diagram is shown,
and “print out picture of output” where a piece of code lies.
I figure the geniuses over there could use some help creating files for the visually impaired.
Heres a quick guide!</p>
<h2 id="diagrams">Diagrams</h2>
<p>Most unexplained diagrams I saw were ones which mirrored classic computer-science imagery;
these diagrams, for the most part, were not complex nor exotic;
they are straight-forward to explain in writing,
or easy to turn into a table.
Ill show two examples here,
one will show a visual aide in relation to stacks and queues,
and the other will show a memory representation of a stack.
Both of these were explained as “image” to the student.</p>
<h2 id="stacks">Stacks</h2>
<p>Diagram 1:</p>
<figure>
<img src="/assets/img/access1/stack.png" alt="image...lol! Just kidding, will explain it below w/ table" />
<figcaption>Simple diagram explaining the push/pop process. Source: <a href="https://stackoverflow.com/questions/32151392/stacks-queues-and-linked-lists">Stackoverflow</a></figcaption>
</figure>
<p>Ok, so here we have a diagram showing the pushing and popping process of a stack.
Now, “image” is hardly sufficient to explain this, so lets try it with text.
I wont finish it because it gets unwieldy very fast:</p>
<blockquote>
<p>A diagram showing a stack. It starts with the operation “Push A”, and now the stack contains the variable “A”; now the stack pushes “B”, which displays now “B” on top of “A”…</p>
</blockquote>
<p>This is no solution.
It is hard to explain this correctly and accurately without being extremely verbose and frankly, confusing—this defeats the whole purpose of describing the image.
The good news, is that computer science diagrams especially tend to lean towards being tabular data.
Now to be clear, something does not need to look like a table to be tabular data;
this image happens to look almost like a table if you squinted hard enough,
but many data not written down in a table, are still “tabular data”.
I will show an example of that next!
For now though, here is the same idea, same data without words:</p>
<table>
<thead>
<tr>
<th>Operator</th>
<th>Stack Values</th>
</tr>
</thead>
<tbody>
<tr>
<td>Push A</td>
<td>[A]</td>
</tr>
<tr>
<td>Push B</td>
<td>[B, A]</td>
</tr>
<tr>
<td>Push C</td>
<td>[C, B, A]</td>
</tr>
<tr>
<td>Push D</td>
<td>[D, C, B, A]</td>
</tr>
<tr>
<td>Pop D</td>
<td>[C, B, A]</td>
</tr>
</tbody>
</table>
<p>Now this diagram does imply you can pop other items, like “Pop A”, which is just not true.
But thats the fault of the diagram, not the representation of it.</p>
<p>Here is the raw text equivalent (in Markdown):</p>
<pre>
Operator|Stack Values
---|---
Push A|[A]
Push B|{B, A]
Push C|[C, B, A]
Push D|[D, C, B, A]
Pop (D)|[C, B, A]
</pre>
<h2 id="stacks-in-memory">Stacks in Memory</h2>
<p>So I couldnt find a good non-copyright image of a stack in memory, but Ill write it down here in plain text, and you should get the idea.
Now again, remember this is still labeled “image” to the student,
they do not have access to a text version of this.</p>
<pre>
( ) ( ( ( ) ) ) ( ) ( ( ) ( ( )
1 0 1 2 3 2 1 0 1 0 1 2 1 2 3 2
</pre>
<p>Now, someone who looks at this can probably see that the number goes up for a left parenthesis, and down for a right parenthesis.
“Image”, however, does not handle the detail.
The issue here is a transcriber is likely to want to transcribe this as <em>text</em>.
But its really not.
This is again, tabular data, which is best represented in a table.</p>
<p>Table of this:</p>
<table>
<thead>
<tr>
<th>Character</th>
<th>Counter</th>
</tr>
</thead>
<tbody>
<tr>
<td>(</td>
<td>1</td>
</tr>
<tr>
<td>)</td>
<td>0</td>
</tr>
<tr>
<td>(</td>
<td>1</td>
</tr>
<tr>
<td>(</td>
<td>2</td>
</tr>
<tr>
<td>(</td>
<td>3</td>
</tr>
<tr>
<td>)</td>
<td>2</td>
</tr>
<tr>
<td>)</td>
<td>1</td>
</tr>
<tr>
<td>)</td>
<td>0</td>
</tr>
<tr>
<td>(</td>
<td>1</td>
</tr>
<tr>
<td>)</td>
<td>0</td>
</tr>
<tr>
<td>(</td>
<td>1</td>
</tr>
<tr>
<td>(</td>
<td>2</td>
</tr>
<tr>
<td>)</td>
<td>1</td>
</tr>
<tr>
<td>(</td>
<td>2</td>
</tr>
<tr>
<td>(</td>
<td>3</td>
</tr>
<tr>
<td>)</td>
<td>2</td>
</tr>
</tbody>
</table>
<p>Raw text in markdown:</p>
<pre>
Character|Counter
---|---
(|1
)|0
(|1
(|2
(|3
)|2
)|1
)|0
(|1
)|0
(|1
(|2
)|1
(|2
(|3
)|2
</pre>
<p>Insanely simple!
Look for clues of tabular data.
Things which have a one to one correspondence of any kind can usually be represented as a table, even if its only “aligned” on the slide or note.</p>
<h2 id="math-expressions--mathml">Math Expressions &amp; MathML</h2>
<p>Here is a more complex example:
using math within a presentation.</p>
<p>Lets take for example the mathematical expression <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>16</mn><mo>=</mo><msup><mn>2</mn><mn>4</mn></msup></mrow><annotation encoding="application/x-tex">16 = 2^{4}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.64444em;vertical-align:0em;"></span><span class="mord">16</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.8141079999999999em;vertical-align:0em;"></span><span class="mord"><span class="mord">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141079999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">4</span></span></span></span></span></span></span></span></span></span></span></span>. This is a very simple math expression that completely breaks in some cases.
When converting some math expressions to text, it will convert that expression as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>16</mn><mo>=</mo><mn>24</mn></mrow><annotation encoding="application/x-tex">16 = 24</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.64444em;vertical-align:0em;"></span><span class="mord">16</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.64444em;vertical-align:0em;"></span><span class="mord">24</span></span></span></span>, erasing the superscript to denote the exponent.</p>
<p>This gets even worse with large mathematical expressions like this:</p>
<p><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mtext>B2U</mtext><mo stretchy="false">(</mo><mi>X</mi><mo stretchy="false">)</mo><mo>=</mo><munderover><mo></mo><mrow><mi>i</mi><mo>=</mo><mn>0</mn></mrow><mrow><mi>w</mi><mo></mo><mn>1</mn></mrow></munderover><msub><mi>x</mi><mi>i</mi></msub><mo>×</mo><msup><mn>2</mn><mi>i</mi></msup></mrow><annotation encoding="application/x-tex">
\text{B2U}(X) = \sum_{i=0}^{w-1} x_{i} \times 2^{i}
</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord text"><span class="mord">B2U</span></span><span class="mopen">(</span><span class="mord mathdefault" style="margin-right:0.07847em;">X</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:3.0787820000000004em;vertical-align:-1.277669em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.8011130000000004em;"><span style="top:-1.872331em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathdefault mtight">i</span><span class="mrel mtight">=</span><span class="mord mtight">0</span></span></span></span><span style="top:-3.050005em;"><span class="pstrut" style="height:3.05em;"></span><span><span class="mop op-symbol large-op"></span></span></span><span style="top:-4.300005em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathdefault mtight" style="margin-right:0.02691em;">w</span><span class="mbin mtight"></span><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:1.277669em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord"><span class="mord mathdefault">x</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.31166399999999994em;"><span style="top:-2.5500000000000003em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathdefault mtight">i</span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">×</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span></span><span class="base"><span class="strut" style="height:0.8746639999999999em;vertical-align:0em;"></span><span class="mord"><span class="mord">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8746639999999999em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathdefault mtight">i</span></span></span></span></span></span></span></span></span></span></span></span></span></p>
<p>Here is what I get by extracting the text from the PDF:</p>
<pre>
B2U(X ) =
w-1
Σ xi •2
i=0
i
</pre>
<p>And this is generous, as the sigma sign, bullet point, equal sign and minus sign were for some reason not UTF-8 encoded so it displayed as a chat sign emoji, down arrow, video camera and book sign respectively.
Not sure about you, but I certainly cant get the equation out of that mess.</p>
<p>These can be written in LaTeX, then converted to MathML (an accessible math format) using <a href="https://katex.org">KaTeX</a>.
Heres an example of what to write to product the function above:</p>
<pre>
\text{B2U}(X) = \sum_{i=0}^{w-1} x_{i} \times 2^{i}
</pre>
<p>For someone who is doing transcription as a <em>job</em> for visually impaired students,
I would go so far as to say to learn this is a necessity.</p>
<ol>
<li>Its not difficult. You can learn the vast majority of LaTeX math syntax in an afternoon.</li>
<li>Its easier for <em>everyone</em> to read. Especially with KaTeX. KaTeX is able to convert the formula to both MathML for screenreader users and HTML markup for people who just want to see those fancy math expressions.</li>
</ol>
<p>Likely, the teacher is already using some LaTeX derivative to create the math in the first place,
they might as well use a program like KaTeX, MathJax or likewise to convert it to MathML.</p>
<h2 id="code--output">Code &amp; Output</h2>
<p>How did it even happen that entire programs and outputs were just ignored with the label “picture of output” is beyond me.
Everything should be transcribed.
Whoever transcribed that document should be fired.</p>
<h2 id="conclusion">Conclusion</h2>
<p>To teachers:</p>
<p>Presenting information in plain text, or at least having alternates forms of images, diagrams and math formulas makes education better for everyone, not just blind students.
It makes it better for people running on cheaper devices which may not handle running heavy software like Microsoft PowerPoint;
it makes it better for people who use operating systems other than MacOS and Windows (this is especially important in the technology sector, where Linux/BSD users make up a sizeable minority of users);
and finally, it makes it easier to search through the content of all notes at once using simple text-manipulation tools.</p>
<p>To accessibility departments:</p>
<p>Running a <code class="language-plaintext highlighter-rouge">pdftotext</code> program, or simply transcribing handwritten notes is not enough to properly describe slides and notes—handwritten or not.
Every diagram, math equation, annotation, piece of code or output—every single thing must be transcribed to plain text, or some alternate format like MathML.</p>
<p>I find it sad that a student (with their own full-time job) can product better work than someone who has this job exclusively at a major university.
Perhaps I am mistaken and the university has volunteers do this work.
In that case I guess you cant ask for too much, but somehow I feel like this is probably not the case.</p>
<p>Big sad.</p>
</article>
</main>
<hr>
<footer>
This page will be mirrored on <a href="https://beta.tait.tech/2021/09/18/how-to-generate-proper-content-mathml-from-katex-or-latex/">beta.tait.tech</a>.
</footer>
</div>
</body>
</html>

@ -0,0 +1,70 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>New Company | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Tait Hoyem">
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<div id="wrapper">
<header>
<h1>tait.tech</h1>
<nav>
<a href="/" class="nav-link" >Home</a>
<a href="/blog/" class="nav-link" >Blog</a>
<a href="/ideas/" class="nav-link" >Ideas</a>
<a href="/links/" class="nav-link" >Links</a>
<a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer" >Github</a>
</nav>
</header>
<main>
<article>
<header>
<h1 class="post-title">New Company</h1>
<time datetime="21-11-30" class="post-date">Tuesday, November 30 2021</time>
</header>
<hr>
<p>In my accidental quest to create accessible diagrams to a computer science student I have been contracting for,
I found in the post-secondary field a massive lack of care given to the topic of accessible diagrams,
even when they are relatively easy to create.
For example, a binary tree, or any tree structure actually has <a href="https://www.w3.org/WAI/GL/wiki/Using_ARIA_trees">native <code class="language-plaintext highlighter-rouge">aria-role</code> attributes</a> to alert a screen reader to the presence of a tree object.
A tree is only a list of lists after all.</p>
<h2 id="what-im-doing-now">What Im Doing Now</h2>
<p>Although I sort of thought my career was going in a different direction after starting a full-time job in August,
I think Im the right guy to create a good system for this.
I will be using my existing company <a href="https://bytetools.ca/">Bytetools</a> to create and sell these tools to universities.
It will be all open-source (GPLv3), but access to a website that I maintain for an institution will cost a bunch of money that only a university can afford.</p>
<p>Side note: This is how to make money with open source:
Create the software (free and libre), then host the software for a monthly fee.
<a href="https://www.invoiceninja.com/">Invoice Ninja</a> uses this strategy, and I think it strikes the appropriate balance between the need to live off of something you care about and creating free and open-source software.
For the <em>vast</em> majority of people it makes more sense for them to purchase a subscription to your site than to find someone who can setup a website for them alone.</p>
<p>So, here goes nothing…</p>
</article>
</main>
<hr>
<footer>
This page will be mirrored on <a href="https://beta.tait.tech/2021/11/30/new-company/">beta.tait.tech</a>.
</footer>
</div>
</body>
</html>

@ -1,170 +1,29 @@
Creative Commons Attribution-ShareAlike 4.0 International
Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible.
Using Creative Commons Public Licenses
Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses.
Considerations for licensors: Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. More considerations for licensors.
Considerations for the public: By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensors permission is not necessary for any reasonfor example, because of any applicable exception or limitation to copyrightthen that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described.
Although not required by our licenses, you are encouraged to respect those requests where reasonable. More considerations for the public.
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.
Section 1 Definitions.
a. Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.
b. Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License.
c. BY-SA Compatible License means a license listed at creativecommons.org/compatiblelicenses, approved by Creative Commons as essentially the equivalent of this Public License.
d. Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
e. Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements.
f. Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.
g. License Elements means the license attributes listed in the name of a Creative Commons Public License. The License Elements of this Public License are Attribution and ShareAlike.
h. Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License.
i. Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.
j. Licensor means the individual(s) or entity(ies) granting rights under this Public License.
k. Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.
l. Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.
m. You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning.
Section 2 Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
A. reproduce and Share the Licensed Material, in whole or in part; and
B. produce, reproduce, and Share Adapted Material.
2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.
3. Term. The term of this Public License is specified in Section 6(a).
4. Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material.
5. Downstream recipients.
A. Offer from the Licensor Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.
B. Additional offer from the Licensor Adapted Material. Every recipient of Adapted Material from You automatically receives an offer from the Licensor to exercise the Licensed Rights in the Adapted Material under the conditions of the Adapters License You apply.
C. No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.
6. No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this Public License.
3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties.
Section 3 License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the following conditions.
a. Attribution.
1. If You Share the Licensed Material (including in modified form), You must:
A. retain the following if it is supplied by the Licensor with the Licensed Material:
i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of warranties;
v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and
C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License.
2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.
3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable.
b. ShareAlike.In addition to the conditions in Section 3(a), if You Share Adapted Material You produce, the following conditions also apply.
1. The Adapters License You apply must be a Creative Commons license with the same License Elements, this version or later, or a BY-SA Compatible License.
2. You must include the text of, or the URI or hyperlink to, the Adapter's License You apply. You may satisfy this condition in any reasonable manner based on the medium, means, and context in which You Share Adapted Material.
3. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, Adapted Material that restrict exercise of the rights granted under the Adapter's License You apply.
Section 4 Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database;
b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material, including for purposes of Section 3(b); and
c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
Section 5 Disclaimer of Warranties and Limitation of Liability.
a. Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.
b. To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.
c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.
Section 6 Term and Termination.
a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.
b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or
2. upon express reinstatement by the Licensor.
c. For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.
d. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.
e. Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
Section 7 Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.
Section 8 Interpretation.
a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.
c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.
d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.
Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at creativecommons.org/policies, Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses.
Creative Commons may be contacted at creativecommons.org.
BSD 3-Clause License
Copyright (c) 2020, Tait Hoyem
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

@ -1,3 +1,23 @@
# site
# tait.tech
The uncompiled version of my website. Compiled files in _site
Files to serve to NGINX (original code contained in tait.tech repository).
### To compile
To compile the files, simply use the bundle Ruby gem.
```
bundle exec jekyll build
```
to compile once. If you decide you want to actually have changes appear instantly, use the following
```
bundle exec jekyll watch
```
To run a local web server to view the changes on:
```
bundle exec jekyll server -w
```
This will watch for the latest changes, compile them, and make them available on localhost:4000

@ -0,0 +1,45 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>About | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Tait Hoyem">
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<div id="wrapper">
<header>
<h1>tait.tech</h1>
<nav>
<a href="/" class="nav-link" >Home</a>
<a href="/blog/" class="nav-link" >Blog</a>
<a href="/ideas/" class="nav-link" >Ideas</a>
<a href="/links/" class="nav-link" >Links</a>
<a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer" >Github</a>
</nav>
</header>
<main>
<h1 id="tait-hoyem">Tait Hoyem</h1>
<p>I believe in three fundamentals</p>
</main>
<hr>
<footer>
This page will be mirrored on <a href="https://beta.tait.tech/about/">beta.tait.tech</a>.
</footer>
</div>
</body>
</html>

@ -0,0 +1,9 @@
body { background-color: #222222; color: #ffffff; font-family: -apple-system, helvetica, arial, sans-serif; line-height: 1.5em; padding: .25em; }
a { color: #7ad; }
a:visited { color: #ff3492; }
h1, h2 { text-align: center; }
/*# sourceMappingURL=book.css.map */

@ -0,0 +1,16 @@
{
"version": 3,
"file": "book.css",
"sources": [
"book.scss",
"_sass/book.scss",
"_sass/vars.scss"
],
"sourcesContent": [
"@import \"book\";\n",
"@import \"vars\";\n\nbody {\n background-color: $background-color;\n color: $normal-text-color;\n font-family: -apple-system, helvetica, arial, sans-serif;\n line-height: $line-height;\n padding: .25em;\n}\na {\n color: $link-color;\n}\na:visited {\n color: $visited-link-color;\n}\nh1, h2 {\n text-align: center;\n}\n",
"$normal-text-color: #ffffff;\n$background-color: #222222;\n$lighter-color: #ffffff;\n$nav-link-color: #ffffff;\n$nav-link-hover-color: black;\n$link-color: #7ad;\n$visited-link-color: #ff3492;\n$last-p-padd: 1.5em;\n$nav-padd: 1em;\n$line-under: 1px solid #aaa; \n$line-height: 1.5em;\n$term-line-height: 1em;\n$file-line-height: 1.2em;\n$terminal-bg: #000000;\n$terminal-fg: #00FF00;\n$file-bg: #444444;\n$file-fg: #ffffff;\n"
],
"names": [],
"mappings": "ACEA,AAAA,IAAI,CAAC,EACH,gBAAgB,ECFC,OAAO,EDGxB,KAAK,ECJa,OAAO,EDKzB,WAAW,EAAE,2CAA2C,EACxD,WAAW,ECIC,KAAK,EDHjB,OAAO,EAAE,KAAK,GACf;;AACD,AAAA,CAAC,CAAC,EACA,KAAK,ECLM,IAAI,GDMhB;;AACD,AAAA,CAAC,CAAC,OAAO,CAAC,EACR,KAAK,ECPc,OAAO,GDQ3B;;AACD,AAAA,EAAE,EAAE,EAAE,CAAC,EACL,UAAU,EAAE,MAAM,GACnB"
}

@ -0,0 +1,80 @@
/* code highlghting */
.highlight .hll { background-color: #ffffcc }
.highlight { background: #f0f0f0; }
.highlight .c { color: #60a0b0; font-style: italic } /* Comment */
.highlight .err { border: 1px solid #FF0000 } /* Error */
.highlight .k { color: #007020; font-weight: bold } /* Keyword */
.highlight .o { color: #666666 } /* Operator */
.highlight .ch { color: #60a0b0; font-style: italic } /* Comment.Hashbang */
.highlight .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #007020 } /* Comment.Preproc */
.highlight .cpf { color: #60a0b0; font-style: italic } /* Comment.PreprocFile */
.highlight .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
.highlight .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #A00000 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #FF0000 } /* Generic.Error */
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.highlight .gi { color: #00A000 } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.highlight .gt { color: #0044DD } /* Generic.Traceback */
.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #007020 } /* Keyword.Pseudo */
.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #902000 } /* Keyword.Type */
.highlight .m { color: #40a070 } /* Literal.Number */
.highlight .s { color: #4070a0 } /* Literal.String */
.highlight .na { color: #4070a0 } /* Name.Attribute */
.highlight .nb { color: #007020 } /* Name.Builtin */
.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
.highlight .no { color: #60add5 } /* Name.Constant */
.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */
.highlight .ne { color: #007020 } /* Name.Exception */
.highlight .nf { color: #06287e } /* Name.Function */
.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */
.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #bb60d5 } /* Name.Variable */
.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #40a070 } /* Literal.Number.Bin */
.highlight .mf { color: #40a070 } /* Literal.Number.Float */
.highlight .mh { color: #40a070 } /* Literal.Number.Hex */
.highlight .mi { color: #40a070 } /* Literal.Number.Integer */
.highlight .mo { color: #40a070 } /* Literal.Number.Oct */
.highlight .sa { color: #4070a0 } /* Literal.String.Affix */
.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */
.highlight .sc { color: #4070a0 } /* Literal.String.Char */
.highlight .dl { color: #4070a0 } /* Literal.String.Delimiter */
.highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
.highlight .s2 { color: #4070a0 } /* Literal.String.Double */
.highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */
.highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
.highlight .sx { color: #c65d09 } /* Literal.String.Other */
.highlight .sr { color: #235388 } /* Literal.String.Regex */
.highlight .s1 { color: #4070a0 } /* Literal.String.Single */
.highlight .ss { color: #517918 } /* Literal.String.Symbol */
.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #06287e } /* Name.Function.Magic */
.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */
.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */
.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */
.highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */
.highlight .il { color: #40a070 } /* Literal.Number.Integer.Long */
/* ADDED CUSTOM */
.highlight .n { color: #000; } /* General name */
div.highlight {
padding: 0px 12px;
width: 85%;
margin: auto;
overflow-x: scroll;
}

File diff suppressed because one or more lines are too long

@ -0,0 +1,3 @@
textarea { width: 100%; height: 300px; overflow-y: scroll; }
/*# sourceMappingURL=markdown.css.map */

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save