This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate ring; | |
use ring::aead::*; | |
use ring::pbkdf2::*; | |
use ring::rand::SystemRandom; | |
fn main() { | |
// The password will be used to generate a key | |
let password = b"nice password"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Convert applet to downloadable jnlp | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match http://192.168.1.23/kvms.html | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=1.23 | |
// @grant none | |
// @require https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.7.7/handlebars.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import time | |
import bs4 | |
import requests | |
url = 'http://service.berlin.de/terminvereinbarung/termin/tag.php?termin=1&dienstleister%5B%5D=122210&dienstleister%5B%5D=122217&dienstleister%5B%5D=122219&dienstleister%5B%5D=122227&dienstleister%5B%5D=122231&dienstleister%5B%5D=122238&dienstleister%5B%5D=122243&dienstleister%5B%5D=122252&dienstleister%5B%5D=122260&dienstleister%5B%5D=122262&dienstleister%5B%5D=122254&dienstleister%5B%5D=122271&dienstleister%5B%5D=122273&dienstleister%5B%5D=122277&dienstleister%5B%5D=122280&dienstleister%5B%5D=122282&dienstleister%5B%5D=122284&dienstleister%5B%5D=122291&dienstleister%5B%5D=122285&dienstleister%5B%5D=122286&dienstleister%5B%5D=122296&dienstleister%5B%5D=150230&dienstleister%5B%5D=122301&dienstleister%5B%5D=122297&dienstleister%5B%5D=122294&dienstleister%5B%5D=122312&dienstleister%5B%5D=122314&dienstleister%5B%5D=122304&dienstleister%5B%5D=122311&dienstleister%5B%5D=122309&dienstleister%5B%5D=317869&dienstleister%5B%5D=324433&dienstleister%5B%5D=325341 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Generate colored entries for the extension AWS Extend Switch Roles [1]. | |
[1] https://chrome.google.com/webstore/detail/aws-extend-switch-roles/jpmkfafbacpgapdghgdpembnojdlgkdl | |
""" | |
from pathlib import Path | |
from configparser import ConfigParser | |
CONFIG = Path("~/.aws/config").expanduser() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# based on https://github.com/junegunn/fzf/wiki/Examples#autojump | |
function _fzf_autojump() { | |
fzf --height 40% --reverse --inline-info | |
} | |
function _fzf_cleanup() { | |
awk '$1 ~ /[0-9]:/ && $2 ~ /^\// { for (i=2; i<=NF; i++) { print $(i) } }' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function gclone() { | |
local organization | |
local repositories | |
organization="$1" | |
repositories="$(gh repo list -L 1000 "$organization" | fzf --multi --cycle | awk '{print $1}')" | |
for repository in $repositories; do | |
echo "Cloning $repository" | |
gh repo clone "$repository" | |
done | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import json | |
import os | |
import shlex | |
from configparser import ConfigParser | |
from copy import deepcopy | |
from pathlib import Path | |
from subprocess import check_call, check_output | |
from ruamel import yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CaseInsensitiveDict(dict): | |
def __init__(self, *args, **kwargs): | |
super().__init__(*args, **kwargs) | |
self.__map = {} | |
mapping = args[0] if len(args) else {} | |
keys = set() | |
if isinstance(mapping, dict): | |
keys |= mapping.keys() | |
elif isinstance(mapping, (list, tuple)): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# On linux side you need iptables | |
# On windows side you need sudo which can be installed with scoop | |
$CidrBlocks = "10.0.0.0/16", "10.1.0.0/16", "10.70.0.0/16", "10.3.0.0/16" | |
$WslIP = "$(wsl -- ip addr show dev eth0 | Select-String -Pattern 'inet ')" | |
$WslIP = $WslIP.Split(' ').Where{ $_.Length }[1].Split('/')[0] | |
function BuildIptablesRoute { | |
param ( | |
[Parameter(Mandatory = $true)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
from dataclasses import dataclass, fields | |
from typing import Dict | |
CAMEL_CASE_RE = re.compile(r'([a-z])([A-Z])') | |
@dataclass(frozen=True) | |
class ApiGatewayRequest: | |
headers: Dict[str, str] |
NewerOlder