Skip to content

Instantly share code, notes, and snippets.

View mauvehed's full-sized avatar
:shipit:
hax.

mauvehed mauvehed

:shipit:
hax.
View GitHub Profile

Keybase proof

I hereby claim:

  • I am mauvehed on github.
  • I am mauvehed (https://keybase.io/mauvehed) on keybase.
  • I have a public key whose fingerprint is C171 5060 CB31 B1AE 2246 25BD 17E0 D1A7 9C39 7504

To claim this, I am signing this object:

#!/usr/bin/python
import sqlite3
import os
import urllib
import unicodedata
import getopt
import sys
import codecs
# Find unscanned files not in Plex database but on filesystem
SCAN INFO
----------
19506 Nessus Scan Information
SAMBA
----------
1337 Samba Detection
10395 Microsoft Windows SMB Shares Enumeration
10396 Microsoft Windows SMB Shares Access

1. Temporarily disable blocking

pihole disable

2. Find which list is blocking the domain

pihole -q <domain>

3. Remove list from master file

/etc/pihole/adlist.list

4. Sync pihole with master list

The general idea here is to always use a new branch to create new content you want to submit to the original parent repo, known as upstream. In doing so you'll never work directly from your master branch, you'll instead use new branches for each feature or speaker note.

With this idea in mind, your master branch should always be an up to date version of the upstream repo. The following commands will overwrite your master branch every time you run this. Any changes made there will be destroyed and only the most recent changes from upstream/master will remain. This is intentional, but requires that you never make changes to your local master branch.

1. Add remote upstream (only required the first time):

git remote add upstream git@github.com:REPLACE-YOUR-REPO-NAME/REPLACE-YOUR-REPO-NAME.git

2. Verify it was added (optional):

git remote -v
@mauvehed
mauvehed / Upgrade Git Repos.sh
Created June 14, 2017 00:43
Small script to update a folder full of various git repos
#!/bin/bash
CWD=$(pwd)
for ii in "$CWD"/*; do
cd $ii
echo ""
echo "Updating $ii"
git checkout master
git pull
@mauvehed
mauvehed / gist:6a06eab671c0a2aeca1979154ac19a16
Last active April 18, 2018 15:46 — forked from carlosmcevilly/gist:2221249
fix git commit with wrong email address in git config, before pushing
If:
- you add and commit with the wrong email address in git, and
- your remote has a hook set up to prevent you from pushing with the bad address
Then you need to amend the author of your commit before push can succeed:
1. fix your email address in git config:
$ git config user.name "Your Name"
@mauvehed
mauvehed / Python (3.6) Virtual Environment.md
Last active September 16, 2022 14:57
Python (3.6) Virtual Environment

python3.6 -m venv <venv_name>

source <venv_name>/bin/active

pip install -r <requirements.txt>

deactivate

@mauvehed
mauvehed / Dockerfile
Created April 3, 2020 21:01 — forked from Popsiclestick/Dockerfile
Dockerfile example with best practices
### Generic Dockerfile demonstrating good practices
### Imports
# Bad. You risk both the stability and security of your application
# You don't know what they might merge into their image or who they may give control of the project
# https://twitter.com/b0rk/status/1226856930875932672/photo/1
FROM random-person/golang:latest
# Bad-ish. We don't need Ubuntu, it comes with unnecessary bloat
# FROM: https://askubuntu.com/a/1285102/747165
# In Ubuntu 20.04 LTS and Ubuntu 20.10, I removed snapd following this steps:
# stop snapd services
sudo systemctl stop snapd && sudo systemctl disable snapd
# purge snapd
sudo apt purge snapd
# remove no longer needed folders
rm -rf ~/snap
sudo rm -rf /snap /var/snap /var/lib/snapd /var/cache/snapd /usr/lib/snapd