Skip to content

Instantly share code, notes, and snippets.

View felipekm's full-sized avatar
🦈

Felipe Kautzmann felipekm

🦈
View GitHub Profile
@felipekm
felipekm / nginx.conf
Created February 5, 2018 20:06
NGINX robots.txt
location /robots.txt { alias /home/www/html/robots.txt; }
location /robots.txt { root /home/www/html/; }
@felipekm
felipekm / nginx_gzip
Last active February 22, 2018 19:10
NGINX gzip configuration
# gzip
gzip on;
gzip_disable "msie6";
gzip_static always;
gzip_comp_level 6;
gzip_min_length 1100;
gzip_buffers 16 8k;
gzip_proxied any;
gzip_types
text/plain
@felipekm
felipekm / zsh_ubuntu.md
Created March 24, 2018 18:33
Install ZSH in Ubuntu
@felipekm
felipekm / certbot_ubuntu.sh
Last active March 25, 2018 22:21
Install SSL/TLS for free with CERTBOT in NGINX
sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-nginx -y
sudo certbot --nginx
@felipekm
felipekm / check_tls_version.sh
Created April 3, 2018 13:45
Check TLS/SSL version
#!/bin/bash
openssl ciphers -v | awk '{print $2}' | sort | uniq
@felipekm
felipekm / Dockerfile
Created April 4, 2018 20:17
Dockerfile sample with Alpine/NODE
FROM mhart/alpine-node:9 AS build
WORKDIR /srv
ADD package.json .
RUN npm install
ADD . .
FROM mhart/alpine-node:base-9
COPY --from=build /srv .
EXPOSE 3000
CMD ["node", "index.js"]
@felipekm
felipekm / npm_globally_without_sudo.md
Created April 5, 2018 11:51
Install `npm` packages globally without sudo on macOS and Linux

Install npm packages globally without sudo on macOS and Linux

npm installs packages locally within your projects by default. You can also install packages globally (e.g. npm install -g <package>) (useful for command-line apps). However the downside of this is that you need to be root (or use sudo) to be able to install globally.

Here is a way to install packages globally for a given user.

1. Create a directory for global packages
mkdir "${HOME}/.npm-packages"
@felipekm
felipekm / docker_without_sudo.md
Created April 5, 2018 11:51
Run Docker commands without sudo

Run Docker commands without sudo

1. Add the docker group if it doesn't already exist
$ sudo groupadd docker
2. Add the connected user $USER to the docker group
@felipekm
felipekm / reinstall_git_macosx_brew.md
Created April 6, 2018 17:34
Re-installing Git on Mac OSX with Brew

Re-installing Git on Mac OSX with Brew

This is helpful if you've previously installed git from source on OSX, and other compilers can't find the correct path. You need to remove the current version of git, then re-install with brew.

Uninstall git if installed manually

  1. Check which git you're running:
    which git
    
@felipekm
felipekm / ecr_build_push.md
Last active April 6, 2018 18:07
ECR - Build, tag, and push Docker image

1) Retrieves the docker login command that you can use to authenticate your Docker client to your registry

aws ecr get-login --no-include-email --region sa-east-1

1.1) Copy the response content docker login... and run it before next step

2) Build your Docker image using the following command

docker build -t pling-docker .

3) After the build completes, tag your image so you can push the image to this repository

docker tag : .dkr.ecr..amazonaws.com/: