Skip to content

Instantly share code, notes, and snippets.

View NilsWildt's full-sized avatar

Nils NilsWildt

  • University of Stuttgart
View GitHub Profile
@courtneyfaulkner
courtneyfaulkner / devices.c
Created December 11, 2013 22:20
List OpenCL platforms and devices
#include <stdio.h>
#include <stdlib.h>
#ifdef __APPLE__
#include <OpenCL/opencl.h>
#else
#include <CL/cl.h>
#endif
int main() {
@liantian-cn
liantian-cn / file
Last active October 26, 2022 18:51
shadowsocks iptables规则
# 新建一个无密码,无法登陆,没home的系统用户,就叫shadowsocks
adduser --system --disabled-password --disabled-login --no-create-home shadowsocks
# 修改 /etc/default/shadowsocks-libev
USER=shadowsocks
GROUP=nogroup
# 使用setcap,允许非root用户无法监听低位端口
apt-get install libcap2-bin
setcap 'cap_net_bind_service=+ep' /usr/bin/ss-server
@Atrate
Atrate / snowstats.sh
Last active July 19, 2024 20:28
Quick script to get the statistics of traffic on Tor Project's Snowflake proxy instance running locally on docker
#!/bin/bash --posix
docker logs snowflake-proxy 2>&1 | grep --color=auto 'Traffic Relayed' | awk '
{
# Extract the download and upload values
down[1] = $14
down[2] = $15
gsub(/[^a-zA-Z]/, "", down[2])
up[1] = $17
up[2] = $18
@Pangoraw
Pangoraw / fix_slide_controls.jl
Last active June 6, 2023 17:03
Fix the broken slide controls in Pluto (0.19.? <= x <= 0.19.9)
# ╔═╡ 9e5d37c8-c45c-4eb0-bc38-fd42bb408508
html"""
<script>
const calculate_slide_positions = (/** @type {Event} */ e) => {
const notebook_node = /** @type {HTMLElement?} */ (e.target)?.closest("pluto-editor")?.querySelector("pluto-notebook")
console.log(e.target)
if (!notebook_node) return []
const height = window.innerHeight
const headers = Array.from(notebook_node.querySelectorAll("pluto-output h1, pluto-output h2"))