Skip to content

Instantly share code, notes, and snippets.

View houstondapaz's full-sized avatar

Houston da Paz houstondapaz

View GitHub Profile
@houstondapaz
houstondapaz / launch.json
Created June 12, 2018 17:26
Vscode launch for debug async/await
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
@houstondapaz
houstondapaz / Dockerfile
Created August 16, 2019 22:30
Example of multi stage build for vue
# build stage
FROM node:9.11.1-alpine as build-stage
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
# production stage
FROM nginx:1.13.12-alpine as production-stage
@houstondapaz
houstondapaz / mimetype-extension.json
Created September 5, 2019 17:58
Collection of mimetype and respective file extension
{
'application/andrew-inset': '/A',
'application/vnd.handheld-entertainment+xml': 'zmm',
'application/vnd.zul': 'zir',
'application/zip': 'zip',
'application/vnd.zzazz.deck+xml': 'zaz',
'application/yin+xml': 'yin',
'application/yang': 'yang',
'text/yaml': 'yaml',
'chemical/x-xyz': 'xyz',
@houstondapaz
houstondapaz / mongodb-cross-servers.js
Created September 26, 2019 01:48
access another db on mongodb shell
conn2 = new Mongo( "desitination_server:port")
desti_db = conn2.getDB( "destination_db_name" )
@houstondapaz
houstondapaz / kubernetes_commands.md
Last active March 24, 2023 01:42
comandos de ajuda para trabalhar com kubernets

Deletar evicted pods

kubectl get pods -n NAMESPACE | grep Evicted | awk '{print $1}' | xargs kubectl delete pod -n NAMESPACE

Deletar pods em crash

kubectl delete pod -n NAMESPACE `kubectl get pods -n NAMESPACE | awk '$3 == "CrashLoopBackOff" {print $1}'`

Deletar pods de um deploy

@houstondapaz
houstondapaz / usefull_comands
Last active March 15, 2022 19:56
usefull comands
- REDIS
-- Del keys by pattern
EVAL "return redis.call('del', unpack(redis.call('keys', ARGV[1])))" 0 KEY_PATTERN*
or
EVAL "for _,k in ipairs(redis.call('keys','KEY_PATTERN*')) do redis.call('del',k) end" 0
- AWK
-- Get all node process id
@houstondapaz
houstondapaz / install.bash
Created June 17, 2020 17:23
install just redis-cli
cd /tmp
wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
make
cp src/redis-cli /usr/local/bin/
chmod 755 /usr/local/bin/redis-cli
@houstondapaz
houstondapaz / .bash_aliases
Last active February 8, 2021 16:26
my bash files
alias g="git"
alias gs="git status"
alias gp="git pull"
alias gch="git checkout"
alias gpu="git push"
alias gpu-nv="git push --no-verify"
alias gc="git commit"
alias ga="git add"
alias gm="git merge"
alias gcleartags="git tag -l | xargs git tag -d && git fetch -p && git pull origin master"
@houstondapaz
houstondapaz / ingres.yaml
Created June 19, 2020 13:55
ingress nginx configuration snippet
nginx.ingress.kubernetes.io/configuration-snippet: |
more_set_headers "Server:SEU_SERVER";
more_set_headers "cache-Control: no-cache, no-store";
more_set_headers "pragma: no-cache";
if ($request_uri ~* \.(?:ico|css|js|gif|jpe?g|png|svg|woff2|woff|ttf|eo|mp3)$) {
more_set_headers "cache-control: public, must-revalidate, proxy-revalidate";
more_set_headers "pragma: public";
expires max;
}
rewrite ^/SUB_PATH(/?)(.*)$ /$2 break;