Skip to content

Instantly share code, notes, and snippets.

View dpfrakes's full-sized avatar

Dan Frakes dpfrakes

View GitHub Profile
@dpfrakes
dpfrakes / Dockerfile
Created August 16, 2024 21:40
Dockerfile for ROS2 Iron (ros-core)
# Use the official ros-core image for Ubuntu 24.04 (Iron release if available)
FROM ros:iron-ros-core
# Alternatively, you can use a previous LTS version if Iron is not available
# FROM ros:humble-ros-core
# Install any additional tools or dependencies you need
# RUN apt-get update && apt-get install -y \
# <additional-packages>
@dpfrakes
dpfrakes / os_check.sh
Last active August 16, 2024 21:23
Simple public shell script to run directly from terminal to check OS
#!/bin/bash
# Get the Ubuntu version number
os_version=$(lsb_release -sr)
# Function to install ROS 2 Humble (for Ubuntu 22.04)
install_ros_humble() {
echo "Installing ROS 2 Humble..."
sudo apt update && sudo apt install -y curl gnupg2 lsb-release
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key | sudo apt-key add -
@dpfrakes
dpfrakes / DTED_tileset.md
Last active March 14, 2024 18:22
Convert DTED to GeoTIFF for Mapbox tileset

Unzip DTED archive. This should contain one inner directory for every longitudinal band (e.g. w077).

Run the following script to convert to 8-bit GeoTIFF. Mapbox tilesets only support 8-bit.

# Convert all dt0 to GeoTIFF
for file in ../dtedlevel0/**/*.dt0; do
    output_file="./$(basename "$file" .dt0).tif"
    gdal_translate -of GTiff -ot Byte "$file" "$output_file"
done
const fs = require('fs');
const readline = require('readline');
const moment = require('moment-timezone');
readline.emitKeypressEvents(process.stdin);
process.stdin.setRawMode(true);
process.stdin.on('keypress', (str, key) => {
if (key.ctrl && key.name === 'c') {
process.exit();
} else {
@dpfrakes
dpfrakes / guide.md
Last active February 26, 2020 22:01
Python 2 and 3 on Mac

Python on Mac

Feb. 2020


DO NOT DELETE ANYTHING IN /System/Library/Frameworks/Python.framework/


Clean

@dpfrakes
dpfrakes / find_in_dict.py
Created October 15, 2019 16:37
Find key or value recursively in python dict
def find_k(data, target, spec=0):
result = ''
found = False
for k, v in data.items():
print(f'{"\t" * spec}{k}: {type(v)}')
if isinstance(v, dict):
search, found = find_k(v, target, spec+1)
result = f'{k} > {search}'
elif k == target:
found = True
a {
background: linear-gradient(90deg, blue 100%, blue 0);
background-position: center 85%;
background-size: 0 2px;
background-repeat: no-repeat;
transition: color 200ms ease-in-out, background 200ms linear;
padding-bottom: 0.5rem;
}
a:hover {
background-size: 100% 2px;

Kali Linux

Set up Kali Linux on Raspberry Pi 3

  1. Download Kali Linux image (for Raspberry Pi)
  2. Insert micro SD card
  3. Open [Disk Utility](/Applications/Utilities/Disk\ Utility.app)
  4. Erase and format as MS-DOS (FAT)

From the command line:

Keybase proof

I hereby claim:

  • I am dpfrakes on github.
  • I am dpfrakes (https://keybase.io/dpfrakes) on keybase.
  • I have a public key ASCE8olUpYws_jv2idRkQYxAouurKIe9t0GdgcZavmxsjAo

To claim this, I am signing this object:

@dpfrakes
dpfrakes / run_speedtest.py
Created March 8, 2019 06:35
Run speedtest and upload results to AWS DynamoDB
import boto3
import speedtest
from decimal import Decimal
# Initialize variables
s = speedtest.Speedtest()
s.get_best_server()
# Run tests
s.download()