Skip to content

Instantly share code, notes, and snippets.

View robxu9's full-sized avatar
📑
ping me directly if you need my attention

Robert Xu robxu9

📑
ping me directly if you need my attention
View GitHub Profile
@ddevault
ddevault / Makefile
Last active February 20, 2024 14:17
Tiny Wayland compositor
WAYLAND_PROTOCOLS=/usr/share/wayland-protocols
# wayland-scanner is a tool which generates C headers and rigging for Wayland
# protocols, which are specified in XML. wlroots requires you to rig these up
# to your build system yourself and provide them in the include path.
xdg-shell-protocol.h:
wayland-scanner server-header \
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
xdg-shell-protocol.c: xdg-shell-protocol.h
@alirobe
alirobe / reclaimWindows10.ps1
Last active July 3, 2024 09:36
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
@joostrijneveld
joostrijneveld / gpg2qrcodes.sh
Created May 20, 2014 19:43
Producing printable QR codes for persistent storage of GPG private keys
# Heavily depends on:
# libqrencode (fukuchi.org/works/qrencode/)
# paperkey (jabberwocky.com/software/paperkey/)
# zbar (zbar.sourceforge.net)
# Producing the QR codes:
# Split over 4 codes to ensure the data per image is not too large.
gpg --export-secret-key KEYIDGOESHERE | paperkey --output-type raw | base64 > temp
split temp -n 4 IMG
for f in IMG*; do cat $f | qrencode -o $f.png; done
@ryancdotorg
ryancdotorg / dnaas.c
Created October 30, 2013 23:20
Wrapper library to use /dev/null as a service on Linux via LD_PRELOAD
/* This is a wrapper library that will give your server the power of
* /dev/null as a service, as seen at http://devnull-as-a-service.com/
*
* Compile:
* gcc -ggdb -shared -fPIC dnaas.c -ldl -lcurl -o libdnaas.so
*
* Try:
* LD_PRELOAD=./libdnaas.so dd if=/dev/sda of=/dev/null bs=8192 count=16
*
* Install:

As part of an effort to figure out what my fellow students are working on, I'm assembling a list of GitHub usernames for Stony Brook Computing Society Members. You should follow these people and maybe ask them if they'd like to collaborate with you on some project or other. Have more usernames? Suggest additions!

#Members Past and Present

@lukespragg
lukespragg / sign4j.c
Last active August 2, 2018 15:57
Sign4j for Linux
/*
sign4j.c: a simple utility to sign executables created by Launch4j
Copyright (c) 2012 Grzegorz Kowal
Modified for Linux by Luke Spragg (Wulfspider), Dalton Pelc (Olloth), Contex, and raphfrk
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007
@Pamelloes
Pamelloes / RandomPronouncableText.java
Created July 16, 2012 03:45
Program that generates pronouncable, random text.
import java.util.ArrayList;
import java.util.List;
public class RandomPronouncableText {
private static Object[][] letterCombinations = {
//letter vowel "L" "R" Random Following Letters Prefixing Letters
{"a" ,true},
{"b" ,false ,true ,true ,true ,new String[]{} ,new String[]{} },
{"c" ,false ,true ,true ,true ,new String[]{"h","k"} ,new String[]{} },
{"d" ,false ,false ,true ,true ,new String[]{} ,new String[]{} },
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 27, 2024 16:01
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jboner
jboner / latency.txt
Last active July 27, 2024 12:32
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD