This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
has_command() { | |
which "$1" >/dev/null 2>&1 | |
} | |
urlencode() { | |
python -c ' | |
import sys | |
import urllib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
force-inet4-or-inet6.c - hack to force applications to use IPv4 or IPv6 exclusively | |
compilation: cc -fPIC -shared -DUSE_INET4 -o force-inet4.so force-inet4-or-inet6.c | |
cc -fPIC -shared -DUSE_INET6 -o force-inet6.so force-inet4-or-inet6.c | |
usage: LD_PRELOAD=/path/to/library.so program args ... | |
This file is in the public domain. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(require readline) | |
(require readline/pread) | |
(let loop () | |
(parameterize ([readline-prompt (string->bytes/utf-8 "👀? ")]) | |
(match (read-line) | |
[(? eof-object?) | |
(newline) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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/* |
NewerOlder