Skip to content

Instantly share code, notes, and snippets.

@dot-mike
dot-mike / twentythreevideoex.py
Created July 9, 2024 19:30
Yt-DLP plugin for detandreteatret / 23video.com
# coding: utf-8
from __future__ import unicode_literals
import re
# ⚠ Don't use relative imports
from yt_dlp.extractor.common import InfoExtractor
from yt_dlp.utils import int_or_none, try_get, clean_html, unescapeHTML
@dot-mike
dot-mike / caddy_ubuntu.sh
Last active July 5, 2024 23:25 — forked from abhishek77in/caddy_ec2_ubuntu22_04.sh
Script to install caddy
#!/bin/bash
sudo apt update
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy
sudo tee /etc/caddy/Caddyfile > /dev/null <<EOF
yourdomain.com {
reverse_proxy localhost:7860
@dot-mike
dot-mike / popos_post_install.sh
Created June 22, 2024 13:52
Installs packages on system after inital OS install
#!/usr/bin/env bash
sudo apt update && sudo apt upgrade -y
apt_packages=(
git
tmux
htop
curl
wget
vim
#unbind-key C-b
#set -g prefix 'C-a'
#bind-key 'C-a' send-prefix
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using | and -
bind | split-window -h
@dot-mike
dot-mike / update_go.sh
Last active August 8, 2024 10:21
This script downloads and installs a specific version of Go lang
#!/usr/bin/env bash
# This script downloads and installs a specific version of Go.
# Check if the version is provided
if [ -z "$1" ]; then
echo "Usage: ./update_go.sh version (example 1.20.4 or latest)"
exit 1
fi
@dot-mike
dot-mike / README.md
Last active July 8, 2024 14:56
Inital setup script for Ubuntu server

Inital Ubuntu setup script

This script is meant to be run on a fresh Ubuntu LTS installation.

Todo

  • Add fail2ban
  • add packages such as vim, git, curl
  • ?
@dot-mike
dot-mike / synology-free-port.sh
Created May 28, 2024 16:17
Free port from Synology system
#! /bin/bash
# NEWLY ADDED BACKUP FUNCTIONALITY IS NOT FULLY TESTED YET, USE WITH CARE, ESPECIALLY DELETION
# Developed for DSM 6 - 7.0.1. Not tested on other versions.
# Steps to install
# Save this script in one of your shares
# Edit it according to your requirements
# Backup /usr/syno/share/nginx/ as follows:
# # cd /usr/syno/share/
# # tar cvf ~/nginx.tar nginx
@dot-mike
dot-mike / profile.js
Created May 9, 2024 17:54
Firefox profile privacy tweaks
user_pref("devtools.editor.keymap", "emacs");
user_pref("browser.tabs.closeWindowWithLastTab", false);
user_pref("app.normandy.api_url", "");
user_pref("app.normandy.enabled", false);
user_pref("app.shield.optoutstudies.enabled", false);
user_pref("beacon.enabled", false);
user_pref("breakpad.reportURL", "");
user_pref("browser.aboutConfig.showWarning", false);
user_pref("browser.crashReports.unsubmittedCheck.autoSubmit", false);
user_pref("browser.crashReports.unsubmittedCheck.autoSubmit2", false);
@dot-mike
dot-mike / squid-plus-mikrotik.txt
Created May 6, 2024 14:54 — forked from riipandi/squid-plus-mikrotik.txt
Squid Proxy & Mikrotik Setup Script
http://ictsentani.org/?p=258
http://opensource.telkomspeedy.com/forum/viewtopic.php?pid=122506
#-------------------------------------------------------------------------------
E1 Modem1 : 192.168.77.1 -> IP Modem1 : 192.168.77.2
E2 Server : 192.168.88.1 -> IP Server : 192.168.88.2
E3 Hotspot : 192.168.99.1 -> IP Hotspot : 192.168.99.10 - 192.168.99.250
E4 Labkom : 10.10.10.254 -> IP Labkom : 10.10.10.1 - 10.10.10.20
#-------------------------------------------------------------------------------
@dot-mike
dot-mike / extract_zst.py
Created November 21, 2023 20:46 — forked from scivision/extract_zst.py
Extract a .zst file in Python
from pathlib import Path
import tempfile
import tarfile
import zstandard
# pip install zstandard
def extract_zst(archive: Path, out_path: Path):
"""extract .zst file