Skip to content

Instantly share code, notes, and snippets.

Telstra call forwarding unconditional:
Dial:
**21*[phone number]*10#
Press call
Turn off call forwarding unconditional:
Dial:
##21#
Press call
@daz
daz / fcp-consolidate-tips.md
Last active July 16, 2023 07:47
FCP Consolidate tips

If you're having issues with FCP not consolidating a library, you can recursively search the library for files that are aliases, and are linking to certain directory or volume.

This will find anything in the home directory, ~/Desktop, ~/Documents, etc

cd "~/Movies/My Library.fcpbundle"
find . -type l -ls | grep /Users/darren/

This will find anything linked that's on the volume "14TB"

cd "~/Movies/My Library.fcpbundle"

@daz
daz / fusion360-open-or-switch-to.sh
Created April 11, 2023 11:00
Open or switch to Fusion360
#!/bin/bash
# This will switch to Fusion 360 if it is running, or open it if it is not running.
#
# Fusion360 on Mac opens from the path "~/Applications/Autodesk Fusion 360.app"
# but it's essentially an alias and it runs as
# "~/Library/Application Support/Autodesk/webdeploy/production/{hash}/Autodesk Fusion 360.app"
# The hash, and therefore the path, changes with each update, so you can get
# double instances if it updates while running and you try to switch to it.
@daz
daz / gist:477190328f5f20121c26c42ef8fbedbc
Created September 23, 2022 09:10
Upgrading postgresql 12 to 14 homebrew with postgis
brew install postgresql
brew services stop postgresql
pg_upgrade --old-bindir=/opt/homebrew/opt/postgresql@12/bin \
--new-bindir=/opt/homebrew/opt/postgresql@14/bin \
--old-datadir=/opt/homebrew/var/postgresql@12 \
--new-datadir=/opt/homebrew/var/postgres \
--check
# If you're getting non-empty database errors for the new database, rename the directory to a backup and init a new db:
@daz
daz / organize-h20t.rb
Last active September 2, 2022 03:02
Organize DJI H20T images into folders
#!/usr/bin/env ruby
# organize-h20t.rb [files]
# https://gist.github.com/daz/9c214125341ce7a3dc3909a1126297c8
# Organize H20T images, videos, and captions into folders by camera types, i.e. S, T, W, Z
# Creates a folder for each camera type, and moves the files into their respective folder
# Usage:
# cd DJI_202208071450_002
# ./organize-h20t.rb DJI_20220807145439_0001_S.MP4 DJI_20220807145439_0001_T.MP4 DJI_20220807145439_0001_W.MP4 DJI_20220807145439_0001_Z.MP4
@daz
daz / 360-photo-facebook.sh
Last active January 14, 2024 14:36
Prepare 360 photo for Facebook with max resolution
#!/bin/sh
# Resizes any equirectangular image down to the max resolution and file size
# that Facebook will allow and adds 360 metadata. Saves copy with _fb appended
# to file name.
#
# Usage:
# ./360-photo-facebook.sh equirectangular_360_image.jpg
# Max settings, working June 2023
@daz
daz / is-inside.js
Created March 8, 2022 13:41
Check if images are inside a polygon
#!/usr/bin/env node
// Example usage:
//
// ./is-inside.js base/path/to/images -21,149 -21.1,152 -24,152.2 -24.1,148.9
import glob from "glob";
import * as fs from "fs";
import * as path from "path";
import * as turf from "@turf/turf";
@daz
daz / setup-unifi-macos.sh
Created October 29, 2021 16:37 — forked from mkormendy/setup-unifi-macos.sh
UniFi Network Controller Setup for MacOS with Homebrew
#!/bin/sh
brew tap homebrew/cask-drivers
brew install --cask homebrew/cask-versions/adoptopenjdk8
brew install --cask ubiquiti-unifi-controller
@daz
daz / hikvision-anpr.sh
Created March 12, 2021 11:21
Hikvision ANPR ISAPI list with curl
curl --digest -u username:password \
-X POST http://192.168.1.4/ISAPI/Traffic/channels/1/vehicleDetect/plates \
-d '<AfterTime><picTime>2020-03-07T21:00:00Z</picTime></AfterTime>'
@daz
daz / airdata-flights.js
Created October 23, 2020 07:43
Download all Airdata flights
// Get a list of all Airdata flight download URLs in KML, GPX, CSV, original format.
// Go to https://app.airdata.com/flight/last and paste this into the console
let urlList = $("#item_list_dt")
.DataTable()
.tables()
.context[0].aoData.map(a => {
return a._aData.h;
})
.slice(1, -1)