Skip to content

Instantly share code, notes, and snippets.

@adripo
adripo / tp.md
Created March 30, 2024 04:47 — forked from shreve/tp.md
TP-Link Router Config Decrypt

TP-Link Router Config

Update 2021-04-29: This may still work for you if you've got an old TP-Link router, but this is not maintained and doesn't work with newer models. If you've got a newer router, other projects like tpconf_bin_xml will likely work better for you.

TP-Link allows you to backup and restore your router's config file. For some reason, they decided to encrypt these backups so you cannot modify them. I think this is dumb. This script lets you decrypt and re-encrypt your config files so you can modify them as you see fit.

I use this to modify my reserved addresses list because editing them through the web interface is terribly slow and cumbersome.

  1. Go to the router and download the config file from the "Backup & Restore" section of "System Tools".
  2. Run ruby tp.rb config.bin
@adripo
adripo / boot.sh
Created February 20, 2024 15:33 — forked from ThePlenkov/boot.sh
Resolve WSL DNS automatically
#!/bin/bash
# Remove existing "nameserver" lines from /etc/resolv.conf
sed -i '/nameserver/d' /etc/resolv.conf
# Run the PowerShell command to generate "nameserver" lines and append to /etc/resolv.conf
# we use full path here to support boot command with root user
/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -Command '(Get-DnsClientServerAddress -AddressFamily IPv4).ServerAddresses | ForEach-Object { "nameserver $_" }' | tr -d '\r'| tee -a /etc/resolv.conf > /dev/null
@adripo
adripo / json-exporter-config.yaml
Created December 6, 2023 03:40 — forked from dfsnow/json-exporter-config.yaml
Export Jellyfin playback statistics to Prometheus and Grafana. See https://sno.ws/jellyfin-stats for more info
modules:
jellyfin:
headers:
# The Token value here needs to be an API key generated from the
# Jellyfin admin panel. It's hard-coded here but I'm sure there's
# a better way
Authorization: MediaBrowser Token=ADD_TOKEN_HERE
Content-Type: application/json
accept: application/json
@adripo
adripo / trakt-backup.php
Created September 1, 2023 21:59 — forked from darekkay/trakt-backup.php
Trakt.tv backup script
<?php
/*
Backup script for trakt.tv (API v2).
Live demo: https://darekkay.com/blog/trakt-tv-backup/
*/
// create a Trakt app to get a client API key: http://docs.trakt.apiary.io/#introduction/create-an-app
$apikey = "CLIENT_API_KEY";
@adripo
adripo / change_filament_without_ams.gcode
Last active April 19, 2024 11:32
G-code to manually change filament without AMS. See https://github.com/bambulab/BambuStudio/issues/278
;===== Change filament G-code without AMS ===
;===== version: 1.2 =========================
;===== original version date: 20230719 ======
;===== description ==========================
; Everything between M620 and M621 is executed only if AMS is connected.
; All M620, M620.x and M621 commands are removed to enable manual filament change.
; first filament change is skipped
{if toolchange_count > 1}
@adripo
adripo / semantic-commit-messages.md
Created January 14, 2023 00:03 — forked from joshbuchea/semantic-commit-messages.md
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@adripo
adripo / docker-compose.yml
Created May 24, 2022 00:34 — forked from Aghassi/docker-compose.yml
LinuxServer Docker Compose: Plex, Sonarr, Radarr, NZBGet, Let's Encrypt, Time Machine
version: '2'
services:
plex:
image: linuxserver/plex
container_name: plex
volumes:
- /path/to/plex/config:/config
- /path/to/plex/Movies:/data/movies
- /path/to/plex/Shows:/data/tvshows
- /path/to/plex/transcode:/data/transcode
@adripo
adripo / Inject_jQuery.txt
Last active January 1, 2022 18:24
Inject jQuery in the JavaScript Console - Bookmark
javascript:(function(e,s){e.src=s;e.onload=function(){jQuery.noConflict();console.log('jQuery injected')};document.head.appendChild(e);})(document.createElement('script'),'//ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js')
@adripo
adripo / console.sh
Created January 1, 2022 18:21
Inject jQuery in the JavaScript Console
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
// ... give time for script to load, then type
jQuery.noConflict();
@adripo
adripo / fossil_5e_debloat.txt
Last active December 27, 2021 01:42
Fossil Gen 5E (codename: sole) SAFE DEBLOAT- commands and packages
### COMMANDS
# connect
adb connect WATCH_IP:5555
# list enabled packages
adb shell cmd package list packages -e > enabled_packages.txt
# list disabled packages
adb shell cmd package list packages -d > disabled_packages.txt