Skip to content

Instantly share code, notes, and snippets.

arantius arantius

Block or report user

Report or block arantius

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@arantius
arantius / grant-none-shim.js
Last active Sep 8, 2019
Greasemonkey "@grant none" compatibility shim.
View grant-none-shim.js
/*
The MIT License (MIT)
Copyright (c) 2014 Anthony Lieuallen
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@arantius
arantius / simple-rrd-merge.py
Created Mar 23, 2012
A very simple script to merge multiple RRD files, since none of those available seem to work.
View simple-rrd-merge.py
#!/usr/bin/env python
"""Simple script to merge multiple RRD files together.
Accepts any number of RRD file names as arguments. Produces an "rrdtool dump"
style file on stdout. The last RRD file should have a slot for every possible
record in the resulting merged RRD.
Run something like:
$ python simple-merge-rrd.py filea.rrd fileb.rrd filec.rrd | \
@arantius
arantius / create-test-container.script
Last active Apr 6, 2019
How To Install Gentoo Onto Any OpenVZ VPS
View create-test-container.script
# vzctl create 200 --config unlimited --ostemplate \
> debian-6.0-x86 --ipadd 192.168.202.200 --hostname guest
Creating container private area (debian-6.0-x86)
Performing postcreate actions
CT configuration saved to /etc/vz/conf/200.conf
Container private area was created
# vzctl start 200
Starting container...
Container is mounted
Adding IP address(es): 192.168.202.200
View everything-red.css
* { color: red !important; }
@arantius
arantius / dependency1.js
Last active May 2, 2018
Sample user scripts, for testing Greasemonkey installs.
View dependency1.js
/*
Mapb2ZIzBFdJ/7I5VWhmOOJi9O/MSlZGFA5RjrCg6gTwm6KZW+zOP0NLQ0uz04+pdRkOZZakc2sq
J0nFeXkQza0roHezO7F11qxhL2ApSApaspLdIjpx/ymLJDtBvR5ShaIvSmBqzHTMQweGdct/pKD2
goN9J9V4tsMSr5w21jt/xmYYMyNKUh9fBASz+WuxSmJ4k+CK77CnWv95z/MlMHSEMxp71dXHF2rK
bajyljD1rbBhTzNMC2Vq3H3UAHzkV9vxL9k31C9oDOdjpu7MMjtgFFBl1RBDpq+MgOpxQ8puXG6E
*/
@arantius
arantius / gm-get-set-demo-with-polyfill.user.js
Last active May 2, 2018
A simple persistent value test user script
View gm-get-set-demo-with-polyfill.user.js
'use strict';
// ==UserScript==
// @name GM set/get demo
// @description Exercises both GM.getValue() and GM.getValue(). Logs a counter which goes up by one, at each page load.
// @grant GM.getValue
// @grant GM_getValue
// @grant GM.setValue
// @grant GM_setValue
// @require https://greasemonkey.github.io/gm4-polyfill/gm4-polyfill.js
// ==/UserScript==
View gm-addstyle.js
function GM_addStyle(aCss) {
'use strict';
let head = document.getElementsByTagName('head')[0];
if (head) {
let style = document.createElement('style');
style.setAttribute('type', 'text/css');
style.textContent = aCss;
head.appendChild(style);
return style;
}
@arantius
arantius / serve-user-script-slow.py
Last active Feb 16, 2018
Serves a user script, slowly
View serve-user-script-slow.py
#!/usr/bin/env python
import time
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
PORT = 8000
USER_JS = """// ==UserScript==
// @name Red Border
@arantius
arantius / red-border.user.js
Created Sep 7, 2017
A super simple user script with an unobtrusive way of being clear that it's running.
View red-border.user.js
// ==UserScript==
// @name Red Border
// @description A super simple user script with an unobtrusive way of being clear that it's running.
// @namespace test
// @include http*
// @version 1
// @grant none
// ==/UserScript==
document.body.style.border = '3px dashed red';
@arantius
arantius / long-name-no-space.user.js
Created Jan 26, 2018
User scripts with long @name values.
View long-name-no-space.user.js
// ==UserScript==
// @name This_user_script_has_a_terribly_long_name_and_is_likely_to_break_UI_that_hasn't_been_crafted_specifically_to_handle_long_names.
// @grant none
// ==/UserScript==
// No_op.
You can’t perform that action at this time.