Skip to content

Instantly share code, notes, and snippets.

@Nyr
Nyr / imgur-direct-images.user.js
Last active Aug 11, 2022
Redirect imgur to the raw images skipping the crappy HTML pages
View imgur-direct-images.user.js
// ==UserScript==
// @name imgur direct images
// @description Redirect to the raw images skipping the crappy HTML pages.
// @include /^https?:\/\/imgur\.com\/[A-Za-z0-9]+$/
// @exclude *imgur.com/vidgif
// @exclude *imgur.com/jobs
// @exclude *imgur.com/about
// @exclude *imgur.com/apps
// @exclude *imgur.com/tos
// @exclude *imgur.com/privacy
@Nyr
Nyr / openvpn-useradd-bulk.sh
Last active Dec 18, 2021
Simple script for adding users in bulk to an openvpn-install setup
View openvpn-useradd-bulk.sh
#!/bin/bash
# Fast way for adding lots of users to an openvpn-install setup
# See the main openvpn-install project here: https://github.com/Nyr/openvpn-install
# openvpn-useradd-bulk is NOT supported or maintained and could become obsolete or broken in the future
# Created to satisfy the requirements here: https://github.com/Nyr/openvpn-install/issues/435
if readlink /proc/$$/exe | grep -qs "dash"; then
echo "This script needs to be run with bash, not sh"
exit 1
View amigo-invisible.sh
#!/bin/bash
#
# amigo-invisible.sh
#
# Este script gestionará un archivo amigos.csv con siguiente el formato:
# nombre,email
#
# Limitaciones:
# - El .csv no puede contener líneas en blanco
# - El sorteo puede ser lento/ineficiente con listas de amigos MUY largas
@Nyr
Nyr / upload.php
Last active Mar 22, 2016
Very simple file upload script for private use
View upload.php
<?php
// Very simple file upload script
// ----------------------------------------------
// I'm a shitty coder, so this is a shitty script
/////////////////////////////////////////////////////////////
// Fill these three variables
$allowedip = '1.2.3.4'; // IP address allowed to upload
$serveurl = 'https://uploads.example.com/';
$uploaddir = '/srv/uploads.example.com/htdocs/';
@Nyr
Nyr / gist:5124270
Last active Dec 14, 2015
lighttpd rewrite rules for archive-my-tweets
View gist:5124270
# Rewrite for tweets.nyr.be
$HTTP["host"] =~ "(^|\.)tweets.nyr\.be$" {
url.rewrite-once = (
# Single Tweet
"^/([0-9]+)/?$" => "/index.php?id=$1",
# Tweets by date
"^/archive/([0-9]{4})/([0-9]{2})/([0-9]{2})/?$" => "/index.php?year=$1&month=$2&day=$3",
"^/archive/([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)/?$" => "/index.php?year=$1&month=$2&day=$3&page=$4",
"^/archive/([0-9]{4})/([0-9]{2})/?$" => "/index.php?year=$1&month=$2",
"^/archive/([0-9]{4})/([0-9]{2})/page/([0-9]+)/?$" => "/index.php?year=$1&month=$2&page=$3",
@Nyr
Nyr / imgur-gif-to-gifv.user.js
Last active Aug 29, 2015
Turn imgur GIF links into GIFV
View imgur-gif-to-gifv.user.js
// ==UserScript==
// @name imgur GIF to GIFV
// @description Turn imgur GIF links into GIFV.
// @exclude *imgur.com*
// @version 1.2.1
// @grant none
// @run-at document-start
// ==/UserScript==
(function () {