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
package main | |
import ( | |
"flag" | |
"fmt" | |
"os" | |
"path" | |
"regexp" | |
"strings" | |
"unicode" |
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
#!/usr/bin/env bash | |
_lang=nato | |
while getopts ":l:" opt; do | |
case "${opt}" in | |
l) _lang="${OPTARG}" ;; | |
esac | |
done | |
shift $((OPTIND - 1)) |
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
FROM alpine | |
RUN apk update; \ | |
apk --no-cache upgrade; \ | |
apk add --no-cache bash | |
SHELL ["/bin/bash", "-o", "pipefail", "-xec"] | |
RUN apk add --no-cache autoconf automake file gcc git libcap-static libcap-ng libcap-ng-dev libcap-ng-static libnsl-static libltdl-static libtool linux-headers lz4-dev lz4-static make musl-dev openssl1.1-compat-dev openssl1.1-compat-libs-static pkgconfig | |
WORKDIR /usr/local/src/openvpn | |
RUN git clone --branch=v2.5.8 --depth=1 https://github.com/OpenVPN/openvpn $(pwd) | |
RUN autoreconf -i -v -f; \ | |
./configure --enable-static --enable-iproute2 --disable-shared --disable-plugins --disable-selinux-build --disable-tap --disable-lzo; \ |
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 | |
PHONETRACK_URL="https://cloud.example.com/apps/phonetrack/logGet" | |
PHONETRACK_SESSION= | |
PHONETRACK_DEVICE= | |
MINIMUM_SPEED=0 | |
while getopts ":m:" opt; do | |
case "${opt}" in | |
m) MINIMUM_SPEED="${OPTARG}" ;; |
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 -ex | |
_gpio="${1}" | |
_direction="${2:-out}" | |
if [[ ! -d /sys/class/gpio/gpio"${_gpio}" ]]; then | |
echo "${_gpio}" >/sys/class/gpio/export | |
fi | |
echo "${_direction}" >/sys/class/gpio/gpio"${_gpio}"/direction |
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
package main | |
import ( | |
"bufio" | |
"context" | |
"encoding/json" | |
"flag" | |
"fmt" | |
"os" | |
"strconv" |
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
#!/usr/bin/env bash | |
CORTEX_CRYPTO="aes-256-cbc" | |
_cortex_logger() { printf '{%s}[%s](%s):%s\t%s\n' "$(date -u '+%FT%TZ')" "${1}" "$(caller)" "${2}" "${@:3}" 1>&2; } | |
_cortex_io() { | |
case "${CORTEX_FILE}" in | |
"") _cortex_logger "$(caller)" ERR "CORTEX_FILE environment variable is empty/unset" && return 127 ;; | |
*) |
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
package main | |
import ( | |
"encoding/hex" | |
"encoding/json" | |
"flag" | |
"fmt" | |
"net" | |
"os" | |
"os/signal" |
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 -e | |
# gpus.json | |
# to find out uuid, first match PCI port with GPU UUID | |
# #> lspci -vnn | grep VGA -A 2 && cat /proc/driver/nvidia/gpus/*/information | |
# then confirm | |
# #> nvidia-smi -L | |
if [[ -z ${1} ]] || [[ ! -s ${1} ]]; then | |
printf 'must provide json config file with first argument\n' |
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
curl -sL -F formtype=simple -F corpus=@corpus.txt http://www.speech.cs.cmu.edu/cgi-bin/tools/lmtool/run | grep -o 'http*://[^"]*' |
NewerOlder