Skip to content

Instantly share code, notes, and snippets.

View malston's full-sized avatar

Mark Alston malston

View GitHub Profile
@malston
malston / update_opsmanager_hostname.sh
Created May 11, 2016 21:01 — forked from mandarjog/update_opsmanager_hostname.sh
After a 1.7+ opsmanager restarts with a new ip address, this script will update it in the database
#!/bin/bash
# After a 1.7+ opsmanager restarts with a new ip address
# ssh into the opsmanager as 'ubuntu' and
# Run this file from the opsmanager as follows
# sudo su -l postgres < thisfile.sh >
# Get the current public ip or hostname from aws metadata
HN=$(curl http://169.254.169.254/latest/meta-data/public-hostname)
go get github.com/concourse/autopilot
cf install-plugin $GOPATH/bin/autopilot
cf login -a ${CF_URL_US_SOUTH} -u ${CF_USERNAME} -p ${CF_PASSWORD} -o ${CF_ORG} -s ${CF_SPACE}
cf zero-downtime-push myapp -f manifest.yml
@malston
malston / git-serve.md
Last active August 29, 2015 14:23 — forked from datagrok/git-serve.md

Launch a one-off git server from any local repository.

I [tweeted this already][1] but I thought it could use some expansion:

Enable decentralized git workflow: git config alias.serve "daemon --verbose --export-all --base-path=.git --reuseaddr --strict-paths .git/"

Say you use a git workflow that involves working with a core "official" repository that you pull and push your changes from and into. I'm sure many companies do this, as do many users of git hosting services like Github.

Say that server, or Github, goes down for a bit.

➜ bosh-lite git:(master) CF_HOME=/tmp/cf2 cf login -a https://api.10.244.0.34.xip.io -u admin -p admin --skip-ssl-validation
API endpoint: https://api.10.244.0.34.xip.io
Authenticating...
OK
Targeted org jdk-org
Targeted space jdk-space