Skip to content

Instantly share code, notes, and snippets.

View iczero's full-sized avatar
🪲
i made bugs

iczero iczero

🪲
i made bugs
View GitHub Profile
@iczero
iczero / build-vscode.sh
Last active April 14, 2022 13:29
Compile linux builds of VSCode from source
#!/bin/bash
# note: certain directory names have been changed to the original to
# preserve compatibility with certain extensions that do not expect
# changed directory names
export NVM_DIR="$(realpath nvm)" && (
git clone https://github.com/creationix/nvm.git "$NVM_DIR" || true
cd "$NVM_DIR"
git fetch --all
git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)`
@iczero
iczero / tinc-dist.sh
Last active October 13, 2021 13:29
Build a binary tarball of tinc
#!/bin/bash
set -xe
if [[ $EUID -ne 0 ]]; then
fakeroot $0
exit $?
fi
umask 022
VERSION=$(git rev-parse --short HEAD)
autoreconf -fsi
./configure --prefix=/opt/tinc
@iczero
iczero / oneify.ts
Last active July 5, 2021 09:48
stupid api service
import express from 'express';
import createDebug from 'debug';
import childProcess from 'child_process';
// RANDOM BULLSHIT AS A SERVICE (RBaaS), brought to you by iczero
// IMAGINE BEING THE PERSON THAT WROTE THIS
// i have literally spent more time writing this than thinking about the problem
// Find the shortest path from n to 1 using the operations n = n/2, n = n + 1, n = n - 1.
// n can only be divided by 2 when it is even, and it is always an integer.
@iczero
iczero / dots3.js
Last active April 21, 2021 07:53
stupid unicode things
// @ts-check
const { Transform } = require('stream');
const zlib = require('zlib');
// abuse varwidth fonts by encoding bytes to very thin unicode characters
// for best results run calculateWidths() with different fonts and devices
/* run this on about:blank
let root = document.createElement('div');
document.body.appendChild(root);
@iczero
iczero / mediasite-fetch.js
Last active January 15, 2021 02:28
Script to get information and download mediasite videos
#!/usr/bin/env node
// @ts-check
// $ npm install got path-to-regexp yargs cli-progress
// put value of MediasiteAuth cookie in a file named mediasite-auth-cookie.txt
// in the same directory as this script
const fs = require('fs');
const fsP = fs.promises;
const path = require('path');
const childProcess = require('child_process');
const got = require('got');
@iczero
iczero / build-proton.sh
Last active December 25, 2020 12:55
this script will probably not build proton
# Build Proton. Hopefully.
# Note: DO NOT ACTUALLY RUN THIS SCRIPT. Copy/paste each command so if something goes wrong this thing
# doesn't murder your system by accident.
# You should probably run this in a container.
# If you decide to stop it when it is building wine32, make sure you reinstall the 64-bit versions of
# the libraries so you don't have a massive headache while trying to build 64-bit things later on.
git clone --depth 10 https://github.com/ValveSoftware/Proton ./proton --recursive --shallow-submodule
cd proton
# reset all the submodules, no clue why this is needed
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index 8fafcb2cd..2b1c7b378 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -2363,7 +2363,8 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf,
CPU_BASED_MWAIT_EXITING |
CPU_BASED_MONITOR_EXITING |
CPU_BASED_INVLPG_EXITING |
- CPU_BASED_RDPMC_EXITING;
+ CPU_BASED_RDPMC_EXITING |
@iczero
iczero / scihub-nginx.conf
Last active August 13, 2020 23:30
Sci-Hub nginx reverse proxy setup
# relevant parts of configuration
upstream scihub {
server 80.82.77.83:443;
server 80.82.77.84:443;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name sci-hub.yourdomain.comt;
@iczero
iczero / mariabin-writeup.md
Last active June 27, 2020 01:57
maria-bin writeup
@iczero
iczero / mariabin-writeup.md
Created June 27, 2020 01:51
maria-bin writeup