Skip to content

Instantly share code, notes, and snippets.

View anthonysnk's full-sized avatar
🏠
Working from home

Nelson Sánchez anthonysnk

🏠
Working from home
View GitHub Profile
@anthonysnk
anthonysnk / cloudTrailEventNames.list
Created February 27, 2024 13:36 — forked from pkazi/cloudTrailEventNames.list
List of values for parameter EventName in AWS Cloudtrail events
AbortDocumentVersionUpload
AbortEnvironmentUpdate
AbortMultipartUpload
AbortVaultLock
AcceptAccountMapping
AcceptCertificateTransfer
AcceptDelegate
AcceptDirectConnectGatewayAssociationProposal
AcceptFxPaymentCurrencyTermsAndConditions
AcceptHandshake
@anthonysnk
anthonysnk / outputs.tf
Created June 5, 2021 01:49
outputs tf
output "EIP"{
description = "Ligthsail EIP"
value = aws_lightsail_static_ip.static_ip.ip_address
}
@anthonysnk
anthonysnk / main.tf
Created June 5, 2021 01:48
Main tf lightsail
## Creates an AWS Lightsail Instance.
resource "aws_lightsail_instance" "lightsail_instance" {
name = var.project_name ## Name of lightsail instance in AWS
availability_zone = "${var.aws_region}a" ## AZ
blueprint_id = var.lightsail_blueprints["wordpress"] ## Options for "wordpress"
bundle_id = var.bundle_id ## Options for instance size
}
## Creates a static public IP address on Lightsail
resource "aws_lightsail_static_ip" "static_ip" {
name = "${var.project_name}_static_ip" ## Name of static IP in AWS
@anthonysnk
anthonysnk / inputs.tf
Created June 5, 2021 01:31
Terraform varibales
variable "aws_region" {
type = string
default = "us-east-1"
description = "Set up our region, that we want to use"
}
variable "project_name" {
description = "Project's Names"
type = string
}
variable "bundle_id" {
@anthonysnk
anthonysnk / terraform.tf
Last active June 5, 2021 01:39
Terraform variables ligthsail
aws_region = "us-east-1"
project_name = "medium_project"
bundle_id = "nano_2_0"
lightsail_blueprints = {
"wordpress" = "wordpress_4_9_8"
}
@anthonysnk
anthonysnk / install_tf.sh
Created June 5, 2021 00:54
Script to install tf
#!/bin/bash
set -e
tf_version=0.15.0
echo "DOWNLOADING TERRAFORM"
wget https://releases.hashicorp.com/terraform/"$tf_version"/terraform_"$tf_version"_linux_amd64.zip
unzip terraform_"$tf_version"_linux_amd64.zip
sudo mv terraform /usr/local/bin/
rm terraform_"$tf_version"_linux_amd64.zip
@anthonysnk
anthonysnk / provider.tf
Last active June 5, 2021 00:50
Provider Tf
provider "aws" {
region = var.aws_region
profile = "tf-tutorial"
default_tags {
tags = {
Project = "wordpress-ligthsail"
}
}
}
@anthonysnk
anthonysnk / install-firacode.sh
Created April 28, 2021 04:17 — forked from nikhita/install-firacode.sh
How to install FiraCode font on Linux
mkdir -p ~/.local/share/fonts
for type in Bold Light Medium Regular Retina; do wget -O ~/.local/share/fonts/FiraCode-$type.ttf "https://github.com/tonsky/FiraCode/blob/master/distr/ttf/FiraCode-$type.ttf?raw=true"; done
fc-cache -f
@anthonysnk
anthonysnk / publickey-git-error.markdown
Created January 27, 2021 23:58 — forked from adamjohnson/publickey-git-error.markdown
Fix "Permission denied (publickey)" error when pushing with Git

"Help, I keep getting a 'Permission Denied (publickey)' error when I push!"

This means, on your local machine, you haven't made any SSH keys. Not to worry. Here's how to fix:

  1. Open git bash (Use the Windows search. To find it, type "git bash") or the Mac Terminal. Pro Tip: You can use any *nix based command prompt (but not the default Windows Command Prompt!)
  2. Type cd ~/.ssh. This will take you to the root directory for Git (Likely C:\Users\[YOUR-USER-NAME]\.ssh\ on Windows)
  3. Within the .ssh folder, there should be these two files: id_rsa and id_rsa.pub. These are the files that tell your computer how to communicate with GitHub, BitBucket, or any other Git based service. Type ls to see a directory listing. If those two files don't show up, proceed to the next step. NOTE: Your SSH keys must be named id_rsa and id_rsa.pub in order for Git, GitHub, and BitBucket to recognize them by default.
  4. To create the SSH keys, type ssh-keygen -t rsa -C "[email protected]". Th