Skip to content

Instantly share code, notes, and snippets.

@jftuga
jftuga / rows_cols.go
Created March 13, 2019 00:13
two dimensional slice in Go
package main
import (
"fmt"
"os"
"strconv"
)
@jftuga
jftuga / add.reg
Last active March 16, 2019 01:38
Add command to Windows context menu
Windows Registry Editor Version 5.00
; https://www.reddit.com/r/PowerShell/comments/b1ew3f/is_there_a_way_to_create_an_explorer_shell/?
[HKEY_CLASSES_ROOT\.rmt]
[HKEY_CLASSES_ROOT\.rmt\shell]
[HKEY_CLASSES_ROOT\.rmt\shell\Posted]
@jftuga
jftuga / getDNSInfo.go
Created August 6, 2019 10:33
getDNSInfo.go
// +build windows
package main
import (
"bytes"
"fmt"
"syscall"
"unsafe"
)
@jftuga
jftuga / bufWrite.go
Created September 9, 2019 09:18
demonstrates how to either write to STDOUT or to a buffer in golang
// demonstrates how to either write to STDOUT or to a buffer
package main
import (
"bufio"
"fmt"
"os"
)
@jftuga
jftuga / chocolateyInstalls_and_VSCodeExtensions.md
Last active December 5, 2021 17:00
May 2020 Chocolatey installed packages and VSCode extensions

Chocolatey Notes

Install a package

choco install [package] -a (use -a or -y to install without any prompts)

Non-interactive configuration

choco feature enable -n allowGlobalConfirmation (sets global default to not prompt, assume yes)

@jftuga
jftuga / getNames.bat
Created December 31, 2019 15:00
Quick jq example
@echo off
rem use -r to return strings without surrounding double-quotes
jq -r ".Buckets | .[] | .Name" s3.json
@jftuga
jftuga / go-aws-new.go
Created January 12, 2020 05:00
Fixed version of go-aws-new.go
package main
import (
"fmt"
"log"
"time"
awsNews "github.com/circa10a/go-aws-news"
)
func main() {
@jftuga
jftuga / Remove_PDF_Pages.ps1
Created February 21, 2020 00:52
Remove PDF Pages
<#
Remove_PDF_Pages
-John Taylor
Jan-7-2020
This is a simple, GUI frontend to pdfcpu.
https://github.com/pdfcpu/pdfcpu
The resulting PDF will have the filename appended with "--RemovedPages.pdf"
#>
@jftuga
jftuga / make_backup.sh
Last active May 19, 2020 17:21
Raspberry Pi backup script
#!/bin/bash
# Side note:
# for better performance append to /etc/sysctl.conf (and then reboot)
# vm.vfs_cache_pressure = 50
# vm.swappiness = 10
# vm.dirty_writeback_centisecs = 1500
# location of backups
BASE="/data/backups"
@jftuga
jftuga / active_directory_contacts.cs
Last active October 13, 2020 02:31
Retrieve Active Directory Contacts Belonging to a Group
/*
Given an AD group name, return all of the AD Contacts that belong to that group
Return a list of strings in this format:
CN Name|Email Address
*/
using System.DirectoryServices;