Skip to content

Instantly share code, notes, and snippets.

View cweedall's full-sized avatar

Christopher Weedall cweedall

View GitHub Profile
@cweedall
cweedall / keybase.md
Last active July 19, 2017 02:36
Keybase-GitHub verification

Keybase proof

I hereby claim:

  • I am flueterflam on github.
  • I am chrisweedall (https://keybase.io/chrisweedall) on keybase.
  • I have a public key ASB3LWIxAPjl_4tMNB97NA-g6e_ViTkAa5Ip5poXJ_7q8go

To claim this, I am signing this object:

@cweedall
cweedall / git_config_and_cheatsheet
Created August 20, 2020 23:49
Cheatsheet for configuring git locally and creating/updating repositories
# Install hub - the API for github and git
sudo apt-get install hub
###
### See link for details on `hub` API:
### https://hub.github.com/
###
# Prefer the HTTPS protocol for git operations: instead of git: or ssh::
# This will affect `clone`, `fork`, `remote add` and other `hub` commands that expand shorthand references to GitHub repo URLs.
@cweedall
cweedall / chrony.conf as NTP server
Created August 20, 2020 23:59
Configuration file for chrony to act as NTP server
# Welcome to the chrony configuration file. See chrony.conf(5) for more
# information about usuable directives.
#pool 2.debian.pool.ntp.org iburst
pool 0.us.pool.ntp.org iburst
pool 1.us.pool.ntp.org iburst
pool 2.us.pool.ntp.org iburst
pool 3.us.pool.ntp.org iburst
# Allow NTP client access from local network.
### MODIFY IP ADDRESS FOR USE WITHIN YOUR PRIVATE NETWORK
@cweedall
cweedall / copy+paste method for entire file
Created August 21, 2020 00:03
Using `xsel` to copy + paste contents of entire file
# Install if needed!
apt-get install xsel
# Contents piped from file into xsel buffer (can then be pasted elsewhere)
cat FILENAME | xsel
@cweedall
cweedall / Run django cmd via docker-compose
Created August 21, 2020 00:10
Method to use `migrate` and `makemigrations` commands in Django which is running in Docker container (via docker-compose)
# Assume django in container named web
# Use `python3` instead of `python` if necessary
docker-compose run web python manage.py migrate
docker-compose run web python manage.py makemigrations APP_NAME
#######################################################
### example docker-compose.yaml file
#######################################################
version: '3'
@cweedall
cweedall / waitress (gunicorn alternative) in Python (for Windows OS)
Last active April 26, 2024 08:39
`waitress` / `waitress-serve` is `gunicorn` alternative for Python-based WSGI web app (like Django) on Windows
# Run a WSGI web app (like Django) on Windows
# see: https://stackoverflow.com/a/48542020/7363740
# Install if necessary
conda install waitress
pip install waitress
# Replace standard `gunicorn` command with `waitress-serve`
# for example: gunicorn --listen=*:8000 myapp.wsgi:application
waitress-serve --listen=*:8000 myapp.wsgi:application
@cweedall
cweedall / log2ram: ERROR: RAM disk too small. Can't sync
Created August 21, 2020 00:30
log2ram (safe logs to RAM until large enough to transfer to log file) sometimes doesn't start because virtual RAM disk is too small - these settings can fix!
# When log2ram has the following error:
# ERROR: RAM disk too small. Can't sync
# see: https://github.com/azlux/log2ram/issues/90
# In /etc/log2ram.conf
# change
SIZE=40M
# to