Skip to content

Instantly share code, notes, and snippets.

### Install OpenJDK
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Download and Install ElasticSearch
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.2.deb
sudo dpkg -i elasticsearch-1.4.2.deb
{
"vars": {
"@gray-base": "#FF6600",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
#!/usr/bin/env python
# Try to determine how much RAM is currently being used per program.
# Note per _program_, not per process. So for example this script
# will report RAM used by all httpd process together. In detail it reports:
# sum(private RAM for program processes) + sum(Shared RAM for program processes)
# The shared RAM is problematic to calculate, and this script automatically
# selects the most accurate method available for your kernel.
# Licence: LGPLv2
openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
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
import logging
import tornado.ioloop
import tornado.web
from tornado.web import Application
from .urls import urls_map
settings = {'auto_reload': True, 'debug': True}
from os.path import dirname, abspath
from fabric.api import local, task, lcd
PROJECT_ROOT = dirname(abspath(__file__))
@task
def update_os():
"""Updates Ubuntu"""
## 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"
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
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.