Skip to content

Instantly share code, notes, and snippets.

export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/GitHub
export VIRTUALENVWRAPPER_SCRIPT=/usr/share/virtualenvwrapper/virtualenvwrapper.sh
source /usr/share/virtualenvwrapper/virtualenvwrapper_lazy.sh
# One-liner to fix "no unqualified-search registries are defined" errors in Podman
mkdir -p ~/.config/containers && echo unqualified-search-registries = [\"docker.io\"] >> ~/.config/containers/registries.conf

Reading MS Access data in Pandas

  1. Download and install 32-bit Python 3.9 (this is the latest version that works with Access drivers) https://www.python.org/ftp/python/3.9.13/python-3.9.13.exe
  2. Create a virtualenv: mkvirtualenv -p 3.9 pandas-32bit
  3. Install pandas 2.0.3 (the last with 32-bit wheels) and pyodbc: pip install pandas==2.0.3 pyodbc sqlalchemy
  4. List drivers: import pyodbc; pyodbc.drivers() - the usual driver will be Microsoft Access Driver (*.mdb, *.accdb)
  5. Connect using sqlalchemy:
DRIVER = "Microsoft Access Driver (*.mdb, *.accdb)"
@bdunnette
bdunnette / .env
Last active August 17, 2023 16:07
Send email notifications if 6-hour precipitation is above threshold
SENDGRID_API_KEY=Paste key from https://app.sendgrid.com/settings/api_keys here
[email protected]
RECIPIENTS=${SENDER},[email protected]
NWS_STATION=KMIC
MIN_PRECIP=25
from datetime import datetime
import logging
import requests
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO, format="%(asctime)s %(message)s")
# Start Configuration
NWS_STATION = "KMIC"
MIN_PRECIP = 10
@bdunnette
bdunnette / bc-parks-geopandas.ipynb
Last active July 16, 2024 20:46
bc-parks-geopandas.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bdunnette
bdunnette / funkwhale-manage.md
Last active December 16, 2022 22:09
Deleting a Funkwhale library via manage.py

Enter the virtualenv and run Django shell:

cd /srv/funkwhale/
source virtualenv/bin/activate
./manage shell

Import Funkwhale models:

@bdunnette
bdunnette / docker-compose.yml
Created September 16, 2022 20:56
compose file for quick Dremio OSS demo server
version: "3"
services:
dremio:
image: dremio/dremio-oss:latest
container_name: dremio-oss
ports:
- "9047:9047"
- "31010:31010"
- "45678:45678"
@bdunnette
bdunnette / derby_name_scraper.ipynb
Last active July 7, 2022 17:05
derby_name_scraper.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.