Skip to content

Instantly share code, notes, and snippets.

View m0n5t3r's full-sized avatar

Sabin Iacob m0n5t3r

  • in the intertubes
View GitHub Profile
@m0n5t3r
m0n5t3r / nitter-redirect.userscript.js
Last active November 29, 2022 07:50
Random nitter redirect userscript; tested with violentmonkey on brave, gets instance data from https://xnaas.github.io/nitter-instances/
// ==UserScript==
// @description Redirects Twitter URLs to nitter
// @name Nitter Redirect
// @namespace Backend
// @downloadURL https://gist.github.com/m0n5t3r/fdd267c81b4e4059a4b409890a019fa3/raw/nitter-redirect.userscript.js
// @include https://twitter.com/*
// @version 1.0
// @run-at document-start
// @inject-into content
// @grant none
@m0n5t3r
m0n5t3r / invidious-redirect.userscript.js
Last active December 11, 2023 05:28
Random invidious redirect (fetches list from api.invidious.io, attempts to keep 100% healthy ones, picks random instance from the list; tested with violentmonkey, greasemonkey (firefox) and tampermonkey (brave)
// ==UserScript==
// @description Redirects Youtube URLs to Invidio.us
// @name Invidious Redirect
// @namespace Backend
// @downloadURL https://gist.githubusercontent.com/m0n5t3r/b7c13265152bd8c997f2d22afb4932e7/raw/invidious-redirect.userscript.js
// @include http://www.youtube.com/*
// @include https://www.youtube.com/*
// @include https://consent.youtube.com/*
// @version 1.6
// @run-at document-start
@m0n5t3r
m0n5t3r / update-lighthouse
Last active December 25, 2020 07:18
Lighthouse update script
#!/bin/bash -e
function log() {
date +"[%Y-%m-%d %H:%M:%S] $*"
}
lighthouse=$HOME/bin/lighthouse
latest_release="$(curl -s -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/sigp/lighthouse/releases | jq 'sort_by("published_at") | .[0]')"
release_tag="$(echo "$latest_release" | jq -r '.tag_name')"
@m0n5t3r
m0n5t3r / beso.FCMacro
Created July 20, 2019 16:13
beso freecad macro
# -*- coding: utf-8 -*-
import os
__title__ = "BESO topological optimization"
__author__ = "fandaL"
__version__ = "00.01"
__date__ = "20/07/2019"
__Wiki__ = "https://github.com/fandaL/beso/wiki"
__Status__ = "stable"
@m0n5t3r
m0n5t3r / bitchute-rss.user.js
Created April 19, 2018 06:22
Add RSS link to bitchute
// ==UserScript==
// @name Bitchute RSS
// @namespace CompletelyUnknown
// @description Adds RSS URL to bitchute.
// @include *://www.bitchute.com/channel/*
// @include *://www.bitchute.com/video/*
// @version 1
// @grant none
// @run-at document-idle
// ==/UserScript==
@m0n5t3r
m0n5t3r / plugin.py
Last active March 26, 2018 08:57
supybot web plugin using bs4 instead of HtmlParser
###
# Copyright (c) 2005, Jeremiah Fincher
# Copyright (c) 2009, James McCoy
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions, and the following disclaimer.
@m0n5t3r
m0n5t3r / cleanup_prusa_slic3r_gcode.py
Created November 30, 2017 16:46
Clean up slic3r Prusa edition gcode for multi-material prints
#!/usr/bin/env python
"""
Gcode cleaner to work around prusa slic3r annoyances for multi-filament
single-tool printing on non-Prusa printers.
Based on this gist:
* https://gist.github.com/ex-nerd/22d0a9796f4f5df7080f9ac5a07a381f
"""
import os
@m0n5t3r
m0n5t3r / set-vpn-dns.sh
Created June 27, 2017 07:27
(Ubuntu specific-ish) Openvpn up script to configure local dnsmasq so only internal domains are resolved via the pushed DNS; needs root, unfortunately
#!/bin/bash
export PATH=/bin:/sbin:/usr/bin:/usr/local/bin
case $script_type in
up)
(for optionname in ${!foreign_option_*}; do
echo ${!optionname}
done) | awk '$2 == "DNS" { dns_server = $3 }; $2 == "DOMAIN" { domains = domains "/" $3 }; END { print "server=" domains "/" dns_server }' > /etc/NetworkManager/dnsmasq.d/$remote_1
@m0n5t3r
m0n5t3r / such_backup
Last active January 23, 2017 09:38
AWS consistent snapshot and expire script; replaces not-quite-working ec2-consistent-snapshot and ec2-expire-snapshots (both don't work in eu-central-1, the latter tries to manage all snapshots)
#!/bin/bash
#
# Copyright: 2016 Sabin Iacob
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
@m0n5t3r
m0n5t3r / soundgasm.userscript.js
Created April 25, 2016 18:34
soundgasm download userscript
// ==UserScript==
// @name soundgasm dl
// @namespace local
// @include https://soundgasm.net/*
// @version 1
// @grant none
// ==/UserScript==
;(function(){
var player = $('#jquery_jplayer_1'),
desc = $('.jp-description'),