Skip to content

Instantly share code, notes, and snippets.

@JSouthGB
JSouthGB / 0_reuse_code.js
Created October 1, 2016 02:43
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#!/bin/bash
# deluge2rtorrent
# deluge handles downloading and initial sorting
# this script is to move everything to rtorrent
# torrents and torrent data only
# torrent info will not be preserved (seed time, etc)
# -P flag and echo because i dont run this unattended
# this is quick and dirty, i have no idea what im doing

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@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
@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 / 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 / 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');
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 / 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
@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