Skip to content

Instantly share code, notes, and snippets.

View Decrapifier.ps1
#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 Dec 13, 2020 — forked from Alexey-Tsarev/zfs_install.sh
ZFS 0.8 at Raspberry Pi
View zfs_install.sh
#!/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 Jan 27, 2020
Setting up Pyhon on a Mac
View PythonOnMac.md

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 Sep 26, 2019
An explanation of `git rebase --onto`
View README.md

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 Aug 29, 2019
Converts key/value pairs returned by a vault command into environment variables
View vault-env
#!/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 Feb 5, 2019
Flushes local DNS cache on MacOS X
View flush_dns
#!/bin/bash
set -e
sudo killall -HUP mDNSResponder
@rca
rca / rancher-exec
Created Jan 25, 2019
Execute a command within a container running in Rancher k8s
View rancher-exec
#!/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;
View gist:07cb74c350d6be278249db6136faa7f7
class Foo:
def __init__(self, x=[]):
self.x = x
f = Foo()
f.x.append(1)
@rca
rca / docker-service-ports
Created Mar 21, 2018
Script to list service ports and get next available port
View docker-service-ports
#!/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 Jul 13, 2018
Lists all docker networks sorted by their subnet address
View docker-networks
#!/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):