Skip to content

Instantly share code, notes, and snippets.

View bradmontgomery's full-sized avatar

Brad Montgomery bradmontgomery

View GitHub Profile
$ python3 search.py
> ice cream
Saturday Night Live
San Miguel Beermen
Android (operating system)
Durham, North Carolina
Pharrell Williams
New England
Guanajuato
Lafayette, Louisiana
@Uchean
Uchean / clamav-mac.md
Created December 9, 2015 23:36
Get ClamAV running on Mac OS X (using Homebrew)

Get ClamAV running on Mac OS X (using Homebrew)

The easiest way to get the ClamAV package is using Homebrew

$ brew install clamav

Before trying to start the clamd process, you'll need a copy of the ClamAV databases.

Create a freshclam.conf file and configure as so

@xrstf
xrstf / letsencrypt.md
Last active April 18, 2023 05:01
Let's Encrypt on Ubuntu 14.04, nginx with webroot auth

Let's Encrypt on Ubuntu 14.04, nginx with webroot auth

This document details how I setup LE on my server. Firstly, install the client as described on http://letsencrypt.readthedocs.org/en/latest/using.html and make sure you can execute it. I put it in /root/letsencrypt.

As it is not possible to change the ports used for the standalone authenticator and I already have a nginx running on port 80/443, I opted to use the webroot method for each of my domains (note that LE does not issue wildcard certificates by design, so you probably want to get a cert for www.example.com and example.com).

Configuration

For this, I placed config files into etc/letsencrypt/configs, named after <domain>.conf. The files are simple:

@albert-decatur
albert-decatur / crouton_notes.md
Last active August 24, 2016 01:41
crouton notes

crouton tips for chromebook

# making chroots in any diredctory you want, eg on removeable media
sudo sh ~/Downloads/crouton -r trusty -t x11 -p /media/removable/USB\ Drive/crouton/chroots/

# enter chroot from removeable media
sudo enter-chroot -c /media/removable/USB\ Drive/crouton/chroots/
@bradmontgomery
bradmontgomery / resize_drawables.sh
Last active March 5, 2018 18:44
A bash function to resize a collection of icons (e.g. png images) and organize them using android studio's drawable directory format.
#!/bin/bash
# Given a collection of .png files, this function will resize the images
# and organize them in a way that android studio expects.
#
# Usage: resize_drawables *.png
#
# Given a file, my_icon.png, the command:
#
# rezie_drawables my_icon.png
@herrbischoff
herrbischoff / new_gist_file.sh
Last active December 21, 2018 14:43
Install MacVim via Homebrew with Lua and Python
brew install macvim --HEAD --with-cscope --with-lua --override-system-vim --with-luajit --with-python
#!/usr/bin/env sh
# take the current folder name as the app name
APPNAME=${PWD##*/}
# start a new persistent postgres container named appname_pg that listens on local port 5432
docker run -p 5432:5432 --name ${APPNAME}_pg postgres
@bradmontgomery
bradmontgomery / git-cheat-sheet.md
Last active February 25, 2022 20:08
a little git cheat sheet.

git cheat sheet

Interactively stage changes in a file

git add -ip <file>

Create a new, remote tracking branch (without branching from a local branch)

git co -b somebranch upstream/somebranch
nginx: https://gist.github.com/michiel/1064640
django: https://github.com/ottoyiu/django-cors-headers
@sburns
sburns / gist:5bd6a203721bfaef4031
Created June 27, 2014 16:23
Python scientific stack in <40 seconds!
$ mkvirtualenv test && workon test
New python executable in test/bin/python2.7
Not overwriting existing python script test/bin/python (you must use test/bin/python2.7)
Installing setuptools, pip...done.
$ pip --version
pip 1.5.4 from /Users/scottburns/.virtualenvs/test/lib/python2.7/site-packages (python 2.7)
$ date; pip install numpy pandas scipy > /dev/null; date
Fri Jun 27 11:19:57 CDT 2014
Fri Jun 27 11:20:35 CDT 2014