Skip to content

Instantly share code, notes, and snippets.

View felipekm's full-sized avatar
🦈

Felipe Kautzmann felipekm

🦈
View GitHub Profile
@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
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 / 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 "your_email@example.com" 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 < ~/.ssh/id_rsa.pub

@felipekm
felipekm / rhel-nodejs-config.sh
Last active July 22, 2020 19:30
RHEL NodeJS Server Pre Config
# NGINX | GIT
sudo yum install -y nginx git
# Install the current version of node version manager (nvm) by typing the following at the command line to install version 33.6
# currently using v0.35.2
curl -o- https://raw.githubusercontent.com/creationix/nvm/{VERSION}/install.sh | bash
# Activate nvm by typing the following at the command line.
. ~/.nvm/nvm.sh
@felipekm
felipekm / set_environment_variables.md
Created April 5, 2018 11:50
Set environment variables

Set environment variables

Environment variables are a set of dynamic named values that can affect the way running processes will behave on a computer.

They are part of the operating environment in which a process runs. For example, a running process can query the value of the TEMP environment variable to discover a suitable location to store temporary files, or the HOME or USERPROFILE variable to find the directory structure owned by the user running the process.

macOS

  1. Find out if you're using Bash or ZSH by running the command echo $SHELL in your Terminal.
@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