Skip to content

Instantly share code, notes, and snippets.

View old-adapdr's full-sized avatar

Ada old-adapdr

  • The Netherlands
View GitHub Profile
@old-adapdr
old-adapdr / .ssh-config
Created January 28, 2023 09:52
SSH Config Example
Host github.com
User git
Hostname github.com
PreferredAuthentications publickey
IdentityFile /home/user/.ssh/id_rsa

Useful Python snippets

# Append to venv/bin/activate to load .env variables in VSCode
export $(grep -v '^#' .env | xargs)
# Append to venv/bin/activate to avoid .pyc files
export PYTHONDONTWRITEBYTECODE=1
@old-adapdr
old-adapdr / setup_github_cli.sh
Last active January 8, 2021 20:21
GitHub CLI one-liner for installing on new devices
#!/usr/bin/env bash
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0 && \
sudo apt-add-repository https://cli.github.com/packages && \
sudo apt update && \
sudo apt install gh
@old-adapdr
old-adapdr / python_kv_store.py
Last active December 9, 2022 18:26
Python native key/value storage
"""
This file contains helper functions for the built-in
python (key, value) storage
"""
import dbm
from secrets import token_urlsafe
from logging import getLogger
from typing import Union, Tuple