Create a openVPN server on Google Cloud Platform to connect to your Google Cloud network using openVPN and/or to route your internet traffic through the VPN (Road Warrior Scenario)
- Create new instance in default network
- Chosse Ubuntu 16.04 LTS
/* Client side, works in Chrome 55 and Firefox 52 without transpilation */ | |
//https://blogs.msdn.microsoft.com/typescript/2016/11/08/typescript-2-1-rc-better-inference-async-functions-and-more/ | |
async function fetchURLs() { | |
try { | |
// Promise.all() lets us coalesce multiple promises into a single super-promise | |
var data = await Promise.all([ | |
/* Alternatively store each in an array */ | |
// var [x, y, z] = await Promise.all([ | |
// parse results as json; fetch data response has several reader methods available: | |
//.arrayBuffer() |
Create a openVPN server on Google Cloud Platform to connect to your Google Cloud network using openVPN and/or to route your internet traffic through the VPN (Road Warrior Scenario)
These are generic npm scripts that you can copy & paste into your package.json
file as-is and get access to convinience scripts to manage your Docker images all in one place.
npm i -g mrm-task-npm-docker
npx mrm npm-docker
Here's the code repository https://github.com/expertly-simple/mrm-task-npm-docker
anchors: | |
tf_init: &tf_init | | |
terraform init -lock=false \ | |
-backend-config="resource_group_name=terraform" \ | |
-backend-config="key=${{ env.TF_BACKEND_KEY }}" \ | |
-backend-config="access_key=${{ secrets.TF_BACKEND_ACCESS_KEY }}" \ | |
-backend-config="storage_account_name=${{ secrets.TF_BACKEND_SA }}" | |
setup_backend_key: &setup_backend_key "githubdeployment.${{ github.event.inputs.environment }}.aks_setup.terraform.tfstate" | |
configure_backend_key: &configure_backend_key "githubdeployment.${{ github.event.inputs.environment }}.aks_configure.terraform.tfstate" |
CHANGED_FOLDERS=$(git diff --name-status $TRAVIS_COMMIT_RANGE -- | awk 'BEGIN {FS="/"} {print $1}' | awk '{print $2}' | uniq) |
#include <iostream> | |
#include <map> | |
using namespace std; | |
class BaseClass{ | |
public: | |
virtual int funk() { | |
return 0; | |
} |
import { Queue } from "@aws-cdk/aws-sqs"; | |
import { App, Duration, Stack, StackProps } from "@aws-cdk/core"; | |
import { Runtime, Code, Function } from "@aws-cdk/aws-lambda"; | |
import { SqsEventSource } from "@aws-cdk/aws-lambda-event-sources"; | |
class DeadLetterQueue extends Stack { | |
constructor(parent: App, name: string, props?: StackProps) { | |
super(parent, name, props); |
import importlib | |
from mock import MagicMock, patch | |
def example(): | |
with patch_modules(): | |
import something.not.importable | |
print("yay! it worked!") | |
def patch_modules(): | |
sm = mock_import('not.importable', 'something') |
function retry_backoff {local m=${ATTEMPTS:-5};local t=${TIMEOUT:-1};local a=0;local e=1;while (($a < $m));do "$@";e=$?;if (($e == 0)); then break;fi;echo "Failure! Retrying in $t.." 1>&2;sleep $t;((a++));t=$((t*2));done;if (($e != 0));then echo "Max attempts reached!" 1>&2;fi;return $e; }
retry_backoff $YOUR_COMMAND # default of 5 retries, starting with 1 second timeout