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
@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
@edtjones
edtjones / zabbix_cleanup.sql
Created February 10, 2016 13:55
Clean up zabbix database
SET @history_interval = 7;
SET @trends_interval = 90;
DELETE FROM alerts WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60);
DELETE FROM acknowledges WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60);
DELETE FROM events WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60);
DELETE FROM history WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60);
DELETE FROM history_uint WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60);
DELETE FROM history_str WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60);
@halberom
halberom / 00_play.yml
Last active September 6, 2022 08:03
ansible - example of parsing a url
---
- hosts: localhost
gather_facts: False
connection: local
vars:
myvar: 'http://www.example.domain.com:9090'
tasks:
- name: not as good as a custom filter
debug:
@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:

@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;
@matthiasg
matthiasg / docs style (bootstrap)
Created August 5, 2013 06:26
the callouts from the bootstrap documentation
/* Side notes for calling out things
-------------------------------------------------- */
/* Base styles (regardless of theme) */
.bs-callout {
margin: 20px 0;
padding: 15px 30px 15px 15px;
border-left: 5px solid #eee;
@lost-theory
lost-theory / app.py
Created January 12, 2013 23:49
flask: show request time in template
import time
from flask import Flask, request, g, render_template
app = Flask(__name__)
app.config['DEBUG'] = True
@app.before_request
def before_request():
g.request_start_time = time.time()
@luhn
luhn / getter_and_setter.py
Created November 29, 2012 18:35
Using getters and setters with SQLAlchemy
class Table(Base):
id = Column(Integer, primary_key=True)
_name = Column('name', String(24))
@property
def name(self):
return self._name;
@name.setter
def name(self, value):
@iamralch
iamralch / sshtunnel.go
Last active April 16, 2023 03:07
SSH tunnelling in Golang
package main
import (
"log"
"bufio"
"time"
"os"
"fmt"
"io"
"net"