Skip to content

Instantly share code, notes, and snippets.

View thalysonalexr's full-sized avatar
:electron:
Coding solutions

Thalyson Rodrigues thalysonalexr

:electron:
Coding solutions
View GitHub Profile
@thalysonalexr
thalysonalexr / docker-create-docker_gwbridge.sh
Created January 21, 2023 17:03
Create network GW bridge for Swarm
#!/bin/sh
docker network create \
--subnet <same-pool-address-default-docker-subnets> \
--opt com.docker.network.bridge.name=docker_gwbridge \
--opt com.docker.network.bridge.enable_icc=false \
--opt com.docker.network.bridge.enable_ip_masquerade=true \
docker_gwbridge
@thalysonalexr
thalysonalexr / create-nginx-service-swarm.sh
Last active January 21, 2023 16:59
Create loadbalancer nginx as Container Service in Swarm
#!/bin/sh
docker service create --name loadbalancer \
--mount type=bind,source=/data/loadbalancer,target=/etc/nginx/conf.d \
--publish 80:80 --publish 443:443 nginx
@thalysonalexr
thalysonalexr / default-pool-address.json
Created January 21, 2023 16:38
Set default pool address to docker subnets
{
"features": {
"buildkit": true
},
"default-address-pools": [
{
"base": "172.50.0.0/24",
"size": 28
}
]
@thalysonalexr
thalysonalexr / start-docker-on-boot.sh
Created January 21, 2023 16:33
Start Docker Service on system boot
#!/bin/sh
sudo systemctl enable docker.service
sudo systemctl enable containerd.service
@thalysonalexr
thalysonalexr / init-swarm.sh
Created January 21, 2023 16:31
Init docker swarm with default IP address
#!/bin/sh
docker swarm init --advertise-addr 172.16.0.24 --default-addr-pool 172.61.1.0/24
@thalysonalexr
thalysonalexr / gen-pub-priv-key.sh
Created January 21, 2023 16:21
Generate public and private key RSA with ssh-keygen
#!/bin/sh
# $1 argument for filename
ssh-keygen -t rsa -b -f $1
@thalysonalexr
thalysonalexr / expose-wsl-port.ps1
Created January 21, 2023 16:19
Expose port in Windows from WSL2
netsh interface portproxy set v4tov4 listenport=6379 listenaddress=0.0.0.0 connectport=6379 connectaddress=$(wsl hostname -I)
@thalysonalexr
thalysonalexr / alter-start-sequence.sql
Created January 21, 2023 16:17
Change initial sequence to last value of Oracle table
ALTER TABLE ROLES MODIFY ID GENERATED BY DEFAULT ON NULL AS IDENTITY (START WITH LIMIT VALUE);
@thalysonalexr
thalysonalexr / cron-docker-prune.sh
Last active January 21, 2023 16:18
Cron to prune dangling images and trash of docker
#!/bin/sh
0 */2 * * * /usr/bin/docker rmi $(docker images -f dangling=true -a -q) && /usr/bin/docker system prune -f
@thalysonalexr
thalysonalexr / settings.json
Last active August 20, 2020 12:29
Minhas configurações atuais do VSCode 🚀
{
"workbench.iconTheme": "material-icon-theme",
"workbench.startupEditor": "newUntitledFile",
"editor.tabSize": 2,
"editor.lineHeight": 26,
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
"explorer.compactFolders": false,