This file contains 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 | |
# This script is a template for debugging things that run as init (PID=1) | |
test_me () { | |
echo hello world! | |
lsusb | |
} | |
printf '\033[2J\033[0;0H' # clear screen | |
mount -t proc proc /proc |
This file contains 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 | |
# Track a Kickstarter page in real time | |
# License: https://raw.githubusercontent.com/Zuph/ACAB-License/master/LICENSE.md/LICENSE.md | |
# Github Gists don't preserve file permissions - check the comments on this page | |
# for a downloadable copy of this script whose permissions have already been set. | |
interval=10 # refresh interval in seconds | |
graph_interval=240 # how frequently we add to the histogram |
This file contains 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 | |
# Track a Kickstarter page in real time | |
# License: https://raw.githubusercontent.com/Zuph/ACAB-License/master/LICENSE.md/LICENSE.md | |
# Github Gists don't preserve file permissions - check the comments on this page | |
# for a downloadable copy of this script whose permissions have already been set. | |
interval=5 # refresh interval in seconds | |
url="https://www.kickstarter.com/projects/lookingglass/looking-glass-portrait/stats.json" |
This file contains 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 | |
[[ -z $1 ]] && { | |
config=$(mktemp) | |
echo "config.txt options: " > $config | |
echo " $(vcgencmd get_config arm_freq)" >> $config | |
echo " $(vcgencmd get_config gpu_freq)" >> $config | |
echo " $(vcgencmd get_config gpu_freq_min)" >> $config | |
echo " $(vcgencmd get_config arm_freq_min)" >> $config | |
echo " $(vcgencmd get_config over_voltage)" >> $config | |
echo " $(vcgencmd get_config force_turbo)" >> $config |
This file contains 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 | |
PATH=$PATH:/usr/local/bin | |
checkdep(){ | |
command -v $1 && return | |
msg="Please install Homebrew by visiting https://brew.sh." | |
[[ "$1" == "brew" ]] || msg="Please install ${1} with 'brew install ${1}'." | |
osascript -e "tell app \"System Events\" to display dialog \"$msg\"" | |
exit 0 | |
} |
This file contains 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 | |
k= | |
name= | |
case $1 in | |
0) | |
name=SINC | |
k="-30 -2 167 -112 84 2 19 -167 -215 -128 128 168 -1 -113 -115 179 132 248 23 219 121 -248 235 -149 -89 -76 -236 43 160 -23 -111 204 0";; | |
1) | |
name=SINC_BLACKMAN | |
k="-30 -2 167 -112 84 2 55 -167 -199 -128 192 -87 -129 -113 -115 183 132 -8 87 219 121 -248 235 -149 -89 180 -226 43 160 -24 -111 204 0";; |
This file contains 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 | |
#set -e | |
# discover connected displays | |
DISPLAYNUM=$(tvservice -l | tail -c 2) | |
MMAL_DISPLAY=$(expr $DISPLAYNUM + 1) | |
export DISPLAY=:$DISPLAYNUM |
This file contains 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
// ShowQuilt example code | |
// Shiyun (Vanilla) Liu and Evan Kahn, 8/17/2020 | |
// | |
// Easiest way to build this on any platform is to add this source file to | |
// HoloPlayCore/examples, and uncomment lines 26-29 in HoloPlayCore/examples/CMakeLists.txt. | |
// | |
// Oh and you need a file called quilt.jpg in the same directory from which you run | |
// the executable. You can download a sample one from: http://eka.hn/quilts/evan.jpg | |
// (remember to rename it). | |
// |
This file contains 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
function patternsearch(U8ABuf, U8APat, nOffset) { | |
var nCur = nOffset; | |
var result = 0; | |
while (nCur <= U8ABuf.length - U8APat.length) { | |
var add = 0; | |
var mat = 1; | |
for (var i = 0; i < U8APat.length; i++) { | |
if (U8APat[0] == U8ABuf[nCur + i]) { | |
add = i; | |
} |
This file contains 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
char addressBuffer[INET_ADDRSTRLEN]; | |
getip(addressBuffer); | |
char url1[100]; | |
sprintf(url1, "ws://%s:11222/driver", addressBuffer); | |
char *url2 = "ipc:///tmp/pipe.ipc"; | |
int rv; | |
printf("Beginning repeater %s -> %s...\n", url1, url2); | |
if ((rv = nng_rep0_open_raw(&sock1)) != 0) | |
fatal("nng_socket", rv); | |
if ((rv = nng_rep0_open_raw(&sock1)) != 0) |
NewerOlder