(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| import mesosphere.mesos.util.FrameworkInfo | |
| import org.apache.mesos.MesosSchedulerDriver | |
| /** | |
| * @author Tobi Knaup | |
| */ | |
| object Main extends App { |
| # URI of the local (caching) HTTP proxy | |
| LOCAL_HTTP_PROXY = 'http://192.168.33.200:8123' | |
| # Configures vagrant-cachier and vagrant-proxyconf. | |
| # Should be called only on "local machine" providers. | |
| def configure_caching(config) | |
| if Vagrant.has_plugin?('vagrant-cachier') | |
| config.cache.enable_nfs = true | |
| config.cache.enable :gem | |
| config.cache.enable :npm |
| user www-data; | |
| worker_processes 1; | |
| pid /var/run/nginx.pid; | |
| events { | |
| worker_connections 1024; | |
| } | |
| http { | |
| sendfile on; |
| wifi-menu | |
| ping www.google.com | |
| # setup disk partitions | |
| cfdisk. | |
| # format disk partitions | |
| lsblk /dev/sda | |
| mkfs.ext4 /dev/sda1 | |
| mkfs.ext4 /dev/sda2 |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
Use these rapid keyboard shortcuts to control the GitHub Atom text editor on macOS.
If you use Amazon AWS for nearly anything, then you are probably familiar with KMS, the Amazon Key Management Service.
KMS is a service which allows API-level access to cryptographic primitives without the expense and complexity of a full-fledged HSM or CloudHSM implementation. There are trade-offs in that the key material does reside on servers rather than tamper-proof devices, but these risks should be acceptable to a wide range of customers based on the care Amazon has put into the product. You should perform your own diligence on whether KMS is appropriate for your environment. If the security profile is not adequate, you should consider a stronger product such as CloudHSM or managing your own HSM solutions.
The goal here is to provide some introductory code on how to perform envelope encrypt a message using the AWS KMS API.
KMS allows you to encrypt messages of up to 4kb in size directly using the encrypt()/decrypt() API. To exceed these limitations, you must use a technique called "envelope encryptio
| #!/usr/bin/env sh | |
| OLDDIR="$PWD" | |
| if [ -z "$CACERTS_FILE" ]; then | |
| CACERTS_FILE=$JAVA_HOME/jre/lib/security/cacerts | |
| fi | |
| mkdir /tmp/rds-ca && cd /tmp/rds-ca |
| """ Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """ | |
| import numpy as np | |
| import cPickle as pickle | |
| import gym | |
| # hyperparameters | |
| H = 200 # number of hidden layer neurons | |
| batch_size = 10 # every how many episodes to do a param update? | |
| learning_rate = 1e-4 | |
| gamma = 0.99 # discount factor for reward |