Skip to content

Instantly share code, notes, and snippets.

@jftuga
jftuga / create_scheduled_task.ps1
Created July 17, 2020 11:43
How to create a Scheduled Task with PowerShell
# This task will run once per day at 9AM, only on week days
$A = New-ScheduledTaskAction -Execute "c:\scripts\my_project\scheduled_task.bat" -WorkingDirectory "c:\scripts\my_project"
$T = New-ScheduledTaskTrigger -At 9am -Weekly -DaysofWeek Monday,Tuesday,Wednesday,Thursday,Friday
$P = New-ScheduledTaskPrincipal -UserId "LOCALSERVICE" -LogonType ServiceAccount
$S = New-ScheduledTaskSettingsSet
$D = New-ScheduledTask -Action $A -Principal $P -Trigger $T -Settings $S
Register-ScheduledTask "My Project" -InputObject $D
@jftuga
jftuga / ec2info.bat
Last active July 19, 2020 14:03
ec2info: retrieve all EC2 instance type info such as vCPU, clock speed, memory, network
@echo off
setlocal
rem ec2info.bat
rem -John Taylor
rem Jul-19-2020
rem Retrieve all EC2 instance type info such as vCPU, clock speed, memory, network
rem Save results to a tab separated file, named 'ec2_types.tsv'
rem Note: the 'RAM in GB' column is rounded to the nearest whole number
#!/bin/bash
# ec2info.sh
# -John Taylor
# Aug-03-2020
# Retrieve EC2 instance type info such as vCPU, clock speed, memory, network
# This queries your default AWS region
# Results are saved to the user-defined file name: $TSV and also to the MacOS clipboard
# Note: the 'RAM in GB' column is rounded to the nearest whole number
@jftuga
jftuga / update_pihole_block_lists.sh
Created August 15, 2020 11:40
Update block lists in a dockerized version of PiHole
#!/bin/bash
# Update block lists in a dockerized version of PiHole
# the log file should be: update_pihole_block_lists.log
#
# run this script from cron each Saturday morning with this contab entry:
# 00 3 * * 6 /root/update_pihole_block_lists.sh
IMAGE=pihole
LENGTH=12
@jftuga
jftuga / macapp.go
Last active December 8, 2020 12:33 — forked from mholt/macapp.go
Distribute your Go program (or any single binary) as a native macOS application
// Package main is a sample macOS-app-bundling program to demonstrate how to
// automate the process described in this tutorial:
//
// https://medium.com/@mattholt/packaging-a-go-application-for-macos-f7084b00f6b5
//
// Bundling the .app is the first thing it does, and creating the DMG is the
// second. Making the DMG is optional, and is only done if you provide
// the template DMG file, which you have to create beforehand.
//
// Example use:
@jftuga
jftuga / go-os-arch.md
Created December 4, 2020 19:07 — forked from asukakenji/0-go-os-arch.md
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.14.7 darwin/amd64.

A list of valid GOOS values

(Bold = supported by go out of the box, ie. without the help of a C compiler, etc.)

  • aix
  • android
@jftuga
jftuga / macbook.md
Last active February 22, 2022 20:40
MacBook Config

Big Sur

App Store

  • SetApp
  • Speedtest
  • WiFi Explorer
  • Xcode

Other Apps

  • Cisco VPN Client
@jftuga
jftuga / input.txt
Last active December 12, 2020 00:13
Zebra .elp2 files
A329,349,0,1,1,1,N,"REF: 3717559625"
A39,363,0,1,1,1,N,"INV: "
A39,377,0,1,1,1,N,"PO: "
A429,377,0,1,1,1,N,"DEPT: "
A329,349,0,1,1,1,N,"REF: 2222222333"
A39,363,0,1,1,1,N,"INV: "
A39,377,0,1,1,1,N,"PO: "
A429,377,0,1,1,1,N,"DEPT: "
@jftuga
jftuga / enable_clearpass.bat
Created January 26, 2021 20:50
Enabling Aruba ClearPass on a switch port
@echo off
setlocal
set PORT=%1
if not defined PORT goto ERR
@echo conf t
@echo vlan 1 untag %PORT%
@echo no port-security %PORT%
@echo aaa port-access authenticator %PORT% client-limit 1
@jftuga
jftuga / MyViewController.cs
Created January 28, 2021 20:39 — forked from ShayMe21/MyViewController.cs
Xamarin with Auth0 and TouchID Authentication
// https://github.com/auth0-community/auth0-xamarin-oidc-samples/tree/master/Quickstart/01-Login/iOS
using System;
using UIKit;
using Auth0.OidcClient;
using System.Text;
using LocalAuthentication;
using Foundation;
using Xamarin.Auth;