Skip to content

Instantly share code, notes, and snippets.

View pythoninthegrass's full-sized avatar

pythoninthegrass

View GitHub Profile
@pythoninthegrass
pythoninthegrass / driverautomationtool.ps1
Created June 26, 2017 18:15
driverautomationtool.ps1 - Modified to pass UseBasicParsing parameter. See: http://www.scconfigmgr.com/2017/03/01/driver-automation-tool/
<#
.SYNOPSIS
Driver Automation GUI Tool for Dell,HP,Lenovo,Acer and Microsoft systems
.DESCRIPTION
This script allows you to automate the process of keeping your Dell, Lenovo
and HP drives packages up to date. The script reads the Dell, Lenovo and HP
SCCM driver pack site for models you have specified and then downloads
the corresponding latest driver packs and BIOS updates(Dell only).
.NOTES
FileName: DriverDownloadTool.ps1
@pythoninthegrass
pythoninthegrass / cloudSettings
Last active October 24, 2021 05:46
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-10-24T05:46:51.840Z","extensionVersion":"v3.4.3"}
@pythoninthegrass
pythoninthegrass / dscl_create_user
Last active May 11, 2017 16:46
create user on mac os x with dscl command
#!/usr/bin/env bash
# SOURCES:
# https://gist.github.com/rubytester/7330557
# http://stackoverflow.com/a/1923893
# Exit upon failed command
# set -e
@pythoninthegrass
pythoninthegrass / dscl_create_user
Created May 4, 2017 18:35
create user on mac os x with dscl command
# for pair programming setup a user on your machine
#INPUT
USERNAME="tmuxpair"
# COMPUTE
LATEST_ID=$(dscl . -list /Users UniqueID | awk '{print $2}' | sort -ug | tail -1)
USER_ID=$((LATEST_ID+1))
# CREATE with sudo
tap 'caskroom/cask'
tap 'homebrew/bundle'
tap 'homebrew/core'
tap 'homebrew/dupes'
brew 'arp-scan'
brew 'libnet'
brew 'arping'
brew 'bash-completion'
brew 'cheat'
brew 'curl', args: ['with-openssl']
for i in 3des-cbc aes128-cbc aes128-ctr aes128-gcm@openssh.com aes192-cbc aes192-ctr aes256-cbc aes256-ctr aes256-gcm@openssh.com arcfour arcfour128 arcfour256 blowfish-cbc cast128-cbc chacha20-poly1305@openssh.com rijndael-cbc@lysator.liu.se; do dd if=/dev/zero bs=1000000 count=1000 2> /dev/null | ssh -c $i localhost "(time -p cat) > /dev/null" 2>&1 | grep real | awk '{print "'$i': "1000 / $2" MB/s" }'; done
@pythoninthegrass
pythoninthegrass / remove_mcafee.sh
Last active October 29, 2020 22:18 — forked from mikedamm/gist:d0ef2291a3c4eecdc35a
Remove McAfee Agent and McAfee Endpoint Security for Mac
#!/usr/bin/env bash
# See McAfee KBs:
# https://kc.mcafee.com/corporate/index?page=content&id=KB88461 # Remove ENS for Mac (ENSM)
# https://kc.mcafee.com/corporate/index?page=content&id=KB61125 # Remove McAfee Agent
# Exit upon failed command
# set -e
@pythoninthegrass
pythoninthegrass / get_ip_address.sh
Created April 3, 2017 16:15
Taken from n8felton's setHostname.sh code. Very clever use of route, awk, and ipconfig getifaddr.
# Source: https://github.com/n8felton/Mac-OS-X-Scripts
# Find an active network interface
interface=$(route get 0.0.0.0 2>/dev/null | awk '/interface: / {print $2}')
# If ${interface} wasn't set, we probably don't have an internet connection
# Exit now because we're not going to talk to DNS like this.
if [[ -z "${interface}" ]]; then
exit 1
fi
@pythoninthegrass
pythoninthegrass / Set-ProfileForDocker.ps1
Last active January 10, 2021 05:50 — forked from sixeyed/Set-ProfileForDocker.ps1
PowerShell aliases for working with Docker on Windows - save to $profile. Ignore PoshGit and Chocolatey if neither is installed.
Rename-Item Function:\Prompt PoshGitPrompt -Force
function Prompt() {if(Test-Path Function:\PrePoshGitPrompt){++$global:poshScope; New-Item function:\script:Write-host -value "param([object] `$object, `$backgroundColor, `$foregroundColor, [switch] `$nonewline) " -Force | Out-Null;$private:p = PrePoshGitPrompt; if(--$global:poshScope -eq 0) {Remove-Item function:\Write-Host -Force}}PoshGitPrompt}
# Chocolatey profile
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path($ChocolateyProfile)) {
Import-Module "$ChocolateyProfile"
}
# Docker Module
#Security log
#============
####
#4624 - Logon & Logoff events successful
#4625 - Logon unsucceful
####
# Get usernames
Get-WinEvent -path .\Security.evtx | Where {$_.id -eq "4624"} | Foreach {([xml]$_.ToXml()).GetElementsByTagName("Data").ItemOf(5)}| Select -ExpandProperty "#text" -Unique
# Get domains