Skip to content

Instantly share code, notes, and snippets.

View willgarcia's full-sized avatar
🌴

William Garcia willgarcia

🌴
  • Brisbane, Australia
View GitHub Profile
@lucasponce
lucasponce / istio-gke-kiali
Last active May 13, 2021 16:58
Install Istio in Google Kubernetes Engine + Update Kiali to latest
[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 -
@mdlavin
mdlavin / lambda-function-xray-enablement.tf
Last active July 23, 2024 14:40
Terraform configuration to enable X-Ray for a Lambda function
resource "aws_lambda_function" "service" {
# Your usual aws_lambda_function configuration settings here
tracing_config {
mode = "Active"
}
}
@davewongillies
davewongillies / Terraform_functions.md
Last active July 4, 2024 22:15
Terraform Functions

Supported built-in functions

  • abs(float) - Returns the absolute value of a given float. Example: abs(1) returns 1, and abs(-1) would also return 1, whereas abs(-3.14) would return 3.14. See also the signum function.

  • basename(path) - Returns the last element of a path.

  • base64decode(string) - Given a base64-encoded string, decodes it and returns the original string.

@devjin0617
devjin0617 / .manifest
Created May 19, 2017 15:15
chrome extension using a content script to access the `window` object
{
"content_scripts": [
{
"matches": ["http://*/*", "https://*/*"],
"js": ["inject.js"],
"all_frames": true
}
],
"web_accessible_resources": [
"content.js"
@MortenDHansen
MortenDHansen / ticker.go
Created February 7, 2017 21:54
GoLang ticker - every second for ... time
package main
import "time"
import "fmt"
func main() {
tickerChannel := time.NewTicker(1 * time.Second)
go func() {
for {
select {
@martinbuberl
martinbuberl / git-import-repository.md
Last active June 20, 2024 10:42
Import existing Git repository into another

Import existing Git repository into another

Folder structure before (2 separate repositories):

XXX
 |- .git
 |- (project files)
YYY
 |- .git

How to setup AWS lambda function to talk to the internet and VPC

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.

  1. No VPC, where it can talk openly to the web, but can't talk to any of your AWS services.
  2. VPC, the default setting where the lambda function can talk to your AWS services but can't talk to the web.
  3. VPC with NAT, The best of both worlds, AWS services and web.
@jam13
jam13 / hook.sh
Last active March 1, 2017 11:40
letsencrypt.sh hook for AWS Route53
#!/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
@Integralist
Integralist / vegeta load test.sh
Last active February 7, 2022 13:30
[Vegeta load test examples https://github.com/tsenart/vegeta] #go #golang #vegeta #examples #loadtest #benchmark #report
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:
#
@hd-deman
hd-deman / gist:d856151147ab9c3c3564
Created February 21, 2015 21:56
Downgrade Boot2Docker and Docker from 1.5.0 to 1.4.1 on OS X
* 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