Skip to content

Instantly share code, notes, and snippets.

View chrisdev's full-sized avatar

Christopher Clarke chrisdev

View GitHub Profile
# sending the email
# ----------
import sys
import mandrill
API_KEY = 'API_KEY_HERE'
def send_mail(template_name, file_name, batch_size=2, starting_pos=0):
@chrisdev
chrisdev / ssl_site
Created June 6, 2015 07:42
SSL site
server {
listen [::]:443 default_server;
server_name mysite.org;
ssl on;
ssl_certificate_key /svr/ssl/cert/mysite_org.pem;
ssl_certificate /svr/ssl/cert/ca-bundle.pem;
@chrisdev
chrisdev / my_static_site
Last active August 29, 2015 14:22
Nginx static conf
server {
listen 80;
server_name www.mysite.org;
return 301 $scheme://mysite.org;
}
server {
listen 80;
root /home/myorg/static/myour_static_site;
@chrisdev
chrisdev / gist:b6b2a150a1d51454b9a0
Created June 21, 2015 17:00
Highlight a given file and copy it as RTF
!/bin/zsh
#
# Highlight a given file and copy it as RTF.
#
## Simon Olofsson <simon@olofsson.de>
#
#
set -o errexit
set -o nounset
@chrisdev
chrisdev / play.yml
Created May 23, 2016 18:59
Sudo setting in Ansible Old vs New Playbook
Ansible 2.0 has been nagging me about this for a while
#Old Way with sudo and user
- name: apply common configruation to all nodes
hosts: all
sudo: yes
user: root
roles:
- common
@chrisdev
chrisdev / postgres-cheatsheet.md
Created February 3, 2018 20:54 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)