Skip to content

Instantly share code, notes, and snippets.

Avatar

Alexandre L. u1735067

View GitHub Profile
View ansible-delegate_to-fail.yml
---
# ---Setup:
# > ansible-playbook -i mytest.ini mytest.yml --limit test2
# ./mytest.ini:
# test1 site=ams
# test2 site=ams
# test3 site=blg
#
# ---Result:
# PLAY [TEST] ********************************************************************
View 34db8a351b8fc43362bcbf0cba9e186b2c3a1b80.patch
From 34db8a351b8fc43362bcbf0cba9e186b2c3a1b80 Mon Sep 17 00:00:00 2001
From: "Alexandre L."
Date: Tue, 7 Jul 2015 19:25:22 +0200
Subject: [PATCH] Dirty workaround
---
exportify.js | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/exportify.js b/exportify.js
View nbconfig.py
#!/usr/bin/python
#-*- encoding: Utf-8 -*-
from hashlib import md5
from sys import argv
try:
from Crypto.Cipher import AES
except ImportError:
exit('Erreur : la bibliothèque "PyCryto" n\'est pas installée')
View PuTTY Tray - Gnome style CP - 412a091 over 308994a.patch
From 412a091ab8f97a5964bc548c29ca3cfa646fcbc9 Mon Sep 17 00:00:00 2001
From: Alexandre L.
Date: Fri, 7 Nov 2014 04:28:58 +0100
Subject: [PATCH] Patch pour le C/C Gnome-style
---
config.c | 5 -----
putty.h | 3 +++
settings.c | 4 ++++
terminal.c | 15 +++++++++++++--
@u1735067
u1735067 / united-we-stream_dl.py
Last active Mar 27, 2021
United We Stream audio downloader, with corrected meta & cover (dirty script)
View united-we-stream_dl.py
#!python3
import sys, os, io, re, subprocess, threading, shutil, json
def youtubedl_fetch(url):
# Like check_output, but keep stderr
# https://github.com/python/cpython/blob/2.7/Lib/subprocess.py#L194
cmdline = [
'./youtube-dl-2020.06.16.1',
@u1735067
u1735067 / Windows Sandbox FR.wsb
Created Jan 29, 2021
Windows Sandbox launcher with French localization (keyboard layout, datetime, .. without UI)
View Windows Sandbox FR.wsb
<!-- Fr -->
<Configuration>
<LogonCommand>
<Command>powershell.exe -Command "Set-WinUserLanguageList -Force -LanguageList fr-FR"</Command>
</LogonCommand>
</Configuration>
@u1735067
u1735067 / scrapy-icinga-exchange-plugins.py
Last active Jan 16, 2021
Icinga Exchange scrapper (scrapy), because the (dumb) search engine doesn't allow sorting by views or downloads
View scrapy-icinga-exchange-plugins.py
import scrapy, urllib.parse, re
# Python36\Scripts\scrapy.exe runspider .\icinga-exchange-plugins.py -o plugins.json
# jq ". |= sort_by(.views) | reverse | .[0:30]" plugins.json > plugins-top30views.json
FEED_EXPORT_ENCODING = 'utf-8'
class IcingaExchangeSpider(scrapy.Spider):
name = 'scrapy-icinga-exchange-plugins'
allowed_domains = ['exchange.icinga.com']
@u1735067
u1735067 / zoneidentifier_dump.py
Last active Dec 24, 2020
This script scan files for the Zone.Identifier stream (ADS : Alternate Data Streams) and prints the referrer + host URLs if available
View zoneidentifier_dump.py
#!/usr/bin/env python
# Help with Powershell encoding:
# [Console]::InputEncoding = [Console]::OutputEncoding = [Text.UTF8Encoding]::new()
# $env:PYTHONIOENCODING="utf-8"
import argparse, pathlib
parser = argparse.ArgumentParser(description='This script scan files for the Zone.Identifier stream (ADS : Alternate Data Streams) and prints the referrer + host URLs if available')
parser.add_argument('path', metavar='PATH', type=pathlib.Path, help='Path (file or directory) to scan')
parser.add_argument('-r', '--recurse', action='store_true', help='Recurse subdirectories')
parser.add_argument('-ia', '--include-about', action='store_true', help='Include about:client, about:internet entries')
@u1735067
u1735067 / radius.ksy
Created Aug 24, 2020
Quick & dirty Radius Kaitai format
View radius.ksy
meta:
id: radius
file-extension: radius
endian: be
doc-ref: "https://www.iana.org/assignments/radius-types/radius-types.xhtml"
doc-ref: "https://tools.ietf.org/html/rfc2865"
doc-ref: "https://wiki.wireshark.org/SampleCaptures#RADIUS_.28RFC_2865.29"
seq:
- id: code
type: u1
@u1735067
u1735067 / dark-custom.md
Last active Jan 26, 2020
Original Trilium (https://github.com/zadam/trilium) dark theme with a bit more contrast
View dark-custom.md

image

In Trilium, select dark theme, create a CSS note with the code and add the atttribute @appCss (yes, that's hacky / not a full theme, but it works).

Code (v2.1 for v0.40):

/*
https://github.com/zadam/trilium/wiki/Themes
https://developer.mozilla.org/en-US/docs/Web/CSS/var
https://css-tricks.com/hsl-hsla-is-great-for-programmatic-color-control/