Skip to content

Instantly share code, notes, and snippets.

View Jacke's full-sized avatar
👀
Mastermind

Stan Sobolev Jacke

👀
Mastermind
View GitHub Profile
@Jacke
Jacke / rotate_dkim.py
Created October 27, 2023 15:22 — forked from ryancdotorg/rotate_dkim.py
Experimental DKIM rotate/revoke/repudiate script for Exim+Route53. I take no responsibility for its use.
#!/usr/bin/env python
import os
import grp
import sys
import stat
import time
import hmac
import boto3
import tempfile
@Jacke
Jacke / dkim_rotation.sh
Created October 27, 2023 15:22 — forked from Frederick888/dkim_rotation.sh
Automatic DKIM key rotation with Cloudflare
#!/usr/bin/env bash
# Read https://www.linode.com/docs/email/postfix/configure-spf-and-dkim-in-postfix-on-debian-8 first!
# Run this script at the beginning of each month
# (Optional) Email notification if the script is interrupted
#function notify() {
# printf 'Refer to the logs for further info.\n' | mail -s 'DKIM rotation process was interrupted' 'admin@example.com'
#}
#
@Jacke
Jacke / escape-sequences.txt
Created October 25, 2023 15:38 — forked from olivertappin/escape-sequences.txt
Stuck with a frozen SSH session which has timed out? Try some of these:
Supported escape sequences:
~. - terminate connection (and any multiplexed sessions)
~B - send a BREAK to the remote system
~C - open a command line
~R - request rekey
~V/v - decrease/increase verbosity (LogLevel)
~^Z - suspend ssh
~# - list forwarded connections
~& - background ssh (when waiting for connections to terminate)
~? - this message
@Jacke
Jacke / pg_13_rewind_and_back
Created June 8, 2023 07:41 — forked from cabecada/pg_13_rewind_and_back
pg_13_rewind_and_back
postgres@db:~/playground/rewinddemo$ initdb -D primary
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
@Jacke
Jacke / macOS Internals.md
Created May 30, 2023 14:33 — forked from kconner/macOS Internals.md
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@Jacke
Jacke / settings.jsonc
Created May 15, 2023 14:03 — forked from hyperupcall/settings.jsonc
VSCode config to disable popular extensions' annoyances (telemetry, notifications, welcome pages, etc.)
// I'm tired of extensions that automatically:
// - show welcome pages / walkthroughs
// - show release notes
// - send telemetry
// - recommend things
//
// This disables all of that stuff.
// If you have more config, leave a comment so I can add it!!
{
@Jacke
Jacke / bandwidth_throughput_latency_testing.md
Created April 2, 2023 11:24 — forked from yodamaster/bandwidth_throughput_latency_testing.md
Network & CLI: Bandwidth, Throughput and Latency Testing

Bandwidth and Latency Testing

It's very useful to understand the bandwidth, throughput and latency of the remote computer you're trying to communicate with. It can inform you how well you can play a multiplayer game (latency), or the bitrate at which you can stream a video (throughput).

The difference between bandwidth and throughput is:

@Jacke
Jacke / slope_vs_starting.md
Created February 19, 2023 07:44 — forked from gtallen1187/slope_vs_starting.md
A little bit of slope makes up for a lot of y-intercept

"A little bit of slope makes up for a lot of y-intercept"

01/13/2012. From a lecture by Professor John Ousterhout at Stanford, class CS140

Here's today's thought for the weekend. A little bit of slope makes up for a lot of Y-intercept.

[Laughter]

@Jacke
Jacke / sql_data_gen.sql
Created December 19, 2022 08:20
Postgres Data generator
CREATE UNLOGGED TABLE test_table (
id bigint /*primary key*/ not null,
text1 text not null, /* 1 KiB of random data */
text2 text not null, /* 255 bytes of random data */
/* cardinality columns */
int1000 bigint not null, /* ranges 0..999, cardinality: 1000 */
int100 bigint not null, /* 0..99, card: 100 */
int10 bigint not null /* 0..10, card: 10 */
@Jacke
Jacke / Quirks of C.md
Created November 27, 2022 17:43 — forked from fay59/Quirks of C.md
Quirks of C

Here's a list of mildly interesting things about the C language that I learned mostly by consuming Clang's ASTs. Although surprises are getting sparser, I might continue to update this document over time.

There are many more mildly interesting features of C++, but the language is literally known for being weird, whereas C is usually considered smaller and simpler, so this is (almost) only about C.

1. Combined type and variable/field declaration, inside a struct scope [https://godbolt.org/g/Rh94Go]

struct foo {
   struct bar {
 int x;