Skip to content

Instantly share code, notes, and snippets.

@we-taper
we-taper / aws-temp-token.sh
Created July 15, 2021 21:05 — forked from ogavrisevs/aws-temp-token.sh
Script to generate AWS STS token
#!/bin/bash
#
# Sample for getting temp session token from AWS STS
#
# aws --profile youriamuser sts get-session-token --duration 3600 \
# --serial-number arn:aws:iam::012345678901:mfa/user --token-code 012345
#
# Based on : https://github.com/EvidentSecurity/MFAonCLI/blob/master/aws-temp-token.sh
#
@we-taper
we-taper / ydljson2cue.py
Last active January 12, 2024 16:20
Extract chapters part of the Youtube-dl's json info into a CUE file
#! python3
"""
Extract chapters part of the Youtube-dl's json info into a CUE file.
This file is in the public domain.
Requirements:
pydantic
python>=3.6
@we-taper
we-taper / Ansible-Vault how-to.md
Created December 25, 2020 21:19 — forked from tristanfisher/Ansible-Vault how-to.md
A short tutorial on how to use Vault in your Ansible workflow. Ansible-vault allows you to more safely store sensitive information in a source code repository or on disk.

Working with ansible-vault


I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.

What I decided on was the following: put your secret information into a vars file, reference that vars file from your task, and encrypt the whole vars file using ansible-vault encrypt.

Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.

@we-taper
we-taper / macfix4-disable-crash-reporter.rb
Created February 13, 2020 23:26 — forked from SteveBenner/macfix4-disable-crash-reporter.rb
Mac fix - Disable CrashReporter and prevent it from launching
#!/usr/bin/env ruby
#
# Mac fix 4 - Disable CrashReporter
#
# CrashReporter is a daemon that monitors for crashes and generates a report (duh) when they occur.
# If an application (such as Finder) become stuck in an infinite crash loop, then sometimes it's
# desirable to just turn off CrashReporter entirely, as it will continually generate processes in
# the background which spew errors and logs, resulting in massive overhead to your system resources.
#
# DIAGNOSING: