From 6d138a58f1ab9663154767047bcd34b717d5ccf7 Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Tue, 27 Aug 2019 12:52:46 -0400 Subject: [PATCH] github cleanup --- _posts/2019-08-27-GitHub-cleanup.md | 48 +++++ _posts/WIP-2019-08-25-Crypto-my-thoughts.md | 9 + _site/about/index.html | 2 +- _site/blog/2018/06/27/becomeranter.html | 2 +- _site/blog/2019/04/30/frc-languages.html | 2 +- .../05/27/building-safe-vision-comms.html | 2 +- _site/blog/2019/06/12/styiling-github.html | 2 +- _site/blog/2019/06/16/graphing-w2a.html | 2 +- _site/blog/2019/06/17/amm2m1-release.html | 2 +- _site/blog/2019/06/21/robot-experiences.html | 2 +- _site/blog/2019/06/23/googlectf.html | 2 +- _site/blog/2019/06/24/languagehunt2.html | 2 +- _site/blog/2019/06/26/bashsmash.html | 2 +- _site/blog/2019/06/27/pwnlink.html | 2 +- _site/blog/2019/06/27/python.html | 2 +- _site/blog/2019/07/01/devdns.html | 2 +- _site/blog/2019/07/06/scrapingfrcgithub.html | 2 +- _site/blog/2019/07/13/lookback-gmad.html | 2 +- _site/blog/2019/07/15/mindmap.html | 2 +- _site/blog/2019/08/10/why-i-carry-nfc.html | 2 +- _site/blog/2019/08/12/setting-up-ja.html | 2 +- _site/blog/2019/08/24/shift2.html | 2 +- _site/blog/2019/08/27/github-cleanup.html | 178 ++++++++++++++++++ _site/blog/index.html | 29 ++- _site/documentation.html | 2 +- _site/feed.xml | 157 ++++----------- _site/fossl-feeds.html | 2 +- _site/index.html | 2 +- _site/projects.html | 2 +- 29 files changed, 318 insertions(+), 151 deletions(-) create mode 100644 _posts/2019-08-27-GitHub-cleanup.md create mode 100644 _posts/WIP-2019-08-25-Crypto-my-thoughts.md create mode 100644 _site/blog/2019/08/27/github-cleanup.html diff --git a/_posts/2019-08-27-GitHub-cleanup.md b/_posts/2019-08-27-GitHub-cleanup.md new file mode 100644 index 0000000..37dd9ef --- /dev/null +++ b/_posts/2019-08-27-GitHub-cleanup.md @@ -0,0 +1,48 @@ +--- +layout: post +title: "I did some cleaning" +description: "Spring cleaning is fun when it isn't spring, and a computer does all the work" +date: 2019-08-27 12:37:00 +categories: random +--- + +As I am continuing to check items off my TODO list before school starts, I have come to an item I have been putting off for a while. **Clean up GitHub Account**. Luckily, I discovered a little trick to make the process of deleting unused repos a little easier! + +## Getting a list of repos to delete +I could have automated this, but I prefer a little control. To get the list, start by opening up a new Firefox window with a single tab. In this tab, open your GitHub profile to the list of repos. +Starting from the top, scroll through, and middle click on anything you want to delete. This opens it in a new tab. + +Once you have a bunch of tabs open with repos to remove, use [this Firefox plugin](https://addons.mozilla.org/en-US/firefox/addon/urls-list/) to create a plaintext list of every link you opened, and paste the list of links into VS-code. + +## Getting an API token +Next, an API token is needed. Go to GitHub's [token settings](https://github.com/settings/tokens), and generate a new one (make sure to enable repository deletion). + +## "Parsing" the links +With our new token, and out VS-code file, we can start "parsing" the data. + +Pressing `CTRL + F` brings up the Find/Search toolbar. In the text box, there are a few icons. Pressing the one farthest to the right will enable [Regex](https://en.wikipedia.org/wiki/Regular_expression) mode. With this set, paste the following: +``` +https://github.com/ +``` + +Now, click the arrow on the left to enable *replace mode*, and put this in the new box: +``` +curl -XDELETE -H 'Authorization: token ' "https://api.github.com/repos/ +``` + +Then press *replace all*. + +Finally, replace the contents of the first box with: +``` +\n +``` + +and the second with: +``` +"\n +``` + +and *replace all* again. + +## Deleting the repos +Simply copy the entire text file that was made, and paste it in a terminal, then press \ (this will take a while) \ No newline at end of file diff --git a/_posts/WIP-2019-08-25-Crypto-my-thoughts.md b/_posts/WIP-2019-08-25-Crypto-my-thoughts.md new file mode 100644 index 0000000..13f105a --- /dev/null +++ b/_posts/WIP-2019-08-25-Crypto-my-thoughts.md @@ -0,0 +1,9 @@ +--- +layout: post +title: "Never roll your own crypto!" +description: "My thoughts on this statement" +date: 2019-08-25 22:36:00 +categories: random +--- + +https://security.stackexchange.com/questions/62699/what-if-i-develop-my-own-hash-algorithm-to-create-strong-passwords-from-easy-one \ No newline at end of file diff --git a/_site/about/index.html b/_site/about/index.html index b134cb3..17c3d5d 100644 --- a/_site/about/index.html +++ b/_site/about/index.html @@ -178,7 +178,7 @@ sub rsa4096/0xA61A2F1676E35144 2019-08-11 [] [expires: 2025-08-09] Site design by: Evan Pratten | - This site was last updated at: 2019-08-24 15:35:35 -0400 + This site was last updated at: 2019-08-27 12:52:06 -0400 diff --git a/_site/blog/2018/06/27/becomeranter.html b/_site/blog/2018/06/27/becomeranter.html index f479b5f..34b7b14 100644 --- a/_site/blog/2018/06/27/becomeranter.html +++ b/_site/blog/2018/06/27/becomeranter.html @@ -123,7 +123,7 @@ pip3 install tensorflow-gpu #for gpu processing Site design by: Evan Pratten | - This site was last updated at: 2019-08-24 15:35:35 -0400 + This site was last updated at: 2019-08-27 12:52:06 -0400 diff --git a/_site/blog/2019/04/30/frc-languages.html b/_site/blog/2019/04/30/frc-languages.html index 484565c..c1bd3e3 100644 --- a/_site/blog/2019/04/30/frc-languages.html +++ b/_site/blog/2019/04/30/frc-languages.html @@ -87,7 +87,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-08-24 15:35:35 -0400 + This site was last updated at: 2019-08-27 12:52:06 -0400 diff --git a/_site/blog/2019/05/27/building-safe-vision-comms.html b/_site/blog/2019/05/27/building-safe-vision-comms.html index 61898fd..d74e79c 100644 --- a/_site/blog/2019/05/27/building-safe-vision-comms.html +++ b/_site/blog/2019/05/27/building-safe-vision-comms.html @@ -100,7 +100,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-08-24 15:35:35 -0400 + This site was last updated at: 2019-08-27 12:52:06 -0400 diff --git a/_site/blog/2019/06/12/styiling-github.html b/_site/blog/2019/06/12/styiling-github.html index a1c30dd..73effee 100644 --- a/_site/blog/2019/06/12/styiling-github.html +++ b/_site/blog/2019/06/12/styiling-github.html @@ -111,7 +111,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-08-24 15:35:35 -0400 + This site was last updated at: 2019-08-27 12:52:06 -0400 diff --git a/_site/blog/2019/06/16/graphing-w2a.html b/_site/blog/2019/06/16/graphing-w2a.html index 15eb650..2654895 100644 --- a/_site/blog/2019/06/16/graphing-w2a.html +++ b/_site/blog/2019/06/16/graphing-w2a.html @@ -125,7 +125,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-08-24 15:35:35 -0400 + This site was last updated at: 2019-08-27 12:52:06 -0400 diff --git a/_site/blog/2019/06/17/amm2m1-release.html b/_site/blog/2019/06/17/amm2m1-release.html index 945db29..7594908 100644 --- a/_site/blog/2019/06/17/amm2m1-release.html +++ b/_site/blog/2019/06/17/amm2m1-release.html @@ -84,7 +84,7 @@ Your browser does not support audio players Site design by: Evan Pratten | - This site was last updated at: 2019-08-24 15:35:35 -0400 + This site was last updated at: 2019-08-27 12:52:06 -0400 diff --git a/_site/blog/2019/06/21/robot-experiences.html b/_site/blog/2019/06/21/robot-experiences.html index cfbda23..03f1fdf 100644 --- a/_site/blog/2019/06/21/robot-experiences.html +++ b/_site/blog/2019/06/21/robot-experiences.html @@ -124,7 +124,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-08-24 15:35:35 -0400 + This site was last updated at: 2019-08-27 12:52:06 -0400 diff --git a/_site/blog/2019/06/23/googlectf.html b/_site/blog/2019/06/23/googlectf.html index 876fbff..430faa3 100644 --- a/_site/blog/2019/06/23/googlectf.html +++ b/_site/blog/2019/06/23/googlectf.html @@ -82,7 +82,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-08-24 15:35:35 -0400 + This site was last updated at: 2019-08-27 12:52:06 -0400 diff --git a/_site/blog/2019/06/24/languagehunt2.html b/_site/blog/2019/06/24/languagehunt2.html index 02117d1..f450cf7 100644 --- a/_site/blog/2019/06/24/languagehunt2.html +++ b/_site/blog/2019/06/24/languagehunt2.html @@ -82,7 +82,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-08-24 15:35:35 -0400 + This site was last updated at: 2019-08-27 12:52:06 -0400 diff --git a/_site/blog/2019/06/26/bashsmash.html b/_site/blog/2019/06/26/bashsmash.html index 971fc04..c2da733 100644 --- a/_site/blog/2019/06/26/bashsmash.html +++ b/_site/blog/2019/06/26/bashsmash.html @@ -191,7 +191,7 @@ __() {/???/???/???n?f Site design by: Evan Pratten | - This site was last updated at: 2019-08-24 15:35:35 -0400 + This site was last updated at: 2019-08-27 12:52:06 -0400 diff --git a/_site/blog/2019/06/27/pwnlink.html b/_site/blog/2019/06/27/pwnlink.html index 182b011..d8b3673 100644 --- a/_site/blog/2019/06/27/pwnlink.html +++ b/_site/blog/2019/06/27/pwnlink.html @@ -112,7 +112,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-08-24 15:35:35 -0400 + This site was last updated at: 2019-08-27 12:52:06 -0400 diff --git a/_site/blog/2019/06/27/python.html b/_site/blog/2019/06/27/python.html index 84ccd3c..a929108 100644 --- a/_site/blog/2019/06/27/python.html +++ b/_site/blog/2019/06/27/python.html @@ -177,7 +177,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-08-24 15:35:35 -0400 + This site was last updated at: 2019-08-27 12:52:06 -0400 diff --git a/_site/blog/2019/07/01/devdns.html b/_site/blog/2019/07/01/devdns.html index 5924f69..1194668 100644 --- a/_site/blog/2019/07/01/devdns.html +++ b/_site/blog/2019/07/01/devdns.html @@ -101,7 +101,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-08-24 15:35:35 -0400 + This site was last updated at: 2019-08-27 12:52:06 -0400 diff --git a/_site/blog/2019/07/06/scrapingfrcgithub.html b/_site/blog/2019/07/06/scrapingfrcgithub.html index 5e8cef8..b280c67 100644 --- a/_site/blog/2019/07/06/scrapingfrcgithub.html +++ b/_site/blog/2019/07/06/scrapingfrcgithub.html @@ -174,7 +174,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-08-24 15:35:35 -0400 + This site was last updated at: 2019-08-27 12:52:06 -0400 diff --git a/_site/blog/2019/07/13/lookback-gmad.html b/_site/blog/2019/07/13/lookback-gmad.html index 884f0a5..b8c151e 100644 --- a/_site/blog/2019/07/13/lookback-gmad.html +++ b/_site/blog/2019/07/13/lookback-gmad.html @@ -95,7 +95,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-08-24 15:35:35 -0400 + This site was last updated at: 2019-08-27 12:52:06 -0400 diff --git a/_site/blog/2019/07/15/mindmap.html b/_site/blog/2019/07/15/mindmap.html index 332334d..736586b 100644 --- a/_site/blog/2019/07/15/mindmap.html +++ b/_site/blog/2019/07/15/mindmap.html @@ -187,7 +187,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-08-24 15:35:35 -0400 + This site was last updated at: 2019-08-27 12:52:06 -0400 diff --git a/_site/blog/2019/08/10/why-i-carry-nfc.html b/_site/blog/2019/08/10/why-i-carry-nfc.html index 0d2982c..afadb17 100644 --- a/_site/blog/2019/08/10/why-i-carry-nfc.html +++ b/_site/blog/2019/08/10/why-i-carry-nfc.html @@ -107,7 +107,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-08-24 15:35:35 -0400 + This site was last updated at: 2019-08-27 12:52:06 -0400 diff --git a/_site/blog/2019/08/12/setting-up-ja.html b/_site/blog/2019/08/12/setting-up-ja.html index f3d30c1..b26adcd 100644 --- a/_site/blog/2019/08/12/setting-up-ja.html +++ b/_site/blog/2019/08/12/setting-up-ja.html @@ -152,7 +152,7 @@ ibus-daemon -drx Site design by: Evan Pratten | - This site was last updated at: 2019-08-24 15:35:35 -0400 + This site was last updated at: 2019-08-27 12:52:06 -0400 diff --git a/_site/blog/2019/08/24/shift2.html b/_site/blog/2019/08/24/shift2.html index 74cea42..6de6b10 100644 --- a/_site/blog/2019/08/24/shift2.html +++ b/_site/blog/2019/08/24/shift2.html @@ -117,7 +117,7 @@ shift2 -h Site design by: Evan Pratten | - This site was last updated at: 2019-08-24 15:35:35 -0400 + This site was last updated at: 2019-08-27 12:52:06 -0400 diff --git a/_site/blog/2019/08/27/github-cleanup.html b/_site/blog/2019/08/27/github-cleanup.html new file mode 100644 index 0000000..e263d33 --- /dev/null +++ b/_site/blog/2019/08/27/github-cleanup.html @@ -0,0 +1,178 @@ + + Evan Pratten + + + + + + + + + + + + + +
+ + + + + + + +
+
+

