Skip to content

Instantly share code, notes, and snippets.

View adiberr's full-sized avatar
🎯
Focusing

Adib Err adiberr

🎯
Focusing
View GitHub Profile
@adiberr
adiberr / edgerouter-pppoe-reconnect.md
Last active December 6, 2025 22:34
EdgeRouter: Auto-Reconnect PPPoE Before DHCP Lease Expires

My ISP provides a dynamic IP with a DHCP lease that expires roughly 24 hours after the last reboot. When it expires, PPPoE renegotiation sometimes takes too long and I end up rebooting the router or SSH'ing in to clear the session.
This scheduler forces a clean reconnect at a fixed time so the renewal happens on my terms.

Configuration

configure

set system task-scheduler task reconnect-pppoe crontab-spec "0 6 * * *"
set system task-scheduler task reconnect-pppoe executable path "/opt/vyatta/bin/vyatta-op-cmd-wrapper"
@adiberr
adiberr / mailserver.md
Last active September 20, 2024 22:14
Homelab Mail Server

install mailserver

add an account

hostname config

install postfix

sudo apt install postfix
@adiberr
adiberr / graylog-dpi.md
Last active August 13, 2024 01:29
Edgerouter X DIY DPI with Graylog
@adiberr
adiberr / proxmox-cloudinit.md
Last active July 13, 2025 17:59
Proxmox Template with Cloud Image and Cloud Init
@adiberr
adiberr / App.java
Created July 22, 2024 21:05
File upload example with Swagger UI - Spring Boot 2.7
@SpringBootApplication
public class App {
public static void main(String[] args) {
SpringApplication.run(App.class, args);
}
}
@RestController
class UploadController {
@adiberr
adiberr / 1-first_boot.md
Last active June 5, 2024 03:22
Homelab: Starting Point
@adiberr
adiberr / create_test_user.md
Last active August 4, 2024 00:41
Create a new Oracle user for testing

Connect as SYSDBA :

sqlplus / as sysdba

Fix a down Database :

STARTUP MOUNT;
ALTER DATABASE OPEN;
@adiberr
adiberr / parse-ufw.md
Last active March 31, 2024 23:03
Oneliner command to parse UFW logs, useful for abuse blocking and reporting

Extract the source ip address and destination port :

sed -n 's/^.*SRC=\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\).*DPT=\([0-9]\+\).*$/\1 \2/p' <<< $(sudo cat /var/log/ufw.log) \
| uniq -c \
| sort \
| column -t

Example (details omitted for simplicity):

@adiberr
adiberr / spotify_search.sh
Created May 20, 2023 20:06
Search for a song using Spotify's API
import requests
import webbrowser
import sys
import json
CLIENT_ID=
CLIENT_SECRET=
REDIRECT_URI=
def get_authorization_url():
@adiberr
adiberr / gl_label.sh
Last active October 22, 2022 10:47
Simple script for creating labels in GitLab
#!/bin/sh
# Author: Adib Err (@adiberr)
# GitLab Docs: https://docs.gitlab.com/ee/api/labels.html#create-a-new-label
PROJECT_ID= # Your project id
GITLAB_API="https://gitlab.com/api/v4/projects/${PROJECT_ID}/labels"
if [ "$#" -ne 2 ]; then
echo "Usage: mklabel <label> <color>"