Skip to content

Instantly share code, notes, and snippets.

View diegograssato's full-sized avatar
🏠
Working from home

Diego Pereira Grassato diegograssato

🏠
Working from home
View GitHub Profile
@diegograssato
diegograssato / gist:a72f3f48d328da960f19051f5daae6c1
Created April 9, 2024 13:26 — forked from ibnux/gist:59dd7d64bd9cb7e1e670b6ddd70ad991
Mikrotik Script for DHCP Lease to Queue simple
:local queueName "Client-$leaseActMAC";
:local ipAdd "$leaseActIP/32";
:if ([:len [/queue simple find name=$queueName]] = 0) do={
:log info "No Queue";
/queue simple add name=$queueName target=($ipAdd) limit-at=10M/4M max-limit=10M/4M comment=[/ip dhcp-server lease get [find where active-mac-address=$leaseActMAC && active-address=$leaseActIP] host-name];
} else={
:log info "exists";
:local ada [/queue simple get [find name=$queueName] target];
{
"id": "45c0996e-ac5e-4271-80e1-a09a16391a27",
"name": "Sonoff Mini",
"values": [
{
"key": "sonoff_ip",
"value": "10.0.1.32",
"enabled": true
},
{

How use

Update your system:

sudo apt update && sudo apt upgrade

Install WireGuard:

apt install wireguard net-tools curl wget git
@diegograssato
diegograssato / pf_nat
Created August 4, 2021 15:25 — forked from retspen/pf_nat
Enable NAT on macOS
#!/bin/bash
cat > /usr/local/etc/pf-nat.conf << EOF
nat on en0 from vnic1:network to any -> (en0)
EOF
sudo pfctl -d
sudo sysctl -w net.inet.ip.forwarding=1
sudo pfctl -f /usr/local/etc/pf-nat.conf -e
---
#https://doc.owncloud.com/server/10.7/admin_manual/installation/docker/#raspberry-pi
version: '3.7'
services:
traefik:
container_name: proxy
image: traefik
restart: always
command:
- "--log.level=DEBUG"
@diegograssato
diegograssato / Install-kind.sh
Last active April 29, 2021 19:24
Cluster with kind
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.9.0/kind-linux-amd64
chmod +x ./kind
mv ./kind $HOME/.local/bin/kind
@diegograssato
diegograssato / osb
Last active September 21, 2020 20:55
Install OBS flatpak
flatpak from Ubuntu package server via the following command.
sudo apt update && sudo apt install flatpak
https://github.com/bazukas/obs-linuxbrowser
https://linuxhint.com/install_obs_ubuntu/#:~:text=Install%20OBS%20from%20Ubuntu%20Package%20Server&text=To%20get%20this%20program%20from,refresh%20the%20APT%20repository%20cache.&text=Now%2C%20install%20OBS%20Studio.
@diegograssato
diegograssato / k8s-kubeadm
Last active July 22, 2022 19:42
k8s-kubeadm
cat <<EOF | sudo tee /etc/modules-load.d/containerd.conf
overlay
br_netfilter
ip_vs_rr
ip_vs_wrr
ip_vs_sh
nf_conntrack_ipv4
ip_vs
EOF
@diegograssato
diegograssato / sonar COLLATE
Created August 1, 2020 19:38
sonar-database
drop database sonarqube
CREATE DATABASE sonar COLLATE Latin1_General_100_CS_AS_SC;
ALTER DATABASE sonar SET READ_COMMITTED_SNAPSHOT ON WITH ROLLBACK IMMEDIATE;
@diegograssato
diegograssato / jenkins-infra
Created July 31, 2020 12:09
jenkins-infra
https://github.com/jenkins-infra/crawler
https://pghalliday.com/jenkins/groovy/sonar/chef/configuration/management/2014/09/21/some-useful-jenkins-groovy-scripts.html
https://github.com/Praqma/JenkinsAsCodeReference/tree/master/dockerizeit/master
https://github.com/Praqma/JenkinsAsCodeReference/blob/master/dockerizeit/master/globalPipelineLibraries.groovy
https://github.com/dianariyanto/virtual-display-linux