(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf
:
My Elasticsearch cheatsheet with example usage via rest api (still a work-in-progress)
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import os | |
import requests | |
from bs4 import BeautifulSoup | |
import glob | |
from PyPDF2 import PdfFileMerger | |
#Todo: debug this function |
I'm going to walk you through the steps for setting up a AWS Lambda to talk to the internet and a VPC. Let's dive in.
So it might be really unintuitive at first but lambda functions have three states.
This is a collection of information on PostgreSQL and PostGIS for what I tend to use most often.
#!/bin/bash | |
#set -e | |
# origin-source: http://www.fars-robotics.net/install-wifi | |
# install-wifi - v9.4 - by MrEngman. | |
# After downloading this script: | |
# $ sudo mv ./install-wifi /usr/bin/install-wifi | |
# $ sudo chmod +x /usr/bin/install-wifi | |
# $ sudo install-wifi -h | |
# |
We prefer to have audit logging in our services that leverage databases. It gives us clarity into sources of where ACL issues might originate as well as gives us a general timeline of activity in our application.
Audit logging is tedious to set up so this gist contains our latest iteration of audit logging support for a sequelize based service.
#!/bin/bash | |
# | |
# Script to setup a Elastic Beanstalk AMI with geospatial libraries and postGIS | |
# | |
# sh aws_ami_prep.sh > aws_ami_prep.log 2>&1 & | |
# Go to ec2-user home directory | |
cd /home/ec2-user | |
# yum libraries |