Skip to content

Instantly share code, notes, and snippets.

View airtonGit's full-sized avatar

Airton F Sauer Oliveira airtonGit

View GitHub Profile
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GopenPGP 2.7.2
Comment: https://gopenpgp.org
xsBNBGYsEpYBCADiv5xcmCk/MtP/pPhxISy8mBLMbb3IREQwX8iVHTlaEKsYRi8n
wJS/am0ByBJyVZ/A2kJ/r/oz5uTndO7Zi81ldK4SAbJHtaTi2HiMcbQDJHhCtri8
tC6+A7XPGgfLqBkQxiH3fT6pY8EgyV/Hz6mCjnotWXRqYD45aGZCTxMlL/Gi7286
Ltt8rL1KNEtqrQM7inw5bWbvDyLYtgzEj9cxWf/iusElhJZ47YX7WGPJGshB1WQn
ZRe4fdUXHdYCjINTy/jUudXPGVFp1ZlWtJP1Ui/RMOgyq7YSi4lnwXsePsY3bcGK
BVSlNIUVlfZaHSGxF2g1FmsiPVGHDCYB9Da1ABEBAAHNSkZNX05FVFpVTl9DQVJE
@airtonGit
airtonGit / router.cfg
Last active November 16, 2023 00:25 — forked from marfillaster/router.cfg
MikroTik RouterOS v7 dual DHCP WAN recursive failover w/ PCC load-balancing; and recursive ECMP
# feb/11/2022 11:00:55 by RouterOS 7.2rc3
# software id = 9QK9-C798
#
# model = RB5009UG+S+
# serial number = XXXXXXXXXX
/ip settings set allow-fast-path=no
/interface bridge add admin-mac=FF:FF:FF:FF:FF:FF auto-mac=no name=bridge
Value Description Reference
100 Continue [RFC7231, Section 6.2.1]
101 Switching Protocols [RFC7231, Section 6.2.2]
102 Processing [RFC2518]
103 Early Hints [RFC8297]
104-199 Unassigned
200 OK [RFC7231, Section 6.3.1]
201 Created [RFC7231, Section 6.3.2]
202 Accepted [RFC7231, Section 6.3.3]
// Utilizador pode chamar passando qualquer objeto que implemente io.Writer, inclusive os.File
func escreverInfo(destino io.Writer){
(…)
}
// Utilizador é obrigado a chamar com parametro *os.File
func escreverInfo(destino *os.File){
(…)
}
// continuação, exemplo de uso de MsgOla
func enviaMsg(msg IMsgBasica){
(…)
}
//criando objeto MsgOla
msg := &MsgOla{}
msg.SetTexto("Olá duck typing!")
// msg é aceito pela interface IMsgBasica por duck typing
enviaMsg(msg)
// Exemplo em GO
type IMsgBasica interface{
SetTexto(valor string)
}
// Exemplo de objeto
type MsgOla struct{
(…)
}
// Ao definir este método MsgOla "se parece" com IMsgBasica
// logo implementa a interface e poderá ser utilizada
// Exemplo em Java
void enviaMsg(IMsgBasica msg){
// quem precisar chamar este método deve fornecer como
// parâmetro algum objeto que implemente a
// interface IMsgBasica
}
// Exemplo de objeto necessário
class MsgOla implements IMsgBasica{
(…)
}
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql