Skip to content

Instantly share code, notes, and snippets.

View pythoninthegrass's full-sized avatar

pythoninthegrass

View GitHub Profile
@pythoninthegrass
pythoninthegrass / docker-cleanup-resources.md
Created August 14, 2017 02:59 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@pythoninthegrass
pythoninthegrass / smb.sh
Last active January 24, 2025 09:53
Edited QNAP TS-453A /etc/init.d/smb.sh config to automatically generate a more performant /etc/config/smb,conf.
#!/bin/sh
# SOURCES:
# QNAP persistent smb.conf commands @ https://forum.qnap.com/viewtopic.php?t=132175
# Socket options @ https://calomel.org/samba_optimize.html
# Server multichannel support / AIO @ https://blog.chaospixel.com/linux/2016/09/samba-enable-smb-multichannel-support-on-linux.html
# Min receivefile, RW raw, AIO switched aio to 16384 @ https://superuser.com/a/928126
netbios_wrapper()
{
@pythoninthegrass
pythoninthegrass / baseBox.ps1
Last active December 10, 2017 00:34
Recreate Windows 10 box from thin image + chocolatey.
<#
# Sources:
https://github.com/JonCubed/boxstarter/blob/master/box.ps1
https://github.com/cdhunt/Boxstarter/blob/master/DevWorkstation.ps1
#>
# ENV Variables
#$Boxstarter.RebootOk=$true
#$Boxstarter.NoPassword=$false
#$Boxstarter.AutoLogin=$true
@pythoninthegrass
pythoninthegrass / baseNetworkSettings.ps1
Created December 4, 2017 02:28
Fresh PC: DNS, workgroup, and mapped shared drive.
# SOURCES:
# http://techgenix.com/using-powershell-add-computer-workgroup/
# https://www.howtogeek.com/132354/how-to-map-network-drives-using-powershell/
# DNS
$newDNSServers = "8.8.8.8","8.8.4.4"
# Get all network adapters that already have DNS servers set
$adapters = Get-WmiObject Win32_NetworkAdapterConfiguration | Where-Object {$_.DNSServerSearchOrder -ne $null}
# Set the DNS server search order for all of the previously-found adapters
$adapters | ForEach-Object {$_.SetDNSServerSearchOrder($newDNSServers)}
@pythoninthegrass
pythoninthegrass / .bash_aliases
Last active January 8, 2024 01:43
WSL Ubuntu .bashrc
export ASDF_DIR="$HOME/.asdf"
[[ -f "$ASDF_DIR/asdf.sh" ]] && . "$ASDF_DIR/asdf.sh"
[[ -f ~/.fzf.bash ]] && . ~/.fzf.bash
export BUN_INSTALL="$HOME/.bun"
export PATH=$BUN_INSTALL/bin:$PATH
lg() {
export LAZYGIT_NEW_DIR_FILE=~/.lazygit/newdir
@pythoninthegrass
pythoninthegrass / .bash_aliases
Created December 11, 2017 04:13
WSL Ubuntu .bash_aliases
# SOURCES:
# http://unix.stackexchange.com/a/122188
# https://natelandau.com/my-mac-osx-bash_profile
# https://jonsuh.com/blog/bash-command-line-shortcuts
# https://news.ycombinator.com/item?id=8159771
# .bashrc: https://gist.github.com/evdokimovm/67e4fcd938af98528aa108574626e522
# ---------------------------
# ETC
# ---------------------------
@pythoninthegrass
pythoninthegrass / gist:7b8ce5493369e828dc6680b06dc4666d
Last active December 22, 2017 22:46 — forked from chrissimpkins/gist:5bf5686bae86b8129bee
Atom Editor Cheat Sheet (Sweetmeat)

Use these rapid keyboard shortcuts to control the GitHub Atom text editor on Mac OSX.

Key to the Keys

  • ⌘ : Command key
  • ⌃ : Control key
  • ⌫ : Delete key
  • ← : Left arrow key
  • → : Right arrow key
  • ↑ : Up arrow key
@pythoninthegrass
pythoninthegrass / lazy-ssh-agent.sh
Created December 28, 2017 22:05 — forked from bseibold/lazy-ssh-agent.sh
Lazy Loading for ssh-agent keys. Loads default SSH identities on demand. Tested with bash and zsh.
function wrapssh() {
setopt shwordsplit &>/dev/null
# load agent if it's not running
if [ -z "$SSH_AUTH_SOCK" ]; then
eval $(ssh-agent) &>/dev/null
fi
# load keys if necessary
DO_ADD=0
@pythoninthegrass
pythoninthegrass / vbox-cli-manual.md
Created January 3, 2018 20:46 — forked from mortymacs/vbox-cli-manual.md
VirtualBox Useful Commands

Create vm

VBoxManage createvm --name "Debian 9" --register

Modify vm

VBoxManage modifyvm "Debian 9" --memory 1024
@pythoninthegrass
pythoninthegrass / vbox_cli.md
Last active January 3, 2018 23:42 — forked from Driste/vbox_cli.md
VBox CLI

VirtualBox CLI

Installation

Mac

brew cask install virtualbox virtualbox-extension-pack

Linux

Linux Download