Skip to content

Instantly share code, notes, and snippets.

@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" {}
@nathanpc
nathanpc / ndi-tools.md
Last active June 11, 2022 10:20
NDI Tools Direct Links for Download
@nathanpc
nathanpc / Ruby-StyleGuide.md
Last active September 21, 2018 21:03
Ruby Style Guide (Innove Workshop Company)

Ruby Style Guide

This style guide is based on the one used by GitHub, but with some changes that make the code a tiny bit more readable.

  • Use soft-tabs with a two space indent.

  • Keep each line of code to a readable length. Unless you have a reason to, keep lines to fewer than 100 characters.

  • Never leave trailing whitespace.