Skip to content

Instantly share code, notes, and snippets.

View darmiel's full-sized avatar
🦖
Boing Boing

Daniel darmiel

🦖
Boing Boing
View GitHub Profile
@darmiel
darmiel / EeeeExample.java
Last active March 13, 2022 00:22
EEEE vs. Plain
import io.d2a.eeee.Starter;
import io.d2a.eeee.annotation.annotations.common.Range;
import io.d2a.eeee.annotation.annotations.generate.Generate;
import io.d2a.eeee.annotation.annotations.prompt.Entrypoint;
import io.d2a.eeee.annotation.annotations.prompt.Prompt;
import io.d2a.eeee.generate.random.RandomFactory;
import java.util.Arrays;
public static class EEEE {
@darmiel
darmiel / twitch_chat_crawl.py
Last active June 28, 2022 23:45
Crawl twitch chat from a past broadcast
import requests
import json
# change me
BROADCAST_ID: str = ""
CLIENT_ID: str = ""
# ---
START_URL: str = f"https://api.twitch.tv/v5/videos/{BROADCAST_ID}/comments?content_offset_seconds=0"
@darmiel
darmiel / backup.sh
Created May 30, 2021 16:17
Google Drive + OpenSSL Encrypted Backup
#!/bin/bash
# required: tar, curl, openssl, jq
# Backup Settings
TARGET_DIR="~/" # change me
TARGET="export/". # change me
ENCRYPTION_PASS="xVyA..." # change me
OUT_DIR="/tmp/" # change me
OUT_FILE="$(date +%Y-%m-%d).tar.gz.enc" # change me
#!/usr/local/bin/python3
import requests
import re
import sys
import subprocess
# INPUT
URL: str = ""
if len(sys.argv) >= 2:
URL = sys.argv[1]
@darmiel
darmiel / check_domains.py
Created May 13, 2021 14:57
Find free domains
import dns.resolver
import requests
import tqdm
import re
# SETTINGS
# english
WORDS = 'https://raw.githubusercontent.com/dwyl/english-words/master/words_alpha.txt'
# german
# WORDS = 'https://gist.github.com/MarvinJWendt/2f4f4154b8ae218600eb091a5706b5f4/raw/36b70dd6be330aa61cd4d4cdfda6234dcb0b8784/wordlist-german.txt'
@darmiel
darmiel / crypto-updates.py
Created May 9, 2021 10:43
Send a notification with the current rate of a cryptocurrency to the system every x seconds
from pynotifier import Notification
from pycoingecko import CoinGeckoAPI
from time import sleep
# init api
cg = CoinGeckoAPI()
COIN_ID: str = "dogecoin"
VS_CURR: str = "eur"
DELAY: int = 15 * 60 # in seconds
public static int weirdAbs(int num) {
return Math.abs(num) << 1 | (num < 0 ? 1 : 0);
}
public static int weirdAbsP(int abs) {
return (abs >> 1) * (abs & 1) == 1 ? -1 : 1;
}
@darmiel
darmiel / jsvr.sh
Last active May 19, 2021 15:55
Small script to deploy Jamulus quickly on an EC2 instance
#!/bin/bash
# ============================================================================================================== #
# #
# wget -qO- https://gist.github.com/darmiel/219bfb6ee51b4257cb6a9993d96f4994/raw/jsvr.sh | sudo bash #
# #
# ============================================================================================================== #
P_DOWNLOAD_URL="https://gist.github.com/darmiel/219bfb6ee51b4257cb6a9993d96f4994/raw/jsvr.sh"
P_BIN_PATH="/bin/jsvr"
# Cancel script if something goes wrong
#!/bin/bash
# Cancel script if something goes wrong
set -e
# Settings
P_PRIV="sudo"
P_TIMEZONE="Europe/Berlin"
P_PORT="22124"
P_VOLUME="-v $(pwd)/jam:/jam"
import math
class KeyboardLayout():
def __init__(self, keys: list):
self.keys = keys
self.key_map = {}
# create character map
for row in range(len(keys)):
for column in range(len(keys[row])):