Skip to content

Instantly share code, notes, and snippets.

@tarsnake
tarsnake / Dockerfile
Created December 28, 2018 17:33 — forked from admhpr/Dockerfile
Dockerfile to create a Debian 9 instance
FROM debian:latest
# Install packages
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install \
openssh-server \
apt-utils \
python3\
zip \
unzip \
<!-- Force older Internet Explorer to avoid compatibility mode -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Include HTML5 Shiv and Respond.js to IE 8 and earlier
https://github.com/aFarkas/html5shiv/blob/master/dist/html5shiv.min.js
https://github.com/scottjehl/Respond/blob/master/dest/respond.min.js -->
<!-- Include after bootstrap.js
HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
@tarsnake
tarsnake / flask_deploy.sh
Last active August 29, 2015 14:10 — forked from ksaric/flask_deploy.sh
flask centOS deployment script
# Flask installer
# If you want a quick setup for a flask app on CentOs 7, try this.
# Requires 'requirements.txt' on your application folder.
# WARNING: this script will open port 8081!
# ideas:
# - http://linuxcommand.org/lc3_new_script.php
# - http://stackoverflow.com/questions/14008125/shell-script-common-template

Make me a new CentOS linode

Notes:

  • Instructions written for CentOS 6.3
  • Change, me, myhost, myip etc. to your username, hostname, ip address and so on.
  • Run all commands as root unless otherwise directed.
  • You might want to look at mounting /var and /home on separate partitions.
  • I've just allowed all members of the wheel group to operate as root. This is the height of laziness and highlights the fact that I'm just a developer that's stolen a sysadmin's
@tarsnake
tarsnake / fabfile.py
Last active August 29, 2015 14:09 — forked from justquick/fabfile.py
import os
import sys
from fabric.api import abort, run, sudo, env, cd
from fabric.colors import red, green
from fabric.contrib.files import exists, put, upload_template
ROOT = '/home/jquick/code/'
WORKON = '/home/jquick/.virtualenvs'
VENVS = {
@tarsnake
tarsnake / fabfile.py
Last active August 29, 2015 14:09 — forked from pombredanne/fabfile.py
from deployment.cuisine import *
from fabric.api import *
from fabric.context_managers import *
from fabric.utils import puts
from fabric.colors import red, green
import simplejson
import os
@tarsnake
tarsnake / fabfile.py
Last active August 29, 2015 14:09 — forked from renatooliveira/fabfile.py
fabfile for gunicorn nginx flask virtualenv
# coding: utf-8
from fabric.api import env, cd, run, sudo
from fabric.contrib.files import exists
from fabric.colors import green
from config import (HOST, USER, PASSWORD, APP_DIR,
ENV_HOME, PROJECT_NAME, VIRTUALENVS, REPOSITORY, BRANCH)
env.hosts = [HOST]
env.user = USER
@tarsnake
tarsnake / fabfile.py
Last active August 29, 2015 14:09 — forked from joepreludian/fabfile.py
Sample fabfile including nginx conf
# -*- encoding: utf8 -*-
from fabric.api import env, settings, cd
from fabric.contrib.files import exists
from fabric.operations import local, sudo, run, put
import os
# Default configurations
env.hosts = ['trilhus@universo42.com.br']
@tarsnake
tarsnake / fabfile.py
Last active August 29, 2015 14:09 — forked from mattmakai/fabfile.py
from fabric.api import *
from fabric.context_managers import cd
from fabric.operations import local as lrun, sudo
from fabric.contrib.files import sed
from fabric.utils import warn
from local_fabfile import root, prod, lh, SERVER_IP
def virtualenv(command, run_directory=''):
if run_directory == '':
#!/usr/bin/env fab
# vim:ts=4:sw=4:tw=120:et:sm:foldmethod=indent
import os
import time
from fabric.api import *
from fabric.contrib import files
# Global Settings