Skip to content

Instantly share code, notes, and snippets.

View itslukej's full-sized avatar
🥑

Luke James itslukej

🥑
View GitHub Profile
#!/usr/bin/env python3
# Download your data dump and place this file in the messages folder of your data dump.
# Then run it!
from datetime import datetime, timedelta, timezone
import dateutil.parser
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import matplotlib.dates as mdates
import csv
#!/usr/bin/env python3
# Download your data dump and place this file in the messages folder of your data dump.
# Then run it!
from datetime import datetime, timedelta, timezone
import dateutil.parser
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import matplotlib.dates as mdates
import csv
@itslukej
itslukej / proxmox.md
Created December 3, 2023 15:52
Swap from legacy boot to UEFI - Proxmox ZFS
  1. Get a proxmox ISO mounted

  2. boot to bios, switch to uefi, boot to ISO

  3. head to Install Proxmox (Debug Mode) under advanced options

  4. press ctrl-d to launch a terminal

  5. mount zfs, then chroot into it

@itslukej
itslukej / tunneling.md
Created September 16, 2023 01:12
Tunneling a whole process through wireguard

Tunneling a whole process through wireguard

Certain company blocking a certain hosting provider? No problem, just tunnel the process through a small VPS with wireguard.

Consider server A your blocked server and server B your VPS.

Step 1: Generate a keypair on server A and server B

Server A:

# Caches movie covers, tv covers and other media
# Replace <YOUR PLEX TOKEN> with a random plex token
# docker-compose.yml
# varnish:
# image: "varnish:fresh"
# network_mode: "host"
# environment:
# VARNISH_SIZE: 2G
# VARNISH_HTTP_PORT: 32500
@itslukej
itslukej / jsonify.js
Last active March 16, 2023 19:47
JSON Serialiser written in pure mongodb aggregate.
db.aggregate([{
$replaceRoot: {
newRoot: {
_id: '$_id',
data: {
$objectToArray: '$$ROOT'
}
}
}
},
@itslukej
itslukej / fix_metadata.sh
Created January 9, 2023 00:47
Fix incorrect metadata for Plex Media Server Linux
#!/bin/sh
/usr/lib/plexmediaserver/Plex\ Media\ Server \
--sqlite /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Plug-in\ Support/Databases/com.plexapp.plugins.library.db \
"UPDATE metadata_items SET added_at = created_at WHERE added_at > strftime('%s', 'now');"
@itslukej
itslukej / bird6.conf
Last active January 17, 2022 11:34
Linux AnyIP IPv6 setup
router id x;
protocol bgp as62240 {
local as 209808;
source address x;
neighbor x as 62240;
import all;
export filter {
if net ~ [2a06:e881:5404::/48] then accept;
@itslukej
itslukej / Captcha.vue
Created May 1, 2021 18:29
hCaptcha vue but better
<template>
<div ref="container"></div>
</template>
<script>
export default {
data() {
return { id: null };
},
navigator.serviceWorker && navigator.serviceWorker.getRegistrations().then(rs => {
rs.forEach(r => {
if (r.active && r.active.scriptURL.includes('arc-sw.js')) {
r.unregister()
}
});
});