Skip to content

Instantly share code, notes, and snippets.

@rca
rca / Decrapifier.ps1
Created May 4, 2021 15:36 — forked from gvlx/Windows 10 Decrapifier, 1803_1809.ps1
Windows 10 Decrapifier
#Windows 10 Decrapifier 18XX/19XX
#By CSAND
#Mar 01 2021
#
#
#PURPOSE: Eliminate much of the bloat that comes with Windows 10. Change many privacy settings to be off by default. Remove built-in advertising, Cortana, OneDrive, Cortana stuff (all optional). Disable some data collection.
# Clean up the start menu for new user accounts. Remove a bunch of pre-installed apps, or all of them (including the store). Create a more professional looking W10 experience. Changes some settings no longer
# available via GPO for Professional edition. All of this without breaking Windows.
#
#DISCLAIMER: Most of the changes are easily undone, but some like removing the store are difficult to undo. You should use local/group policy to remove the store if you want.
@rca
rca / zfs_install.sh
Last active December 13, 2020 18:23 — forked from Alexey-Tsarev/zfs_install.sh
ZFS 0.8 at Raspberry Pi
#!/usr/bin/env sh
set -e
set -x
ZFS_RELEASE=zfs-2.0-release
# keep track of the current directory
CUR_PWD="$(pwd)"
@rca
rca / PythonOnMac.md
Created January 27, 2020 20:42
Setting up Pyhon on a Mac

Installing Python3 on a Mac

Getting a sane Python3 runtime on a Mac can be tedious. The most painless way I have found thus far installing a Python3 package from python.org and, from there, installing two additional packages into the system directory: pip and pipx.

Install Python

Install Python with a package from python.org. This post uses 3.6.8: https://www.python.org/downloads/release/python-368/

At this point, close the current shell and launch a new shell. This will ensure you have Python 3.6 in your PATH; you should see something similar to:

@rca
rca / README.md
Last active February 25, 2022 05:33
An explanation of `git rebase --onto`

git rebase onto fu

Looking at the following git history, there are a few commits that were accidentally made on top of env/dev-auth that should be on a feature branch named experiments/sso-login-app (1. in the command below):

[0][~/Projects/openslate/thing(env/dev-auth:feb0ee9)]
$ git log
commit feb0ee98c8b77e929b9cc23442c5664c9d4986c9 (HEAD -> env/dev-auth)  # this is `0.` in the command below
Author: Roberto Aguilar <roberto@openslate.com>
Date:   Thu Sep 26 00:25:15 2019 -0400
@rca
rca / vault-env
Created August 29, 2019 18:26
Converts key/value pairs returned by a vault command into environment variables
#!/usr/bin/env python3.6
"""
Converts key/value pairs returned by a vault command into environment variables
"""
import json
import sys
KEY_MAP = {
'access_key': 'AWS_ACCESS_KEY_ID',
'secret_key': 'AWS_SECRET_ACCESS_KEY',
@rca
rca / flush_dns
Created February 5, 2019 15:44
Flushes local DNS cache on MacOS X
#!/bin/bash
set -e
sudo killall -HUP mDNSResponder
@rca
rca / rancher-exec
Created January 25, 2019 16:01
Execute a command within a container running in Rancher k8s
#!/bin/bash
set -e
set -x
SCRIPT_NAME=$(basename $0)
if [ -z "$4" ]; then
echo "${SCRIPT_NAME} <env> <namespace> <pod name> <command> [args]" 1>&2
exit 1
fi;
class Foo:
def __init__(self, x=[]):
self.x = x
f = Foo()
f.x.append(1)
@rca
rca / docker-service-ports
Created March 21, 2018 16:14
Script to list service ports and get next available port
#!/usr/bin/env python3.6
import argparse
import logging
import re
import shlex
import sh
PORT_RE = re.compile(r':(?P<port>\d+)->')
@rca
rca / docker-networks
Last active July 13, 2018 17:04
Lists all docker networks sorted by their subnet address
#!/usr/bin/env xonsh
import json
import re
import sys
from tabulate import tabulate
# https://arcpy.wordpress.com/2012/05/11/sorting-alphanumeric-strings-in-python/
# https://stackoverflow.com/questions/2669059/how-to-sort-alpha-numeric-set-in-python
def sorted_alnum(l, key=None):