Skip to content

Instantly share code, notes, and snippets.

View jeffersfp's full-sized avatar

Jefferson Pires jeffersfp

  • São Paulo, Brazil
  • 06:27 (UTC -03:00)
View GitHub Profile

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@jeffersfp
jeffersfp / docker-compose.yml
Created August 25, 2023 16:28 — forked from marcelo-ochoa/docker-compose.yml
Traefik plus Portainer stack
version: "3.6"
services:
whoami:
image: traefik/whoami:v1.6.0
deploy:
mode: replicated
replicas: 1
labels:
- traefik.enable=true
@jeffersfp
jeffersfp / Quirks of C.md
Created August 10, 2023 18:55 — forked from jdmonty/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;
@jeffersfp
jeffersfp / wsl-cheatsheet.ps1
Created September 14, 2022 22:05 — forked from karthiks/wsl-cheatsheet.ps1
WSL 2 CLI Cheat-sheet To Be Run In Powershell
# To list installed distributions
wsl -l
wsl --list
# To list installed distributions along with its running status and wsl config being 1 or 2
wsl -l --verbose
wsl -l -v
# To run a specific distro
wsl -d distro_name
@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 2, 2023 19:48
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