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 | |
# I have no idea where I got this script, possibly here: | |
# https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF | |
for d in /sys/kernel/iommu_groups/*/devices/* ; do | |
n=${d#*/iommu_groups/*} | |
n=${n%%/*} | |
printf 'IOMMU Group %s ' "$n" | |
lspci -nns "${d##*/}" |
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
// I expect this to generate errors on mismatched prototypes but apparently it does not. I should probably figure out why. | |
// gcc -std=c1x -Wstrict-aliasing -Wall -Wno-unused-but-set-variable restrict_punning.c | |
// clang -std=c1x -Wstrict-aliasing -Wall restrict_punning.c | |
void f1(char * restrict a, char * b) | |
{ | |
return; | |
} |
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 <xc.h> | |
#include <stdint.h> | |
typedef struct _cmd_read_write_disp | |
{ | |
uint8_t cmd; | |
void (*newseq)(); | |
// ... Reduced for brevity ... | |
} CMD_READ_WRITE_DISP_ST; |
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 | |
for bin in $(dpkg -L llvm-3.9 clang-3.9 llvm-3.9-runtime llvm-3.9-tools | xargs ls -ld | grep -E '^-r.x' | awk '{print $9}') | |
do | |
ldd "$bin" 2> /dev/null | awk -v binname="$bin" '{print binname "::" $0}' | |
done | grep -i libllvm | grep -Fv 'libLLVM-3.9.so.1::' |
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
alignment top_right | |
cpu_avg_samples 2 | |
gap_x 5 | |
gap_y 60 | |
minimum_size 5 5 | |
net_avg_samples 2 | |
update_interval 2.0 | |
double_buffer true | |
# Set font size to legible. |
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 | |
TARGET_IF=wlan0 | |
ADDPRIO=101 | |
DEFAULT_RT=$(ip ro show dev "$TARGET_IF" | grep 'default' | cut -d' ' -f3 | tail -1) | |
if [ -n "$DEFAULT_RT" ]; then | |
sudo ip ro add default via $DEFAULT_RT metric $ADDPRIO | |
sudo sed -i -e 's@^nameserver 10\.8\.1\.@#\0@' /etc/resolv.conf | |
else |
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
// Put this in a separate .h file (called "getopt.h"). | |
// The prototype for the header file is: | |
/* | |
#ifndef GETOPT_H | |
#define GETOPT_H | |
int getopt(int nargc, char * const nargv[], const char *ostr) ; | |
#endif | |
*/ |
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
################################################################## | |
# If you have not read the multiple disclaimers, do not do this. # | |
# It is supposed to be a joke, haha. # | |
################################################################## | |
This goofiness is valid: | |
/etc/network/interfaces: | |
for procif in /etc/network/interfaces.d/*; do | |
procifname="$(basename $procif)" |
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
# Makefile called like so: | |
#SIGN=YES gmake | |
RELEASEFILES:=a.exe a.dll | |
SIGNED_SDIR:=signed_bin | |
UNSIGNED_SDIR:=unsigned_bin | |
ODIR:=install | |
SIGNTOOL:='/cygdrive/c/Program Files (x86)/Windows Kits/8.1/bin/x64/signtool.exe' | |
# Update with your signtool options: | |
SIGOPTS:=/tr http://timestamp.digicert.com /td sha256 /fd sha256 /i DigiCert_Test |
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
# This module defines | |
# Keyutils_LIBRARIES, the name of the libraries to link against | |
# Keyutils_FOUND, if false, do not try to link keyutils | |
# Keyutils_INCLUDE_DIRS, where to find keyutils.h and dependent includes | |
# | |
# As keyutils is a Linux interface, paths for other OSes are not defined | |
# | |
# Copyright (c) 2017, Andrew Domaszek | |
# | |
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying |