Skip to content

Instantly share code, notes, and snippets.

View pythoninthegrass's full-sized avatar

pythoninthegrass

View GitHub Profile
@pythoninthegrass
pythoninthegrass / logparser.ps1
Created March 24, 2017 17:27 — forked from exp0se/logparser.ps1
Logparser log parsing
# Logparser
###############
# Security Log
###############
# Find Event id
& 'C:\Program Files (x86)\Log Parser 2.2\LogParser.exe' -stats:OFF -i:EVT "SELECT * FROM 'Security.evtx' WHERE EventID = '5038'"
# commit docker image (container then repo/image:tag)
docker commit centos jollygoodhorsepower/centos-ps:latest
# stop all containers:
docker kill $(docker ps -q)
# remove all containers
docker rm $(docker ps -a -q)
# remove all docker images
@pythoninthegrass
pythoninthegrass / wsus_client.ps1
Created January 11, 2017 23:49 — forked from trodemaster/wsus_client.ps1
Register Windows Server 2012 r2 to wsus server via registry keys
New-Item -Path "HKLM:Software\Policies\Microsoft\Windows\WindowsUpdate"
New-Item -Path "HKLM:Software\Policies\Microsoft\Windows\WindowsUpdate\AU"
Set-ItemProperty -Path "HKLM:\software\policies\Microsoft\Windows\WindowsUpdate" -Name WUServer -Value "http://wsus.domain.com:8530" -Type String -force
Set-ItemProperty -Path "HKLM:\software\policies\Microsoft\Windows\WindowsUpdate" -Name WUStatusServer -Value "http://wsus.domain.co:8530" -Type String -force
Set-ItemProperty -Path "HKLM:\software\policies\Microsoft\Windows\WindowsUpdate\AU" -Name UseWUServer -Value "1" -Type DWORD -force
#!/bin/bash
# Fedora64 Ubuntu64 Ubuntu32 Fedora32
OS='Ubuntu64'
DEB=('Ubuntu' 'elementary OS' 'Lubuntu')
RPM=('Fedora' 'Centos')
DIST='Lubuntu'
SCRAPELINK='https://plex.tv/downloads?channel=plexpass'
SCRAPESTR='data-event-action="Linux" data-event-category="Download-Media-Server'
declare -A array
declare $(curl -sk $SCRAPELINK |grep -i "$SCRAPESTR" | awk 'BEGIN { FS = "\"" } { print "array["$10"]="$2""}')
#! /bin/bash
#script to change all desktop backgrounds
echo -n “Drag and drop an image file here then press ‘return’ or
press ‘control-c’ to cancel…”
read -e WLPR;
function change_wallpaper
{
defaults write com.apple.desktop Background “{default = {ImageFilePath=’$WLPR’; };}”; killall Dock
}
change_wallpaper
#!/bin/bash
# ¯\_(ツ)_/¯
REMOVE_PATHS=( "/Applications/Microsoft Office 2011/" \
"/Library/Preferences/com.microsoft.office.licensing.plist" \
"/Library/LaunchDaemons/com.microsoft.office.licensing.helper.plist" \
"/Library/PrivlegedHelperTools/com.microsoft.office.licensing.helper" \
#"/Users/*/Library/Application Support/Microsoft/Office/" \
#"/Users/*/Library/Preferences/com.microsoft*" \
#"/Users/*/Library/Preferences/ByHost/com.microsoft*" \
@pythoninthegrass
pythoninthegrass / cask_gist.txt
Last active May 2, 2020 18:17 — forked from jitendravyas/gist:8d35b092dd9102a05ea3
Brew Cask installation with Laptop script
#!/bin/sh
# homebrew taps
brew tap caskroom/cask
brew tap caskroom/versions
brew tap homebrew/boneyard
brew tap caskroom/fonts
# Updated grep
@pythoninthegrass
pythoninthegrass / Rsync Backup to Network Share on OS X
Created October 3, 2016 16:36
Painfully constructed rsync switches and exclusions to backup to an SMB share from a local drive.
# SMB Mounted in /Volumes
## Rsync to \\network-share
rsync -aPW -r --progress --exclude='.DocumentRevisio*' --exclude='.Spotlight*' /Volumes/Mac/Backups.backupdb /Volumes/Time-Machine-Backups/
## Copy to external HDD
rsync -aPW -r --progress --exclude='.DocumentRevisio*' --exclude='.Spotlight*' /Volumes/My\ Passport /Volumes/Mac/
## Verify transfer
diff <( tree /Volumes/My\ Passport/ ) <( tree /Volumes/Mac )
@pythoninthegrass
pythoninthegrass / Documentation.md
Created September 6, 2016 23:49 — forked from KartikTalwar/Documentation.md
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
# Finally able to keep a main configuration that transfers across computers.