Skip to content

Instantly share code, notes, and snippets.

@mxey
mxey / Vagrantfile
Created December 5, 2018 11:39
Vagrantfile disable audio
machine.vm.provider "virtualbox" do |v|
# Prevent VirtualBox from interfering with host audio stack
v.customize ["modifyvm", :id, "--audio", "none"]
end
(
set -e -x
aptly mirror update -max-tries=5 "upstream-stretch"
aptly repo import "upstream-stretch" "stretch" Name
aptly publish update "stretch" "stretch"
) 2>&1 | ts >> "/var/log/aptly/stretch.log"
./diff_stringify_facts.sh host1.example.com host2.example.com
host1.example.com
I, [2017-09-08T15:34:29.591598 #84032] INFO -- : Catalogs compiled for host1.example.com
I, [2017-09-08T15:34:29.699115 #84032] INFO -- : Diffs computed for host1.example.com
I, [2017-09-08T15:34:29.699145 #84032] INFO -- : No differences
host2.example.com
I, [2017-09-08T15:34:29.591598 #84032] INFO -- : Catalogs compiled for host2.example.com
I, [2017-09-08T15:34:29.699115 #84032] INFO -- : Diffs computed for host2.example.com
I, [2017-09-08T15:34:29.699145 #84032] INFO -- : No differences
@mxey
mxey / diff_stringify_facts.sh
Last active September 9, 2017 16:23
Testing the effect of Puppet stringify_facts with octocatalog-diff
#!/bin/bash
set -e -u -o pipefail
mkdir -p facts
for hostname in "$@"; do
echo "${hostname}"
fact_file="facts/${hostname}.json"
(
@mxey
mxey / hosts
Created February 4, 2016 13:48
$ ansible-playbook -i hosts playbook.yml -vvv
No config file found; using defaults
1 plays in playbook.yml
PLAY ***************************************************************************
TASK [ping] ********************************************************************
task path: /Users/mga/Documents/Arbeitsmittel/Ansible-Bug mit ansible_host Template/playbook.yml:4
<osf4-management1.osf.credativ.lan> ESTABLISH SSH CONNECTION FOR USER: None
<osf4-management1.osf.credativ.lan> SSH: EXEC ssh -C -q -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/Users/mga/.ansible/cp/ansible-ssh-%h-%p-%r -tt osf4-management1.osf.credativ.lan '( umask 22 && mkdir -p "$( echo $HOME/.ansible/tmp/ansible-tmp-1454593572.41-8142288545326 )" && echo "$( echo $HOME/.ansible/tmp/ansible-tmp-1454593572.41-8142288545326 )" )'
/etc/http/conf/http.conf:
file:
- managed
- source: salt://apache/http.conf
- user: root
- group: root
- mode: 644
- template: jinja
- context:
custom_var: "override"
root@ubuntu-512mb-fra1-01:~# touch $(printf '\xff\xff\xffäöü')
root@ubuntu-512mb-fra1-01:~# ls
???äöü
>>> os.listdir(b".")[1]
git_branch_for_prompt () {
branch="$(git rev-parse --abbrev-ref HEAD 2>/dev/null)"
if [ -n "${branch}" ]; then
echo "[$branch] "
fi
}
export PS1='\W $(git_branch_for_prompt)$ '
mxey@4seasons:~/Downloads/tmux$ git log --format=oneline --author="Maximilian Gass"
fa65aec2ef256d6e8c2f64a39b213c57d48422f3 More stuff TODO
5813ba6c39a824252b79d36dc8368b2a1e795c33 More TODO entries
beae2d91a491ca0866e7b99f33d44a37028912a8 Added my tmux start script as an example (examples/start-tmux.sh)
6a784ba0b0b450fe21034d97280f7d4dce702d42 New sessions can now be given a command for their first window
3c16d72218ce4bd72d039b25d87318d50cd72b9e Fixed usage statement for new-window
dcd73be71e3f9fabb2e5e200d892f47858dcc908 Updatet documentation
d2e035f892ac8b21889e0124157a9be4f94462d3 Added window renaming support (tmux rename)
@mxey
mxey / gist:abbb58b0feeca062a34e
Created December 23, 2014 22:30
Upgrade PostgreSQL data directory on OS X
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
mv /usr/local/var/postgres/ /usr/local/var/postgres.old
initdb /usr/local/var/postgres/
pg_upgrade -b /usr/local/Cellar/postgresql/9.3.5_1/bin/ -B /usr/local/Cellar/postgresql/9.4.0/bin/ -d /usr/local/var/postgres.old/ -D /usr/local/var/postgres/
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
psql postgres -c ''
rm -r /usr/local/var/postgres.old