Skip to content

Instantly share code, notes, and snippets.

@JSouthGB
JSouthGB / README.rst
Created April 23, 2025 00:54 — forked from imthenachoman/README.rst
Common markup for Markdown and reStructuredText

GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as

@JSouthGB
JSouthGB / reflector.sh
Created March 23, 2025 17:06
reflector
reflector --country US --latest 25 --age 24 --protocol https --completion-percent 100 --sort rate --verbose --save /etc/pacman.d/mirrorlist
@JSouthGB
JSouthGB / ssh_sudo.sh
Created March 11, 2025 20:01
Using sudo over ssh
#!/usr/bin/env bash
# This was needed due to a stale NFS mount on a server which had no BMC
# Install `sshpass`
sudo pacman -S sshpass
# Terminal command
sshpass -p 'YOUR_PASSWORD' ssh USERNAME@IP_ADDRESS 'echo YOUR_PASSWORD | sudo -S umount -f -l /path/to/mount'
@JSouthGB
JSouthGB / ssh_key_config.sh
Last active July 14, 2024 17:06
Generate SSH key file pair, copy to remote server, and add entry to .ssh/config
#!/usr/bin/env bash
# TODO: Allow specifying the key type and size as optional arguments
# TODO: Validate the IP address, port number, and hostname
# TODO: Add a check for the existence of the .ssh directory/config file
# TODO: Better handling of existing SSH config entries, offer to update/append
# TODO: Check that external commands are available before using them
# This script generates SSH key file pairs, copies the key file to a remote server, and adds an entry in the local .ssh/config
@JSouthGB
JSouthGB / emailme.py
Created June 12, 2024 00:16 — forked from alexalemi/emailme.py
Python Gmail Email notification sender, with SMS and docopt.
#! /usr/bin/env python
""" Email Me.
Usage:
emailme <message>
emailme [-s] <message>
emailme [-s] <subject> <message>
emailme <toaddr> <subject> <message>
emailme <toaddr> <fromaddr> <subject> <message>
emailme -h | --help
import logging
import os
import sys
from datetime import datetime
from typing import List, Dict, Tuple
from urllib.parse import urlencode, urlunparse, urlparse
import requests
# TODO: This script does not yet delete anything, merely logs and notifies until I'm sure it works properly.
@JSouthGB
JSouthGB / detect-js-framework.js
Created April 25, 2024 11:31 — forked from rambabusaravanan/detect-js-framework.js
Detect JS Framework used in a Website
// Paste these lines into website's console (Win/Linux: Ctrl + Shift + I / Mac: Cmd + Alt + I)
if(!!window.React ||
!!document.querySelector('[data-reactroot], [data-reactid]') ||
Array.from(document.querySelectorAll('*')).some(e => e._reactRootContainer !== undefined || Object.keys(e).some(k => k.startsWith('__reactContainer')))
)
console.log('React.js');
if(!!document.querySelector('script[id=__NEXT_DATA__]'))
console.log('Next.js');
@JSouthGB
JSouthGB / kde_backup.sh
Created November 26, 2023 18:45
kde_backup
#!/usr/bin/env bash
# transfuse.sh #
## Automates backing up and restoring Plasma user configs #
## https://gitlab.com/cscs/transfuse #
##### cscs #####
underline=`tput smul`
nounderline=`tput rmul`
HELP=$(echo " ";
echo "#########################################################################";
echo "# #";
@JSouthGB
JSouthGB / mypostgres.sh
Created July 25, 2023 20:25 — forked from jefrydco/mypostgres.sh
Run PostgreSQL and pgAdmin4 on Docker with single command
#!/bin/bash
# Create postgres directory with pgvolume and pga4volume as child directory.
mkdir -p postgres/{pgvolume,pga4volume}
# Navigate to postgres directory
cd postgres
# Create pg.env that holds environment variable for postgres docker container.
cat << EOF > pg.env
@JSouthGB
JSouthGB / clean-up-arch-linux.md
Created July 4, 2023 17:34 — forked from rumansaleem/clean-up-arch-linux.md
Instructions to clean up Arch Linux (Manjaro)

Contents

  • Clean pkg cache
  • Remove unused packages (orphans)
  • Clean cache in /home
  • remove old config files
  • Find and Remove
    • duplicates
    • empty files
    • empty directories
  • broken symlinks