Skip to content

Instantly share code, notes, and snippets.

View pythoninthegrass's full-sized avatar

pythoninthegrass

View GitHub Profile
@pythoninthegrass
pythoninthegrass / profile.ps1
Created January 17, 2018 00:22
PowerShell Profile
<#
# ┌ ┐
# 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"
@pythoninthegrass
pythoninthegrass / .hyper.js
Created February 5, 2018 03:58
Windows Hyper config
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// Choose either "stable" for receiving highly polished,
// or "canary" for less polished but more frequent updates
updateChannel: 'stable',
@pythoninthegrass
pythoninthegrass / backup-all-docker-images.sh
Created March 12, 2018 02:18 — forked from jrenggli/backup-all-docker-images.sh
Backup/Save all Docker Images to a compressed file
docker images | tail -n +2 | grep -v "none" | awk '{printf("%s:%s\n", $1, $2)}' | while read IMAGE; do
echo $IMAGE
filename="${IMAGE//\//-}"
filename="${filename//:/-}.docker-image.gz"
docker save ${IMAGE} | pigz --stdout --best > $filename
done
@pythoninthegrass
pythoninthegrass / backup_all_docker_images.sh
Last active January 11, 2023 04:58 — forked from dieterrosch/backup_all_docker_images.sh
A bash script to backup all docker images to files
#!/usr/bin/env bash
if [[ $# -eq 0 ]]; then
echo "Usage: $0 <backup_dir>"
exit
fi
destination=$1
if ! type "pv" > /dev/null; then
echo 'pv' command not found on your system, install it to get a nice progress indicator...
else
@pythoninthegrass
pythoninthegrass / uninstall_mso.sh
Last active April 22, 2025 14:38 — forked from pirafrank/uninstall_office_2016.sh
Uninstall Microsoft Office from macOS completely
#!/usr/bin/env bash
# SOURCES:
# https://gist.github.com/pirafrank/18d62c062e2806c1d183
# SEE THIS EXCELLENT SITE IF GIST FAILS:
# https://office-reset.com
# activate verbose standard output (stdout)
set -v
@pythoninthegrass
pythoninthegrass / remove_drivers.ps1
Last active April 24, 2018 17:55 — forked from jonman364/RemoveDrivers.ps1
Remove all OEM drivers from an offline image
$image = “D:\Windows\System32\DriverStore\FileRepository” # may just need mounted Windows root dir (e.g., "D:\")
$dism = dism /image:$image /get-drivers
ForEach($line in $dism){
If($line -like “Published Name*”){
$sp = ($line -split “ “)
$oem = $sp[3]
Dism /image:$image /Remove-Driver /Driver:$oem # /Recurse
}
}
@pythoninthegrass
pythoninthegrass / install_mosh_centos7.sh
Created May 25, 2018 23:10
Install mosh on CentOS 7
#!/usr/bin/env bash
# SOURCE: https://eligiblestore.com/blog/2017/05/02/how-to-install-mosh-on-centos/
# ensure running as root
if [[ "$(id -u)" != "0" ]]; then
exec sudo "$0" "$@"
fi
# install mosh
yum install -y epel-release
@pythoninthegrass
pythoninthegrass / WindowsUpdateAgentReset.ps1
Last active July 9, 2018 23:08 — forked from dotps1/WindowsUpdateAgentReset.ps1
Resets the Windows Update Agent components.
<#
.SYNOPSIS
Resets the requried components of the Windows Update Agent.
.DESCRIPTION
Stops required services.
Removes cached files/folders used by the Windows Update Agent.
Resets the permissions on the bits and wuauserv services.
Registers dlls needed by the bits/Windows Update Agent.
Removes lingering registry entries from SUS if present.
Restarts all the services that where stopped.
@pythoninthegrass
pythoninthegrass / macosx_bootstrap.sh
Created August 5, 2018 23:49 — forked from fnichol/macosx_bootstrap.sh
Mac OS X 10.7/10.8/10.9 (Lion/Mountain Lion/Mavericks) Bootstrapping
#!/usr/bin/env bash
set -e
# # Mac OS X 10.7/10.8/10.9/10.10 Bootstrapping
#
# ## Pre-requisites
#
# 1. Set your hostname: In **System Preferences** go to **Sharing** and enter
# the name in **Computer Name**
# 2. Run **Software Update** and reboot if necessary
@pythoninthegrass
pythoninthegrass / remove_chef
Last active October 19, 2018 22:02 — forked from kwilczynski/gist:491227d9813702e18151
Remove Chef Server
#!/usr/bin/env bash
chef-server-ctl stop
chef-server-ctl kill
chef-server-ctl cleanse
chef-server-ctl uninstall
pkill -9 -u opscode
pkill -9 -f postgres
pkill -9 -f beam
pkill -9 -f /opt/chef