Skip to content

Instantly share code, notes, and snippets.

View felipecwb's full-sized avatar
🎧
🚀

Felipe Francisco felipecwb

🎧
🚀
View GitHub Profile
@felipecwb
felipecwb / alacritty.yml
Last active October 10, 2023 15:47
$HOME/.config/alacritty/alacritty.yml
dynamic_title: true
live_config_reload: true
window:
opacity: 1.0
startup_mode: Windowed
decorations: Full
dimensions:
lines: 45
columns: 165
@felipecwb
felipecwb / migrate-redis.sh
Last active January 15, 2021 05:22
Redis Migration script
#!/bin/bash
REDIS_CLI_PREFIX="redis-cli"
DEFAULT_PORT=6379
DEFAULT_DB=0
log () { echo "[$(date +%Y-%m-%dT%H:%M:%S:%:z)] $@" >&2; }
usage () {
@felipecwb
felipecwb / default.vim
Last active July 7, 2020 21:10
New default .vimrc
" felipecwb's vim
"*****************************************************************************
"" Vim-PLug core
"*****************************************************************************
let vimplug_exists=expand('~/.vim/autoload/plug.vim')
if !filereadable(vimplug_exists)
if !executable("curl")
echoerr "You have to install curl or first install vim-plug yourself!"
@felipecwb
felipecwb / change-netroute-default-pid.sh
Created June 27, 2019 01:36
How to change a IP route from proccess inside container
docker inspect -f '{{.State.Pid}}' my-container
pid=$(docker inspect -f '{{.State.Pid}}' my-container)
echo $pid
mkdir -p /var/run/netns
ln -s /proc/$pid/ns/net /var/run/netns/$pid
ip netns exec $pid ip route del default
docker network inspect my-network
ip netns exec $pid ip route add default via 172.16.238.1
docker exec -it my-container sh
@felipecwb
felipecwb / load-env.sh
Last active June 6, 2019 22:17
Load dotenv in shell script
load_env() {
if [ ! -f $1 ]; then
return 1
fi
echo "> Loading $2 dotenv: $1"
awk '!/^#/{if ($1 != "") {print ">> " $0}}' $1
source <(awk '!/^#/{if ($1 != "") {print "export " $0}}' $1)
}
@felipecwb
felipecwb / netctl-hidden-wifi
Last active July 4, 2020 03:26
netctl config for hidden network with static IP
Description='hidden static wifi'
Interface=wlp3s0
Connection=wireless
IP=static
Gateway='192.168.105.254'
DNS=('192.168.105.254')
Address=('192.168.105.101/24')
export EDITOR=vim
export VISUAL=vim
alias vim=nvim
alias grep='grep --color'
alias ls='ls --color'
alias ll='ls -lsh'
alias lla='ll -a'
[ -s "$HOME/.nvm/nvm.sh" ] && source "$HOME/.nvm/nvm.sh"
@felipecwb
felipecwb / PHP7-alpine38.Dockerfile
Last active February 9, 2022 02:03
Runit PHP & Nginx - one container - user level - output logginn
FROM alpine:3.8
ENV USER app
ENV GROUP app
ENV WORKDIR /home/app
ENV PHPFPM_SOCK /tmp/php-fpm7.sock
# USER
RUN addgroup -g 1000 $GROUP \
&& adduser -S -u 1000 -G $GROUP $USER
@felipecwb
felipecwb / infrastructure.yml
Last active September 3, 2018 17:54
Traefik and Portainer infrastructure-definition.yml
version: "3.7"
services:
reverse-proxy:
image: traefik
command:
- "--docker"
- "--docker.swarmMode"
- "--docker.watch"
- "--docker.exposedbydefault=false"
@felipecwb
felipecwb / download-theme.sh
Last active August 22, 2018 12:57
WGET beeing Fucking Awesome!!!
#!/usr/bin/env bash
endpoint="$1"
domain="$(echo $endpoint | cut -d'/' -f3)"
wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \