Skip to content

Instantly share code, notes, and snippets.

Maximilian Gaß mxey

Block or report user

Report or block mxey

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mxey
mxey / Vagrantfile
Created Dec 5, 2018
Vagrantfile disable audio
View Vagrantfile
machine.vm.provider "virtualbox" do |v|
# Prevent VirtualBox from interfering with host audio stack
v.customize ["modifyvm", :id, "--audio", "none"]
end
View gist:c96e2cca94d9ef1b7734f6c8f7b9b0ea
(
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"
View diff_stringify_facts Output
./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 Sep 9, 2017
Testing the effect of Puppet stringify_facts with octocatalog-diff
View diff_stringify_facts.sh
#!/bin/bash
set -e -u -o pipefail
mkdir -p facts
for hostname in "$@"; do
echo "${hostname}"
fact_file="facts/${hostname}.json"
(
View hosts
$ 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 )" )'
View gist:e3035d704946d1f84a2e
/etc/http/conf/http.conf:
file:
- managed
- source: salt://apache/http.conf
- user: root
- group: root
- mode: 644
- template: jinja
- context:
custom_var: "override"
View gist:56692d2f2db239a5c229
root@ubuntu-512mb-fra1-01:~# touch $(printf '\xff\xff\xffäöü')
root@ubuntu-512mb-fra1-01:~# ls
???äöü
>>> os.listdir(b".")[1]
View .bash_profile
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)$ '
View gist:cef1b304e9679d3420cf
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 Dec 23, 2014
Upgrade PostgreSQL data directory on OS X
View gist:abbb58b0feeca062a34e
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
You can’t perform that action at this time.