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. Note that it outputs localtime due to limitations in
# BASH printf (whichis used for speed reasons). Automated runner processes as a rule of thumb
# should be set to UTC anyways, so it seems not a significant limitation.
s_datestamp() {
while IFS= read -r line; do
@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 April 5, 2025 18:17
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 January 25, 2025 22:46
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 January 14, 2025 12:25
autobahn.md
@RobertKrajewski
RobertKrajewski / mattermost-dl.py
Last active January 27, 2025 12:57
This script allows to export the content (text+files) of an interactively selected Mattermost channel (public, private, group, direct message) to files. Tested on Mattermost 5.27 using Python 3.7
import os
import sqlite3
from datetime import datetime, date
from typing import Tuple, Dict, List
import getpass
from mattermostdriver import Driver
import pathlib
import json