Skip to content

Instantly share code, notes, and snippets.

@Josh5
Josh5 / README.md
Last active September 13, 2024 22:02
Docker WireGuard Network Manager

Setting Up a WireGuard VPN Docker Network

Overview

Introduction

  • Purpose: Set up a WireGuard VPN Docker bridge network to route specific Docker containers' traffic through a VPN without affecting the host or other containers.

Problem Statement

@Josh5
Josh5 / README.md
Last active July 31, 2021 21:23
NoFrillsNAS

The No-Frills NAS

This is the setup process for the no-frills NAS.

Before running this, you need to have Ubuntu 20.04 installed on a USB stick.

After booting Ubuntu, before doing anything else, follow these steps:

@Josh5
Josh5 / gist:5265eddc73923908f64a824cf808a8fc
Created September 13, 2020 07:01
ubports-anbox-installer.sh
#!/bin/bash
sudo mount -o rw,remount /
mkdir -p /home/phablet/aptcache
sudo mount --bind /home/phablet/aptcache /var/cache/apt
sudo apt update
sudo apt install -y anbox-ubuntu-touch android-tools-adb
@Josh5
Josh5 / mc.sh
Created May 29, 2019 06:22
Calculate process memory use
#!/bin/bash
#
# Credit: http://cloudinservice.com/tune-apache-performance-using-mpm-prefork-module/
#
ps -ylC ${1} | awk '{x += $8;y += 1} END {print "Process Memory Usage (MB): "x/1024; print "Average Proccess Size (MB): "x/((y-1)*1024)}';
@Josh5
Josh5 / calculate_apache_mpm_config.sh
Last active November 8, 2024 14:10
A rough calculation of Apache MPM config
#!/bin/bash
#
# @Author: Josh Sunnex
# @Date: 2019-01-31 10:26:00
# @Last Modified by: josh5
# @Last Modified time: 2019-01-31 10:36:07
#
# usage:
# curl -sSL https://gist.githubusercontent.com/Josh5/ff6ccfe4c75ae27a3f1efebcb645e7c4/raw/calculate_apache_mpm_config.sh | bash -s [PID]
#
@Josh5
Josh5 / gist:3dadff856b7277c19780fa336773f390
Created September 11, 2018 19:24
Changing user ubuntu
# The idea of this series of commands is to rename your home folder files asynchronously.
# If you do your whole /home/ folder in one go, it will take forever. Better to open up several terminals and run this command splitting up the task
HOME_DIR=/mnt/encrypted/home/josh5
OLD_USER=
# Make a temp directory.
# This is where we run from to prevent our for loop from checking every folder if we add '*'
mkdir -p /tmp/blah
cd /tmp/blah
@Josh5
Josh5 / cloudsync.sh
Last active September 8, 2018 03:24
cloudsync
#!/bin/bash
# @Author: jsunnex
# @Date: 2017-10-02 10:18:03
# @Last Modified by: jsunnex
# @Last Modified time: 2018-08-17 14:06:36
#
#
# Use this script to backup your systemo config for quick redeploy
#
# chmod +x /opt/cloudsync.sh
@Josh5
Josh5 / SETUP.sh
Last active June 25, 2024 09:39
.myscripts
#!/bin/bash
#
# @Author: Josh Sunnex
# @Date: 2018-08-13 12:54:13
# @Last Modified by: Josh.5
# @Last Modified time: 2019-03-17 11:50:19
#
# bash -c "$(curl -sSL https://gist.githubusercontent.com/Josh5/14bbb2e69b701693fee5790c7f5989b3/raw/SETUP.sh)";
@Josh5
Josh5 / dpkg-get
Last active August 13, 2018 01:12
dpkg-get
#!/bin/bash
#
# @Author: Josh Sunnex
# @Date: 2018-08-13 12:54:13
# @Last Modified by: Josh Sunnex
# @Last Modified time: 2018-08-13 12:54:13
#
NOW="$(date +'%Y-%m-%d_%H.%M.%S')";
DIR="/tmp/dpkg-get/";
@Josh5
Josh5 / README.md
Last active September 2, 2018 20:35
Tasks2IssueTracker

Install

Install deps:

sudo apt install python-pip python3-pip python3-setuptools python-setuptools;
sudo -H python3 -m pip install lxml;

Install script to taskwarrior hooks (ie. ~/.task/hooks/)