Skip to content

Instantly share code, notes, and snippets.

View jleclanche's full-sized avatar
⛸️

Jerome Leclanche jleclanche

⛸️
View GitHub Profile
@jleclanche
jleclanche / bnet_patchnotes.sh
Created June 17, 2021 17:17
Blizzard patchnotes script (OLD, NO LONGER WORKS)
function patchnotes {
ua="Battle.net/1.0.8.4217"
_baseurl="https://us.battle.net/connect/"
usage="usage: $0 <product> [live|ptr|beta] [language]\nproduct is one of wow, s2, d3, heroes, wtcg"
hash lynx 2>/dev/null || {
>&2 echo "You need to install Lynx first."
return 1
}
class APIKeyMixin:
@classmethod
def from_env(cls: Type[T], livemode: bool = False) -> T:
key_id = os.environ.get("API_KEY_ID", "")
secret_key = os.environ.get("API_SECRET_KEY", "")
if not key_id or not secret_key:
raise RuntimeError(
"Environment variables `API_KEY_ID` and `API_SECRET_KEY` need to be defined."
@jleclanche
jleclanche / 0001_initial.py
Last active May 30, 2020 21:18
Example of generating postgres constraints functions inside Django's migrations engine (https://code.djangoproject.com/ticket/31622)
# Generated migration file
import django.db.models.constraints
import django.db.models.deletion
import django.db.models.expressions
import financica.contrib.constraints
import financica.contrib.pg_functions
from django.db import migrations
@jleclanche
jleclanche / keycloak.patch
Created January 30, 2020 12:29
postgres keycloak
--- standalone.xml 2020-01-30 10:24:42.387997193 +0100
+++ archlinux.xml 2020-01-30 11:13:42.877321148 +0100
@@ -1,5 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
-
+<?xml version="1.0" encoding="UTF-8"?>
<server xmlns="urn:jboss:domain:10.0">
<extensions>
<extension module="org.jboss.as.clustering.infinispan"/>
@@ -130,23 +129,18 @@
import time
import requests
class ApiClient:
def __init__(self, url: str):
self.url = url
def get(self, url: str, params=None, retries=3):
@jleclanche
jleclanche / keycloak.tf
Created October 6, 2019 09:54
keycloak arch linux
provider "keycloak" {
client_id = "terraform"
username = "lol"
password = "lol"
url = "https://gitlab.archlinux.org:8443"
}
variable "devops" {
default = [
"jleclanche"
@jleclanche
jleclanche / missing.txt
Created October 12, 2018 16:56
Missing ngdp files (hsb endpoint)
http://blzddist1-a.akamaihd.net/tpr/hs/config/03/32/033288c0cfb11b8c8f190037bc817b25
http://blzddist1-a.akamaihd.net/tpr/hs/config/13/79/1379e076461e0a80a09576b3bcd5f020
http://blzddist1-a.akamaihd.net/tpr/hs/config/1f/38/1f381a0aec9b76c02aed15bd39a6fda7
http://blzddist1-a.akamaihd.net/tpr/hs/config/44/53/4453e5c5071062a7c5927fdf7e44ee15
http://blzddist1-a.akamaihd.net/tpr/hs/config/68/c8/68c8edc31b46f1c1beb1b220971fd180
http://blzddist1-a.akamaihd.net/tpr/hs/config/7e/b9/7eb92104c32c1e11325f23a202356123
http://blzddist1-a.akamaihd.net/tpr/hs/data/19/10/19100282d1f955ad5ce5a156d66d8dc5
http://blzddist1-a.akamaihd.net/tpr/hs/data/1d/75/1d75363003bac673efa4faf52ef16705
http://blzddist1-a.akamaihd.net/tpr/hs/data/26/78/2678c365d0b5c4cf012bdc8e433d6710
http://blzddist1-a.akamaihd.net/tpr/hs/data/27/eb/27ebad3a1aef8e72c359c03a9fbd97ab
@jleclanche
jleclanche / validate_deck.py
Created June 9, 2018 00:05
Take deckstrings and validate them
import sys
from hearthstone.cardxml import load_dbf
from hearthstone.deckstrings import parse_deckstring
from hearthstone.enums import ZodiacYear
YEAR = ZodiacYear.RAVEN
@jleclanche
jleclanche / ngdp.md
Created June 1, 2018 23:06
NGDP docs

Definitions

  • Keys: a key is a 16-byte md5 hash. When used as a string, it is encoded as 32 hexadecimal characters. There are two types of keys:
  • Content Key, ckey: equal to the MD5 hash of the file's contents
  • Encoded Key, ekey: equal to the MD5 hash of the file's header

Default patch server:

  • http://{region}.patch.battle.net:1119/hsb
@jleclanche
jleclanche / kdbx_to_1password.py
Last active December 8, 2022 04:38
Use PyKeePass to turn a kdbx file into a 1Password-importable csv file
# License: CC0 (https://creativecommons.org/share-your-work/public-domain/cc0/)
import csv
import getpass
import sys
from pykeepass import PyKeePass
class BadData(Exception):
pass