Skip to content

Instantly share code, notes, and snippets.

View df-a's full-sized avatar
🎯
Focusing

df-a

🎯
Focusing
View GitHub Profile
@df-a
df-a / yaml-to-json.md
Created October 7, 2022 17:56
Convert yaml to json using python

python3 -c 'import sys, yaml, json; json.dump(yaml.load(sys.stdin, Loader=yaml.FullLoader), sys.stdout, indent=4)' < input.yaml > output.json

@df-a
df-a / 01nginx-tls-sni.md
Created October 7, 2022 01:23 — forked from kekru/01nginx-tls-sni.md
nginx TLS SNI routing, based on subdomain pattern

Nginx TLS SNI routing, based on subdomain pattern

Nginx can be configured to route to a backend, based on the server's domain name, which is included in the SSL/TLS handshake (Server Name Indication, SNI).
This works for http upstream servers, but also for other protocols, that can be secured with TLS.

prerequisites

  • at least nginx 1.15.9 to use variables in ssl_certificate and ssl_certificate_key.
  • check nginx -V for the following:
    ...
    TLS SNI support enabled
@df-a
df-a / nginx-tls.conf
Created October 3, 2022 02:24 — forked from gavinhungry/nginx-tls.conf
Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Name: nginx-tls.conf
# Auth: Gavin Lloyd <gavinhungry@gmail.com>
# Desc: Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Enables HTTP/2, PFS, HSTS and OCSP stapling. Configuration options not related
# to SSL/TLS are not included here.
#
# Additional tips:
#
@df-a
df-a / words.js
Created August 10, 2022 09:13 — forked from devbyray/words.js
const words = [
// Borrowed from xkcd password generator which borrowed it from wherever
"ability","able","aboard","about","above","accept","accident","according",
"account","accurate","acres","across","act","action","active","activity",
"actual","actually","add","addition","additional","adjective","adult","adventure",
"advice","affect","afraid","after","afternoon","again","against","age",
"ago","agree","ahead","aid","air","airplane","alike","alive",
"all","allow","almost","alone","along","aloud","alphabet","already",
"also","although","am","among","amount","ancient","angle","angry",
"animal","announced","another","answer","ants","any","anybody","anyone",
@df-a
df-a / folder_splitter.py
Created May 12, 2022 12:41 — forked from zupo/folder_splitter.py
Split a folder with many files into subfolders with N files. Usage: python folder_splitter.py path/to/target/folder
# -*- coding: utf-8 -*-
# @author: Peter Lamut
import argparse
import os
import shutil
N = 10 # the number of files in seach subfolder folder
@df-a
df-a / FreeNAS.md
Created January 13, 2022 05:10 — forked from nojuan/FreeNAS.md
Utimate FreeNAS Setup

FreeNAS

This page is constantly being edited and worked on. Most of these should work but some might be broken.

Here are straight-forward instructions to setting up a bunch of different software on FreeNAS. If you make a terrible error, just throw up another plugin sandbox and repeat.

ToC

@df-a
df-a / user.js
Created January 9, 2022 02:02 — forked from brainfucksec/user.js
user.js - brainfucksec
/*********************************************************************
*
* Mozilla Firefox configuration file: `user.js`
*
* date: 2022-01-08
* version: 0.8.2
* maintainer: brainf+ck
*
* info: Set preferences for the selected profile when Firefox start.
* Copy this file on Firefox Profile folder. You should create a
@df-a
df-a / .rtorrent.rc
Last active January 6, 2022 23:21 — forked from sasapurin/.rtorrent.rc
rtorrent configuration file with description fix 20190713
# This is an example resource file for rTorrent. Copy to
# ~/.rtorrent.rc and enable/modify the options as needed. Remember to
# uncomment the options you wish to enable.
# Maximum and minimum number of peers to connect to per torrent.
throttle.min_peers.normal = 1
throttle.max_peers.normal.set = 100
# Same as above but for seeding completed torrents (-1 = same as downloading)
throttle.min_peers.seed.set = 1
@df-a
df-a / .rtorrent.rc
Created January 6, 2022 23:14 — forked from bryanjswift/.rtorrent.rc
rtorrent configuration file with description
# This is an example resource file for rTorrent. Copy to
# ~/.rtorrent.rc and enable/modify the options as needed. Remember to
# uncomment the options you wish to enable.
# Maximum and minimum number of peers to connect to per torrent.
min_peers = 1
max_peers = 100
# Same as above but for seeding completed torrents (-1 = same as downloading)
@df-a
df-a / openssl-macos-install.sh
Created December 19, 2021 11:50
Install OpenSSL on macOS monterrey+
#!/bin/zsh
# choose OpenSSL version to install
# avbailable versions here: https://github.com/openssl/openssl/tags
# you have to copy from the "l" or the "L", they use lowecase and uppercase on the various branches
VERSION="l-3.0.1" # VERSION="L_1_1_1l"
# compiler options:
# darwin-i386 | darwin-i386-cc | darwin-ppc | darwin-ppc-cc | darwin64-arm64 | darwin64-arm64-cc | darwin64-ppc | darwin64-ppc-cc | darwin64-x86_64 | darwin64-x86_64-cc
COMPILER="darwin64-x86_64-cc"