I did some cleaning + +

+

Spring cleaning is fun when it isn't spring, and a computer does all the work + +

+
+

2019-08-27 08:37:00 -0400 + +

+ +
+ +

As I am continuing to check items off my TODO list before school starts, I have come to an item I have been putting off for a while. Clean up GitHub Account. Luckily, I discovered a little trick to make the process of deleting unused repos a little easier!

+ +

Getting a list of repos to delete

+

I could have automated this, but I prefer a little control. To get the list, start by opening up a new Firefox window with a single tab. In this tab, open your GitHub profile to the list of repos. +Starting from the top, scroll through, and middle click on anything you want to delete. This opens it in a new tab.

+ +

Once you have a bunch of tabs open with repos to remove, use this Firefox plugin to create a plaintext list of every link you opened, and paste the list of links into VS-code.

+ +

Getting an API token

+

Next, an API token is needed. Go to GitHub’s token settings, and generate a new one (make sure to enable repository deletion).

+ + +

With our new token, and out VS-code file, we can start “parsing” the data.

+ +

Pressing CTRL + F brings up the Find/Search toolbar. In the text box, there are a few icons. Pressing the one farthest to the right will enable Regex mode. With this set, paste the following:

+
https://github.com/
+
+ +

Now, click the arrow on the left to enable replace mode, and put this in the new box:

