Skip to content

Instantly share code, notes, and snippets.

View normoes's full-sized avatar
💭
working

Norman Schenck normoes

💭
working
View GitHub Profile
@normoes
normoes / remove_docker_volumes.md
Last active November 23, 2020 08:10
Remove docker volumes

This is more or less a sequence of manual steps, because I don't want to remove volumes I might still need, especially if no containers are using those volumes at the moment.

This is also why I, sometimes, prefer the following over: docker volume prune.


In situations where I have literally thousands of docker volumes, basically after a long time of not removing any docker volumes, the following comes in handy.

At first I get the 200 (just some number) biggest docker volumes (as root). I exclude containers, that contain postgres or redis in their names, essentially allowing the removal of all other volatile containers, named and unnamed.

@normoes
normoes / aws_rds_postgres shared_buffers.md
Last active June 15, 2023 08:36
AWS RDS PostgreSQL shared_buffers
@normoes
normoes / python_privy.md
Created June 13, 2020 14:49
Python and privy - password-protect data

Python and privy

python -c "import privy; hidden=privy.hide(secret=b'test', password='passwd', security=2); print(hidden); plain=privy.peek(hidden=hidden, password='passwd'); print(plain.decode())"

Output:

1$2$7nzvIxU2Xkt8DE4DgxwIgRt_HE6acDcPx10mCCQXbDM=$Z0FBQUFBQmU1T1pKQ0hfSVJ6bmZxZVpVckpTTzd4NElYNnVfNGdweFZiLUQtdDVCREQ2djJPLWxFVG81bXNHaUtmbnJ4NTVYZXpLbm1CdWl4aEF0cFd3ZTJES19HR1ViNXc9PQ==
test
@normoes
normoes / get_ashandle_of_domain.md
Last active March 10, 2022 21:28
Get ASHandle of a domain

Get ASHandle of a domain

I wanted to get all IPs that belong to facebook.com.

The command I found is the following

whois -h whois.radb.net -- '-i origin AS32934'

whois -h whois.radb.net -- '-i origin AS32934' | grep ^route
@normoes
normoes / dns_over_tls_pubkey_value.md
Last active December 13, 2023 14:01
getting tls pubkey value for DNS over TLS certificates

Getting the tls pubkey for a DNS over TLS address

I added cloudflare-dns.com to my stubby.yml and couldn't find any information on the value of the tls_pubkey_pinset

tls_pubkey_pinset:
  - digest: "sha256"
    value: MISSING

Although I could find some examples, the value seemed to be wrong.

@normoes
normoes / docker_troubleshooting.md
Last active March 12, 2019 13:33
docker troubleshooting

Text file is busy

When executing a file whose permissions were changed earlier, a Text file is busy error could appear.

RUN cd scripts/test_env \
    && chmod +x test.prepareapp.sh
    && ./test.prepareapp.sh

It helps to add sync after changing permissions on the file:

@normoes
normoes / get_files_and_info_from_docker_container.md
Created March 1, 2019 15:12
Get files and information from a docker container

This can be used to retreive files/binaries/information from docker containers.

#!/bin/bash

set -Eeuo pipefail

mkdir ./binary || true

# build most recent docker image
@normoes
normoes / ledger_nano_s_and_monero.md
Last active October 22, 2018 09:10
Using the ledger nano s with Monero

Ledger nano s

Ledger nano s initialization

After unboxing the ledger, I just connected it via the USB cable. It powered up perfectly and started the initialization process. The ledger asked to set a PIN, then I had to copy the seed word by word and confirm it by repeating it word by word.

I had a short look into the settings and naively tried to create a HW wallet using monero-wallet-cli (see below for the actual command).

Getting the ledger recognized by the system

It turned out the ledger nano s was not detected by my linux system (ubuntu 18.04), so I searched the internet and found a script (see below) from

@normoes
normoes / pipenv_create_virtualenv_in_project_dir.md
Last active October 12, 2018 07:52
Create pipenv virtual env folder in project directory

create venv in project directory

# create project directory
mkdir ~/project && cd ~/project
# create virtual environment
PIPENV_VENV_IN_PROJECT=true pipenv --three
# check location
pipenv --venv
# output
@normoes
normoes / get_latest_release.md
Created October 12, 2018 07:45
Get latest github release

Get latest:

curl --silent "https://api.github.com/repos/monero-project/monero/releases/latest" | grep '"tag_name":' | cut -d ':' -f2 | tr -d '", '

Get all

curl --silent "https://api.github.com/repos/monero-project/monero/releases" | grep '"tag_name":' | cut -d ':' -f2 | tr -d '", ' | head -n1