Skip to content

Instantly share code, notes, and snippets.

View jeffersfp's full-sized avatar

Jefferson Pires jeffersfp

View GitHub Profile
@jeffersfp
jeffersfp / kafka-del-topics.sh
Created January 31, 2022 14:50 — forked from hartfordfive/kafka-del-topics.sh
Script to delete all kafka topics on a given cluster
#!/bin/bash
TOPICS=$(kafka-topics --zookeeper [ZK_IP]:2181/kafka --list )
for T in $TOPICS
do
if [ "$T" != "__consumer_offsets" ]; then
kafka-topics --zookeeper [ZK_IP]:2181/kafka --delete --topic $T
fi
done
@jeffersfp
jeffersfp / README.md
Last active March 19, 2025 19:54
Arch Linux install: gpt + luks + btrfs + systemd-boot

Arch Linux Install

  • GUID Partition Table
  • Encrypted root and swap partitions with dm-crypt
  • Btrfs filesystem with support to snapshots
  • bspwm + polybar

Download the install ISO image at https://archlinux.org/download/

Burn the ISO to a USB drive and boot from it.

Keybase proof

I hereby claim:

  • I am jeffersfp on github.
  • I am jeffersfp (https://keybase.io/jeffersfp) on keybase.
  • I have a public key ASCkH8T1PmlISYHIPsIJMEPP7hcnPz_MVDH735B19PC1qwo

To claim this, I am signing this object:

@jeffersfp
jeffersfp / gpg-import-and-export-instructions.md
Created May 7, 2020 19:41 — forked from chrisroos/gpg-import-and-export-instructions.md
Instructions for exporting/importing (backup/restore) GPG keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/

or, instead of backing up trustdb...

brew install postgresql openssl
echo 'export PATH="/usr/local/Cellar/postgresql/bin:$PATH"' > ~/.zshrc
env LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" pip --no-cache install psycopg2
@jeffersfp
jeffersfp / config.ini
Created February 10, 2020 14:57 — forked from tsuriga/config.ini
Simple config file validation in python
[DEFAULT]
; Operation mode
; This is a global value for all sections
mode = master
[server]
; Connection lifetime
timeout = 3600
@jeffersfp
jeffersfp / README.md
Last active August 5, 2020 16:18 — forked from erichrobinson/README.md
SwitchResX Configuration

SwitchResX Settings for LG 21:9 UltraWide

SwitchResX is a utility that allows users to override the default resolution settings in OSX. For more information, including download links, vist http://www.madrau.com/ .

Disabling System Integrity Protection (SIP)

If you are running OSX 10.11 or higher, SIP must be disabled. To disable SIP do the following:

  • Boot into the recovery partition by pressing CMD + R when starting up your Mac.
  • Once in recovery mode, open a terminal window.
  • Type the command csrutil disable
@jeffersfp
jeffersfp / sign-virtualbox-kernel-module-files-ubuntu.md
Last active February 7, 2025 15:02
Sign VirtualBox Kernel Module Files - Ubuntu

Sign VirtualBox Kernel Modules - Ubuntu

Follow the steps below if you have EFI Secure Boot enabled and need to sign VirtuaBox Kernel Modules.

  1. Install the virtualbox package
sudo apt install virtualbox
  1. Create a personal public/private RSA key pair which will be used to sign kernel modules
@jeffersfp
jeffersfp / README.md
Last active July 3, 2018 12:08 — forked from mayorova/README.md
Mutual SSL in NGINX

Securing traffic to upstream servers with client certificates

Info: https://www.nginx.com/resources/admin-guide/nginx-https-upstreams/

Creating and Signing Your Certs

Source: http://nategood.com/client-side-certificate-authentication-in-ngi

This is SSL, so you'll need an cert-key pair for you/the server, the api users/the client and a CA pair. You will be the CA in this case (usually a role played by VeriSign, thawte, GoDaddy, etc.), signing your client's certs. There are plenty of tutorials out there on creating and signing certificates, so I'll leave the details on this to someone else and just quickly show a sample here to give a complete tutorial. NOTE: This is just a quick sample of creating certs and not intended for production.