This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adapted from https://github.com/doobeh/Flask-S3-Uploader | |
# Improved to store the data on the local server and process | |
# the upload via a celery task queue | |
from uuid import uuid4 | |
import boto | |
import os.path | |
from flask import current_app as app | |
from werkzeug.utils import secure_filename | |
from .. import celery |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# supervisord This scripts turns supervisord on | |
# | |
# Author: Mike McGrath <mmcgrath@redhat.com> (based off yumupdatesd) | |
# Jason Koppe <jkoppe@indeed.com> adjusted to read sysconfig, | |
# use supervisord tools to start/stop, conditionally wait | |
# for child processes to shutdown, and startup later | |
# Mikhail Mingalev <mingalevme@gmail.com> Merged | |
# redhat-init-jkoppe and redhat-sysconfig-jkoppe, and |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
($sec,$min,$hour,$mday,$mon,$year,$nothing,$nothing,$nothing)=localtime(time); | |
if ($mon<12) { | |
$mon++; | |
} | |
if ($pmon<12) { | |
$pmon++; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
PORT=3306 | |
HP=:$PORT | |
echo 'Checking to see if MariaDB is up...' | |
if ( /usr/sbin/lsof -Pni $HP | grep "$PORT (LISTEN)" 2>&1 >/dev/null ); then | |
echo 'MariaDB is up'; | |
else | |
echo 'MariaDB is down, restarting...'; | |
/sbin/service mariadb restart | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
PORT=80 | |
HP=:$PORT | |
echo 'Checking to see if Apache is up...' | |
if ( /usr/sbin/lsof -Pni $HP | grep "$PORT (LISTEN)" 2>&1 >/dev/null ); then | |
echo 'Apache is up'; | |
else | |
echo 'Apache is down, restarting...'; | |
/sbin/service httpd restart | |
logger -p mail.info apache_check_restart.sh restarting Apache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name my-app.com; | |
location / { | |
proxy_pass http://127.0.0.1:8000; | |
proxy_connect_timeout 300s; | |
# Set some HTTP headers so that our app knows where the | |
# request really came from | |
proxy_set_header Host $host; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, render_template | |
from flask.ext.wtf import Form, widgets, SelectMultipleField | |
SECRET_KEY = 'development' | |
app = Flask(__name__) | |
app.config.from_object(__name__) | |
class MultiCheckboxField(SelectMultipleField): | |
widget = widgets.ListWidget(prefix_label=False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/ | |
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server | |
############################################### | |
# To use: | |
# wget https://gist.githubusercontent.com/four43/e00d01ca084c5972f229/raw/install-redis.sh | |
# chmod 777 install-redis.sh | |
# ./install-redis.sh | |
############################################### | |
echo "*****************************************" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title>My awesome site!</title> | |
<style type="text/css"> | |
html { | |
width:100%; | |
height:100%; | |
background:url(logo.png) center center no-repeat; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import base64 | |
from Crypto import Random | |
from Crypto.Cipher import AES | |
BS = 16 | |
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS) | |
unpad = lambda s : s[0:-ord(s[-1])] |
OlderNewer