Skip to content

Instantly share code, notes, and snippets.

View felipekm's full-sized avatar
🦈

Felipe Kautzmann felipekm

🦈
View GitHub Profile
@felipekm
felipekm / install_codedeploy_ubuntu_20.sh
Created June 24, 2020 20:10
Install codedeploy in ubuntu 20
apt-get update
apt-get install -y ruby
wget https://aws-codedeploy-us-east-1.s3.amazonaws.com/releases/codedeploy-agent_1.0-1.1597_all.deb
mkdir codedeploy-agent_1.0-1.1597_ubuntu20
dpkg-deb -R codedeploy-agent_1.0-1.1597_all.deb codedeploy-agent_1.0-1.1597_ubuntu20
sed 's/2.0/2.7/' -i ./codedeploy-agent_1.0-1.1597_ubuntu20/DEBIAN/control
dpkg-deb -b codedeploy-agent_1.0-1.1597_ubuntu20
dpkg -i codedeploy-agent_1.0-1.1597_ubuntu20.deb
systemctl start codedeploy-agent
systemctl enable codedeploy-agent
@felipekm
felipekm / aws_rs_count_by_zone
Created May 22, 2020 23:23
AWS Record Set counter by Zone
aws route53 get-hosted-zone --id HOSTED_ZONE_ID --query "HostedZone.ResourceRecordSetCount"
@felipekm
felipekm / gist:d2eda934d2268c660db274f5f91d27ac
Created May 19, 2020 14:13
nmap to find all devices on network listening on a particular port
nmap -p 80 --open -sV 192.168.1.0/24
@felipekm
felipekm / certbot.md
Last active May 3, 2024 14:57
Ubuntu - Setup free SSL HTTPS for your domain

It installs Let’s Encrypt client certbot, download SSL and certificates for your domain, configures Nginx to use these certificates, and set up automatic certificate renewal

Step 1 — Installing Certbot

sudo snap install core; sudo snap refresh core sudo apt remove certbot sudo snap install --classic certbot sudo ln -s /snap/bin/certbot /usr/bin/certbot

Step 2 — Confirming Nginx’s Configuration

scp -i "{KEY_PAGE}" FILES ec2-user@ec2-{IPNUMBER}.sa-east-1.compute.amazonaws.com:~/{FOLDER_NAME}
@felipekm
felipekm / check-git.sh
Created April 27, 2020 13:17
Shell - Check if the folder is a git repo
#!/bin/sh
if git rev-parse --git-dir > /dev/null 2>� then
# git repo!
else
# NOT a git repo!
fi
@felipekm
felipekm / server.js
Created April 23, 2020 00:05
asset prefix next server
const express = require('express');
const proxy = require('http-proxy-middleware');
const next = require('next');
const assetPrefix = process.env.ASSET_PREFIX || "";
const proxyPort = parseInt(process.env.PROXY_PORT, 10) || 9000;
const nextPort = parseInt(process.env.NEXT_PORT, 10) || 3000;
const dev = process.env.NODE_ENV !== 'production';
const app = next({ dev });
const handle = app.getRequestHandler();
@felipekm
felipekm / fix_sharp.sh
Created March 20, 2020 03:02
nodejs sharp issue problem
sudo npm i --unsafe-perm=true --allow-root
sudo chmod -R 777 node_modules/
npm rebuild sharp --allow-root
@felipekm
felipekm / grep_multi.sh
Created March 19, 2020 18:47
grep with multi line
# List 5 lines below the scripts grep
cat package.json | grep -b 5 scripts
# List 5 lines above the scripts grep
cat package.json | grep -a 5 scripts
@felipekm
felipekm / chmod_exec.sh
Last active March 20, 2020 20:47
Linux gives permission to a folder recursive
sudo chmod -R a+rwx /path/to/file