How to Add a Power Button to Your Raspberry Pi

So the pi monitors GPIO 3 when in standby mode for signal high to boot, we can add a software routine to monitor for that signal once booted to shutdown. Then it is just a matter of a switch across pins 5&6.

Basically, make two files, one to call the other. add the one that calls the other to the init.d and have it start when booted.

create listen-for-shutdown.py:

#!/usr/bin/env python

import RPi.GPIO as GPIO
import subprocess

GPIO.setmode(GPIO.BCM)
GPIO.setup(3, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.wait_for_edge(3, GPIO.FALLING)

subprocess.call(['shutdown', '-h', 'now'], shell=False)

then:
sudo mv listen-for-shutdown.py /usr/local/bin/
sudo chmod +x /usr/local/bin/listen-for-shutdown.py

create another file listen-for-shutdown.sh:

#! /bin/sh

### BEGIN INIT INFO
# Provides: listen-for-shutdown.py
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO

# If you want a command to always run, put it here

# Carry out specific functions when asked to by the system
case "$1" in
start)
echo "Starting listen-for-shutdown.py"
/usr/local/bin/listen-for-shutdown.py &
;;
stop)
echo "Stopping listen-for-shutdown.py"
pkill -f /usr/local/bin/listen-for-shutdown.py
;;
*)
echo "Usage: /etc/init.d/listen-for-shutdown.sh {start|stop}"
exit 1
;;
esac

exit 0

Place this file in /etc/init.d and make it executable.

sudo mv listen-for-shutdown.sh /etc/init.d/
sudo chmod +x /etc/init.d/listen-for-shutdown.sh

Now we’ll register the script to run on boot.

sudo update-rc.d listen-for-shutdown.sh defaults

Since the script won’t be running, we’ll go ahead and start it with:

sudo /etc/init.d/listen-for-shutdown.sh start

Source: How to Add a Power Button to Your Raspberry Pi – Howchoo

CRISPR in your kitchen! – The ODIN

So seeing as a lot of us have some extra time on our hands… lets make humans with more hands!

Source: All Products – Beginner Kits – The ODIN

Windows Environment Variables

Here is a list of Windows Environment Variables. I was looking to use some in a batch script.

Original found here: https://www.tenforums.com/tutorials/3234-environment-variables-windows-10-a.html

Continue reading Windows Environment Variables

How to save command output to file using Command Prompt or PowerShell

So we all know to use > and >> to pipe the screen (STDIO) output to a file… turns out there are other ways of doing this as well!

Source: How to save command output to file using Command Prompt or PowerShell | Windows Central

See also: https://helpdeskgeek.com/how-to/redirect-output-from-command-line-to-text-file

Pre-lci Halogen to Full LED headlight (Plug & Play) | BimLand Performance

BimLand Performance has LED replacement bulbs for the 2006/E90 w/Xenon headlights.  Not many options for that one.

Source: Pre-lci Halogen to Full LED headlight (Plug & Play) | BimLand Performance

Raspberry Pi GPIO Emulator Simulates Physical Components | Tom’s Hardware

Nice – dont’ even need a Pi to learn Pi’s now!

Source: Raspberry Pi GPIO Emulator Simulates Physical Components | Tom’s Hardware

flightsimulator · GitHub

So, you know they are coming out with a new FlightSim, right?

Time to get moving on that simulator cockpit!

Source: flightsimulator/altimetro_v0.2 at master · alvaroalea/flightsimulator · GitHub

Install Windows Subsystem for Linux (WSL) on Windows 10 | Microsoft Docs

Yet another branch on the ol’ IT Tree…

Source: Install Windows Subsystem for Linux (WSL) on Windows 10 | Microsoft Docs

Infiniti TSB Index

Source: Index of /TSB

SIEM / IDS

Security Information and Event Management (SIEM) software has been in use in various guises for over a decade and has evolved significantly during that time. Intrusion Detection System (IDS) are a component of SIEM’s.

Suricata is a fairly new IDS with a reported easy (easier?) to use interface.

Suricata

Wazuh has a community based version and a lot of support.

Installing Wazuh server ‐ Installation guide · Wazuh 3.12 documentation