Skip to content

Instantly share code, notes, and snippets.

View jjosserand's full-sized avatar

Jesse Josserand jjosserand

View GitHub Profile
@jjosserand
jjosserand / postgres-cheatsheet.md
Created February 17, 2020 19:13 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@jjosserand
jjosserand / diskchecker.pl
Created February 11, 2020 19:20 — forked from bradfitz/diskchecker.pl
diskchecker.pl
#!/usr/bin/perl
#
# Brad's el-ghetto do-our-storage-stacks-lie?-script
#
sub usage {
die <<'END';
Usage: diskchecker.pl -s <server[:port]> verify <file>
diskchecker.pl -s <server[:port]> create <file> <size_in_MB>
diskchecker.pl -l [port]
@jjosserand
jjosserand / RUNBOOK.md
Created August 6, 2019 13:40 — forked from voxxit/RUNBOOK.md
Example of a solid run book/operations manual

Run Book / Operations Manual

  1. Table of Contents
  2. System Overview
    • Service Overview
    • Contributing Applications, Daemons, and Windows Services
    • Hours of Operation
    • Execution Design
    • Infrastructure and Network Design
    • Resilience, Fault Tolerance and High-Availability
@jjosserand
jjosserand / $_SERVER.php
Created March 11, 2018 16:48 — forked from georgioupanayiotis/$_SERVER.php
Get visitor IP address in PHP
function get_visitor_ip() {
$ip = '';
if ($_SERVER['HTTP_CLIENT_IP'])
$ip = $_SERVER['HTTP_CLIENT_IP'];
else if($_SERVER['HTTP_X_FORWARDED_FOR'])
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
else if($_SERVER['HTTP_X_FORWARDED'])
$ip = $_SERVER['HTTP_X_FORWARDED'];
else if($_SERVER['HTTP_FORWARDED_FOR'])
$ip = $_SERVER['HTTP_FORWARDED_FOR'];
@jjosserand
jjosserand / gist:d7aa095926f67f243eaea01f83c0e7d8
Created February 8, 2018 03:57 — forked from hontas/gist:3955052
HTML/CSS3: Star Wars Crawl
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<style type="text/css">
body {
background: black;
color: yellow;
font-family: Helvetica;
@jjosserand
jjosserand / starter-template.html
Created May 30, 2017 01:16 — forked from jonschlinkert/starter-template.html
bootstrap starter template with cdn assets
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Starter Template</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- styles -->