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 / 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 <[email protected]>
# 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 / libtorrent and rtorrent on mac.sh
Last active December 10, 2021 21:24 — forked from pyed/libtorrent and rtorrent on mac.sh
Compiling rtorrent on a mac
#!/bin/bash
# Installs the XCode command line tools if you don't have them
xcode-select --install
# Installs brew if you don't have it
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Makes your account the owner of /usr/local, which is preferred on single user Macs
sudo chown -R `whoami` /usr/local
# Installs all the dependencies for building libtorrent and rtorrent
brew install automake libtool boost curl lzlib libsigc++ openssl pkg-config xmlrpc-c
# Uninstall libtorrent-rasterbar if you already have it
@df-a
df-a / zmv-examples.md
Last active November 2, 2021 01:23 — forked from nightscape/zmv-examples.md
ZMV-Examples (require autoload zmv)

rename a section of a filename, i. e. example.1.{txt,conf,db} or 12345.1.{wav,ogg,mp3} and change the 1 to a 2 in the filename while preserving the rest of it.

  zmv -n '(*.)(<->)(.[^.]#)' '$1$(($2+1))$3' # would rename x.0001.y to x.2.y.
  zmv -n '(*.0#)(<->)(.[^.]#)' '$1$(($2+1))$3'

Rename files to lower case

  $ zmv '*' '${(L)f}'