Skip to content

Instantly share code, notes, and snippets.

View pythoninthegrass's full-sized avatar

pythoninthegrass

View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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"
@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 / 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 / sysctl.conf
Last active July 24, 2017 01:35
Fedora 25 on Raspberry Pi 3. Combination of swappiness, vfs cache pressure, libreswan compatible settings for VPN (ipsec), and network tuning per http://www.nateware.com/linux-network-tuning-for-2013.html
# sysctl settings are defined through files in
# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.
#
# Vendors settings live in /usr/lib/sysctl.d/.
# To override a whole file, create a new file with the same in
# /etc/sysctl.d/ and put new settings there. To override
# only specific settings, add a file with a lexically later
# name in /etc/sysctl.d/ and put new settings there.
#
# For more information, see sysctl.conf(5) and sysctl.d(5).
@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