Skip to content

Instantly share code, notes, and snippets.

bool-dev

Block or report user

Report or block bool-dev

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bool-dev
bool-dev / migrate_postgresql_database.md
Created Jan 17, 2018 — forked from olivierlacan/migrate_postgresql_database.md
How to migrate a Homebrew-installed PostgreSQL database to a new major version (9.3 to 9.4) on OS X
View migrate_postgresql_database.md

This guide assumes that you recently run brew upgrade postgresql and discovered to your dismay that you accidentally bumped from one major version to another: say 9.3.x to 9.4.x. Yes, that is a major version bump in PG land.

First let's check something.

brew info postgresql

The top of what gets printed as a result is the most important:

@bool-dev
bool-dev / s3DuByPrefix.sh
Created Jan 3, 2018 — forked from joech4n/s3DuByPrefix.sh
Get bucket size and object count by first level prefix (i.e. bucket/prefix1, bucket/prefix2)
View s3DuByPrefix.sh
#!/bin/sh
BUCKETNAME=mybucketname; REGION=us-east-1; for prefix in $(aws s3api list-objects --bucket $BUCKETNAME --delimiter '/' --output text --region $REGION |grep COMMONPREFIX |tail -n+2| awk '{print $2}'); do echo "Totals for $prefix"; aws s3 ls --summarize --human-readable --recursive s3://$BUCKETNAME/$prefix --region $REGION ; done |grep Total
@bool-dev
bool-dev / docker-cleanup-resources.md
Created Nov 6, 2017 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks
View docker-cleanup-resources.md

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
@bool-dev
bool-dev / requirements.txt
Last active Oct 27, 2017
simple test flask sqlalchemy app
View requirements.txt
click==6.7
Flask==0.12.2
Flask-SQLAlchemy==2.3.2
itsdangerous==0.24
Jinja2==2.9.6
MarkupSafe==1.0
psycopg2==2.7.3.2
SQLAlchemy==1.1.14
Werkzeug==0.12.2
@bool-dev
bool-dev / ladder.md
Created Jun 8, 2016 — forked from jamtur01/ladder.md
Kickstarter Engineering Ladder
@bool-dev
bool-dev / nginx.conf
Created May 27, 2016 — forked from jmervine/nginx.conf
Nginx config to test regex.
View nginx.conf
# Usage:
#
# Start with:
#
# sudo /use/local/sbin/nginx -c /path/to/this/nginx.conf
#
# Tail logs:
#
# $ sudo tail -f /tmp/access.log /tmp/error.log /tmp/match.log
#
@bool-dev
bool-dev / gist:5b124f72590cda3d5f13
Created Mar 7, 2016 — forked from gcatlin/gist:1847248
Install specific version of Homebrew formula
View gist:5b124f72590cda3d5f13
brew update
brew versions FORMULA
cd `brew --prefix`
git checkout HASH Library/Formula/FORMULA.rb # use output of "brew versions"
brew install FORMULA
brew switch FORMULA VERSION
git checkout -- Library/Formula/FORMULA.rb # reset formula
## Example: Using Subversion 1.6.17
#
@bool-dev
bool-dev / post-merge
Created Feb 12, 2016 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed. In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed. Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
View post-merge
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@bool-dev
bool-dev / Jinja module loader.md
Created Feb 8, 2016 — forked from voscausa/Jinja module loader.md
Jinja2 compiled templates module loader for App Engine Pyhton 2.7.
View Jinja module loader.md

Jinja compiled templates module loader

This code is part of a Jinja CMS for Google App Engine Python 2.7 and NDB datastore

A Jinja enviroment is created for every CMS site: site_key_id = 'example

The modules are created using compiler.py The resulting code objects are stored in the dadastore using Kind Runtimes and a BlobProperty

The modules can also be saved / downloaded as .pyc in a zip archive: <site_key_id>-compiled-templates.zip

You can’t perform that action at this time.