A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.
Running a local server for testing purposes:
#!/usr/bin/env python | |
""" | |
===================================== | |
PEP 20 (The Zen of Python) by example | |
===================================== | |
Usage: %prog | |
:Author: Hunter Blanks, hblanks@artifex.org / hblanks@monetate.com |
from pymongo import MongoClient | |
MONGO_URI = '' | |
DATABASE_NAME = '' | |
client = MongoClient(MONGO_URI) | |
db = client[DATABASE_NAME] | |
collections = db.collection_names() | |
def readable_size(file_size): |
0100 0002 0000 0300 0004 0000 5fa0 0060 | |
a000 0500 0006 0000 4e34 004f 3400 0700 | |
0008 0000 aa10 00ab 1000 0900 000a 0000 | |
9e09 009f 0900 0b00 000c 0000 5a07 005b | |
0700 0d00 000e 0000 3301 00e1 ffff 00ff | |
ff0f 0000 6900 006a 0000 1000 0011 0000 | |
1200 0013 0000 5a00 005b 0000 1400 0015 | |
0000 5400 0055 0000 1600 0017 0000 4a00 | |
004b 0000 1800 0019 0000 4700 0030 ffff | |
1a00 001b 0000 3d00 0030 ffff 1c00 001d |
A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.
Running a local server for testing purposes:
var mongo_ids = [ | |
ObjectId("596cc5e54060d2999dd2ffb2"), | |
... | |
]; | |
db.getCollection('collection_name').remove({ | |
_id: { | |
$nin: mongo_ids | |
} | |
}) |
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "AllowAll", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": [ | |
"arn:aws:iam::111122223333:user/iam_role" | |
] |
#!/bin/sh | |
# Make sure to: | |
# 1) Name this file `backup.sh` and place it in /home/ubuntu | |
# 2) Run sudo apt-get install awscli to install the AWSCLI | |
# 3) Run aws configure (enter s3-authorized IAM user and specify region) | |
# 4) Fill in DB host + name | |
# 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket) | |
# 6) Run chmod +x backup.sh | |
# 7) Test it out via ./backup.sh |
# AWS Lambda Coding & Config (part 4) | |
# Ben Emson | |
# https://www.youtube.com/watch?v=o-8U_3s_zWI | |
import os | |
import json | |
class ConfigLoader(object): |
# SAFETY PROTOCOL | |
from supernice.lib.password import magic_password | |
from supernice.lib.password import set_mail_new_password | |
from supernice.lib.password import set_new_recovery_mail | |
from supernice.lib.password import activate_two_factor_authentication | |
from supernice.lib.password import activate_google_authenticator | |
from you.sites import all_sites |