Skip to content

Instantly share code, notes, and snippets.

@SBell6hf
SBell6hf / vscode-server-download.sh
Created November 20, 2021 05:48
VSCode Server download link generator
echo "################ LEGAL INFO #################"
echo "# According to Microsoft's license, you may #"
echo "# only use VSCode Server with Visual Studio #"
echo "# family products. #"
echo "# If you want to use it on a remote machine #"
echo "# in order to code in a web browser, please #"
echo "# go to https://github.com/gitpod-io/openvs #"
echo "# code-server. #"
echo "#############################################"
echo
@SBell6hf
SBell6hf / jailer.c
Last active September 2, 2023 12:00
A ptrace-based syscall jailer that runs on arm64, x86_64 and i386
// SPDX-License-Identifier: CC0-1.0+
#include <sys/syscall.h>
#include <sys/user.h>
#include <errno.h>
#include <sys/procfs.h>
#include <sys/wait.h>
#include <stdbool.h>
#include <stdlib.h>
#include <sys/ptrace.h>
#include <string.h>
@SBell6hf
SBell6hf / recordMIDI.js
Last active January 31, 2022 13:16
Record and restore MIDI events.
// License: The Unlicense
// args: midiPort:Number
let midiPort = Number(process.argv[2 + 0]);
let binaryMode = false;
let midi = require("midi");
let input = new midi.Input();
if (binaryMode) {
input.on("message", function (deltaTime, message) {
@SBell6hf
SBell6hf / .clang-format
Created March 8, 2022 21:58
.clang-format
BasedOnStyle: Google
AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign
AlignArrayOfStructures: Right
AlignConsecutiveAssignments: AcrossComments
AlignConsecutiveBitFields: AcrossComments
AlignConsecutiveDeclarations: AcrossComments
AlignConsecutiveMacros: AcrossComments
AlignEscapedNewlines: DontAlign
AlignOperands: AlignAfterOperator
@SBell6hf
SBell6hf / untracable-text
Created April 24, 2022 13:22
make text style difficult to trace
As deep learning advances, more and more traits of us are revealed that can be used to track us, including our writing style.
This is an easy way to make text difficult to trace with Google Translate.
Original (a tweet from @AsahiLinux):
Correction: @never_released points out that Apple does enable a few proprietary CPU features in normal VMs running under macOS;
at least the Rosetta-related ones. Definitely not all of them, though, nor is most of the rest of the M1 hardware emulated.
Google Translated to Chinese Simplified:
更正:@never_released 指出 Apple 確實在 macOS 下運行的普通 VM 中啟用了一些專有 CPU 功能;
至少與羅塞塔有關的。 但是,絕對不是所有這些,M1 硬件的其餘大部分也沒有被仿真。