Skip to content

Instantly share code, notes, and snippets.

View fnkr's full-sized avatar
🐧
cat /dev/urandom | aplay -c 2 -r 24000

Florian Kaiser fnkr

🐧
cat /dev/urandom | aplay -c 2 -r 24000
View GitHub Profile
@SoftCreatR
SoftCreatR / update-hcfw.sh
Last active January 1, 2024 12:36
Hetzner Cloud Firewall Cloudflare IP Updater using either curl, wget or httpie.
#!/usr/bin/env bash
##############################################################
# Title : Hetzner Firewall Cloudflare IP Updater #
# Description : Allows you to update your Hetzner Cloud #
# Firewall to allow all incoming requests #
# from Cloudflare. #
# #
# Author : Sascha Greuel <hello@1-2.dev> #
# Date : 2021-03-30 09:30 #
@marco79cgn
marco79cgn / vaccination-stats.js
Last active January 11, 2023 21:47
A Scriptable widget that shows the amount of people who have received the corona vaccination in Germany
// Version 1.3.0
// 27.11.2021
//
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: red; icon-glyph: notes-medical;
// Mit Caching und Fallback
const cacheMinutes = 60; // 60 min
const today = new Date();
const neededTotalVaccinations = 83200000;
const apiUrl = "https://pass.telekom.de/api/service/generic/v1/status"
let widget = await createWidget()
widget.backgroundColor = new Color("#777777")
if (!config.runsInWidget) {
await widget.presentSmall()
}
Script.setWidget(widget)
Script.complete()
@bryanjhv
bryanjhv / jbadel.py
Created May 19, 2020 21:48
Delete JetBrains IDE Settings Sync (JBA Account) data
#!/usr/bin/env python3
# USAGE:
# 1. Download https://account.jetbrains.com/profile-details/JetBrainsPersonalData.xlsx
# 2. Open with Excel, go to Account sheet (default) and copy "Account ID" value (token)
# 3. Go to your IDE's folder and copy the "name" property from "product-info.json"
# 4. Run:
# export TOKEN=... # step 2
# export PRODUCT=... # step 3
# python3 jbadel.py
@alyssacohen
alyssacohen / lapdogbackup.md
Last active October 2, 2022 02:35
My laptop backup with restic

My Laptop Backup with restic

Some notes about setting up automatic backup on IBM Cloud Object Storage.

Inspired by an article about making free backups to the cloud and this one about automating the process with systemd, I decided to set up automatic backup over the internet of my mule laptop "lapdog". It's an Arch Linux powered machine I mostly use to kill time, so it's not a big deal if for some reason I screw things up. Something went wrong when I followed that guide, so I decided to retrace all the steps following restic and aws documentation instead of those articles. And here is my version of the guide (hope it helps someone) IBM COS basically let you create an Amazon S3 bucket with up to 25GB of cloud space to upload your backups for free! 😁 Too small for a full system backup, but enough fo

@zealot128
zealot128 / README.md
Last active January 6, 2023 20:08
Gitlab Autoscaling Infrastructure on Hcloud with internal caching

Order and provision a Hetzner Cloud based Gitlab-Runner Docker-machine autoscaling infrastructure

See my blog for more information.

  • Adjust settings in vars.auto.tfvars.
  • Run with terraform init && terraform apply

Content:

@Ryanb58
Ryanb58 / install.md
Last active April 19, 2024 08:38
How to install telnet into a alpine docker container. This is useful when using the celery remote debugger in a dev environment.
>>> docker exec -it CONTAINERID /bin/sh
/app # telnet
/bin/sh: telnet: not found

/app # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
v3.7.0-243-gf26e75a186 [http://dl-cdn.alpinelinux.org/alpine/v3.7/main]
v3.7.0-229-g087f28e29d [http://dl-cdn.alpinelinux.org/alpine/v3.7/community]
@fnkr
fnkr / mysql-db-stats.sql
Created February 20, 2018 09:44
Human readable overview of MySQL/MariaDB database size
SELECT table_schema "Database",
Round(Sum(data_length) / 1024 / 1024, 0) "Data size (in MB)",
Round(Sum(data_length) / 1024 / 1024 / 1024, 3) "Data size (in GB)",
Round(Sum(index_length) / 1024 / 1024, 0) "Index size (in MB)",
Round(Sum(index_length) / 1024 / 1024 / 1024, 3) "Index size (in GB)",
Round(Sum(data_length + index_length) / 1024 / 1024, 0) "Total size (in MB)",
Round(Sum(data_length + index_length) / 1024 / 1024 / 1024, 3) "Total size (in GB)"
FROM information_schema.tables
GROUP BY table_schema;
@fnkr
fnkr / simple_mysql_backup.sh
Last active May 30, 2018 06:45
MySQL/MariaDB server backup in 147 chars
echo 'show databases;' | sudo mysql | tail -n+2 | grep -v _schema$ | grep -v ^mysql$ | xargs -n 1 -I _ bash -c 'sudo mysqldump _ | gzip > _.sql.gz'
@valeriomazzeo
valeriomazzeo / github_release.rb
Created July 5, 2017 21:24
Creates or update a GitHub release for the given tag name
#!/usr/bin/env ruby
require 'optparse'
require 'octokit'
options = {}
OptionParser.new do |opt|
opt.on('-s', '--secret SECRET', 'GitHub access token') { |o| options[:secret] = o }
opt.on('-r', '--repo-slug REPO_SLUG', 'Repo slug. i.e.: apple/swift') { |o| options[:repo_slug] = o }
opt.on('-c', '--changelog-file CHANGELOG_FILE', 'Changelog path') { |o| options[:changelog_file] = o }