+
curl -XDELETE -H 'Authorization: token <API token from above>' "https://api.github.com/repos/
+
+ +

Then press replace all.

+ +

Finally, replace the contents of the first box with:

+
\n
+
+ +

and the second with:

+
"\n
+
+ +

and replace all again.

+ +

Deleting the repos

+

Simply copy the entire text file that was made, and paste it in a terminal, then press <enter> (this will take a while)

+ +
+
+ +
+ + +
+
+ + Site design by: Evan Pratten | + + This site was last updated at: 2019-08-27 12:52:06 -0400 + +
+ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/_site/blog/index.html b/_site/blog/index.html index 592aee8..1adec70 100644 --- a/_site/blog/index.html +++ b/_site/blog/index.html @@ -64,22 +64,22 @@ Featured Post
-
Keyed data encoding with Python +
I did some cleaning
-

XOR is pretty cool

- View +

Spring cleaning is fun when it isn't spring, and a computer does all the work

+ View
--> - +
-
Keyed data encoding with Python +
I did some cleaning
-

XOR is pretty cool

+

Spring cleaning is fun when it isn't spring, and a computer does all the work

@@ -92,6 +92,21 @@ + +
+
Keyed data encoding with Python
+ +
+

XOR is pretty cool

+
+ + + + + + + +
How I set up ひらがな input on my laptop
@@ -370,7 +385,7 @@ Site design by:
Evan Pratten | - This site was last updated at: 2019-08-24 15:35:35 -0400 + This site was last updated at: 2019-08-27 12:52:06 -0400
diff --git a/_site/documentation.html b/_site/documentation.html index 97428da..28442ab 100644 --- a/_site/documentation.html +++ b/_site/documentation.html @@ -52,7 +52,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-08-24 15:35:35 -0400 + This site was last updated at: 2019-08-27 12:52:06 -0400 diff --git a/_site/feed.xml b/_site/feed.xml index 79bdbf8..6309de8 100644 --- a/_site/feed.xml +++ b/_site/feed.xml @@ -1,4 +1,39 @@ -Jekyll2019-08-24T15:35:35-04:00http://0.0.0.0:4000/feed.xmlEvan PrattenComputer wizard, student, <a href="https://frc5024.github.io">@frc5024</a> programming team lead, and radio enthusiast.Keyed data encoding with Python2019-08-24T09:13:00-04:002019-08-24T09:13:00-04:00http://0.0.0.0:4000/blog/2019/08/24/Shift2<p>I have always been interested in text and data encoding, so last year, I made my first encoding tool. <a href="https://github.com/Ewpratten/shift64">Shift64</a> was designed to take plaintext data with a key, and convert it into a block of base64 that could, in theory, only be decoded with the original key. I had a lot of fun with this tool, and a very stripped down version of it actually ended up as a bonus question on the <a href="https://github.com/frc5024/Programming-Test/blob/master/test.md">5024 Programming Test</a> for 2018/2019. Yes, the key was in fact <code class="highlighter-rouge">5024</code>.</p> +Jekyll2019-08-27T12:52:06-04:00http://0.0.0.0:4000/feed.xmlEvan PrattenComputer wizard, student, <a href="https://frc5024.github.io">@frc5024</a> programming team lead, and radio enthusiast.I did some cleaning2019-08-27T08:37:00-04:002019-08-27T08:37:00-04:00http://0.0.0.0:4000/blog/2019/08/27/GitHub-cleanup<p>As I am continuing to check items off my TODO list before school starts, I have come to an item I have been putting off for a while. <strong>Clean up GitHub Account</strong>. Luckily, I discovered a little trick to make the process of deleting unused repos a little easier!</p> + +<h2 id="getting-a-list-of-repos-to-delete">Getting a list of repos to delete</h2> +<p>I could have automated this, but I prefer a little control. To get the list, start by opening up a new Firefox window with a single tab. In this tab, open your GitHub profile to the list of repos. +Starting from the top, scroll through, and middle click on anything you want to delete. This opens it in a new tab.</p> + +<p>Once you have a bunch of tabs open with repos to remove, use <a href="https://addons.mozilla.org/en-US/firefox/addon/urls-list/">this Firefox plugin</a> to create a plaintext list of every link you opened, and paste the list of links into VS-code.</p> + +<h2 id="getting-an-api-token">Getting an API token</h2> +<p>Next, an API token is needed. Go to GitHub’s <a href="https://github.com/settings/tokens">token settings</a>, and generate a new one (make sure to enable repository deletion).</p> + +<h2 id="parsing-the-links">“Parsing” the links</h2> +<p>With our new token, and out VS-code file, we can start “parsing” the data.</p> + +<p>Pressing <code class="highlighter-rouge">CTRL + F</code> brings up the Find/Search toolbar. In the text box, there are a few icons. Pressing the one farthest to the right will enable <a href="https://en.wikipedia.org/wiki/Regular_expression">Regex</a> mode. With this set, paste the following:</p> +<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>https://github.com/ +</code></pre></div></div> + +<p>Now, click the arrow on the left to enable <em>replace mode</em>, and put this in the new box:</p> +<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl -XDELETE -H 'Authorization: token &lt;API token from above&gt;' "https://api.github.com/repos/ +</code></pre></div></div> + +<p>Then press <em>replace all</em>.</p> + +<p>Finally, replace the contents of the first box with:</p> +<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>\n +</code></pre></div></div> + +<p>and the second with:</p> +<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>"\n +</code></pre></div></div> + +<p>and <em>replace all</em> again.</p> + +<h2 id="deleting-the-repos">Deleting the repos</h2> +<p>Simply copy the entire text file that was made, and paste it in a terminal, then press &lt;enter&gt; (this will take a while)</p>As I am continuing to check items off my TODO list before school starts, I have come to an item I have been putting off for a while. Clean up GitHub Account. Luckily, I discovered a little trick to make the process of deleting unused repos a little easier!Keyed data encoding with Python2019-08-24T09:13:00-04:002019-08-24T09:13:00-04:00http://0.0.0.0:4000/blog/2019/08/24/Shift2<p>I have always been interested in text and data encoding, so last year, I made my first encoding tool. <a href="https://github.com/Ewpratten/shift64">Shift64</a> was designed to take plaintext data with a key, and convert it into a block of base64 that could, in theory, only be decoded with the original key. I had a lot of fun with this tool, and a very stripped down version of it actually ended up as a bonus question on the <a href="https://github.com/frc5024/Programming-Test/blob/master/test.md">5024 Programming Test</a> for 2018/2019. Yes, the key was in fact <code class="highlighter-rouge">5024</code>.</p> <p>This tool had some issues. Firstly, the code was a mess and only accepted hard-coded values. This made it very impractical as an every-day tool, and a nightmare to continue developing. Secondly, the encoder made use of entropy bits, and self modifying keys that would end up producing encoded files &gt;1GB from just the word <em>hello</em>.</p> @@ -567,122 +602,4 @@ ibus-daemon <span class="nt">-drx</span> <p>This one is interesting. Python, like Java, is compiled into bytecode. So yes, it technically is a compiled language. To see said bytecode, take a look at any <code class="highlighter-rouge">.pyc</code> file sitting in your <code class="highlighter-rouge">__pycache__</code></p> <h2 id="blog-formatting-experiments">Blog formatting experiments</h2> -<p>I am still playing with post formats, and various types of content. This is more random than I usually prefer. Let me know your thoughts on the social media platform of your choosing.</p>A rather large number of people know me as “the guy who does weird things with python”. I would object to this title, but it is quite accurate. So, here are some of the things I like playing with in python. None of these are actually breaking the language, just little known facts and syntax. At some point I will share about actually breaking the language. For now, enjoy the weird things I have found over the past 6 years.BashSmash2019-06-26T11:48:00-04:002019-06-26T11:48:00-04:00http://0.0.0.0:4000/blog/2019/06/26/BashSmash<p>I was watching this great <a href="https://www.google.com/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;cad=rja&amp;uact=8&amp;ved=2ahUKEwiOhNze_4fjAhUiB50JHR12D8AQwqsBMAB6BAgJEAQ&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D6D1LnMj0Yt0&amp;usg=AOvVaw2nOgft0SoPZujc9js9Vxhx">Liveoverflow video</a> yesterday, and really liked the idea of building escape sequences with strings. So, I built a new tool, <a href="https://pypi.org/project/bashsmash/">BashSmash</a>.</p> - -<h2 id="the-goal">The goal</h2> -<p>The goal of BashSmash is very similar to that described in Liveoverflow’s video. Do anything in bash without using any letters or numbers except <code class="highlighter-rouge">n</code> and <code class="highlighter-rouge">f</code> (he used <code class="highlighter-rouge">i</code> instead of <code class="highlighter-rouge">f</code>). This can both bypass shell injection filters, and generally mess with people.</p> - -<p>Saying “Hey, you should run:”</p> -<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>__<span class="o">()</span> <span class="o">{</span>/???/???/???n?f <span class="k">${#}</span><span class="p">;</span><span class="o">}</span><span class="p">;</span> <span class="si">$(</span>/???/???/???n?f <span class="si">$(</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span><span class="si">)</span><span class="p">;</span><span class="si">)</span><span class="p">;</span> -</code></pre></div></div> - -<p>Instead of:</p> -<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo rm</span> <span class="nt">-rf</span> <span class="nt">--no-preserve--root</span> / -</code></pre></div></div> - -<p>Can usually get you much farther with your goal of world domination.</p> - -<h2 id="how-does-this-work">How does this work?</h2> -<p>BashSmash abuses bash wildcards, octal escape codes, and a large number of backslashes to obfuscate any valid shell script.</p> - -<p>Firstly, it is important to know that <code class="highlighter-rouge">printf</code> will gladly convert any octal to a string, and bash’s eval (<code class="highlighter-rouge">$()</code>) function will gladly run any string as a bash script. (See where this is going?)</p> - -<p>Because of these tools, we know that the following is possible:</p> -<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># Printf-ing a string will print the string</span> -<span class="nb">printf</span> <span class="s2">"hello"</span> <span class="c"># This will return hello</span> - -<span class="c"># Printf-ing a sequence of octal escapes will also print a string</span> -<span class="nb">printf</span> <span class="s2">"</span><span class="se">\1</span><span class="s2">50</span><span class="se">\1</span><span class="s2">45</span><span class="se">\1</span><span class="s2">54</span><span class="se">\1</span><span class="s2">54</span><span class="se">\1</span><span class="s2">57"</span> <span class="c"># This will also return hello</span> - -<span class="c"># Eval-ing a printf of an octal escape sequence will build a string, then run it in bash</span> -<span class="si">$(</span><span class="nb">printf</span> <span class="s2">"</span><span class="se">\1</span><span class="s2">50</span><span class="se">\1</span><span class="s2">45</span><span class="se">\1</span><span class="s2">54</span><span class="se">\1</span><span class="s2">54</span><span class="se">\1</span><span class="s2">57"</span><span class="si">)</span> <span class="c"># This will warn that "hello" is not a valid command</span> -</code></pre></div></div> - -<p>This has some issues. You may have noticed that letters are required to spell <code class="highlighter-rouge">printf</code>, and numbers are needed for the octal escapes. Let’s start by fixing the letters problem.</p> - -<p>Bash allows wildcards. You may have run something like <code class="highlighter-rouge">cp ./foo/* ./bar</code> before. This uses the wildcard <code class="highlighter-rouge">*</code>. The <code class="highlighter-rouge">*</code> wildcard will be auto-evaluated to expand into a list of all files in it’s place.</p> -<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># Let's assume that ./foo contains the following files:</span> -<span class="c"># john.txt</span> -<span class="c"># carl.txt</span> - -<span class="c"># Running the following:</span> -<span class="nb">cat</span> ./foo/<span class="k">*</span> - -<span class="c"># Will automatically expand to:</span> -<span class="nb">cat</span> ./foo/john.txt ./foo/carl.txt - -<span class="c"># Now, lets assume that ./baz contains a single file:</span> -<span class="c"># KillHumans.sh</span> - -<span class="c"># Running:</span> -./baz/<span class="k">*</span> - -<span class="c"># Will execute KillHumans.sh</span> -</code></pre></div></div> - -<p>Neat, Right? To take this a step further, you can use the second wildcard, <code class="highlighter-rouge">?</code>, to specify the number of characters you want to look for. Running <code class="highlighter-rouge">./baz/?</code> will not run <code class="highlighter-rouge">KillHumans.sh</code> because <code class="highlighter-rouge">KillHumans.sh</code> is not 1 char long. But <code class="highlighter-rouge">./baz/?????????????</code> will. This is messy, but it works.</p> - -<p>Now, back to our problem with <code class="highlighter-rouge">printf</code>. <code class="highlighter-rouge">printf</code> is located in <code class="highlighter-rouge">/usr/bin/printf</code> on all *nix systems. This is handy as, firstly, this can be wildcarded, and secondly, the path contains 2 <code class="highlighter-rouge">n</code>’s and an <code class="highlighter-rouge">f</code> (the two letters we are allowed to use). So, instead of calling <code class="highlighter-rouge">printf</code>, we can call <code class="highlighter-rouge">/???/??n/???n?f</code>.</p> -<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># Now, we can call:</span> -/???/??n/???n?f <span class="s2">"</span><span class="se">\1</span><span class="s2">50</span><span class="se">\1</span><span class="s2">45</span><span class="se">\1</span><span class="s2">54</span><span class="se">\1</span><span class="s2">54</span><span class="se">\1</span><span class="s2">57"</span> - -<span class="c"># To print "hello". Or:</span> -<span class="si">$(</span>/???/??n/???n?f <span class="s2">"</span><span class="se">\1</span><span class="s2">50</span><span class="se">\1</span><span class="s2">45</span><span class="se">\1</span><span class="s2">54</span><span class="se">\1</span><span class="s2">54</span><span class="se">\1</span><span class="s2">57"</span><span class="si">)</span> - -<span class="c"># To run "hello" as a program (still gives an error)</span> -</code></pre></div></div> - -<p>Now, our problem with letters is solved, but we are still using numbers.</p> - -<p>Bash allows anyone to define functions. These functions can take arguments and call other programs. So, what if we have a function that can take any number of arguments, and return the number of arguments as a number? This will be helpful because an empty argument can be added with <code class="highlighter-rouge">""</code> (not a number or letter), and this will replace the need for numbers in our code. On a side note, bash allows <code class="highlighter-rouge">__</code> as a function name, so that’s cool.</p> - -<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># Our function needs to do the following:</span> -<span class="c"># - Take any number of arguments</span> -<span class="c"># - Turn the number to a string</span> -<span class="c"># - Print the string so it can be evaluated back to a number with $()</span> - -<span class="c"># First, we start with an empty function, named __ (two underscores)</span> -__<span class="o">()</span> <span class="o">{}</span><span class="p">;</span> - -<span class="c"># Easy. Next, we use a built-in feature of bash to count the number of arguments passed</span> -__<span class="o">()</span> <span class="o">{</span> <span class="k">${#}</span> <span class="o">}</span><span class="p">;</span> - -<span class="c"># With the ${#} feature in bash, giving this function 3 arguments will return a 3</span> -<span class="c"># Next, we need to print this number to stdout </span> -<span class="c"># This can be done with printf</span> -<span class="c"># We still do not want to use any letters or numbers, so we must use our string of wildcards</span> -/???/??n/???n?f - -<span class="c"># So, we just plug this into our function</span> -__<span class="o">()</span> <span class="o">{</span>/???/??n/???n?f <span class="k">${#}</span><span class="o">}</span><span class="p">;</span> - -<span class="c"># Now, calling our function with three arguments</span> -__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> -<span class="c"># Will print:</span> -3 -</code></pre></div></div> - -<p>Let’s put this together. First, we must tell bash that our <code class="highlighter-rouge">__</code> function exists.</p> -<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># We do this by starting our new script with: </span> -__<span class="o">()</span> <span class="o">{</span>/???/??n/???n?f <span class="k">${#}</span><span class="o">}</span><span class="p">;</span> - -<span class="c"># Next, an eval to actually run our constructed string. Together it now looks like this:</span> -__<span class="o">()</span> <span class="o">{</span>/???/??n/???n?f <span class="k">${#}</span><span class="o">)</span><span class="p">;</span> <span class="si">$(</span>/???/??n/???n?f <span class="si">)</span> - -<span class="c"># Now, we construct a string using the __ function over and over again. "echo hello" looks like:</span> -__<span class="o">()</span> <span class="o">{</span>/???/???/???n?f <span class="k">${#}</span><span class="p">;</span><span class="o">}</span><span class="p">;</span> <span class="si">$(</span>/???/???/???n?f <span class="si">$(</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span>/???/???/???n?f <span class="s2">"</span><span class="se">\\\\</span><span class="sb">`</span>__ <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">``</span>__ <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="s2">""</span> <span class="sb">`</span><span class="s2">"</span><span class="p">;</span><span class="si">)</span><span class="p">;</span><span class="si">)</span><span class="p">;</span> -</code></pre></div></div> - -<p>Thats it! You do not actually have to worry about this, because BashSmash does it all for you automatically.</p> - -<h2 id="how-do-i-use-the-script">How do I use the script?</h2> -<p>To use BashSmash, simply make sure both <code class="highlighter-rouge">python3.7</code> and <code class="highlighter-rouge">python3-pip</code> are installed on your computer, then run:</p> -<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pip3 install bashsmash -</code></pre></div></div> - -<p>For more info, see the <a href="https://pypi.org/project/bashsmash/">PYPI Page</a>.</p> - -<h2 id="why-do-you-have-a-desire-to-break-things-with-python">Why do you have a desire to break things with python</h2> -<p>Because it is fun. Give it a try!</p> - -<p>I will have a post here at some point about the weird things I do in my python code and why I do them.</p>I was watching this great Liveoverflow video yesterday, and really liked the idea of building escape sequences with strings. So, I built a new tool, BashSmash. \ No newline at end of file +<p>I am still playing with post formats, and various types of content. This is more random than I usually prefer. Let me know your thoughts on the social media platform of your choosing.</p>A rather large number of people know me as “the guy who does weird things with python”. I would object to this title, but it is quite accurate. So, here are some of the things I like playing with in python. None of these are actually breaking the language, just little known facts and syntax. At some point I will share about actually breaking the language. For now, enjoy the weird things I have found over the past 6 years. \ No newline at end of file diff --git a/_site/fossl-feeds.html b/_site/fossl-feeds.html index 1f022ba..1132bd9 100644 --- a/_site/fossl-feeds.html +++ b/_site/fossl-feeds.html @@ -88,7 +88,7 @@ https://blog.mrtnrdl.de/feed.xml Site design by: Evan Pratten | - This site was last updated at: 2019-08-24 15:35:35 -0400 + This site was last updated at: 2019-08-27 12:52:06 -0400 diff --git a/_site/index.html b/_site/index.html index 141a98c..092700d 100644 --- a/_site/index.html +++ b/_site/index.html @@ -101,7 +101,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-08-24 15:35:35 -0400 + This site was last updated at: 2019-08-27 12:52:06 -0400 diff --git a/_site/projects.html b/_site/projects.html index 957bb0a..cca65ae 100644 --- a/_site/projects.html +++ b/_site/projects.html @@ -146,7 +146,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-08-24 15:35:35 -0400 + This site was last updated at: 2019-08-27 12:52:06 -0400