start new:
tmux
start new with session name:
tmux new -s myname
-- Accepted answer from here: https://stackoverflow.com/questions/5408156/how-to-drop-a-postgresql-database-if-there-are-active-connections-to-it | |
SELECT pg_terminate_backend(pg_stat_activity.pid) | |
FROM pg_stat_activity | |
WHERE pg_stat_activity.datname = '[your database name goes here]' | |
AND pid <> pg_backend_pid(); |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# This is how I used it: | |
# $ cat ~/.bash_history | python bash-to-zsh-hist.py >> ~/.zsh_history | |
import sys | |
import time |
if input volume of (get volume settings) = 0 then | |
set level to 90 | |
display notification "On" with title "Mic" | |
tell application "System Events" | |
tell appearance preferences | |
set dark mode to false | |
end tell | |
end tell | |
else | |
set level to 0 |
#!/bin/bash | |
# Expects Ubuntu 16.06 (xenial) and kernel 4.x. | |
# Based upon a blog post by Zach at http://zachzimm.com/blog/?p=191 | |
set -eux | |
# Have the user call sudo early so the credentials is valid later on | |
sudo whoami |