Skip to content

Instantly share code, notes, and snippets.

View lnxd's full-sized avatar
🙊
I may be slow to respond.

Alex lnxd

🙊
I may be slow to respond.
View GitHub Profile
@lnxd
lnxd / start-without-keychain.sh
Created March 26, 2022 03:15
Launch macOS App without permission to access Keychain items
#!/bin/bash
# Variables
app_path="/System/Applications/Automator.app/Contents/MacOS/Automator" # Set the executable, rather than the package
sandbox_file="/tmp/keychain-sandbox.sb"
# Create Sandbox Instruction File
find ~/Library/Keychains -name "*.keychain-db" > $sandbox_file
sed -i'' -e 's/^/\(deny file\* \(literal \"/' $sandbox_file
sed -i'' -e 's/$/\"\)\)/' $sandbox_file
@lnxd
lnxd / start-jekyll-server.sh
Created March 26, 2022 03:47
Start a Jekyll build server at $PWD and serve it over HTTPS using Docker
#!/bin/bash
echo "- Starting server.."
# Starts a jekyll serve instance
docker run -d --rm --name jekyll-server \
--platform linux/amd64 \
--volume="$PWD:/srv/jekyll" \
--volume="$PWD/_vendor/bundle:/usr/local/bundle" \
jekyll/jekyll \
@lnxd
lnxd / start-server.sh
Created March 26, 2022 03:53
Start php-nginx server
#!/bin/bash
echo "- Starting server.."
# Starts a basic PHP/nginx server
docker run -d --rm --name nginx-php-server \
-v $PWD:/var/www/html:ro \
trafex/php-nginx
# Serves the PHP/nginx server over https
@lnxd
lnxd / gist:128b38aa9d4fd47223dc63e18f20e0c3
Created April 10, 2022 11:10
Download using aria2c via docker without installing
docker run --rm -ti \
-w /home/docker \-v $PWD:/home/docker \
--platform linux/amd64 theimpostor/aria2c \
-s 16 -x 16 "https://releases.ubuntu.com/20.04.4/ubuntu-20.04.4-desktop-amd64.iso"
@lnxd
lnxd / detect_stale.sh
Last active January 25, 2023 21:48
Fix Stale File Handles on Proxmox Backup Server NFS Mounts
#!/bin/bash
# detect_stale.sh
# Get all NFS mountpoints from /etc/mtab
mounts=$(grep nfs /etc/mtab | awk '{print $2}')
# Loop through each mountpoint
for mountpoint in $mounts; do
# Try to access the mountpoint and redirect any errors to null
stat "$mountpoint" >/dev/null 2>&1
@lnxd
lnxd / find_webgui.sh
Last active February 8, 2023 12:01
Script to find Web GUIs on local network
#!/bin/bash
# find_webgui.sh
# Usage: ./find_webgui.sh [http|https] [start_ip] [end_ip]
# Author: github.com/lnxd
# Only works on default ports
usage() {
echo "Usage: $0 [http|https] [start_ip] [end_ip]"
echo " Check if argument is http or https and retrieve the title of the web page for each IP address in the specified range."
@lnxd
lnxd / ms-office-dl-links
Last active April 19, 2024 04:30 — forked from DartPower/ms-office-dl-links
MS Office Download Links
@lnxd
lnxd / README.md
Last active August 15, 2025 07:07
A PowerShell script to manage Windows Fast Startup settings. Can enable, disable, or toggle Fast Startup based on user input. Requires admin.

Fast Startup Issues

Overview

This guide provides solutions for issues where Windows computers may not shut down properly or may turn back on unexpectedly. Dell computers appear to be the most impacted[^1].

The issue appears to be resolved by disabling the Fast Startup feature, and therefore can impact systems running Windows 8, Windows 10 and Windows 11.

  • This feature also causes issues with Windows Update[^2].
  • Drivers that do not recognise states correctly might not be able to recover from crashes unless the computer is completely restarted[^3].
  • Dell computers may power on either directly after attempting to shut down, or at a random point in the future, especially if they have external peripherals attached. Boot via peripheral input can be disabled separately from Fast Startup, and at a per device level[^1].
@lnxd
lnxd / generate_changelog.sh
Created August 3, 2024 01:40
Pulls the latest 100 commits from the TA-Lib GitHub repo, formats the commit details (date, message, author, and link), and saves them as a changelog in changelog.txt. If GITHUB_TOKEN is set, the script uses it to avoid hitting API rate limits.
#!/bin/bash
REPO_URL="https://api.github.com/repos/TA-Lib/ta-lib/commits"
OUTPUT_FILE="changelog.txt"
AUTH_HEADER=""
[ -n "$GITHUB_TOKEN" ] && AUTH_HEADER="-H 'Authorization: token $GITHUB_TOKEN'"
eval curl -s $AUTH_HEADER "$REPO_URL?per_page=100&page=1" | jq -r '
.[] |
@lnxd
lnxd / instructions.md
Last active September 13, 2024 08:03
Zerotier Exit Node using Debian 12 LXC on Proxmox 8
lnxd@zt:~# /usr/sbin/zerotier-cli join {network}
200 join OK
lnxd@zt:~# zerotier-cli listnetworks
200 listnetworks <nwid> <name> <mac> <status> <type> <dev> <ZT assigned ips>

Check logs with:

journalctl -u zerotier-one