Skip to content

Instantly share code, notes, and snippets.

View notwa's full-sized avatar
🚲
bikeshedding

Connor notwa

🚲
bikeshedding
View GitHub Profile
@notwa
notwa / rejects.txt
Last active November 1, 2024 04:45
rejects (abusive web crawlers / web spiders)
rule family="ipv4" source address="45.56.185.0/24" reject # WEB2OBJECTS, US
rule family="ipv4" source address="45.56.186.0/24" reject # WEB2OBJECTS, US
rule family="ipv4" source address="45.81.25.0/24" reject # QUICKPACKET, US
rule family="ipv4" source address="45.130.33.0/24" reject # M247, RO
rule family="ipv4" source address="47.128.16.0/19" reject # AMAZON-02, US
rule family="ipv4" source address="47.128.32.0/18" reject # AMAZON-02, US
rule family="ipv4" source address="47.128.96.0/19" reject # AMAZON-02, US
rule family="ipv4" source address="50.118.248.0/24" reject # EGIHOSTING, US
rule family="ipv4" source address="54.36.148.0/24" reject # OVH, FR
rule family="ipv4" source address="63.246.157.0/24" reject # ENDOFFICE, US
@notwa
notwa / simple_templates.py
Last active February 3, 2024 15:13
custom prompt template system for llama-cpp-python
from collections import namedtuple
Template = namedtuple(
"Template",
("prologue", "system", "user", "assistant", "epilogue", "flags"),
defaults=((),),
)
templates = {
"Airoboros-v1.2": Template(
// ==UserScript==
// @name YouTube audio compressor
// @namespace https://eaguru.guru/
// @version 0.5.2
// @description Adds an audio compressor option to YouTube videos. Now with over-engineering! Based on code by Vivelin and Wareya.
// @author notwa
// @match https://*.youtube.com/*
// @updateURL https://gist.github.com/notwa/9b8466b0c2ca48d756afcd02a5e43739/raw/YouTube%2520audio%2520compressor.user.js
// @run-at document-idle
// @grant none
ARG ACES_CONTAINER_COMMIT=7a4e21e142fe46ac300ce047e614e8dbafa873cf
ARG RAWTOACES_COMMIT=8a868b0aa03ecf56d167fb9e725807a282118ce9
ARG CERES=ceres-solver-1.14.0
ARG CERES_SHA256=4744005fc3b902fed886ea418df70690caa8e2ff6b5a90f3dd88a3d291ef8e8e
ARG CERES_CMAKE="-DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF"
FROM ubuntu:bionic AS builder
RUN rm -f /etc/apt/apt.conf.d/docker-clean && apt-get update
@notwa
notwa / based.2022-01-08.sh
Last active August 18, 2022 06:45
something to crudely scrape and reformat all the base16 color palettes
if false; then
:
elif [ "$name" = "apprentice" ]; then # from apprentice
# Apprentice by romainl
ForegroundColour '#BCBCBC'
BackgroundColour '#262626'
CursorColour '#FFFFFF'
Black '#262626'
Red '#5F8787'
@notwa
notwa / wat.sh
Last active February 24, 2024 09:22
set -e is kinda useless
#!/usr/bin/env sh
# run this shell script with one of these shells:
# zsh, bash, dash, or (busybox) ash.
set -e
# false # this exits the shell immediately.
# false || false # this exits as well.
false && true # wait, what?
! true # huh?
@notwa
notwa / generate
Last active July 6, 2021 16:44
something i threw together to make a discord banner out of video frames and will probably want to find and refer to 5 years from now
#!/usr/bin/env bash
set -e
ffmpeg -i mpv-shot%4d.png -filter_complex "\
select=between(n\,20\,39),setpts=PTS-STARTPTS,\
crop=1920:768:0:100,\
scale=600:-1,\
split=2[palette_in][gif];\
[palette_in]palettegen[palette_out];\
[gif]fifo[gif_fifo];\
[gif_fifo][palette_out]paletteuse\
@notwa
notwa / alpine.patch
Last active April 6, 2021 05:08
ad-hoc build script for pytorch 1.8.1 on alpine linux 3.13.4
--- a/c10/macros/Macros.h
+++ b/c10/macros/Macros.h
@@ -287,12 +287,12 @@
defined(__HIP_ARCH__) || defined(__HIP__)
__host__ __device__
#endif // __CUDA_ARCH__
- void
+ _Noreturn void
__assert_fail(
const char* assertion,
@notwa
notwa / phasmo.ahk
Last active September 2, 2021 17:07
phasmophobia macro script for adding and removing items
#SingleInstance Force
#IfWinActive ahk_exe Phasmophobia.exe
Return
; 1 = D.O.T.S Projector
; 2 = EMF Reader
; 3 = Flashlight
; 4 = Ghost Writing Book
; 5 = Spirit Box
; 6 = UV Light
@notwa
notwa / stfu.sh
Created October 24, 2020 01:46
silence
#!/usr/bin/env ash
echo2() {
local IFS=" "
printf "%s\n" "$*" >&2
}
note() {
local IFS=" "
printf "\033[1m%s\033[0m\n" "$*" >&2