Skip to content

Instantly share code, notes, and snippets.

View haasr's full-sized avatar

Ryan Haas haasr

View GitHub Profile
@haasr
haasr / gist:954fafc50f847a16690e95cc05a6bfed
Last active October 15, 2025 14:13
Guide: Set Up Secure Django Website using Ubuntu + Nginx, Certbot, Fail2Ban, UFW
Set Up Secure Django Website: Ubuntu + Nginx, Postgres DB, Certbot, Fail2Ban, UFW
*********************************************************************************
Using Ubuntu 22.04 deployed on DigitalOcean. Some steps (most of the SSH
key configuration) apply more to DigitalOcean. I also used Ubuntu 18.04
but Python version had to be updated to 3.9.7 or many dependencies had
to be deprecated.
In this setup process, my static files are stored in AWS. If your static
storage is configured another way, set the STATIC_ROOT in settings.py.
@haasr
haasr / initial_setup.bash
Last active September 21, 2023 00:15
DigitalOcean Django project Initial setup script
#! /bin/bash -
# Set time zone
echo "> Setting timezone.."
sudo dpkg-reconfigure tzdata
# Initial upgrade/installs
echo "> Upgrading system.."
sudo apt update && sudo apt upgrade -y
@haasr
haasr / gist:dab4f9cb6de2c7a6c186859387635223
Created September 13, 2023 21:52
Fix Apache Directory Studio Hang on Boot (Java exit code -805306369)
For some reason ADS tends to enter a deadlock on launch, seemingly
because it tends to corrupt its own cache. Anyhow, executing Apache
with the "-clean" flag has always fixed it for me. This will clean
the caches that store bundle dependency resolution data and OSGi
extension data and then recreate them.
Windows Batch script (i.e., save in a .bat file):
cd "C:\Program Files\Apache Directory Studio"
ApacheDirectoryStudio.exe -clean
@haasr
haasr / whisperx-gui.py
Last active March 6, 2025 13:51
WhisperX Transcription GUI (frontend for m-bain/whisperX; does not include diarization)
import tkinter as tk
from tkinter import ttk, scrolledtext, filedialog, messagebox
import threading
import whisperx
import os
import sys
import datetime
import shutil
from pathlib import Path
import queue
/*
1. Open command palette (Cmd shift p)
2. Type "install ext" and choose the option "Extensions: Install Extensions"
3. In the Extensions Marketplace, search "minimal". Select "Minimal" by nichabosh and install it.
4. Open command palette (Cmd shift p)
5. Type "open user settings" and choose the option "Preferences: Open User Settings (JSON)"
6. Paste below and save:
*/
{
/*
1. Open command palette (Cmd shift p)
2. Type "install ext" and choose the option "Extensions: Install Extensions"
3. In the Extensions Marketplace, search "minimal". Select "Minimal" by nichabosh and install it.
4. Open command palette (Cmd shift p)
5. Type "open user settings" and choose the option "Preferences: Open User Settings (JSON)"
6. Paste below and save:
*/
{
/*
1. Open command palette (Cmd shift p)
2. Type "install ext" and choose the option "Extensions: Install Extensions"
3. In the Extensions Marketplace, search "minimal". Select "Minimal" by nichabosh and install it.
4. Open command palette (Cmd shift p)
5. Type "open user settings" and choose the option "Preferences: Open User Settings (JSON)"
6. Paste below and save:
*/
{
/*
1. Open command palette (Cmd shift p)
2. Type "install ext" and choose the option "Extensions: Install Extensions"
3. In the Extensions Marketplace, search "minimal". Select "Minimal" by nichabosh and install it.
4. Open command palette (Cmd shift p)
5. Type "open user settings" and choose the option "Preferences: Open User Settings (JSON)"
6. Paste below and save:
*/
{
@haasr
haasr / vscode_claude_light_theme
Last active October 14, 2025 04:18
Made colors warmer = less pain :)
/*
1. Open command palette (Cmd shift p)
2. Type "install ext" and choose the option "Extensions: Install Extensions"
3. In the Extensions Marketplace, search "Grueling Hare". Select "Grueling Hare" by Tim Franklin and install it.
4. Open Command paletted (Cmd shift p)
5. Type "color theme" and select "Preferences: Color Theme"
6. Select "Grueling Hare Light" color theme.
7. Open command palette (Cmd shift p)
8. Type "open user settings" and choose the option "Preferences: Open User Settings (JSON)"
9. Paste below and save:
/*
1. Open command palette (Cmd shift p)
2. Type "install ext" and choose the option "Extensions: Install Extensions"
3. In the Extensions Marketplace, search "Grueling Hare". Select "Grueling Hare" by Tim Franklin and install it.
4. Open Command paletted (Cmd shift p)
5. Type "color theme" and select "Preferences: Color Theme"
6. Select "Grueling Hare Dark" color theme.
7. Open command palette (Cmd shift p)
8. Type "open user settings" and choose the option "Preferences: Open User Settings (JSON)"
9. Paste below and save: