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'"
#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
@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
@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 / 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
@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 / osx_sanity_check.sh
Last active September 12, 2020 15:17
Mac Setup
#!/usr/bin/env bash
# SOURCES:
# https://gist.github.com/DylanTackoor/7a04052cfc3a726d9af6f798875189fc
# https://github.com/timsutton/osx-vm-templates/blob/ce8df8a7468faa7c5312444ece1b977c1b2f77a4/scripts/xcode-cli-tools.sh
# https://github.com/mathiasbynens/dotfiles/blob/master/.macos
# Exit upon failed command
# set -e
@pythoninthegrass
pythoninthegrass / Dockerfile
Created August 2, 2017 05:58 — forked from renzok/Dockerfile
docker: mapping host uid and gid to user inisde container
FROM debian:jessie
ENV USER=boatswain USER_ID=1000 USER_GID=1000
# now creating user
RUN groupadd --gid "${USER_GID}" "${USER}" && \
useradd \
--uid ${USER_ID} \
--gid ${USER_GID} \
--create-home \
@pythoninthegrass
pythoninthegrass / .gitconfig
Last active May 2, 2020 18:20 — forked from VonC/.gitconfig
My global git config
[filter "lfs"]
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
[user]
name = first last
email = address
[github]
user = username
@pythoninthegrass
pythoninthegrass / Microsoft.PowerShell_profile.ps1
Last active August 11, 2017 16:28 — forked from cloudRoutine/Microsoft.PowerShell_profile.ps1
Powershell Profile for use with Cmder
<#
# ┌ ┐
# sources
# └ ┘
https://gist.github.com/cloudRoutine/87c17655405cd8b1eac7
https://gist.github.com/furzeface (not sure where profile.ps1 URL disappeared to)
#>
# If this script is throwing an error near a Unicode symbol try resaving the file as UTF-8 with BOM
$psmodules = ";~\Documents\WindowsPowerShell\Modules"