- 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
#https://www.zeitgeist.se/2013/11/22/strongswan-howto-create-your-own-vpn/ | |
#https://www.gypthecat.com/ipsec-vpn-host-to-host-on-ubuntu-14-04-with-strongswan | |
#Example of simple pre-shared keys vpn setup: https://www.strongswan.org/uml/testresults/ikev2/rw-psk-ipv4/ | |
$ sudo apt-get -y install strongswan | |
$ ipsec version | |
Linux strongSwan U5.1.2/K3.13.0-55-generic | |
Institute for Internet Technologies and Applications | |
University of Applied Sciences Rapperswil, Switzerland | |
See 'ipsec --copyright' for copyright information. |
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
- name: install newer nginx and ovveride old config file | |
shell: sudo apt-get -y -o Dpkg::Options::=--force-confnew install nginx | |
notify: restart nginx |
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
from Crypto.Cipher import AES | |
from Crypto import Random | |
import base64 | |
block_size = AES.block_size | |
#unpad = lambda s : s[0:-ord(s[-1])] | |
def pad(plain_text): |
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
# delete branches that are older than x days | |
# this will delete branches that havent received any commits that are newer than Aug 10, 2016 | |
# see this answer for a bit more detail: http://stackoverflow.com/questions/10325599/delete-all-branches-that-are-more-than-x-days-weeks-old/39277210#39277210 | |
for k in $(git branch -r | sed /\*/d); do | |
if [ -z "$(git log -1 --since='Aug 10, 2016' -s $k)" ]; then | |
branchnew=$(echo $k | sed -e "s/origin\///") | |
echo deleting branch: $branchnew | |
git push origin --delete $branchnew | |
fi |
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
$ sudo apt -y install openvpn | |
## cat /etc/openvpn/client.conf | |
remote <PUBLI_IP> 1194 | |
proto udp | |
ns-cert-type server | |
client | |
dev tun | |
resolv-retry infinite |
-
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
$ cat /etc/apt/sources.list.d/pritunl.list | |
deb https://repo.pritunl.com/stable/apt xenial main | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 7568D9BB55FF9E5287D586017AE645C0CF8E292A | |
sudo apt-get update | |
sudo apt-get install pritunl-client-gtk | |
# download profile(vpn config) | |
# start pritunl client from apps |
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
// create a paypal express checkout app | |
1. create a sandbox paypal app: https://developer.paypal.com/developer/applications (under REST API apps) | |
2. copy the app email([email protected]), client_id(Ac3vNqODzxe40U2kczQd92e4CGDor1SVM7GBfHzimCflhTaS6CtHW-jHMwys1RAKFzfLM-vX7xFPfCzo | |
) | |
3. use the client_id from above and replace it in the html_snippet below | |
4. configure webhooks for any events that occur: https://developer.paypal.com/docs/integration/direct/webhooks/rest-webhooks/ | |
example of events that can occur-> https://developer.paypal.com/docs/integration/direct/webhooks/event-names/ | |
5. setup a Return URL - Target URL where users will be redirected after test transactions. Please allow up to 3 hours for the change to go into effect. | |
6. You will go through the same steps later on when you want to create the proper LIVE prod paypal. app |