Skip to content

Instantly share code, notes, and snippets.

View InternetUnexplorer's full-sized avatar

InternetUnexplorer

  • Portland, OR
View GitHub Profile
@InternetUnexplorer
InternetUnexplorer / ROV.ino
Last active April 27, 2017 14:47
Program for controlling 5 motors with an XBOX360 controller connected via USB shield.
/**
* Copyright (c) 2017 Alex White, Jeremy Harris, Abe Zukor
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@InternetUnexplorer
InternetUnexplorer / brainfuck.vim
Created February 21, 2017 19:23
Syntax highlighting for brainfuck.
" Vim syntax file
" Language: Brainfuck
" Maintainer: InternetUnexplorer <internetunexplorer@gmail.com>
" Last Change: 2017 Feb 17
" Version: 0.1
if !exists("main_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
@InternetUnexplorer
InternetUnexplorer / blendfile.c
Created July 22, 2017 09:11
Reads and prints information about the contents of Blender (.blend) files
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <error.h>
struct BlendFile
{
int ptr_size;
int endianness;
int version_num;
@InternetUnexplorer
InternetUnexplorer / autodrain.lua
Last active January 23, 2020 06:02
OpenComputers script to drain items from an ME network based on a set of item limits
local component = require "component"
local term = require "term"
-- Get ME and database components
-- The interface is needed to access the common network API, see
-- https://github.com/MightyPirates/OpenComputers/issues/3055
local meInterface = component.me_interface
local meExportbus = component.me_exportbus
local database = component.database
@InternetUnexplorer
InternetUnexplorer / items.lua
Last active January 1, 2021 20:49
OpenComputers script to show various statistics about the number of items in an ME network
-- Total number of bits that can be stored in the system
local TOTAL_BITS = 1174405120
-- Approximate number of seconds between average rate resets
local AVG_INTERVAL = 3600 -- 1 hour
local component = require "component"
local event = require "event"
local term = require "term"
local interface = component.me_interface
@InternetUnexplorer
InternetUnexplorer / backup.sh
Last active January 18, 2021 01:50
My current backup "solution". Both source and destination filesystems are btrfs. This will be replaced eventually; you should use btrfs-send or similar instead.
#!/usr/bin/env bash
################################
BLOCK_DEVICE=/dev/disk/by-label/Backup
DM_NAME=cryptbackup
MOUNT_POINT=/mnt/backup
################################
@InternetUnexplorer
InternetUnexplorer / brightness-daemon.service
Last active September 11, 2020 18:27
A really simple daemon for adjusting monitor brightness using DDC/CI. Requires `ddcutil` to be installed.
[Unit]
Description=Simple Brightness Daemon
[Service]
ExecStart=/usr/bin/brightness-daemon.sh
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
@InternetUnexplorer
InternetUnexplorer / wisdom.lua
Last active July 2, 2024 00:36
ComputerCraft program to display useful tips on a connected monitor
------------------------------------------------
-- Wisdom
------------------------------------------------
local WISDOM = {
"If you do your best, whatever happens will be for the best.",
"Things that go away by themselves can come back by themselves.",
"Plaid shirts and striped pants rarely\nmake a positive fashion statement.",
"You should never dive into murky waters.",
"It's never too late to learn to play the piano.",
@InternetUnexplorer
InternetUnexplorer / fix-starlight.patch
Created January 1, 2021 20:52
Patch and NixOS overlay to add support for starlight mode on the Mid 2017 Razer Blade Stealth to OpenRazer
diff --git a/driver/razerkbd_driver.c b/driver/razerkbd_driver.c
index 909a797..a209cfc 100644
--- a/driver/razerkbd_driver.c
+++ b/driver/razerkbd_driver.c
@@ -1242,6 +1242,7 @@ static ssize_t razer_attr_write_mode_starlight(struct device *dev, struct device
}
break;
+ case USB_DEVICE_ID_RAZER_BLADE_STEALTH_MID_2017:
case USB_DEVICE_ID_RAZER_BLADE_STEALTH_LATE_2017:
@InternetUnexplorer
InternetUnexplorer / kwin-lowlatency-build.sh
Last active February 18, 2021 04:28
Systemd timer/service file and hooks for nix-channel-watcher
#! /usr/bin/env bash
REPOSITORY=InternetUnexplorer/kwin-lowlatency-overlay
set -eu
source .secrets
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \