Skip to content

Instantly share code, notes, and snippets.

Avatar
👋
***status goes here***

Winston (Winny) Weinert winny-

👋
***status goes here***
View GitHub Profile
View configuration.nix
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
@winny-
winny- / gist:bb17853ffc76fbb9b039
Created Nov 13, 2015 — forked from nathanielc/gist:9b98350ccbcbf21256d7
Minecraft systemd unit file that uses tmux instead of screen
View gist:bb17853ffc76fbb9b039
[root@plex ~]# cat /etc/systemd/system/minecraft@.service
[Unit]
Description=Minecraft Server %i
[Service]
WorkingDirectory=/opt/minecraft-%i
User=mcserver
Type=forking
ExecStart=/usr/bin/tmux new-session -s mc-%i -d '/bin/java -Xmx2048M -jar minecraft_server.jar nogui'
View b.py
# borrowed from https://github.com/microsoft/ptvsd/issues/1423
import sys
import termios
import tty
fd = sys.stdin.fileno()
old_settings = termios.tcgetattr(fd)
tty.setraw(fd)
ch = sys.stdin.read(1)
View b.rkt
#lang racket
(define (f s)
(define ls (string->list s))
(reverse (for/fold ([rle `((,(car ls) . 1))])
([c (cdr ls)])
(match-define (list (cons v n) previous ...) rle)
(if (char=? v c)
(cons (cons v (add1 n)) previous)
(cons (cons c 1) rle)))))
@winny-
winny- / toggle-microsoft-docs-sidebars.user.js
Last active Sep 22, 2020
greasemonkey userscript to toggle the side bars on Microsoft Docs
View toggle-microsoft-docs-sidebars.user.js
// ==UserScript==
// @name Toggle Microsoft Docs Sidebars
// @namespace MSDN Sidebar
// @version 0.1
// @description Enhance readability of Microsoft Docs via hiding the sidebars.
// @author Winston (winny) Weinert https://winny.tech/
// @include https://docs.microsoft.com/*
// @grant none
// ==/UserScript==
@winny-
winny- / pearson-hide-platform-not-supported.user.js
Last active Sep 22, 2020
greasemonkey userscript to tell pearson to shove it, qutebrowser is cool man
View pearson-hide-platform-not-supported.user.js
// ==UserScript==
// @name Pearson hide "Platform not supported"
// @author Winston Weinert
// @namespace https://winny.tech/
// @description Put a good description in here
// @license Creative Commons Attribution License
// @version 0.1
// @include https://*.pearsoned.com/*
// @include https://*.ecollege.com/*
// @include https://*.pearsonmylabandmastering.com/*
@winny-
winny- / mediawiki-sidebar-toggle.user.js
Last active Sep 22, 2020
greasemonkey userscript to toggle the side bar on MediaWiki installations (WIP)
View mediawiki-sidebar-toggle.user.js
// ==UserScript==
// @name MediaWiki Sidebar Toggle
// @description Toggle the Mediawiki Side Bar with Control-Apostrophe
// @version 1.0
// @minGMVer 1.14
// @minFFVer 26
// @namespace Mediawiki-Sidebar-Toggle
// @license MIT; https://unlicense.org/
// @include http://*.wikipedia.org/*
// @include https://*.wikipedia.org/*
View reset-pulseaudio
#!/bin/sh
# Try to reset pulseaudio after suspend.
# Todo: fix resume to not require this.
set -u
pulseaudio -k
pulseaudio --daemon
pkill -SIGHUP xfce4-panel
View gist:6230e879234f83e667ffe8aad4fb0290
[731694.869009] ata1.00: exception Emask 0x0 SAct 0x100000 SErr 0x50000 action 0x6 frozen
[731694.869017] ata1: SError: { PHYRdyChg CommWake }
[731694.869025] ata1.00: failed command: WRITE FPDMA QUEUED
[731694.869038] ata1.00: cmd 61/00:a0:f0:2e:0d/08:00:06:00:00/40 tag 20 ncq dma 1048576 ou
[731694.869038] res 40/00:00:00:4f:c2/00:00:00:00:00/00 Emask 0x4 (timeout)
[731694.869042] ata1.00: status: { DRDY }
[731694.869050] ata1: hard resetting link
[731695.339011] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[731695.352595] ata1.00: configured for UDMA/133
[731695.352608] ahci 0000:00:12.0: port does not support device sleep
View better-cron.yml
- name: set up a better cron
hosts: alpine
become: yes
tasks:
- name: Install fcron
apk:
name: fcron
state: present
- name: Stop and disable crond
service: