Skip to content

Instantly share code, notes, and snippets.

View gregelin's full-sized avatar

Greg Elin gregelin

  • RegScale, Inc.
  • Knoxville, TN
  • 14:02 (UTC -04:00)
View GitHub Profile
@gregelin
gregelin / playbook-govready-macbook.yml
Created March 11, 2015 14:03
Battleschool Ansible playbook for setting up a Macbook Pro.
---
- hosts: workstation
tasks:
- name: print from playbook
debug: msg="in playbooks/playbook.yml"
- name: easy install pip
easy_install: name=pip
sudo: yes
@gregelin
gregelin / service-checklist.md
Created November 6, 2016 13:12 — forked from marktheunissen/service-checklist.md
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
@gregelin
gregelin / database_snippets.md
Last active December 10, 2021 16:54
Database management snippets

Postgres Snippets

Backup a django Postgres database

cd /codedata/code/django-study/mysite
# Stop the django surver so database will not be updated
# DBNAME=django_link
DBNAME=databasename
dumpfile=$DBNAME.pg_dump.$(date +%Y-%m-%d-%H:%M:%S).sql
pg_dump $DBNAME > ../databak/$dumpfile
@gregelin
gregelin / install.md
Last active September 15, 2021 10:50
Trestle Instructions
@gregelin
gregelin / .vimrc
Created January 21, 2013 17:11
Example vimrc file that provides line numbers and syntax coloring from http://vim.wikia.com/wiki/Example_vimrc
" URL: http://vim.wikia.com/wiki/Example_vimrc
" Authors: http://vim.wikia.com/wiki/Vim_on_Freenode
" Description: A minimal, but feature rich, example .vimrc. If you are a
" newbie, basing your first .vimrc on this file is a good choice.
" If you're a more advanced user, building your own .vimrc based
" on this file is still a good idea.
"------------------------------------------------------------
" Features {{{1
"
@gregelin
gregelin / django-oc.yaml
Last active July 16, 2021 17:19
GovReady Controls
name: Django
schema_version: 3.0.0
documentation_complete: false
satisfies:
- control_key: AC-11
control_name: Session Lock
standard_key: NIST_SP-800-53_rev4
covered_by: []
security_control_type: Hybrid | Inherited | ...
narrative:
@gregelin
gregelin / subobject_update.py
Created May 18, 2021 10:51
Python mind blowing updating obj by reference
>>> list = []
>>> obj = {"k1": {"ks1":"vs1"},"k2": {"ks2":list}}
>>> obj
{'k1': {'ks1': 'vs1'}, 'k2': {'ks2': []}}
>>> list.append({"ks3":"val"})
>>> list
[{'ks3': 'val'}]
>>> obj
{'k1': {'ks1': 'vs1'}, 'k2': {'ks2': [{'ks3': 'val'}]}}
@gregelin
gregelin / govready-v0.9.3-install-notes.md
Last active April 2, 2021 12:51
GovReady-Q v0.9.3+ install notes for Ubuntu 20.04

Install notes

changes

  • Install in venv instead of user specific python as described in docs

nginx

  • Remove default nginx site that takes priority handling requests with rm /etc/nginx/sites-enabled/default

ubuntu 20.04

  • Open Ubuntu's 20.04 default firewall to allow HTTP traffic to nginx with sudo ufw allow 'Nginx HTTP'
@gregelin
gregelin / file.html
Last active March 17, 2021 13:17
WSOA
<html>
<head>
<style>
body { padding-top:24px; font-size:24pt; text-align:center; border:8px solid green; }
</style>
<script>
var i = 1; // set your counter to 1
function myLoop() { // create a loop function
setTimeout(function() { // call a 3s setTimeout when the loop is called
{
"component-definition": {
"uuid": "7551cb7a-85d8-4f64-a8bc-056dc20bf16b",
"metadata": {
"title": "GovReady-Q Component-to-Control Narratives",
"published": "2021-03-11T14:40:52+00:00",
"last-modified": "2021-03-11T11:16:15+00:00",
"version": "string",
"oscal-version": "1.0.0-rc1"
},