Skip to content

Instantly share code, notes, and snippets.

@Anachron
Anachron / turn-off-dpms.lua
Created March 6, 2023 13:35 — forked from nilninull/turn-off-dpms.lua
A mpv script for turn off dpms while playing video automatically
-- save this file to $XDG_CONFIG_HOME/mpv/scripts/
local dpms_mod = nil
-- local function dpms_mod_start(event)
-- print("RUN dpms mod start", dpms_mod)
-- if dpms_mod == nil then
-- -- This code was checked on xset 1.2.3
-- if os.execute("[ `xset q | sed -n '/^DPMS/,${/^ DPMS/s/^ DPMS is //p}'` == Enabled ]") == 0 then
-- dpms_mod = true
@Anachron
Anachron / sst
Created August 8, 2022 10:07 — forked from mortie/sst
sst: Reliable SSH connections using tmux
#!/bin/sh
# SST: SSH, but reliable, using tmux.
# When you lose connection, the connection will be re-tried, and you will get back where you
# left off.
# An aggressive heartbeat setting is used to detect network issues much more reliably than
# SSH's default settings would.
#
# Usage:
# sst <host>: Create a temporary tmux session, which will be killed when it hasn't
@Anachron
Anachron / githubpull.md
Created August 31, 2020 09:03 — forked from Jabarabo/githubpull.md
Gist of a stolen gist
@Anachron
Anachron / Windows 10 Optimization Script.ps1
Created August 31, 2020 05:39
Windows 10 Optimization Script
##########
# Win10 Optimization Script With Extra GPD Win Tweaks
# Adapted version of https://github.com/Disassembler0/Win10-Initial-Setup-Script by Disassembler <disassembler@dasm.cz>
# Author: BlackDragonBE
# Version: v2.2.1 (2017-12-02)
# Copied from https://www.reddit.com/r/gpdwin/comments/6ipa6c/windows_10_optimization_script_for_gpd_win/
##########
# As a workaround for disabled script execution, run this command (without #) in an elevated PowerShell windows first and choose "all" if you're asked where to apply this:
# Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
@Anachron
Anachron / wg_install.sh
Created June 24, 2019 07:15 — forked from sethenoka/wg_install.sh
A script to spin up a Wireguard VPN server with Unbound recursive DNS in a hurry
#!/bin/bash
# This file is designed to spin up a Wireguard VPN quickly and easily,
# including configuring a recursive local DNS server using Unbound
#
# Make sure to change the public/private keys before running the script
# Also change the IPs, IP ranges, and listening port if desired
# iptables-persistent currently requires user input
# add wireguard repo
sudo add-apt-repository ppa:wireguard/wireguard -y
@Anachron
Anachron / etc.sv.adblock.run
Created August 26, 2018 17:34 — forked from abenson/etc.dnsmasq.conf
adblock setup
#!/bin/sh
exec snooze -d 2/5 /usr/local/bin/update-adblock
#!/usr/bin/env python
#-------------------------------------------------
# file: twitcher.py
# author: Florian Ehmke
# description: dmenu for twitch streams
#-------------------------------------------------
import argparse
import requests
from subprocess import Popen, PIPE, STDOUT
/* global requirejs */
'use strict';
var LIVERELOAD_PORT = 35729;
var SERVER_PORT = 9000;
var lrSnippet = require('connect-livereload')({port: LIVERELOAD_PORT});
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
};
// # Globbing