Skip to content

Instantly share code, notes, and snippets.

@kwasmich
kwasmich / EvilMouse.js
Last active May 1, 2024 20:38
UserScript for browser to enable Disney Plus on Linux
// ==UserScript==
// @name Enable Disney Plus on Linux
// @description This is your new file, start writing code
// @match *://*.disneyplus.com/*
// ==/UserScript==
Object.defineProperty(navigator, "userAgent", { value: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36", configurable: true, enumerable: true, writable: true });
@shakalandy
shakalandy / gist:6d41c18437d96bcafad950e972c6ad10
Created October 12, 2022 08:37
ansible fact collecting nginx vhosts
#!/bin/bash
###############################################
# NGINX FACT
###############################################
if [ -f /usr/sbin/nginx ]; then
VHOSTS=$(nginx -T 2>/dev/null | grep "server_name " | awk '{print $2}' | cut -d ";" -f 1 | grep -v localhost |sort | uniq | grep -v -e '^$')
fi
# FIRST VERSION - Outputs UTS formatted timestamp.
# -------------------------------------------------------------------------------------
# handy pipe redirect that appends a datestamp to every line of output. Just paste this into
# the top of a typical BASH script.
s_datestamp() {
while read -r line; do
timestamp=$(date -u '+%Y-%m-%d %H:%M:%S')
@kwasmich
kwasmich / Skip YouTube Ads.js
Last active May 24, 2023 15:30
Script for Userscripts browser extension to skip ads on Youtube.
// ==UserScript==
// @name Skip YouTube Ads
// @description This is your new file, start writing code
// @match *://*.youtube.com/*
// ==/UserScript==
function skipAd() {
const adPlaying = document.body.querySelector(".ad-showing");
if (!adPlaying) {
@mschmitt
mschmitt / stfd.conf
Last active March 18, 2022 09:00
systemd: Howto quickly sigkill (-9) a service that blocks shutdown for minutes. (Here: ESET Antivirus, eea.service)
# /lib/systemd/system/eea.service.d/stfd.conf
[Service]
TimeoutStopSec=5
TimeoutStopFailureMode=kill
@moyix
moyix / killbutmakeitlooklikeanaccident.sh
Created February 5, 2022 22:51
Script to inject an exit(0) syscall into a running process. NB: only x86_64 for now!
#!/bin/bash
gdb -p "$1" -batch -ex 'set {short}$rip = 0x050f' -ex 'set $rax=231' -ex 'set $rdi=0' -ex 'cont'
@erikw
erikw / ..git-commit-status - Generate git commit message from git-status.md
Last active March 13, 2024 07:44
Generate git commit message from git-status. Will generate a commit message like "Added: file1.py file2.py file3.py Modified: file4.py file5.py Deleted: README.md Renamed: test.txt-> test2.txt". Put this in your .gitconfig.

git commit-status alias

An alias that will generate a git commit message staged changes as shown in git-status. Put this alias (section below) in your .gitconfig.

The message generated will be in the format of:

$ git status --porcelain
A file1.py
A file2.py
A file3.py
@ryancdotorg
ryancdotorg / wzip.py
Last active April 8, 2024 14:20
Partial/streaming zip downloader
#!/usr/bin/env python3
# SPDX-License-Identifier: 0BSD or CC0-1.0 or MIT-0 or Unlicense
# Copyright (c) 2023, Ryan Castellucci, No Rights Reserved
import io, sys
import datetime
import argparse
import requests
import operator
import struct
@LilithWittmann
LilithWittmann / autobahn.md
Last active October 26, 2023 12:11
autobahn.md
@superseb
superseb / rke2-commands.md
Last active May 22, 2024 10:03
RKE2 commands

RKE2 commands

Install

curl -sL https://get.rke2.io | sh
systemctl daemon-reload
systemctl start rke2-server