Skip to content

Instantly share code, notes, and snippets.

@stevepereira
stevepereira / devops_topics.txt
Last active February 1, 2020 21:29
Need some inspirado?
Transformation stories - siloed to agiled
Value Streams
Logging
Monitoring
Tech burnout
Project-to-Product
DevOps and regulation
DevOps and the monolithic/12 factor app
Continuous delivery
QA automation
@stevepereira
stevepereira / unicode.sql
Created January 26, 2016 06:53
Convert tables to unicode
SELECT CONCAT("ALTER TABLE ", TABLE_NAME," DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;") AS ExecuteTheString
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA="99"
AND TABLE_TYPE="BASE TABLE";
@stevepereira
stevepereira / git-recover-branch.md
Created December 17, 2015 17:47 — forked from jbgo/git-recover-branch.md
How to recover a git branch you accidentally deleted

UPDATE: A better way! (August 2015)

As pointed out by @johntyree in the comments, using git reflog is easier and more reliable. Thanks for the suggestion!

 $ git reflog
1ed7510 HEAD@{1}: checkout: moving from develop to 1ed7510
3970d09 HEAD@{2}: checkout: moving from b-fix-build to develop
1ed7510 HEAD@{3}: commit: got everything working the way I want
70b3696 HEAD@{4}: commit: upgrade rails, do some refactoring
@stevepereira
stevepereira / bootstrap.sh
Last active February 16, 2016 19:19
bootstrap statflo dev - curl -sSL http://j.mp/statflodev | bash
#!/usr/bin/env -e bash
# bootstrap statflo dev - curl -sSL http://j.mp/statflodev | bash
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install caskroom/cask/brew-cask
brew cask install dockertoolbox the-silver-searcher
docker-machine create dev
eval "$(docker-machine env dev)"
mkdir -p ~/statflo
git clone https://github.com/Statflo/statflo-webapp.git ~/statflo/
curl -Ls https://install.convox.com/osx.zip > /tmp/convox.zip
@stevepereira
stevepereira / useful_pandas_snippets.py
Created October 20, 2015 19:13 — forked from bsweger/useful_pandas_snippets.md
Useful Pandas Snippets
#List unique values in a DataFrame column
pd.unique(df.column_name.ravel())
#Convert Series datatype to numeric, getting rid of any non-numeric values
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True)
#Grab DataFrame rows where column has certain values
valuelist = ['value1', 'value2', 'value3']
df = df[df.column.isin(value_list)]
@stevepereira
stevepereira / learning_to_see.md
Last active August 29, 2015 14:28
Learning to see notes

##What do you typically see?

  • 80 – 90% of total steps are waste from standpoint of end customer
  • 99.9% of throughput time is wasted time
  • Demand becomes more and more erratic as it moves upstream, imposing major inventory, capacity, and management costs at every level
  • Quality becomes worse and worse as we move upstream, imposing major costs downstream
  • Most managers and many production associates expend the majority of their efforts on hand-offs, work-arounds, and logistical complexity

##Objective

  • Correct specification of value
  • Elimination of wasteful steps
@stevepereira
stevepereira / docker-machine-vmfusion.sh
Last active November 13, 2015 20:12
Basic workflow for docker-machine on Mac with VMWare Fusion
# Get everything ready on a Mac
brew install docker docker-machine docker-compose
# Create a new machine (based on the 1.8.1 boot2docker iso)
docker-machine create --driver vmwarefusion --vmwarefusion-memory-size 2048 --vmwarefusion-boot2docker-url https://github.com/boot2docker/boot2docker/releases/download/v1.8.1/boot2docker.iso dev
# Bring the machine up
docker-machine start dev
# Configure Shell
curl -X POST --data-binary @payload.yaml -H "Content-type: text/x-yaml" http://localhost:4200/some-url/1024
DELIMITER $$
DROP PROCEDURE IF EXISTS add_email_address_column_to_customers_table $$
-- Create the stored procedure to perform the migration
CREATE PROCEDURE add_email_address_column_to_customers_table()
BEGIN
-- Add the email_address column to the customers table, if it doesn't already exist
@stevepereira
stevepereira / gist:61b7ed1e6e0ba9ae5132
Created April 22, 2015 00:12
xn_packer_public_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDBE++3o+1WsUCpftq695RaKPe9neQXheGHzlhyTyORzxhdGLEiduhGI4TLFxSyob8fh/tRwbStxbo8G5mSWICueMDgHTkewOKT/fjtTMtSHwc4vlNZkAqJmjHobSQEZuFPddx6Y5pRiiVVDq0/iQDKJUTcKAqTPYy4WEGv++TUgO5rMTCUWWO5jZBFWIElu/L5x/g5f7Q9IjV/kRXL7G6jg3GFopymTZkXUa73RcyXCLzYVUWWQTZtL5gfRv/XCtm1TXWUI8mGhPROh2Rq/QPZ29fD8X3V1YBabzniUlbi3W3WBZhdZzf22PY2XAstFB/W+B+4gU/4hAdZmAxXIUst joeyfreund@gmail.com
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDE1MJsubW/PY3HqZ2BaqPCwhz1oei8Vp+TWNx8ZrGDAlMqfIrkDpOCeOkXPMcOl98iNWO6PixUZQIfIFj+NR3lFSRWZTfc0F3XPUhhli68DY8IUw9Ew11SffEj42rRoy4imn6u5JLiRiSox1VKOGDNrYjUpVbZPOt7vtH7ziFB/fO2rkJWLIa468MvDqWkW7nhTW6Mhi3J4Ty8zntyY9PrGLcD0Q40HRYhc4rggrrHuSm21KIrrM9D1rK39oEpGvMeEcUOQSX6CLlnuoSPPlMPzNhxoECo/IUsMIqAgdZXaUqSSKQvuYfcGVkFa0wYL3rpHUiJ6uwP93cT7c81jaR3 steve@stevepereira.ca