Skip to content

Instantly share code, notes, and snippets.

@Nateowami
Nateowami / pin.js
Created June 15, 2015 06:08
PIN Generator
// Released into the public domain
// Set this to the number of digits you want in your PIN
var pinDigits = 4;
var pin = "";
function random(){
return Math.floor(Math.random()*10);
}
@Nateowami
Nateowami / README.md
Last active May 6, 2023 14:59
Auto-Sync with Unison
Summery

This is a simple script for syncing Unison profiles. Basically, given a list of profiles (which must already be created in Unison), it will sync all files with non-conflicting states. It logs the time of start and completion to unison.log (change OUTPUT=$HOME/unison.log if you want it to output somewhere else), as well as listing the output Unison gives for each sync. Unison already knows the hosts to sync, because that's recorded by Unison in the profiles it stores in ~/.unison. And you'll need SSH keys already setup.

Automating

If you want to automate this script in Ubuntu, search the dash for "Startup Applications" and open it up, then click on "add" in the window that opens. You'll be prompted for a name and command. Name it anything you like and make the command the path to the script, e.g. `~/scr