Skip to content

Instantly share code, notes, and snippets.


Philip Cheong philbert

View GitHub Profile
philbert /
Created Feb 22, 2019
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 .
View onename verification
Verifying that "" is my Blockstack ID.
View gist:46b5c41f0812a8059a3bcea048020134
### Keybase proof
I hereby claim:
* I am philbert on github.
* I am 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:
View gist:913bfdc024523341e38d
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
View network_node
# Network node config
config.vm.define 'network' do |network|
network.vm.hostname = 'network.localnet' :private_network, ip: "" :private_network, ip: "" :private_network, ip: "" :private_network, ip: ""
network.vm.provider :virtualbox do |vbox|
vbox.customize ["modifyvm", :id, "--memory", "640"]
vbox.customize ["modifyvm", :id, "--nicpromisc3", "allow-all"]
View add_nodes_and_classes
$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]
$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]
View hiera_setup
$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:' /etc/puppetlabs/puppet/hieradata/openstack.yaml
sed -i 's/^openstack::network::external::dns:.*/openstack::network::external::dns:' /etc/puppetlabs/puppet/hieradata/openstack.yaml
sed -i "s@^openstack::network::neutron::private:.*@openstack::network::neutron::private: \'\'@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: \'\'/g" /etc/puppetlabs/puppet/hieradata/openstack.yaml
awk '{print} sub(/- global/,"- openstack")' /e
View install_puppet_modules
$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'
View puppet_master
# Puppet Master config
config.vm.define 'master' do |master|
master.vm.hostname = 'master.localnet' :private_network, ip: "" :private_network, ip: "" :private_network, ip: "" :private_network, ip: ""
master.vm.provider :virtualbox do |vbox|
vbox.customize ["modifyvm", :id, "--memory", "1024"]
View general_conf
Vagrant.configure('2') do |config| = 'centos-64-x64-vbox4210-nocm'
config.vm.box_url = ''
config.pe_build.download_root = ''
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'
You can’t perform that action at this time.