diff --git a/_site/2020/06/25/tmux-minecraft.html b/_site/2020/06/25/tmux-minecraft.html index 5348323..d167928 100644 --- a/_site/2020/06/25/tmux-minecraft.html +++ b/_site/2020/06/25/tmux-minecraft.html @@ -36,7 +36,7 @@ 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 something seems to be wrong.

+Especially when I really just want to be playing games but I just need to check something quickly.

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.

@@ -48,7 +48,7 @@ Especially when I really just want to be playing games, but something seems to b

So to solve this interesting problem, I decided to use tmux. tmux is a tterminal multiplexer. -This allows you to run a terminal session, the leave it while it still runs in the background.

+This allows you to run a terminal session, then detach fromc it while it still runs in the background.

This is very valuable when running command line applications that need to have an active console connection, like a Minecraft server.

@@ -88,24 +88,21 @@ Negative numbers start from the bottom, so in theory I can do the follo

No. It just doesn’t work. Negative numbers do not work with the tmux capture-pane subcommand.

-

So I did some simple UNIX piping, like so, to get just the last thing in the chat. --p prints the result to the terminal/stdout. -steve is the name of the tmux session I’m trying to pull form.

+

So I did some simple UNIX piping, like so, to get just the last thing in the chat.

 $ tmux capture-pane -p -t steve | tail -n1
 [SERVER] [ExtraDebuggingInfoHere]: <TaterTheTot> MY_MESSAGE
 
+

TaterTheTot is my Minecraft username :)

-

So that’s done! Beauty!

- -

So now I have a line which will look something like this:

+

-p prints the result to the terminal/stdout.

-

[SERVER] [ExtraDebugInfoHere]: <TaterTheTot> MY_MESSAGE

+

steve is the name of the tmux session I’m trying to pull form.

-

TaterTheTot is my Minecraft username :)

+

So that’s done! Beauty!

-

So, how can we get only the message I wrote, and my username?

+

Now that we have that, how can we extract the username and the message from the latest line?

grep

diff --git a/_site/blog/index.html b/_site/blog/index.html index 04e5f00..00ae95e 100644 --- a/_site/blog/index.html +++ b/_site/blog/index.html @@ -38,7 +38,7 @@ 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 something seems to be wrong.

+Especially when I really just want to be playing games but I just need to check something quickly.

diff --git a/_site/feed.xml b/_site/feed.xml index 7203816..bd7f385 100644 --- a/_site/feed.xml +++ b/_site/feed.xml @@ -1,8 +1,8 @@ -Jekyll2020-06-25T18:40:18+00:00http://localhost:4000/feed.xmlHow to use tmux to send and receive things from your Minecraft server2020-06-25T00:00:00+00:002020-06-25T00:00:00+00:00http://localhost:4000/2020/06/25/tmux-minecraft<p>So recently I had problem. +Jekyll2020-06-25T18:46:07+00:00http://localhost:4000/feed.xmlHow to use tmux to send and receive things from your Minecraft server2020-06-25T00:00:00+00:002020-06-25T00:00:00+00:00http://localhost:4000/2020/06/25/tmux-minecraft<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 something seems to be wrong.</p> +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> @@ -14,7 +14,7 @@ Especially when I really just want to be playing games, but something seems to b <p>So to solve this interesting problem, I decided to use <code class="highlighter-rouge">tmux</code>. <code class="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, the leave it while it still runs in the background.</p> +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> @@ -54,24 +54,21 @@ Negative numbers start from the bottom, so <em>in theory</em> I can <p>No. It just doesn’t work. Negative numbers do <em>not</em> work with the <code class="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. -<code class="highlighter-rouge">-p</code> prints the result to the terminal/stdout. -<code class="highlighter-rouge">steve</code> is the name of the tmux session I’m trying to pull form.</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>So that’s done! Beauty!</p> - -<p>So now I have a line which will look something like this:</p> +<p><code class="highlighter-rouge">-p</code> prints the result to the terminal/stdout.</p> -<p><code class="highlighter-rouge">[SERVER] [ExtraDebugInfoHere]: &lt;TaterTheTot&gt; MY_MESSAGE</code></p> +<p><code class="highlighter-rouge">steve</code> is the name of the tmux session I’m trying to pull form.</p> -<p>TaterTheTot is my Minecraft username :)</p> +<p>So that’s done! Beauty!</p> -<p>So, how can we get only the message I wrote, and my username?</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="highlighter-rouge">grep</code></h3> @@ -131,7 +128,7 @@ And, we have a way to respond.</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>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 something seems to be wrong.Site Update2020-06-04T00:00:00+00:002020-06-04T00:00:00+00:00http://localhost:4000/2020/06/04/site-update<p>I updated the site with some easier to identify information about me and my projects :)</p> +<p>Happy hacking!</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.Site Update2020-06-04T00:00:00+00:002020-06-04T00:00:00+00:00http://localhost:4000/2020/06/04/site-update<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>