Skip to content

Instantly share code, notes, and snippets.

print("hello world")
@pyghassen
pyghassen / nginx_modsite
Created February 13, 2014 22:03
a2 like command to enable and disable nginx websites.
#!/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:
@pyghassen
pyghassen / supervisor.conf
Last active August 29, 2015 14:03
/etc/init/supervisor.conf
description "supervisor"
start on runlevel [2345]
stop on runlevel [!2345]
setuid myuser
respawn
exec /usr/local/bin/supervisord --nodaemon --configuration /etc/supervisord.conf
# #########################################################################
# 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:
#
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.
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
## 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"
from os.path import dirname, abspath
from fabric.api import local, task, lcd
PROJECT_ROOT = dirname(abspath(__file__))
@task
def update_os():
"""Updates Ubuntu"""
import logging
import tornado.ioloop
import tornado.web
from tornado.web import Application
from .urls import urls_map
settings = {'auto_reload': True, 'debug': True}
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