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 / 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 / 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 / dvm1200.py
Last active July 13, 2022 19:17
Python code to read from a Velleman DVM-1200 multimeter (so you can use it in Linux, OS X, *BSDs and that other operating system for which they actually provide software). Protip: if the thing doesn't seem to output data (you don't see the LED flashing when you look at it through a phone camera, for instance), it may be due to sloppy soldering o…
#!/usr/bin/env python
# Copyright (c) Sabin Iacob <iacobs@gmail.com>.
# All rights reserved.
#
# 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.
@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'),
@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 / gist:1006281
Created June 3, 2011 12:50
set x-forwarded-ssl correctly (nginx, http+https in the same config)
set $ssl off;
if ($scheme = https) {
set $ssl on;
}
proxy_set_header X-Forwarded-Ssl $ssl;
@m0n5t3r
m0n5t3r / generate_traffic.py
Created November 3, 2010 17:15
stats gathering with gunicorn; gstats.py should be run with one sync worker, gunicorn.conf.py should be in your config
#!/usr/bin/env python
import sys
from random import random
from time import sleep
from threading import Thread, active_count
execfile('gunicorn.conf.py')
@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 / gunicorn-upstart.conf.template
Created July 30, 2010 12:27
template for a gunicorn upstart job that can run several instances of a django application
# %(mysite)s - run %(mysite)s instances (default is the main production instance)
#
# This runs gunicorn-django for %(mysite)s; to install:
# * sudo ln -s <this file> /etc/init/%(mysite)s
# * sudo initctl reload-configuration
#
# it expects the following directory layout:
#
# /home/%(mysite)s/public_html
# \-env -> virtualenv