-
abs(float)
- Returns the absolute value of a given float. Example:abs(1)
returns1
, andabs(-1)
would also return1
, whereasabs(-3.14)
would return3.14
. See also thesignum
function. -
basename(path)
- Returns the last element of a path. -
base64decode(string)
- Given a base64-encoded string, decodes it and returns the original string.
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
[0] Pre-requisites | |
Install google-cloud-sdk in your laptop | |
Documentation: https://cloud.google.com/sdk | |
Install helm in your laptop. | |
Documentation: https://helm.sh/docs/using_helm/#installing-helm | |
Get latest Istio. | |
curl -L https://git.io/getLatestIstio | ISTIO_VERSION=1.1.7 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
resource "aws_lambda_function" "service" { | |
# Your usual aws_lambda_function configuration settings here | |
tracing_config { | |
mode = "Active" | |
} | |
} |
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
{ | |
"content_scripts": [ | |
{ | |
"matches": ["http://*/*", "https://*/*"], | |
"js": ["inject.js"], | |
"all_frames": true | |
} | |
], | |
"web_accessible_resources": [ | |
"content.js" |
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 "time" | |
import "fmt" | |
func main() { | |
tickerChannel := time.NewTicker(1 * time.Second) | |
go func() { | |
for { | |
select { |
I'm going to walk you through the steps for setting up a AWS Lambda to talk to the internet and a VPC. Let's dive in.
So it might be really unintuitive at first but lambda functions have three states.
- No VPC, where it can talk openly to the web, but can't talk to any of your AWS services.
- VPC, the default setting where the lambda function can talk to your AWS services but can't talk to the web.
- VPC with NAT, The best of both worlds, AWS services and web.
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
#!/bin/bash | |
function deploy_challenge { | |
local DOMAIN="${1}" TOKEN_FILENAME="${2}" TOKEN_VALUE="${3}" | |
# This hook is called once for every domain that needs to be | |
# validated, including any alternative names you may have listed. | |
# | |
# Parameters: | |
# - DOMAIN |
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
echo "GET http://google.com" | vegeta attack -duration=5s -rate=2 -cert=/path/to/certificate.pem | tee results.bin | vegeta report | |
# you don't have to pipe the data to `vegeta report`, | |
# you can instead run it as a separate command... | |
# | |
# echo "GET http://google.com" | vegeta attack -duration=5s | tee results.bin | |
# vegeta report results.bin | |
# | |
# in the vegeta results you might be confused by the `Status Codes` section: | |
# |
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
* brew tap homebrew/boneyard | |
* cd $( brew --prefix ) | |
* brew versions docker | |
git_hash = $(brew versions docker | awk '$1 == "1.4.1" {print $4}') | |
* git checkout $git_hash Library/Formula/docker.rb | |
* brew unlink docker | |
* brew install docker | |
* brew switch docker 1.4.1 | |
* docker --version |
NewerOlder