Skip to content

Instantly share code, notes, and snippets.

View gpoole's full-sized avatar

Greg Poole gpoole

  • Sydney, AU
View GitHub Profile
@gpoole
gpoole / .gitattributes
Last active April 6, 2021 08:35
Standard Unity Git LFS include list
*.png filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text
*.dll filter=lfs diff=lfs merge=lfs -text
*.so filter=lfs diff=lfs merge=lfs -text
*.wav filter=lfs diff=lfs merge=lfs -text
*.mp4 filter=lfs diff=lfs merge=lfs -text
*.mkv filter=lfs diff=lfs merge=lfs -text
*.mov filter=lfs diff=lfs merge=lfs -text
*.fbx filter=lfs diff=lfs merge=lfs -text
*.obj filter=lfs diff=lfs merge=lfs -text
@gpoole
gpoole / .gitignore
Last active July 8, 2019 01:17
Standard Unity gitignore
[Ll]ibrary/
[Tt]emp/
[Oo]bj/
[Bb]uild/
[Bb]uilds/
[Ll]ogs/
[Aa]ssets/AssetStoreTools*
QCAR/
# Visual Studio cache directory
@gpoole
gpoole / encode-360-video.sh
Last active October 25, 2018 02:59
Encode 360 videos for Oculus Go
#!/bin/bash
ffmpeg -i $1 -vf scale=3840:2160,setdar=16:9 -c:v libx265 -preset slow -crf 28 -strict -2 -an $2
# Faster seeking:
# -x265-params "keyint=5:min-keyint=5"
{
"dependencies": {
"com.thinksquirrel.fluviofx": "https://github.com/thinksquirrel/fluviofx.git#bug/2019-support",
"com.unity.ads": "2.0.8",
"com.unity.analytics": "3.3.2",
"com.unity.collab-proxy": "1.2.16",
"com.unity.package-manager-ui": "2.1.2",
"com.unity.purchasing": "2.0.6",
"com.unity.render-pipelines.high-definition": "5.7.2-preview",
"com.unity.textmeshpro": "2.0.1",
@gpoole
gpoole / .zshrc
Created April 4, 2020 04:00
sensible-zshrc with custom prompt
# Sensible, short .zshrc
# Gist page: git.io/vSBRk
# Raw file: curl -L git.io/sensible-zshrc
# GNU and BSD (macOS) ls flags aren't compatible
ls --version &>/dev/null
if [ $? -eq 0 ]; then
lsflags="--color --group-directories-first -F"
else
lsflags="-GF"
@gpoole
gpoole / README.md
Last active April 5, 2025 14:14
Xen/XCP-ng script to attach physical USB devices via passthrough to a VM

XCP-ng USB passthrough tools

A set of command line tools and a service to make setting up passthrough USB devices easier:

  • add-custom-usb-policies - script to store and apply custom USB policies required for specific devices
  • attach-usb-devices - script and service to automatically connect USB devices to VMS when XCP-ng boots up
  • plug-usb - attach a physical USB device to a VM in one command
  • unplug-usb - remove a physical USB device from a VM in one command

To set up, copy the files onto your server and run install.sh to copy everything and set up the service.

@gpoole
gpoole / clean-unreferenced-files.ps1
Created July 6, 2020 00:55
Delete image files that don't have any name references in source files
function FindAny() {
param($name)
$found = Get-ChildItem . -Recurse -Include *.js, *.css, *.html, *.xml |
? { $_.FullName -notmatch "node_modules" -and $_.FullName -notmatch "bower_components" } |
Select-String $name
return ($found | Measure-Object -Line).Lines -gt 0;
}
Get-ChildItem "web\images" | ? { -Not (FindAny $_.Name) } | rm
@gpoole
gpoole / hide-facebook-distractions-tampermonkey.js
Last active November 1, 2020 11:08
Tampermonkey userscript to remove the Facebook feed and flashing notifications
// ==UserScript==
// @name Facebook distractions off
// @author gpoole
// @version 1.0
// @description Removes distracting, attention-grabbing features like the feed and notifications from Facebook
// @include /https?:\/\/www.facebook.com\/*/
// @noframes
// @run-at document-end
// @grant none
// ==/UserScript==
@gpoole
gpoole / tampermonkey-hide-youtube-comments.js
Last active September 2, 2024 01:55
🚨 OUTDATED AND BROKEN ON CURRENT DESIGN 🚨 Tampermonkey userscript to hide comments on YouTube with a toggle on/off button
// ==UserScript==
// @name Hide YouTube comments
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Hides YouTube comments.
// @author gpoole
// @match https://www.youtube.com/*
// @run-at document-end
// @grant none
// ==/UserScript==
@gpoole
gpoole / funkwhale-watch.service
Created April 17, 2021 02:54
Watch service for systemd running outside Funkwhale all-in-one container
[Unit]
Description=Funkwhale watch changes service
[Service]
Type=simple
ExecStart=docker exec -t funkwhale manage import_files <LIBRARY_ID> /music --watch --recursive --noinput --in-place
Restart=on-failure
[Install]
WantedBy=multi-user.target