This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"strconv" | |
) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// +build windows | |
package main | |
import ( | |
"bytes" | |
"fmt" | |
"syscall" | |
"unsafe" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
rem use -r to return strings without surrounding double-quotes | |
jq -r ".Buckets | .[] | .Name" s3.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"time" | |
awsNews "github.com/circa10a/go-aws-news" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |