Skip to content

Instantly share code, notes, and snippets.

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 / 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
@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 / surge.conf
Last active May 30, 2021
My Surge.app config file
View surge.conf
# My custom Surge.app configuration
# Proxy (most) traffic via Shadowsocks
[General]
loglevel = notify
bypass-system = true
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, localhost, *.local
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12
dns-server = 208.67.222.222, 208.67.220.220
@Nyr
Nyr / openvpn-install-pam.sh
Created Jun 6, 2015
Quick an dirty fork of my openvpn-install script as requested by @sonu703
View openvpn-install-pam.sh
#!/bin/bash
#
# QUICK AN DIRTY FORK FOR PAM AUTHENTICATION.
# UNMANTAINED, PLEASE USE INSTEAD: https://github.com/Nyr/openvpn-install
#
# OpenVPN road warrior installer for Debian, Ubuntu and CentOS
# This script will work on Debian, Ubuntu, CentOS and probably other distros
# of the same families, although no support is offered for them. It isn't
# bulletproof but it will probably work if you simply want to setup a VPN on
@Nyr
Nyr / google_es.xml
Last active Aug 29, 2015
Forzar Google España como motor de búsqueda para Firefox (útil cuando se utiliza una VPN)
View google_es.xml
<!--
Instala el motor desde aquí:
http://cl.ly/code/213M0s2f0R0L/google_es.html
-->
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName>Google España</ShortName>
<Description>Buscar usando Google</Description>
@Nyr
Nyr / toalla.sh
Last active Aug 29, 2015
Toalla para Textual.app
View toalla.sh
#!/bin/bash
# Toalla para Textual.app
# Instalación:
# Necesario para obtener shuf: brew install coreutils
# Copiar este script a: ~/Library/Application Scripts/com.codeux.irc.textual5
# Y hacer chmod +x sobre el script.
# Uso: /toalla <nick>
@Nyr
Nyr / .tmfix.sh
Created Mar 4, 2015
Workaround for Time Machine skipping automated backups
View .tmfix.sh
#!/bin/bash
# .tmfix.sh - workaround for Time Machine skipping automated backups
#
# Put this script in: ~/.tmfix.sh
# Fill this with your Time Machine dir:
TMDRIVE="/Volumes/Time Machine/"
# And add something like this to your crontab:
# * * * * * /Users/Nyr/.tmfix.sh > /dev/null 2>&1
@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 () {
@Nyr
Nyr / imgur-direct-images.user.js
Last active Jun 13, 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