Skip to content

Instantly share code, notes, and snippets.

@wideawakening
wideawakening / audio-cd-making
Last active June 16, 2021 08:49
bash scripties
# get the duration (in minutes) of a to-be-burnt audio-cd, based on mp3 files
echo "$(sox --info -D * | awk '{s+=$1} END {print s}')/60" | bc
# after manual order, preview
ls -v | xargs -I {} mplayer {}
@wideawakening
wideawakening / 0. backup-restore
Last active April 26, 2024 09:05
workstation backup+reset checks
# leapfroging tips from the past into the future
# workstation backup and restore checks
# 1. backup-tasks
# 2.0. shared-install
# 2.1. personal-install
# 2.2. work-install
# 3. firefox config
#
# kubectl logic to launch a manual execution of a cronjob
# controlls that current cronjob is not active (non idempotent development)
#
echo "manual launch of cronjob ..."
try{
echo "checking if cronjob is active..."
sh "if [[ \$(kubectl get cronjob.batch/processor-batch -o=jsonpath='{.status.active}' | wc -c) -gt 0 ]] ; then \$( return -1); fi"
@wideawakening
wideawakening / tf-k8s-manifest-deployment.tf
Last active September 8, 2020 06:11
terraform snippets
#
# dirty but easy k8s manifest deployment vía tf
#
# if ordered deployment is required, use numeric convention
# eg:
# $ ls -1
# 0.namespace.yaml
# 1.crd.yaml
# 2.secrets.yaml
# 3.configmap.yaml
@wideawakening
wideawakening / kubernetes-dashboard :: ro user
Last active July 22, 2020 11:41 — forked from karthik101/Readonly user for Kubernetes Dashboard.md
Read only user for Kubernetes Dashboard
```
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: dashboard-viewonly
rules:
- apiGroups:
- ""
resources:
- configmaps
@wideawakening
wideawakening / jenkins-k8s-operator-config.yaml
Created January 17, 2020 13:55
k8s jenkins.io/v1alpha2 operator full anonymized configuration
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: jenkins-pvc
namespace: tools
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
@wideawakening
wideawakening / playmoss2mp3.py
Last active October 15, 2021 13:03
playmoss playlists to mp3 (✞)
#
# $ python3 playmoss2mp3.py {playmoss_playlist_url}
# ex.
# $ python3 playmoss2mp.py https://playmoss.com/en/wideawakening/playlist/2019-wideawakening-legacy
#
#
import requests
import youtube_dl
import os,sys