Skip to content

Instantly share code, notes, and snippets.

View stafot's full-sized avatar
🐧

Stavros Foteinopoulos stafot

🐧
View GitHub Profile
@alexsapran
alexsapran / pre-commit
Last active December 22, 2016 11:08
Terraform client git hook
# Redirect output to stderr.
exec 1>&2
# enable user input
exec < /dev/tty
# check if there is a change in the tfstate file
TFSTATE=`git diff --cached --name-status | awk '$1 != "R" { print $2 }' |grep tfstate |wc -l`
if [ $TFSTATE -ne 0 ]
then
@cuibonobo
cuibonobo / Large-app-how-to.md
Last active March 6, 2024 18:40
How to structure a large application in Flask. Taken from the Flask wiki: https://github.com/mitsuhiko/flask/wiki/Large-app-how-to

Here's an example application that uses the pattern detailed below: https://github.com/tantastik/talent-curator


This document is an attempt to describe the first step of a large project structure with flask and some basic modules:

  • SQLAlchemy
  • WTForms

Please feel free to fix and add your own tips.

@superdaigo
superdaigo / zabbix-alert-smtp.sh
Created September 20, 2012 04:58
Zabbix SMTP Alert script for gmail
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Zabbix SMTP Alert script for gmail.
"""
import sys
import smtplib
from email.MIMEText import MIMEText
from email.Header import Header