Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python2.7
# Note: this script is for manual benchmarking!
# ./benchmark init-spatial
# time ./benchmark write-spatial
# ./benchmark read-spatial
from memsql.common import connection_pool
import random, math, sys
@Techgoldy
Techgoldy / mysql_backup.sh
Created July 18, 2018 14:46 — forked from tleish/mysql_backup.sh
Bash Script to backup all MySQL databases
#!/bin/bash
#==============================================================================
#TITLE: mysql_backup.sh
#DESCRIPTION: script for automating the daily mysql backups on development computer
#AUTHOR: tleish
#DATE: 2013-12-20
#VERSION: 0.4
#USAGE: ./mysql_backup.sh
#CRON:
# example cron for daily db backup @ 9:15 am
@Techgoldy
Techgoldy / install-jq
Created September 2, 2016 19:03 — forked from moomindani/install-jq
install jq (64bit system)
wget http://stedolan.github.io/jq/download/linux64/jq
chmod +x ./jq
sudo cp jq /usr/bin
@Techgoldy
Techgoldy / sh_env_var_opts.sh
Created April 3, 2016 01:21 — forked from KylePDavis/sh_env_var_opts.sh
Simple bash shell script templates. There are two versions: 1) simple env var based options, and 2) with added command line argument parsing and error handling.
#!/bin/bash -e
# A SHORT DESCRIPTION OF YOUR SCRIPT GOES HERE
# USAGE:
# DESCRIPTION OF ENV VARS HERE
###############################################################################
set -e # exit on command errors (so you MUST handle exit codes properly!)
set -o pipefail # capture fail exit codes in piped commands
#set -x # execution tracing debug messages
# Get command info
@Techgoldy
Techgoldy / postgres-cheatsheet.md
Created February 13, 2016 13:02 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

If run with -E flag, it will describe the underlaying queries of the \ commands (cool for learning!).

Most \d commands support additional param of __schema__.name__ and accept wildcards like *.*