Skip to content

Instantly share code, notes, and snippets.

View jakul's full-sized avatar
🏳️‍🌈
LGBT and proud

Craig Blaszczyk jakul

🏳️‍🌈
LGBT and proud
View GitHub Profile
@robertpainsi
robertpainsi / commit-message-guidelines.md
Last active April 25, 2024 13:38
Commit message guidelines

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
@nmarley
nmarley / dec.py
Last active August 8, 2023 13:55
AWS KMS encryption/decryption using Python/Boto3
import boto3
import base64
if __name__ == '__main__':
session = boto3.session.Session()
kms = session.client('kms')
encrypted_password = 'AQECAHjgTiiE7TYRGp5Irf8jQ3HzlaQaHGYgsUJDaavnHcFm0gAAAGswaQYJKoZIhvcNAQcGoFwwWgIBADBVBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDDwxVQuG0oVwpkU7nQIBEIAoVGk1/wpserb+GVUOzE7PiL/Nr9fTDFKZfpKpF0ip2ct4B2q0Wn6ZZw=='
binary_data = base64.b64decode(encrypted_password)
@qw3r
qw3r / pyenv-on-codeship.sh
Last active August 7, 2017 16:58
Install PyEnv, the required Python version and package requirements on Codeship
export PYENV_ROOT="${HOME}/cache/.pyenv"
if [ -d ${PYENV_ROOT} ]; then (cd ${PYENV_ROOT}; git pull --rebase); else git clone https://github.com/yyuu/pyenv.git ${PYENV_ROOT}; fi
export PATH="${PYENV_ROOT}/bin:${PATH}"
eval "$(pyenv init -)"
pyenv install -s; echo 'lofasz'
pip install --upgrade pip setuptools
[ -f requirements.txt ] && pip install -r requirements.txt
[ -f requirements.development.txt ] && pip install -r requirements.development.txt
@hilios
hilios / README.md
Last active July 4, 2022 15:36 — forked from mhayes/supervisord.sh
init.d for supervisord for Amazon Linux AMI

Auto start for Supervisord at AWS

Install commands
$ sudo mv supervisor /etc/init.d
$ sudo chkconfig --add supervisor
$ sudo chkconfig supervisor on
@pkazmierczak
pkazmierczak / waf.py
Created January 28, 2016 13:29
WAF IPSet with troposphere
from troposphere import Template
from troposphere.waf import IPSet
t = Template()
t.add_description("CF Template for setting IP ranges for whitelisting on the WAF.")
Whitelist1 = t.add_resource(IPSet(
"internaladdresses",
Name="Internal_addresses",
@joshbode
joshbode / LICENSE.md
Last active April 5, 2024 14:52
YAML Loader with include constructor (Python 3)

MIT License

Copyright (c) 2018 Josh Bode

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

@jed
jed / how-to-set-up-stress-free-ssl-on-os-x.md
Last active February 25, 2024 17:35
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@geoffalday
geoffalday / secretkey.py
Created March 12, 2012 12:28
How to generate a secret key with Python
# How to generate a secret key with Python
# via http://flask.pocoo.org/docs/quickstart/
import os
os.urandom(24)