Skip to content

Instantly share code, notes, and snippets.

View rodrigo-galba's full-sized avatar

Rodrigo Galba rodrigo-galba

  • Brazil
View GitHub Profile
@rodrigo-galba
rodrigo-galba / README.md
Last active March 23, 2020 17:47
AWS EC2 recovery credentials

What if I lost my EC2 ssh key?

For EBS backed instances

1 - Best option

Run the AWSSupport-ResetAccess automation document via AWS Systems Manager.
Detailed doc here

2 - Modify ssh authorized keys

@rodrigo-galba
rodrigo-galba / stress.sh
Created March 17, 2020 02:00 — forked from mikepfeiffer/stress.sh
Install Stress Utility on Amazon Linux 2
sudo amazon-linux-extras install epel -y
sudo yum install stress -y
@rodrigo-galba
rodrigo-galba / allow-privileged-for-microk8s.md
Created January 7, 2020 13:52 — forked from antonfisher/allow-privileged-for-microk8s.md
MicroK8s add --allow-privileged=true flag

Add --allow-privileged=true to:

# kubelet config
sudo vim /var/snap/microk8s/current/args/kubelet

#kube-apiserver config
sudo vim /var/snap/microk8s/current/args/kube-apiserver

Restart services:

@rodrigo-galba
rodrigo-galba / private-s3-gist.md
Created August 3, 2019 01:06
AWS S3 bucket to private user

S3 bucket to private user

  1. Create a IAM policy called s3-admin-nexus-s3-bucket. It will be used later.
{    
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
@rodrigo-galba
rodrigo-galba / mount_efs.sh
Created June 11, 2019 02:31
Mount AWS EFS on Ubuntu
sudo su
mkdir /efs
sudo apt-get install nfs-common
mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport fs-123456.efs.us-east-1.amazonaws.com:/ /efs
@rodrigo-galba
rodrigo-galba / zsh.md
Created May 3, 2019 12:10 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu
@rodrigo-galba
rodrigo-galba / Vagrantfile
Created May 1, 2019 15:14 — forked from kikitux/Vagrantfile
Vagrantfile, multi machine with ssh password less and hostname over private network.
numnodes=2
baseip="192.168.10"
#global script
$global = <<SCRIPT
#check for private key for vm-vm comm
[ -f /vagrant/id_rsa ] || {
ssh-keygen -t rsa -f /vagrant/id_rsa -q -N ''
}
@rodrigo-galba
rodrigo-galba / README.MD
Created April 8, 2019 19:03
Window Always on top

Go to https://www.autohotkey.com/download/ On your desktop, right-click on an empty space and select "AutoHotkey Script" inside the "New" menu. Give the script a name (e.g. AlwaysOnTop) and save it. Right-click on the script and select "Edit Script". Replace the content of the file with the following code:

#Space:: Winset, AlwaysOnTop, Toggle, A

Save the file.

@rodrigo-galba
rodrigo-galba / QuickAndDirtyKubernetesClusterWithKubespray.md
Created February 15, 2019 17:31
Quick and Dirty Kubernetes Cluster with Kubespray

Prerequisites

Machine which deploys the cluster:

  • Ansible v2.3 (or newer) is installed
  • Jinja 2.9 (or newer) is installed
  • python-netaddr is installed

Machines which belong to the cluster: