Skip to content

Instantly share code, notes, and snippets.

@jftuga
jftuga / rows_cols.go
Created Mar 13, 2019
two dimensional slice in Go
View rows_cols.go
package main
import (
"fmt"
"os"
"strconv"
)
@jftuga
jftuga / add.reg
Last active Mar 16, 2019
Add command to Windows context menu
View add.reg
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]
View getDNSInfo.go
// +build windows
package main
import (
"bytes"
"fmt"
"syscall"
"unsafe"
)
@jftuga
jftuga / bufWrite.go
Created Sep 9, 2019
demonstrates how to either write to STDOUT or to a buffer in golang
View bufWrite.go
// 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 Sep 19, 2020
May 2020 Chocolatey installed packages and VSCode extensions
View chocolateyInstalls_and_VSCodeExtensions.md

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 Dec 31, 2019
Quick jq example
View getNames.bat
@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 Jan 12, 2020
Fixed version of go-aws-new.go
View go-aws-new.go
package main
import (
"fmt"
"log"
"time"
awsNews "github.com/circa10a/go-aws-news"
)
func main() {
View Remove_PDF_Pages.ps1
<#
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
Raspberry Pi backup script
View make_backup.sh
#!/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 Oct 13, 2020
Retrieve Active Directory Contacts Belonging to a Group
View active_directory_contacts.cs
/*
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;