Skip to content

Instantly share code, notes, and snippets.

@nathanpc
nathanpc / build-timelapse.sh
Created July 11, 2024 10:34
Build a timelapse video from sequences of images from a GoPro camera
#!/bin/bash
## build-timelapse.sh
## Builds a timelapse video from sequences of images from a GoPro camera.
##
## Author: Nathan Campos <nathan@innoveworkshop.com>
# Go through directories building videos from them.
echo "Generating a timelapse for each folder created by the camera..."
index=0
for dir in *; do
@nathanpc
nathanpc / Clean-GPS-Power.js
Created April 19, 2024 08:31
A UserScript to clean up the GPS Power forum pages
// ==UserScript==
// @name Clean-GPS-Power
// @description Removes all of the garbage that is in the GPS Power forum pages.
// @match https://www.gpspower.net/*
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// ==/UserScript==
/**
* Deletes an element from the page if it is found.
*
@nathanpc
nathanpc / Reset-DnsLocalAddresses.ps1
Last active October 8, 2023 09:32
Script to update the local DNS records based on the DHCP server reservations
# Reset-DnsLocalAddresses
# Clears and repopulates the automatically managed DNS entries in the server.
#
# Author: Nathan Campos <nathan@innoveworkshop.com>
# Parameters.
[String]$ZoneName = "something.lan"
[IPAddress]$DhcpScope = 192.168.1.0
Function Get-DhcpReservations {
@nathanpc
nathanpc / rsync-buddy.md
Created September 30, 2023 09:42
Transfer a large collection of files between two hosts

Rsync Wrapper

If you wish to transfer a large number of big files between two hosts and have had issues with rsync stability in the past. Then just call it with these arguments and also wrapped in a nice retry loop:

RC=1; while [[ $RC -ne 0 ]]; do rsync -avP --progress local/ remote.server:/somewhere; RC=$?; sleep 1; done
@nathanpc
nathanpc / fix-itermcolors.pl
Created August 1, 2023 11:48
Converts an iTerm2 color profile made for newer versions of iTerm to work in iTerm2 version 2.0 for OS X Leopard.
#!/usr/bin/env perl
### fix-itermcolors.pl
### Converts an iTerm2 color profile made for newer versions of iTerm to work
### in iTerm2 version 2.0 for OS X Leopard.
###
### Author: Nathan Campos <nathan@innoveworkshop.com>
use strict;
use warnings;
@nathanpc
nathanpc / windows_and_office_kms_setup.adoc
Created March 27, 2023 17:47 — forked from jerodg/windows_and_office_kms_setup.adoc
Activate Windows and Office Using KMS Server

Microsoft Windows and Office KMS Setup

@nathanpc
nathanpc / settings.json
Last active August 29, 2023 19:35
Windows Terminal Settings
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command":
{
"action": "copy",
"singleLine": false
@nathanpc
nathanpc / open-close.js
Created August 25, 2022 12:45
Simple store open/closed indicator
/**
* open-close.js
* Dynamic display of a store open state.
*
* @author Nathan Campos <nathan@innoveworkshop.com>
*/
// ==== Week Day Codes ====
// Domingo 0
// Segunda 1
@nathanpc
nathanpc / RenderCameraSwitcher.cs
Created June 7, 2022 00:15
Switch Unity Render Camera for Video Mapping
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// Switches the camera automatically depending on the scene required.
/// </summary>
public class RenderCameraSwitcher : MonoBehaviour {
public RenderTexture renderTexture;
protected Camera lastCamera;
@nathanpc
nathanpc / TextureTransformation.shader
Created June 6, 2022 12:28
Transform Textures in Unity
// TextureTransformation.shader
// A simple shader that allows us to transition between two textures from a script.
//
// Author: Nathan Campos <nathan@innoveworkshop.com>
Shader "Custom/TextureTransformation" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Original Texture", 2D) = "white" {}
_TransTex("Transformed Texture", 2D) = "gray" {}