Skip to content

Instantly share code, notes, and snippets.

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

mauvehed mauvehed

:shipit:
hax.
View GitHub Profile
@mauvehed
mauvehed / gpg_commands.md
Created April 22, 2024 14:28
GnuPG Command Line Usage

list private key and get ID(s)

gpg --list-secret-keys --keyid-format=long

export ascii armor public key

gpg --armor --export YOUR_KEY_ID

export encrypted private key

@mauvehed
mauvehed / docker_image_save.md
Created November 21, 2023 14:48
Save a running docker as a new image

Save a running docker as a new image

The following will show you how to create a new docker image from a running container that you have modified. The image will only exist locally, meaning you can only access and use it on the computer you create it. It will not be associated with any container registry.

We will start with the ubuntu container image as our base.

Run and attach to a container

docker run -a stdin -a stdout -it ubuntu /bin/bash

@mauvehed
mauvehed / revert_last_git_commit.sh
Created October 21, 2023 21:38
Revert last git commit
git reset --hard HEAD~1
@mauvehed
mauvehed / create_pfx_from_crt_and_key.md
Last active October 21, 2023 14:06
Create PFX file from a CRT and KEY file

Create PFX file from a CRT and KEY file

Some services require a combined pfx file to provide TLS to a client

Generating the pfx file

The easiest way is to utilize openssl on the command line. Assuming you already have the .crt and .key files, run the following command.

openssl pkcs12 -export -out domain.name.pfx -inkey domain.name.key -in domain.name.crt

Generating the pfx file with root CA and intermediate certs

@mauvehed
mauvehed / Nextdns_UDM.md
Last active October 11, 2023 22:21
Using NextDNS on UDM Pro

NextDNS on UnifiOS

Source https://github.com/nextdns/nextdns/wiki/UnifiOS

To upgrade/uninstall, run this command again and select the approriate option

sh -c 'sh -c "$(curl -sL https://nextdns.io/install)"'

You can use the nextdns command to control the daemon.

@mauvehed
mauvehed / tail scale-docs.md
Created October 6, 2023 16:02
Tailscale documentation collection
@mauvehed
mauvehed / poetry_export_reqs_wo_hash.sh
Created December 19, 2022 04:01
Poetry Export without Hashes
poetry export --without-hashes --format=requirements.txt > requirements.txt
@mauvehed
mauvehed / BashGPT.sh
Created March 3, 2023 13:25
ChatGPT lookup using bash on the command line
#!/bin/bash
# bashGPT - richinseattle (who failed to gist it, but all credit is given)
[ "${OPENAI_API_KEY}" == "" ] && echo "Please set OPENAI_API_KEY env variable" && exit
[ "$(which jq)" == "" ] && echo "Please install the jq program" && exit
[ "$(which curl)" == "" ] && echo "Please install the curl program" && exit
PROMPT="$1"
while true
@mauvehed
mauvehed / Fail2ban Debian-based Config.md
Last active February 23, 2023 13:47
Fail2ban Debian-based Config

Fail2ban Configuration

The default Fail2ban installation comes with two configuration files, /etc/fail2ban/jail.conf and /etc/fail2ban/jail.d/defaults-debian.conf. It is not recommended to modify these files as they may be overwritten when the package is updated.

Fail2ban reads the configuration files in the following order. Each .local file overrides the settings from the .conf file:

  • /etc/fail2ban/jail.conf
  • /etc/fail2ban/jail.d/*.conf
  • /etc/fail2ban/jail.local
  • /etc/fail2ban/jail.d/*.local
@mauvehed
mauvehed / Tailscale_Docs.md
Last active February 7, 2023 15:45
Tailscale Documentation and Links