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 / 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 / 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 / aws_rds_postgres shared_buffers.md
Last active June 15, 2023 08:36
AWS RDS PostgreSQL shared_buffers
@normoes
normoes / java_springboot_mongodb_aggregates.md
Last active April 12, 2023 16:04
mongodb aggregates using MongoRepository in Java spring boot

mongodb aggregates using MongoRepository in Java spring boot


Some prerequisites and assumptions

Use the following dependencies within your pom.xml:

  • spring-boot-starter-parent 1.5.7.RELEASE
  • spring-boot-starter-data-mongodb
@normoes
normoes / docker_popular_packages.md
Last active February 27, 2023 14:59
install popular docker packages
@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_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
@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 / password creation.md
Last active July 13, 2021 18:40
passwords and encrypted passwords

password creation

cli password generation

apg -a 1 -m 15 -n 15

Output

HrTvb(r&xb1~}Xr
`i;af,/z%bi8(`x
@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.