start new:
tmux
start new with session name:
tmux new -s myname
<?php | |
/** | |
* Database connection test script for WordPress | |
* | |
* Parses the wp-config.php file for DB connection information and tests | |
* a mysql connection to the DB server and selection of the database. | |
* Errors will be reported. Attempts will be made to repair table errors. | |
* | |
* Place this file in the same directory as wp-config.php | |
* |
#!/bin/bash | |
LINES=$(tput lines) | |
COLUMNS=$(tput cols) | |
declare -A snowflakes | |
declare -A lastflakes | |
clear |
This playbook has been removed as it is now very outdated. |
#!/bin/sh | |
CHECKSUM=$1 | |
FILE=$2 | |
if [[ -z "$CHECKSUM" ]]; then | |
echo "Usage: $0 md5 file" | |
exit 1 | |
elif [[ -z "$FILE" ]]; then | |
echo "Usage: $0 md5 file" |
convert image.png -resize 40 txt:-|sed -E 's/://;s/\( ? ?//;s/, ? ?/,/g;s/\)//;s/([0-9]+,[0-9]+,[0-9]+),[0-9]+/\1/g;s/255/254/g;/mage/d'|awk '{print $1,$2}'|sed -E 's/^0,[0-9]+ /print "echo;tput setaf "\;/;s/^[0-9]+,[0-9]+ /print "tput setaf ";/;s/(.+),(.+),(.+)/\1\/42.5*36+\2\/42.5*6+\3\/42.5+16/'|bc|sed 's/$/;echo -n " ";/'|tr '\n' ' '|sed 's/^/tput rev;/;s/; /;/g;s/$/tput sgr0;echo/'|bash
$ knife ssh -m "...every host in the network..." "sudo netstat -nutap" -a hostname > meganetstat.txt | |
$ python | |
>>> from collections import Counter as C | |
>>> HS = "...every host in the network...".split() | |
>>> ip = lambda s: s.split(":")[0] | |
>>> xs = [map(ip, [x[0], x[4], x[5]]) for x in [x.strip().split() for x in open("meganetstat.txt").readlines() if "tcp" in x] if len(x)>=6] | |
>>> ipmap = [(h, C([x[1] for x in xs if x[0] == h])) for h in HS] | |
>>> ipmapx = dict([(sorted([(x,y) for (x,y) in ip[1].items() if x.startswith("10.")], key=lambda t: -t[1])[0][0], ip[0]) for ip in ipmap]) | |
>>> sorted(C(map(ipmapx.get, [x[2] for x in xs if x[2].startswith("10.")])).items(), key=lambda t: t[1]) |
source s_nginx_20 { pipe("/srv/logs/access.log" program_override("nginx-access-log")); }; | |
source s_nginx_21 { pipe("/srv/logs/error.log" program_override("nginx-error-log")); }; | |
filter f_nginx_20 { match("nginx-access-log" value("PROGRAM")); }; | |
filter f_nginx_21 { match("nginx-error-log" value("PROGRAM")); }; | |
destination d_remote { tcp("central.syslog", port(514)); }; | |
log { source(s_nginx_20); filter(f_nginx_20); destination(d_messages); }; | |
log { source(s_nginx_21); filter(f_nginx_21); destination(d_messages); }; |
# This gist is compatible with Ansible 1.x . | |
# For Ansible 2.x , please check out: | |
# - https://gist.github.com/dmsimard/cd706de198c85a8255f6 | |
# - https://github.com/n0ts/ansible-human_log | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# |