I hereby claim:
- I am donatello on github.
- I am donatello (https://keybase.io/donatello) on keybase.
- I have a public key whose fingerprint is 8EC7 3E41 447A CC5B 4966 BC07 B24F 1635 C23D 9B5A
To claim this, I am signing this object:
import Data.Int (Int64) | |
divisors :: Int64 -> [Int64] | |
divisors k = divisors' 2 k | |
where | |
divisors' n k | n*n > k = [k] | |
| n*n == k = [n, k] | |
| k `mod` n == 0 = (n:(k `div` n):result) | |
| otherwise = result | |
where result = divisors' (n+1) k |
{-# LANGUAGE GADTs #-} | |
import Text.XML.Light | |
mkElt :: String -> (Attributes, Body) -> Element | |
mkElt name (attribs, body) = Element { | |
elName = unqual name, | |
elAttribs = map (\(k, v) -> Attr (unqual k) v) attribs, | |
elContent = [Text (CData CDataRaw body Nothing)], | |
elLine = Nothing |
#/srv/salt-state/basepkgs.sls | |
basepackages: | |
pkg.latest: | |
- pkgs: | |
- apt-transport-https | |
- bc | |
- debconf-utils | |
- emacs-goodies-el | |
- emacs23-nox | |
- htop |
# salt-call state.show_lowstate | |
[INFO ] The `lspci` binary is not available on the system. GPU grains will not be available. | |
[WARNING ] Although 'dmidecode' was found in path, the current user cannot execute it. Grains output might not be accurate. | |
[INFO ] The `lspci` binary is not available on the system. GPU grains will not be available. | |
[WARNING ] Although 'dmidecode' was found in path, the current user cannot execute it. Grains output might not be accurate. | |
[INFO ] Loading fresh modules for state activity | |
local: | |
---------- | |
- __env__: | |
base |
import gevent | |
from gevent.monkey import patch_all | |
patch_all() | |
import requests | |
import json | |
s = requests.Session() | |
def make_request(s, d): |
I hereby claim:
To claim this, I am signing this object:
NOTE: 534 stars, 106 forks. I love you all. Please contribute tips and edits back to this cheat sheet -- email's [email protected] and you can treat gists like git repositories and send git diffs.
-- Display table and index sizes | |
SELECT | |
table_name, | |
pg_size_pretty(table_size) AS table_size, | |
pg_size_pretty(indexes_size) AS indexes_size, | |
pg_size_pretty(total_size) AS total_size | |
FROM ( | |
SELECT | |
table_name, | |
pg_table_size(table_name) AS table_size, |
#!/bin/bash | |
GODOWNLOAD=go1.9.1.linux-amd64.tar.gz | |
GOURL=https://storage.googleapis.com/golang/$GODOWNLOAD | |
INSTALL_ARG=$1 | |
if [ -z $INSTALL_ARG ]; then | |
echo "Please specify an install location on the command line." | |
exit 1 |
It is most convenient to use Docker to do this.
A Kafka setup is required (and this requires a Zookeeper setup). A Kafka consumer is needed to check the events sent to Kafka. I used kafkacat.