Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
SELECT | |
schema_name, rel_name, table_size, | |
pg_size_pretty(table_size) AS size | |
FROM ( | |
SELECT | |
nspname AS schema_name, | |
relname AS rel_name, | |
pg_table_size(pg_class.oid) AS table_size | |
FROM pg_class, pg_namespace | |
WHERE pg_class.relnamespace = pg_namespace.oid |
#!/bin/bash | |
# fpm-openssl - @jbuchbinder | |
# Build script for recent openssl builds using FPM on EL7. Untar the release and run this script to build | |
# your RPM. Requires: | |
# - RPMS: ruby-devel make gcc rpm-build | |
# - GEMS: fpm | |
./config && make depend && make all && make install INSTALL_PREFIX=/tmp/openssl | |
fpm -s dir -t rpm -n openssl-recent \ |
## On the server | |
# AWS EC2 | |
SERVER_IP=$(curl http://169.254.169.254/latest/meta-data/public-ipv4) | |
# Digital Ocean | |
SERVER_IP=$(curl http://169.254.169.254/metadata/v1/interfaces/public/0/ipv4/address) | |
# Generate a self-signed server certificate | |
openssl genrsa -out server.key 4096 |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
#!/bin/bash | |
# bash generate random alphanumeric string | |
# | |
# bash generate random 32 character alphanumeric string (upper and lowercase) and | |
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
# bash generate random 32 character alphanumeric string (lowercase only) | |
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1 |
# ADD this to Rakefile and run it by issuing rake roles.to_json | |
ROLE_DIR = File.expand_path(File.join(TOPDIR, "roles")) | |
namespace :roles do | |
desc "Convert ruby roles from ruby to json, creating/overwriting json files." | |
task :to_json do | |
Dir.glob(File.join(ROLE_DIR, '*.rb')) do |rb_file| | |
role = Chef::Role.new | |
role.from_file(rb_file) | |
json_file = rb_file.sub(/\.rb$/,'.json') |
#!/usr/bin/env python | |
import argparse | |
import sys | |
try: | |
import boto3 | |
except ImportError: | |
print('Please install boto3 to use this tool') | |
sys.exit(1) |
For: https://www.reddit.com/r/aws/comments/5jf7fb/permissions_for_lambda_accessing_s3_buckets_in/
This is a little tricky, because it requires several different moving parts, specifically,
bucket-owner-full-control
acl, http://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html otherwise, the bucket owner may not be able to download them.import os | |
import boto3 | |
import datetime | |
import dateutil | |
DEFAULT_MAX_MEM = 3000 | |
LOW_CLUSTER_CPU_TH = 20 | |
HIGH_CLUSTER_CPU_TH = 65 | |
CONTAINERS_MAX_MEM = { | |
'cluster1': 1200, |
-module(systemd). | |
% This is what you need to adopt systemd in erlang | |
-export([ready/0, reloading/0, stopping/0, watchdog/0]). | |
-export([start_link/0]). | |
-export([init/1, handle_info/2, terminate/2]). | |
ready() -> call(<<"READY=1">>). |