Skip to content

Instantly share code, notes, and snippets.

View felipekm's full-sized avatar
🦈

Felipe Kautzmann felipekm

🦈
View GitHub Profile
@felipekm
felipekm / felipekm.zsh-theme
Last active September 30, 2018 01:53
My ZSH Theme
#!/usr/bin/env zsh
#local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
setopt promptsubst
autoload -U add-zsh-hook
PROMPT_SUCCESS_COLOR=$FG[117]
PROMPT_FAILURE_COLOR=$FG[124]
PROMPT_VCS_INFO_COLOR=$FG[242]
@felipekm
felipekm / s3-policy.js
Last active January 25, 2018 22:09
Amazon S3 bucket policy sample to put code in
{
"Id": "Policy1516917873883",
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1516917869302",
"Action": [
"s3:PutObject"
],
"Effect": "Allow",
@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 / LC_TYPE.txt
Last active November 30, 2020 02:36
Linux warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory manpath: can't set the locale; make sure $LC_* and $LANG are correct
vi /etc/environment
# add these lines...
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
@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.