-
Safe Operations For High Volume PostgreSQL: https://www.braintreepayments.com/blog/safe-operations-for-high-volume-postgresql
-
Zero downtime database migrations: https://www.rainforestqa.com/blog/2014-06-27-zero-downtime-database-migrations
-
Online migrations at scale: https://stripe.com/blog/online-migrations
-
Rails migrations, zero downtime: https://blog.codeship.com/rails-migrations-zero-downtime
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#first seen here: http://www.snip2code.com/Snippet/63701/Ansible-task-to-install-nvm-and-node | |
# Here is how to install nvm and node in an Ansible task. | |
# I tried a bunch of different things, and as usual it's simple, but you have to get it right. | |
# The important part is that you have to shell with /bin/bash -c and source nvm.sh | |
--- | |
- name: Install nvm | |
shell: > | |
curl https://raw.githubusercontent.com/creationix/nvm/v0.7.0/install.sh | sh | |
creates=/home/{{ ansible_user_id }}/.nvm/nvm.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"github.com/klauspost/reedsolomon" | |
) | |
// You can use erasure encoding to; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`pip install pycrypto` | |
from Crypto.Cipher import DES3 | |
from Crypto import Random | |
key = 'Sixteen byte key' | |
iv = Random.new().read(DES3.block_size) #DES3.block_size==8 | |
cipher_encrypt = DES3.new(key, DES3.MODE_OFB, iv) | |
plaintext = 'sona si latine loqueri ' #padded with spaces so than len(plaintext) is multiple of 8 | |
encrypted_text = cipher_encrypt.encrypt(plaintext) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import errno | |
import time | |
""" | |
The linux pipe buffers are implemnted as circular buffers[1]. | |
A consequence of the circular buffer is that when it is full and a subsequent write is performed: | |
(a) then it starts overwriting the oldest data[2]. | |
(b) Alternatively, the routines that manage the buffer could prevent overwriting the data and return an error or raise an exception. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If for any reason you don't have a GUI VPN client(you like running headless ubuntu | |
or have ubuntu installed on a chromebook). You can use vpnc as a command line VPN client | |
#this is a comment | |
#install vpnc | |
$ sudo apt-get install network-manager-vpnc | |
#look to see if you have vpnc installed | |
$ sudo vpnc --help #use sudo to run vpnc command | |
#if not installed, install it: | |
$ sudo apt-get install vpnc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apiextensions.k8s.io/v1 | |
kind: CustomResourceDefinition | |
metadata: | |
# name must match the spec fields below, and be in the form: <plural>.<group> | |
name: komucrontabs.stable.example.com | |
spec: | |
# group name to use for REST API: /apis/<group>/<version> | |
group: stable.example.com | |
# list of versions supported by this CustomResourceDefinition | |
versions: |
- intro, download, install & setup
- basics, syntax
- control flow
- more types, data structures
- methods & interfaces
- concurrency
- nice to know stuff
- golang gotchas <-- especially if you are coming from python, ruby etc
- workspace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/aes" | |
"crypto/cipher" | |
"crypto/rand" | |
"crypto/sha256" | |
"encoding/base64" | |
"errors" | |
"fmt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rabbitMQ password hashing algo as laid out in: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/2011-May/012765.html | |
from __future__ import print_function | |
import base64 | |
import os | |
import hashlib | |
import struct | |
# This is the password we wish to encode | |
password = 'simon' |