Skip to content

Instantly share code, notes, and snippets.

View kainlite's full-sized avatar
:shipit:

Gabriel Garrido kainlite

:shipit:
View GitHub Profile
@kainlite
kainlite / snippet1.sh
Last active April 18, 2019 23:21
snippet.sh
ssh -Nn -L 3306:localhost:3306 [email protected]
echo test
@kainlite
kainlite / test.sh
Created April 19, 2019 19:17
test2.sh
echo 2
ssh -Nn -L 3306:localhost:3306 [email protected]
ssh -Nn -L 3306:172.16.16.200:3306 [email protected]
-N Do not execute a remote command. This is useful for just forwarding ports.
-n Redirects stdin from /dev/null (actually, prevents reading from stdin). This must be used when ssh is run in the background.
-L Specifies that connections to the given TCP port or Unix socket on the local (client) host are to be forwarded to the given host and port, or Unix socket, on the remote side.
@kainlite
kainlite / snippet.tf
Last active November 28, 2019 13:30
lambda terraform
# Set the region where the lambda function will be created
variable "aws_region" {
default = "us-east-1"
}
# Assign the region to the provider in this case AWS
provider "aws" {
region = "${var.aws_region}"
}
@kainlite
kainlite / index.js
Created April 27, 2019 20:12
lambda terraform
// 'Hello World' nodejs6.10 runtime AWS Lambda function
exports.handler = (event, context, callback) => {
console.log('Hello world!');
callback(null, 'It works!');
}
$ terraform init
Initializing provider plugins...
- Checking for available provider plugins on https://releases.hashicorp.com...
$ terraform apply
data.archive_file.lambda_zip: Refreshing state...
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
+ aws_iam_role.iam_for_lambda_tf