This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
unshared () { | |
grep '^[0-9]\+$' "$1" > /dev/null | |
} | |
for cpu in $(ls -d /sys/devices/system/cpu/cpu[0-9]* | sort -t u -k 3 -n); do | |
echo "${cpu##*/}: [Package #$(cat $cpu/topology/physical_package_id), Core #$(cat $cpu/topology/core_id)]" | |
if ! unshared $cpu/topology/core_siblings_list; then | |
echo " same package as $(cat $cpu/topology/core_siblings_list)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/usr/sbin/update-rc.d -f unicorn defaults | |
chmod +x /etc/init.d/unicorn | |
/usr/sbin/update-rc.d -f unicorn remove |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# play nice with OSX copy/paste tools | |
set -g default-command "reattach-to-user-namespace /bin/bash --login" | |
bind y run-shell "tmux save-buffer - | reattach-to-user-namespace pbcopy" | |
# Reload the file with Prefix r | |
bind r source-file ~/.tmux.conf \; display "Reloaded!" | |
bind | split-window -h # C-a | to create horizontal pane | |
bind - split-window -v # C-a - to create vertical pane |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The following are suggested values | |
# They should be set in all configs, | |
# so that if a secondary needs to be promoted | |
# it will be generating the correct WAL level | |
wal_level = hot_standby | |
archive_mode = on # allows archiving to be done | |
# (change requires restart) | |
archive_command = 'cp -f %p /data/pgsql/archive/%f </dev/null' # command to use to archive a logfile segment | |
max_wal_senders = 5 # max number of walsender processes | |
# (change requires restart) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Idempotent way to build a /etc/hosts file with Ansible using your Ansible hosts inventory for a source. | |
# Will include all hosts the playbook is run on. | |
# Inspired from http://xmeblog.blogspot.com/2013/06/ansible-dynamicaly-update-etchosts.html | |
- name: "Build hosts file" | |
lineinfile: dest=/etc/hosts regexp='.*{{ item }}$' line="{{ hostvars[item].ansible_default_ipv4.address }} {{item}}" state=present | |
when: hostvars[item].ansible_default_ipv4.address is defined | |
with_items: groups['all'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
BACKUPDEST="$1" | |
DOMAIN="$2" | |
MAXBACKUPS="$3" | |
if [ -z "$BACKUPDEST" -o -z "$DOMAIN" ]; then | |
echo "Usage: ./vm-backup <backup-folder> <domain> [max-backups]" | |
exit 1 |