This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sed -f | |
| # store rule in hold space | |
| 1 { h; d; } | |
| # make borders wrap | |
| s/\(.\)\(.*\)\(.\)/>\3\1\2\3\1|/ | |
| # do some mucking around that can probably be done more elegantly by someone who is actually good at sed | |
| x; G; h; s/\n.*//; x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh -e | |
| target=${1?usage: $0 pid [fd]} | |
| fd=${2-1} | |
| fifo=fifo.$$ | |
| log=log.$$ | |
| mkfifo $fifo | |
| echo writing to $log | |
| tee $log <$fifo >/proc/$target/fd/$fd & |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <ctype.h> | |
| #include <fcntl.h> | |
| #include <linux/openat2.h> | |
| #include <netinet/in.h> | |
| #include <signal.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <sys/socket.h> | |
| #include <sys/syscall.h> | |
| #include <unistd.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| char **func_that_returns_strings(int nstrings) { | |
| // first dump all the strings into a contiguous buffer, separated by \0 | |
| char buf[100]; | |
| size_t size = 0; | |
| for (int i = 0; i < nstrings; i++) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import fuse | |
| import time | |
| import sys | |
| import errno | |
| class fs(fuse.Operations): | |
| def getattr(self, path, fh=None): | |
| if "blockme" in path: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| musl-gcc -shared -fPIC sys_errlist.c -o libsys_errlist.so |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash -e | |
| rm -rf build | |
| mkdir build | |
| cd build | |
| echo "int main() {" > f.c | |
| limit=${1-500} | |
| for (( i = 0; i < ${1-500}; i++ )) do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| shopt -s extglob | |
| declare -A signal=( | |
| [1]=sighup [2]=sigint [3]=sigquit [4]=sigill [5]=sigtrap | |
| [6]=sigabrt [7]=sigbus [8]=sigfpe [9]=sigkill [10]=sigusr1 | |
| [11]=sigsegv [12]=sigusr2 [13]=sigpipe [14]=sigalrm [15]=sigterm | |
| [16]=sigstkflt [17]=sigchld [18]=sigcont [19]=sigstop [20]=sigtstp | |
| [21]=sigttin [22]=sigttou [23]=sigurg [24]=sigxcpu [25]=sigxfsz | |
| [26]=sigvtalrm [27]=sigprof [28]=sigwinch [29]=sigio [30]=sigpwr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| file /bin/true | |
| b main | |
| r |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void f() { } | |
| int main() { | |
| for (int i = 0; i < 100; i++) | |
| f(); | |
| } |