Skip to content

Instantly share code, notes, and snippets.

View jkroepke's full-sized avatar
😀
Happy.

Jan-Otto Kröpke jkroepke

😀
Happy.
View GitHub Profile
@23maverick23
23maverick23 / randPassGen.py
Last active June 9, 2019 11:27
Python: Random password generator
#!/usr/bin/env python
import string
import random
def password_generator(size=8, chars=string.ascii_letters + string.digits):
"""
Returns a string of random characters, useful in generating temporary
passwords for automated password resets.
@albertbori
albertbori / Installation.md
Last active April 9, 2025 08:52
Automatically disable Wifi when an Ethernet connection (cable) is plugged in on a Mac

Overview

This is a bash script that will automatically turn your wifi off if you connect your computer to an ethernet connection and turn wifi back on when you unplug your ethernet cable/adapter. If you decide to turn wifi on for whatever reason, it will remember that choice. This was improvised from this mac hint to work with Yosemite, and without hard-coding the adapter names. It's supposed to support growl, but I didn't check that part. I did, however, add OSX notification center support. Feel free to fork and fix any issues you encounter.

Most the credit for these changes go to Dave Holland.

Requirements

  • Mac OSX 10+
  • Administrator privileges
@halberom
halberom / 00_description
Last active April 14, 2022 19:23
ansible - example of using filters to change each item in a list
The problem:
I wanted to use the jinja 'map' filter to modify each item in a string, in this simple
example, adding '.conf' to each item.
The 'format' filter in jinja takes arguments (value, *args, **kwargs). Unfortunately,
it uses 'value' as the pattern. When called inside map 'value' is the current item in
the list, or in other words *args as far as format is concerned. So it's the wrong way
around.
@fabian-ro
fabian-ro / backup-configuration.json
Created December 7, 2023 07:54
Azure backup for AKS with Terraform
{
"properties": {
"friendlyName": "${cluster_name}\\${name}",
"dataSourceInfo": {
"resourceID": "${cluster_id}",
"resourceUri": "${cluster_id}",
"datasourceType": "Microsoft.ContainerService/managedClusters",
"resourceName": "${cluster_name}",
"resourceType": "Microsoft.ContainerService/managedClusters",
"resourceLocation": "${cluster_location}",