Skip to content

Instantly share code, notes, and snippets.

View felipekm's full-sized avatar
🦈

Felipe Kautzmann felipekm

🦈
View GitHub Profile
@felipekm
felipekm / install-go.sh
Last active September 19, 2020 22:50
Installing Go MacOSX
#/bin/sh
# download gvm
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
# include in path (.bashrc, .zshrc)
export PATH=$PATH:$HOME/.gvm/bin
[[ -s "$HOME/.gvm/scripts/gvm" ]] && source "$HOME/.gvm/scripts/gvm"
export GOPATH=$HOME/Go
@felipekm
felipekm / update_nginx.sh
Created July 31, 2020 19:12
how to update nginx
#!/bin/shell
sudo mkdir /etc/nginx-backup/
sudo cp -r /etc/nginx/* /etc/nginx-backup/
sudo add-apt-repository ppa:nginx/stable
sudo apt-get update
sudo apt-get full-upgrade
sudo nginx -v
@felipekm
felipekm / clear-memory-cache-buffer-swap.sh
Created July 27, 2020 14:31
Linux Clear Cache Shell Script
#!/bin/bash
# Clear PageCache only
sync; echo 1 > /proc/sys/vm/drop_caches
# Clear dentries and inodes
sync; echo 2 > /proc/sys/vm/drop_caches
# Clear PageCache, dentries and inodes
sync; echo 3 > /proc/sys/vm/drop_caches
@felipekm
felipekm / gist:a7b6df8b65f0fdb0414c0ca605f71f4a
Created July 22, 2020 22:35
Install google chrome in ubuntu
sudo apt install gdebi-core wget
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo gdebi google-chrome-stable_current_amd64.deb
@felipekm
felipekm / steps.md
Created July 22, 2020 19:40
Github set ssh keys steps Linux

Generating a new SSH key and adding it to the ssh-agent

ssh-keygen -t rsa -b 4096 -C "[email protected]" eval "$(ssh-agent -s)" ssh-add ~/.ssh/id_rsa

Adding a new SSH key to your GitHub account

sudo apt-get install xclip xclip -sel clip &lt; ~/.ssh/id_rsa.pub

@felipekm
felipekm / pm2_rust.md
Last active July 23, 2024 12:09
Use PM2 with RUST

Make a Rust project: cargo init foo

Install PM2:

  1. npm init
  2. npm install pm2

Create a script entry in your package.json to launch pm2:

local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
PROMPT='%{$fg_bold[red]%}HOME - %{$fg_bold[yellow]%}%t - %{$fg_bold[blue]%}%c $(git_prompt_info)% %{$reset_color%}'
ZSH_THEME_GIT_PROMPT_CLEAN=") %{$fg_bold[green]%}✔ "
ZSH_THEME_GIT_PROMPT_DIRTY=") %{$fg_bold[red]%}✘ "
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[cyan]%}("
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
@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