Skip to content

Instantly share code, notes, and snippets.

View philbert's full-sized avatar

Philip Cheong philbert

View GitHub Profile
@philbert
philbert / gfixup.md
Created February 22, 2019 13:27
The way git commit --fixup --autosquash should work

The way git commit --fixup --autosquash should work

I have an extremely useful alias that I use extensively in my git workflow:

alias gfixup="git commit --fixup HEAD && EDITOR=cat git rebase -i --autosquash HEAD~2 | sed '/^#/ d'"

What it does

Commits changes in the git index and auto-squashes the commit into the previous commit without opening $EDITOR!

The workflow

  1. git add .
Verifying that "philbert.id" is my Blockstack ID. https://onename.com/philbert
### Keybase proof
I hereby claim:
* I am philbert on github.
* I am philbert (https://keybase.io/philbert) on keybase.
* I have a public key whose fingerprint is A27C E58B 3A5C 596E 7AD0 A34C 5CEF E98D 979B A110
To claim this, I am signing this object:
@philbert
philbert / gist:913bfdc024523341e38d
Created June 7, 2015 11:50
OpenBazaar production.log
vagrant@vagrant-ubuntu-trusty-32:~/OpenBazaar$ ./openbazaar --log-level 5 start
vagrant@vagrant-ubuntu-trusty-32:~/OpenBazaar$ Checking NAT Status...
{'nat_type': 'Full Cone', 'external_ip': 'a.b.c.d', 'external_port': 63819}
Setting up UPnP Port Map Entry...
Exception : No UPnP device discovered
UPnP TCP P2P Port Map configuration done (63819 -> 63819) => False
UPnP UDP P2P Port Map configuration done (63819 -> 63819) => False
Warning: UPnP was not setup correctly. Ports could not be automatically mapped.
If you only see two or three stores, here are some tips:
1. If you are using VPN, configure port forwarding or disable your VPN temporarily
# Network node config
config.vm.define 'network' do |network|
network.vm.hostname = 'network.localnet'
network.vm.network :private_network, ip: "192.168.11.6"
network.vm.network :private_network, ip: "192.168.22.6"
network.vm.network :private_network, ip: "172.16.33.6"
network.vm.network :private_network, ip: "172.16.44.6"
network.vm.provider :virtualbox do |vbox|
vbox.customize ["modifyvm", :id, "--memory", "640"]
vbox.customize ["modifyvm", :id, "--nicpromisc3", "allow-all"]
$add_node_classes = <<SCRIPT
/opt/puppet/bin/rake -f /opt/puppet/share/puppet-dashboard/Rakefile RAILS_ENV=production nodeclass:add[openstack::role::compute,skip]
/opt/puppet/bin/rake -f /opt/puppet/share/puppet-dashboard/Rakefile RAILS_ENV=production nodeclass:add[openstack::role::controller,skip]
/opt/puppet/bin/rake -f /opt/puppet/share/puppet-dashboard/Rakefile RAILS_ENV=production nodeclass:add[openstack::role::network,skip]
/opt/puppet/bin/rake -f /opt/puppet/share/puppet-dashboard/Rakefile RAILS_ENV=production nodeclass:add[openstack::role::storage,skip]
SCRIPT
$add_nodes = <<SCRIPT
/opt/puppet/bin/rake -f /opt/puppet/share/puppet-dashboard/Rakefile RAILS_ENV=production node:add[control.localnet,,openstack::role::controller,skip]
/opt/puppet/bin/rake -f /opt/puppet/share/puppet-dashboard/Rakefile RAILS_ENV=production node:add[compute.localnet,,openstack::role::compute,skip]
$hiera_setup = <<SCRIPT
mkdir /etc/puppetlabs/puppet/hieradata
cp /etc/puppetlabs/puppet/modules/openstack/examples/common.yaml /etc/puppetlabs/puppet/hieradata/openstack.yaml
chgrp -R pe-puppet /etc/puppetlabs/puppet/hieradata
sed -i 's/^openstack::network::external::gateway:.*/openstack::network::external::gateway: 192.168.22.1/g' /etc/puppetlabs/puppet/hieradata/openstack.yaml
sed -i 's/^openstack::network::external::dns:.*/openstack::network::external::dns: 8.8.8.8/g' /etc/puppetlabs/puppet/hieradata/openstack.yaml
sed -i "s@^openstack::network::neutron::private:.*@openstack::network::neutron::private: \'10.10.10.0/24\'@g" /etc/puppetlabs/puppet/hieradata/openstack.yaml
sed -i "s@^openstack::nova::libvirt_type:.*@openstack::nova::libvirt_type: \'qemu\'@g" /etc/puppetlabs/puppet/hieradata/openstack.yaml
sed -i "s/^openstack::keystone::admin_email:.*/openstack::keystone::admin_email: \'philip.cheong@elastx.se\'/g" /etc/puppetlabs/puppet/hieradata/openstack.yaml
awk '{print} sub(/- global/,"- openstack")' /e
$install_puppet_modules = <<SCRIPT
/usr/local/bin/puppet module install puppetlabs-openstack --version 4.1.0 --ignore-dependencies --modulepath '/etc/puppetlabs/puppet/modules'
/usr/local/bin/puppet module install dprince-qpid --version 1.0.2 --ignore-dependencies --modulepath '/etc/puppetlabs/puppet/modules'
/usr/local/bin/puppet module install duritong-sysctl --version 0.0.4 --force --modulepath '/etc/puppetlabs/puppet/modules'
/usr/local/bin/puppet module install garethr-erlang --version 0.3.0 --ignore-dependencies --modulepath '/etc/puppetlabs/puppet/modules'
/usr/local/bin/puppet module install puppetlabs-apache --version 1.1.0 --ignore-dependencies --modulepath '/etc/puppetlabs/puppet/modules'
/usr/local/bin/puppet module install puppetlabs-ceilometer --version 4.1.0 --ignore-dependencies --modulepath '/etc/puppetlabs/puppet/modules'
/usr/local/bin/puppet module install puppetlabs-cinder --version 4.1.0 --ignore-dependencies --modulepath '/etc/puppetlabs/puppet/modules'
/u
# Puppet Master config
config.vm.define 'master' do |master|
master.vm.hostname = 'master.localnet'
master.vm.network :private_network, ip: "192.168.11.3"
master.vm.network :private_network, ip: "192.168.22.3"
master.vm.network :private_network, ip: "172.16.33.3"
master.vm.network :private_network, ip: "172.16.44.3"
master.vm.provider :virtualbox do |vbox|
vbox.customize ["modifyvm", :id, "--memory", "1024"]
end
Vagrant.configure('2') do |config|
config.vm.box = 'centos-64-x64-vbox4210-nocm'
config.vm.box_url = 'http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box'
config.pe_build.download_root = 'https://s3.amazonaws.com/pe-builds/released'
config.pe_build.version = '3.2.3'
config.pe_build.filename = 'puppet-enterprise-3.2.3-el-6-x86_64.tar.gz'
config.vm.provision 'shell', inline: 'yum update -y'
# Only here to assist with initial provisioning of machines. After puppet agent run iptables is reenabled and started
config.vm.provision 'shell', inline: 'chkconfig iptables off'