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
print("hello world") |
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 | |
## | |
# File: | |
# nginx_modsite | |
# Description: | |
# Provides a basic script to automate enabling and disabling websites found | |
# in the default configuration directories: | |
# /etc/nginx/sites-available and /etc/nginx/sites-enabled | |
# For easy access to this script, copy it into the directory: |
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
description "supervisor" | |
start on runlevel [2345] | |
stop on runlevel [!2345] | |
setuid myuser | |
respawn | |
exec /usr/local/bin/supervisord --nodaemon --configuration /etc/supervisord.conf |
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
# ######################################################################### | |
# This bash script adds tab-completion feature to django-admin.py and | |
# manage.py. | |
# | |
# Testing it out without installing | |
# ================================= | |
# | |
# To test out the completion without "installing" this, just run this file | |
# directly, like so: | |
# |
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 __future__ import absolute_import | |
from celery import Celery | |
app = Celery('my_project', | |
broker='amqp://', | |
backend='mongodb://', | |
include=['tasks']) | |
# Optional configuration, see the application user guide. |
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
import datetime | |
from uuid import uuid1 | |
from mongoengine import connect, Document | |
from mongoengine.fields import ( | |
StringField, IntField, DateTimeField, UUIDField, BooleanField, FloatField, | |
DictField | |
) | |
from .settings import MONGO_DBNAME |
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
## Broker settings. | |
BROKER_URL = "amqp://guest:guest@localhost:5672//" | |
# List of modules to import when celery starts. | |
CELERY_IMPORTS = ("controllers", "tasks") | |
CELERYD_CONCURRENCY = 1 | |
CELERY_TRACK_STARTED = True | |
# CELERY_DEFAULT_RATE_LIMIT = "30/m" |
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 os.path import dirname, abspath | |
from fabric.api import local, task, lcd | |
PROJECT_ROOT = dirname(abspath(__file__)) | |
@task | |
def update_os(): | |
"""Updates Ubuntu""" |
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
import logging | |
import tornado.ioloop | |
import tornado.web | |
from tornado.web import Application | |
from .urls import urls_map | |
settings = {'auto_reload': True, 'debug': True} |
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
openssl req -new -newkey rsa:2048 -nodes -keyout client3.key -out client3.csr | |
openssl x509 -req -days 365 -in client3.csr -signkey client3.key -out client3.crt | |
#Generate client certificate for a browser | |
openssl pkcs12 -export -out client.pfx -inkey client3.key -in client3.crt |
OlderNewer