Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Build script for dust3d on fedora 27
#
# This script assumes that the current working diretory is in dust3d/
sudo dnf install CGAL-devel rust cargo git make gcc-g++
git clone https://github.com/huxingyi/meshlite.git
cd meshlite
cargo build --release
#!/bin/bash
#Variables
domain=$(echo $1 | sed 's/^.*\:\/\///g' | awk -F '/' '{print $1}' | rev | awk -F '.' '{print $1"."$2}' | rev)
url=$(echo $1 | sed 's/^.*\:\/\///g')
echo -e "Downloading "$domain"\n"
sleep 1
#!/bin/bash
URL=$1
fmtID=$(youtube-dl --list-formats $URL | grep opus | tail -1 | cut -f 1 -d " ")
youtube-dl -f $fmtID $URL
#!/bin/bash
# This script scrapes the road status page of www.tararuadc.govt.nz and displays a list in the terminal
# as well as generating a JSON file which can be found at '/tmp/roads.json'.
#
# requires html-xml-utils which can be installed in ubuntu via 'sudo apt install html-xml-utils'
# or compiled from source found here: https://www.w3.org/Tools/HTML-XML-utils/
saveFile='/tmp/road-dump'
#!/bin/bash
# Blinks the white led on and off every half second the CHIP & PocketCHIP
# To run type 'sudo ./chip-blinky.sh'.
LED='/sys/class/leds/chip:white:status'
while [ true ]; do
echo default-on > $LED/trigger
sleep 0.5
@linuxsocist
linuxsocist / autodecode
Last active March 23, 2018 07:07
A collection of scripts I use for capturing and decoding LRPT signals automatically. (See comment for basic setup instructions).
#!/bin/bash
sFile=$(ls -tr S-files/*.s | tail -n 1)
outFile=$(echo ${sFile/.s/})
echo "====================" >> decode-log
./medet $sFile $outFile -r 65 -g 65 -b 64 -q >> decode-log
date +%Y-%m-%d_%H%M >> decode-log
exit 1
@linuxsocist
linuxsocist / gpsd-traccar.sh
Last active February 3, 2024 09:19
Converts the gpsd JSON output to the osmand protocol. In order for this to work, this script requires 'jq' to process the JSON output of gpsd.
#!/bin/bash
ADDR="192.168.1.9" # Replace with your traccar server address
PORT="5055" # Replace this with the port of your traccar server
ID="1234" # Replace this with your chosen traccar id
UPDATE="5" # Update interval
while [ true ]
do
{ echo "?WATCH={"enable":true}"; sleep 1; echo "?POLL;"; sleep 1; } | telnet 127.0.0.1 2947 2> /dev/null 1> gpsgrab-dump