Skip to content

Instantly share code, notes, and snippets.

@jcjveraa
jcjveraa / change-default-storage-class.sh
Last active November 9, 2024 21:03
Change the default storage class in kubernetes with a single command
#!/bin/bash
## When doing some experimenting, it can be usefull to be able to quickly change the default storage class in k8s.
## This script does that - it will change the default storage class to the one supplied on the commandline, erroring out
## in case this storage class does not exist, or if the changing of the storage class failed.
## Disclaimer/for openness: I thought of creating this script, but ChatGPT did most of the grunt work of realizing it.
# Check if storage class name is provided as an argument
if [ -z "$1" ]; then
echo "Usage: $0 <storage-class-name> - this storage class will be set as the default kubernetes storage class, and the previous default is removed"
exit 1
@jcjveraa
jcjveraa / duplicates.py
Last active June 4, 2022 06:23 — forked from tfeldmann/duplicates.py
Fast duplicate file finder written in python
#!/usr/bin/env python
"""
Fast duplicate file finder.
Usage: duplicates.py [-hcf] <folder> [<folder>...]
Based on https://stackoverflow.com/a/36113168/300783
Modified for Python3 with some small code improvements.
Modified by jcjveraa to include option to hardlink any duplicate files
"""