Skip to content

Instantly share code, notes, and snippets.

View tjdahlke's full-sized avatar

TJ Dahlke tjdahlke

  • Rivian
  • Palo Alto, CA
View GitHub Profile
@tjdahlke
tjdahlke / iphone_photo_backup.sh
Last active June 13, 2023 17:56
iphone -> ubuntu photo backup script
# Make sure iphone is unlocked before running this script
# You will need to install the following on your ubuntu machine first:
# sudo apt install libimobiledevice6 libimobiledevice-utils ifuse
#
# Based off of: https://wuzhaojun.wordpress.com/2021/03/19/memo-of-backup-iphones-photos-in-ubuntu-20-04/
cd
# Pair
echo "Pairing iphone"
idevicepair pair
@tjdahlke
tjdahlke / track_memory.sh
Last active June 16, 2020 23:24
A bash script to easily capture memory usage on a linux machine.
# Usage:
# ./track_memory.sh 100
# Which will record the memory usage (in Mb) for 100 seconds
#!/bin/bash
x=1
free -h| grep free > memory.txt
while [ $x -le $1 ]
do
free -m | grep Mem: >> memory.txt
@tjdahlke
tjdahlke / BashRunMeExample.sh
Last active March 2, 2020 17:29
runMe to launch a command line executable (COLMAP) with docker and cmd line parameters, with logging saved and output using filenames that correspond to the parameters used.
cwd=$(pwd)
start=$SECONDS
suffix=".ply"
foo=$1
filePrefix=${foo%"$suffix"}
output="meshed-$filePrefix-depth$2-trim$3.ply"
outputLog="meshed-$filePrefix-depth$2-trim$3.log"
cmd="docker run -w /working -v $cwd:/working colmap/colmap:latest colmap poisson_mesher --PoissonMeshing.depth $2 --PoissonMeshing.trim $3 --input_path $1 --output_path $output"
@tjdahlke
tjdahlke / GoogleSatelliteDownloader.py
Last active March 19, 2018 17:52 — forked from eskriett/GoogleMapDownloader.py
A python script to download high resolution Google sattelite images given a longitude, latitude and zoom level.
#!/usr/bin/python
# GoogleMapDownloader.py
# Created by Hayden Eskriett [http://eskriett.com]
#
# A script which when given a longitude, latitude and zoom level downloads a
# high resolution google map
# Find the associated blog post at: http://blog.eskriett.com/2013/07/19/downloading-google-maps/
import urllib
from PIL import Image