Skip to content

Instantly share code, notes, and snippets.

@dansimau
dansimau / pglag.sh
Created January 9, 2012 11:58
Calculate the replication lag between postgresql master and one or more slaves in streaming replication mode.
#!/bin/bash
#
# Show replication lag for one or more postgresql slaves in streaming replication.
#
# dsimmons@squiz.co.uk
# 2012-01-09
#
psql="which psql"
psql_extra_opts=""

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 25, 2024 07:26
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@chhh
chhh / .gitignore
Last active January 21, 2024 03:50
.gitignore file for IDEA, Eclipse, NetBeans
#
# Project specific excludes
#
tomcat
#
# Default excludes
#
@JamesTheBard
JamesTheBard / eventcmd
Created June 10, 2013 06:21
mcabber notification script
#!/bin/sh
echo "$1 $2 $3 $4" >> ~/test.mcabber.log
EVENT_TYPE=$1
EVENT_SUBTYPE=$2
JID=$3
FILE=$4
TITLE="Google Hangouts"
SOUND_FILE="$HOME/.mcabber/sounds/alert_47.wav"
ICON="$HOME/.mcabber/images/chat.png"
TIMEOUT=10000
@jbonney
jbonney / jar_through_proxy
Created June 18, 2013 19:56
Execute Java jar program through a socks proxy.
java -jar -DsocksProxyHost=localhost -DsocksProxyPort=8080 program.jar
@plentz
plentz / nginx.conf
Last active June 26, 2024 04:29
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@skarllot
skarllot / bacula-dir.conf
Last active March 28, 2024 23:35
Bacula configuration to use sendEmail
. . .
Messages {
Name = Standard
mailcommand = "/usr/local/bin/sendEmail-backup \"[BACKUP] %t %e of %n %l\" \"%r\""
operatorcommand = "/usr/local/bin/sendEmail-backup \"[BACKUP] Intervention needed for %j\" \"%r\""
mail = backup-handlers@example.com = all, !skipped
operator = backup-operator@example.com = mount
console = all, !skipped, !saved
append = "/var/log/bacula/bacula.log" = all, !skipped
catalog = all
@XVilka
XVilka / TrueColour.md
Last active June 10, 2024 17:21
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@ekristen
ekristen / check_docker_container.sh
Last active January 16, 2024 16:15
Bash Script for Nagios to Check Status of Docker Container
#!/bin/bash
# Author: Erik Kristensen
# Email: erik@erikkristensen.com
# License: MIT
# Nagios Usage: check_nrpe!check_docker_container!_container_id_
# Usage: ./check_docker_container.sh _container_id_
#
# Depending on your docker configuration, root might be required. If your nrpe user has rights
# to talk to the docker daemon, then root is not required. This is why root privileges are not