Skip to content

Instantly share code, notes, and snippets.

@Guest0x0
Guest0x0 / minimal-MLTT.ml
Last active April 21, 2024 16:59
minimal MLTT implementation step-by-step
(* 这是我(预期,亦或是已经)在 ∞-type càfe summer school 上做的 talk,
"从零教你手把手实现一个 MLTT 类型检查器"
的内容稿。本 talk 计划以现场边讲解边手写代码的方式实现,
所以虽然这份内容稿会尽量尝试还原 talk 的思路和逻辑,
它的内容可能会与实际的 talk 有出入,建议有条件的人直接去听 talk 本身 *)
(* 本次 talk 将会使用 OCaml 来实现一个 MLTT 类型检查器。
你可能不会写 OCaml,但这没有关系。本次 talk 只会使用以下的功能:
#!/usr/bin/env bash
echo dump | socat stdio tcp6:[::1]:33123 | awk '
BEGIN {
i = 0
ORS = ""
}
{
if ($2 == "route" && $9 == "yes") {
if (i == 0) {
print "if "
@dragon-fish
dragon-fish / koishi-plugin-qq-channel-patch.js
Last active December 10, 2021 14:11
Koishi plugin QQ Channel Patch
/**
* @name koishi-plugin-qq-channel-patch
* @author Dragon-Fish <dragon-fish@qq.com>
*
* @desc Temporary patch for QQ channel for koishi.js
*/
// Packages
const { CQBot } = require('koishi-adapter-onebot')
const { segment } = require('koishi-core')
@iffa
iffa / ax201-hostapd.conf
Created June 1, 2021 10:29
hostapd config for Intel WiFi6 AX201 (5Ghz)
# Config for Intel WiFi6 AX201
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
logger_syslog=-1
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=1
ssid=AwesomeWifi
@moesoha
moesoha / generate_ptp_cost.sh
Last active March 17, 2023 18:04
Generate BIRD constants with ping statistics in 10s
#!/bin/sh
# gathering all interfaces with IPv6 link-local address
for with_ll in $(cat /proc/net/if_inet6 | grep "^fe80" | tr -s ' ' | cut -d ' ' -f 6 | sort -u); do
# POINTOPOINT flag is 1 << 4, filter non-PTP interfaces out
if [ $(expr \( $(($(cat /sys/class/net/$with_ll/flags))) / 16 \) % 2) -ne 1 ]; then
continue
fi
cost=65535
ping_rtt=N/A
@chriselsner
chriselsner / nix-on-macos-catalina.md
Last active January 24, 2024 18:35
Nix on macOS Catalina

Nix on macOS Catalina

I'm writing this gist for my own records but it might help someone else too.

Installing Nix

Support for Catalina has improved a lot since the update was first rolled out.

Note: See the NixOS manual for discussion of the --darwin-use-unencrypted-nix-store-volume option.

@zeroc0d3
zeroc0d3 / README.md
Created February 9, 2020 03:53 — forked from justincjahn/README.md
Minecraft server(s) using systemd and screen.

Install

# Install dependencies
sudo yum install -y java-1.8.0-openjdk screen

# Create a new unprivileged user for minecraft
useradd -r -m -d /opt/minecraft minecraft

# Create the directory that will house our minecraft instances

sudo su --shell /bin/bash minecraft

@Barakat
Barakat / Driver.c
Last active October 8, 2023 05:43
sysenter/KiFastCallEntry/IA32_SYSENTER_EIP hooking driver for Windows x86
//
// sysenter/KiFastCallEntry/IA32_SYSENTER_EIP hooking driver
//
// Barakat Soror (https://twitter.com/barakatsoror)
//
#include <wdm.h>
#include <intrin.h>
#ifndef _X86_
@adisbladis
adisbladis / podman-shell.nix
Last active July 26, 2024 00:09
Use podman within a nix-shell
{ pkgs ? import <nixpkgs> {} }:
let
# To use this shell.nix on NixOS your user needs to be configured as such:
# users.extraUsers.adisbladis = {
# subUidRanges = [{ startUid = 100000; count = 65536; }];
# subGidRanges = [{ startGid = 100000; count = 65536; }];
# };
@coltenkrauter
coltenkrauter / fix-wsl2-dns-resolution
Last active July 28, 2024 04:05
Fix DNS resolution in WSL2
More recent resolution:
1. cd ~/../../etc (go to etc folder in WSL).
2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line).
3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line).
4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian).
5. cd ~/../../etc (go to etc folder in WSL).
6. sudo rm -Rf resolv.conf (Delete the resolv.conf file).
7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and
secondary.