New Lab Setup

I’ve been working on a new lab setup and I found a great post by Romain Serre at Tech Coffee. I have a 40GbE Infiniband switch in my lab so I’ll be making a few changes from his post but his scripts are all together clear and easy to understand. I’ll be able to rebuild my lab quicker and way more efficiently than the old click’a next, ok, click’a, finish way.

Hopefully I’ll have some time to post during the building process to put my thoughts down but in the mean time here’s an _ok_ picture of the switches and servers.

Change your [SSH/PS1] Shell Prompt

I was doing some work in a server and got lost in the SSH shell I had open. After some googling I found a bashrc generator.  All you do Is drag and drop what you want your shell to look like, no. 3 on the right, and then copy generated output to your command line. Easy.

I’m currently rocking their second example:
user5@the-docker-hosts:[~/docker-dev-setup]:$

My generated .bashrc:
export PS1="\[\033[38;5;11m\]\u\[$(tput sgr0)\]\[\033[38;5;15m\]@\h:\[$(tput sgr0)\]\[\033[38;5;6m\][\w]:\[$(tput sgr0)\]\[\033[38;5;15m\]\\$ \[$(tput sgr0)\]"

Docker Container for Pi-Hole

I want to learn more about Docker and whats a better way to try something new in “production” (my home).

I used this guide and so far no issues. I like using Docker Compose for the portability and I can backup and test different settings without having to memorize Docker commands.

One change I would make, till I can find a way to automate it, is to run the command below after you “docker-compose up -d” so you can set the Pi-Hole website admin password to something that you know.

$ docker exec pihole pihole -a -p supersecurepassword

Current stats

It actually works.

Host Migration – Done

I’ve changed my hosting provider and need to move my WordPress Blog along with it. I had a backup plugin that run a backup every night but the issue is that I was moving everything, even the domain DNS servers. The Plugin wanted $30 to do it and I figured why not do it myself.

I tried a few thing but in the end I took a backup of the MySQL db and the running WordPress config and duplicated it as close as possible on the new host. After importing the database backup and moving all the files back to their /blog folder I was able to login and see my posts. Pretty cool.

One issue I am having is on the wedding site I’m getting a theme error which I contacted the developer i purchased it from and hopefully he can fix it.

Error:

Warning: Declaration of wedding_Menu_Walker::start_el(&$output, $item, $depth, $args) should be compatible with Walker_Nav_Menu::start_el(&$output, $item, $depth = 0, $args = Array, $id = 0) in /home/dh_t6tdrr/airideas.com/blog/wp-content/themes/wedding/includes/navigation.php on line 86

Fatal error: Switch statements may only contain one default clause in /home/dh_t6tdrr/airideas.com/blog/wp-content/themes/wedding/includes/options.php on line 298

Domain Deploy Ninja RMM with PSExec

Spent a few min trying to get NinjaRMM deployed in my lab so I figured I should write down what I did. Lucky its pretty easy and only requires you to do three things.

Also, this is on a Windows Domain and not Workgoup.

Make a share on the network eg. \\server1\ninja and add NinjaRMM msi to the folder. My path looks like below:

\\air.local\air\Seattle\IT\ninja\ninja.msi

On a computer that has local admin rights to the remote computers download PSExec to a folder and make a text file called pcs.txt. In pcs.txt add the names of the computers you want to deploy to and save.

Run the command below and wait for the execution with error code 0. The error code “0” means its worked.

.\psexec.exe @pcs.txt -s msiexec.exe /i “\\air.local\air\Seattle\IT\ninja\ninja.msi” /quiet /norestart

Here is what my output looks like

Factorio Headless Server for Windows

I just spent a few minutes setting up a Factorio Headless Server on my VPS Window Server and I saw that the script on their Wiki is formatted wrong. Below is my modified version of their script. Make sure each statement is on it own line and move all the x64 binary folder to c:\factorio\0.14.22\ and run the .bat from the root of 0.14.22.

I like to launch it from the .bat [link to file] because I can track the saves easier and change the configuration quicker. You will also need to forward port 34197 to that server and any other port that your going to use.


@echo off
set FactorioExeLocation=C:\factorio\0.14.22\bin\x64\
set SaveFileName=game1-save.zip
set SaveLocation=C:\factorio\0.14.22\saves\game1-saves\
set ServerSettingsFileName=server-setting-server-1.json
set ServerSettingsLocation=C:\factorio\0.14.22\data\
cd %FactorioExeLocation% echo.
echo.
echo.PREPARING TO LAUNCH FACTORIO SERVER...
echo.
echo Save to be loaded: echo %SaveLocation%%SaveFileName%
echo.
echo. Server Settings to load: echo %ServerSettingsLocation%%ServerSettingsFileName%
echo.
echo.
echo *** Remember to use Ctrl+C to ensure saving when finished instead of simply closing this window ***
echo.
echo.
pause 3
factorio.exe --start-server "%SaveLocation%%SaveFileName%" --server-settings "%ServerSettingsLocation%%ServerSettingsFileName%" pause 3

You should get the output similar to below.

Factorio!

Find an IP address of an APC PDU

I got a Switched PDU off of eBay a few weeks ago and the seller didn’t know the IP but knew the login username and password ( apc/apc ) so I challenged myself to find the IP of the device. After a few minutes of thinking about it I ended up plugging in the PDU to a managed switch and mirroring the port to my notebook. Once ARP requests came out I was able to see what IP address the MAC address of the PDU its was asking for and set my local IP to something in the range.

After I changed my IP address I pinged the address and was able to login to the PDU. I have a screenshot of the traffic below.

Fun!

Let’s Encrypt on a Synology

I’ve been using Start SSL for a few years but in light of their practices and Chrome not supporting them in early 2017 I was looking for other options. Luckily Let’s Encrypt is available and pretty simple to setup.

One of the main tech that I use is my Synology and in DSM 6 they added Let’s Encrypt support. The best part? Its easy! I took a quick look at a guide and logged in to my Synology and within a few clicks my new SSL cert was added.

So easy
So easy

I’ll look in to using Let’s Encrypt for my blog and I hope there is a plugin so I can show some of my other friends that blog how easy it is to setup.