Headless reinstall and update https://raspberrypi.stackexchange.com/a/57023
- create a text file in /boot/ called ssh
| #!/bin/bash | |
| # A script for shutting down an idle VM with GPUs attached when they are idle and there | |
| # are no users logged in. Add the below crontab via `crontab -e` to run this script every | |
| # 10 minutes and append its output to a log: | |
| # | |
| # */10 * * * * ~/shutdown_idle_gpu_machine.sh >> ~/shutdown_idle_gpu_machine.log 2>&1 | |
| # | |
| # This script should live in your HOME directory. Your user should have sudoer privileges. |
| # Define imports. | |
| from time import time, strftime | |
| from datetime import datetime | |
| from glob import iglob | |
| from os import path, system | |
| from sys import exc_info | |
| from subprocess import Popen, PIPE | |
| from curses import initscr, noecho, cbreak, echo, nocbreak, endwin | |
| from psycopg2 import connect |
Headless reinstall and update https://raspberrypi.stackexchange.com/a/57023
| #----- Create a Docker for cross-compilation -----# | |
| mkdir build && cd $_ | |
| docker run -it --rm -v `pwd`:/build golang:1.8.3 /bin/bash | |
| #----- Inside docker -----# | |
| go get github.com/elastic/beats | |
| cd /go/src/github.com/elastic/beats/filebeat/ | |
| git checkout v5.6.3 | |
| GOARCH=arm go build | |
| cp filebeat /build | |
| exit |
| #!/bin/bash | |
| set -e | |
| set -o pipefail | |
| # Add user to k8s using service account, no RBAC (must create RBAC after this script) | |
| if [[ -z "$1" ]] || [[ -z "$2" ]]; then | |
| echo "usage: $0 <service_account_name> <namespace>" | |
| exit 1 | |
| fi |
# https://unix.stackexchange.com/questions/5010/how-can-i-count-the-number-of-different-characters-in-a-file
# works for linux. There is a variation for MacOS in the link ^
sed 's/\(.\)/\1\n/g' text.txt | sort | uniq -c # sort -nr # uncomment this to sort the list by frequencyUse A3C (asynchronous advantage actor-critic) written in TensorFlow. Training code, model & evaluation code at this repo
Gist doesn't have notifications, please use repo issues to discuss.
| #!/bin/bash | |
| # ./hackrf_baudline.sh <frequency> <samplerate> <IFgain> <BBgain> | |
| FFT=$((${2}/1000000*2048)) | |
| mkfifo /tmp/fifo | |
| hackrf_transfer -r /tmp/fifo -l $3 -g $4 -f $1 -s $2 >> /dev/null & | |
| cat /tmp/fifo | baudline -stdin -quadrature -record -channels 2 -flipcomplex -format s8 -overlap 100 -memory 512 -fftsize ${FFT} -basefrequency $1 -samplerate $2 && rm /tmp/fifo |