As configured in my dotfiles.
start new:
tmux
start new with session name:
# Send a metric to statsd from bash | |
# | |
# Useful for: | |
# deploy scripts (http://codeascraft.etsy.com/2010/12/08/track-every-release/) | |
# init scripts | |
# sending metrics via crontab one-liners | |
# sprinkling in existing bash scripts. | |
# | |
# netcat options: | |
# -w timeout If a connection and stdin are idle for more than timeout seconds, then the connection is silently closed. |
from geventwebsocket.handler import WebSocketHandler | |
from gevent.pywsgi import WSGIServer | |
from flask import Flask, request, render_template | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): | |
return render_template('index.html') |
As configured in my dotfiles.
start new:
tmux
start new with session name:
-- 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 bash | |
# | |
# needs: Pulseaudio, VLC | |
# Load null sink module if not already loaded | |
pacmd list-sinks | grep steam 2>&1 >/dev/null | |
if [[ $? == 1 ]]; then | |
pactl load-module module-null-sink sink_name=steam; | |
fi |
Update: 2023/11/30 Bruce Momjian's take on things: https://momjian.us/main/blogs/pgblog/2023.html#November_22_2023
Given a table...
CREATE TABLE foo (
id SERIAL PRIMARY KEY,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
...
);
# Basically the nginx configuration I use at konklone.com. | |
# I check it using https://www.ssllabs.com/ssltest/analyze.html?d=konklone.com | |
# | |
# To provide feedback, please tweet at @konklone or email [email protected]. | |
# Comments on gists don't notify the author. | |
# | |
# Thanks to WubTheCaptain (https://wubthecaptain.eu) for his help and ciphersuites. | |
# Thanks to Ilya Grigorik (https://www.igvita.com) for constant inspiration. | |
server { |
#!/bin/bash | |
version=0.1.4 | |
versionDate="2014-09-02" | |
function showHelp() { | |
echo "subtlemark - add subtle watermarks to images | |
Usage: | |
---------------------------------------- |
#!/usr/bin/env python | |
"""A noddy fake smtp server.""" | |
import smtpd | |
import asyncore | |
class FakeSMTPServer(smtpd.SMTPServer): | |
"""A Fake smtp server""" | |
def __init__(*args, **kwargs): |
package main | |
import ( | |
"bytes" | |
"encoding/binary" | |
"fmt" | |
"log" | |
"os" | |
) |