Skip to content

Instantly share code, notes, and snippets.

@luanpcweb
luanpcweb / comandos-docker
Created October 4, 2016 20:09 — forked from morvanabonin/comandos-docker
Comandos do Docker
Segue a lista de comandos docker e sua utilidade:
docker attach – Acessar dentro do container e trabalhar a partir dele.
docker build – A partir de instruções de um arquivo Dockerfile eu possa criar uma imagem.
docker commit – Cria uma imagem a partir de um container.
docker cp – Copia arquivos ou diretórios do container para o host.
docker create – Cria um novo container.
docker diff – Exibe as alterações feitas no filesystem do container.
docker events – Exibe os eventos do container em tempo real.
docker exec – Executa uma instrução dentro do container que está rodando sem precisar atachar nele.
@luanpcweb
luanpcweb / mysql-docker.sh
Last active December 30, 2022 20:01 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
pv $BACKUP | docker exec -i $CONTAINER /usr/bin/mysql -u $MARIA_DB_USER --password=$MARIA_DB_PASS $MARIA_DB_NAME
## PORTGRESS
@luanpcweb
luanpcweb / kill-process.sh
Created December 1, 2020 14:53
Kill proccess
while true; do pkill -9 kdevtmpfsi; sleep 60 ; done
@luanpcweb
luanpcweb / ubuntu_agnoster_install.md
Created October 20, 2020 12:49 — forked from renshuki/ubuntu_agnoster_install.md
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH

@luanpcweb
luanpcweb / ignores.php
Created October 9, 2020 14:00 — forked from SmetDenis/ignores.php
Ignores for PHP inspections
<?php
// https://pear.php.net/manual/en/package.php.php-codesniffer.advanced-usage.php
// @codingStandardsIgnoreLine
// @codingStandardsIgnoreFile
// @codingStandardsIgnoreStart
// @codingStandardsIgnoreEnd
// https://phpunit.de/manual/current/en/appendixes.annotations.html#appendixes.annotations.codeCoverageIgnore
// @codeCoverageIgnore
lsblk -p
sudo umount /dev/sdb1
sudo mkfs.vfat -I /dev/sdb
dd bs=4M if=2020-08-20-raspios-buster-armhf.img of=/dev/sdX conv=fsync
## OR
unzip -p 2020-08-20-raspios-buster-armhf.zip | sudo dd of=/dev/sdX bs=4M conv=fsync
netstat -atunp
@luanpcweb
luanpcweb / workbench-ui-fix.sh
Created September 11, 2020 18:21 — forked from AmreeshTyagi/workbench-ui-fix.sh
Exclude MySQL Workbench from dark theme with mojave Mac dark theme
#!/bin/bash
defaults write com.oracle.workbench.MySQLWorkbench NSRequiresAquaSystemAppearance -bool yes
echo "Successfully patched!"
echo "Now restart MySQL Workbench to see the Workbench in light theme."
#Restart MySQL Workbench after executing this.
#Define Libraries
import RPi.GPIO as gpio
import time
gpio.setwarnings(False)
#Configuring GPIO
gpio.setmode(gpio.BOARD)
gpio.setup(38,gpio.OUT)
gpio.setup(40,gpio.OUT)