Skip to content

Instantly share code, notes, and snippets.

View u1735067's full-sized avatar

Alexandre L. u1735067

View GitHub Profile
@u1735067
u1735067 / configuration.cfg.example
Created January 31, 2023 14:58
An adaptation (NOT cleaned) of https://github.com/mattstruble/portainer-swarm-migrate using new StackAssociate API, for when you have to recreate your cluster because you locked yourself out :) // Consider same license as original code (MIT).
[portainer]
username=USER
password=PASSWORD
url=http://127.0.0.1:9000
[swarm]
clusterID=ID
# as seen in `docker info`
@u1735067
u1735067 / flipper_fap_manifest_sdk_api_patcher.py
Last active October 22, 2022 02:27
Simple patcher for Flipper Zero FAPs to change the target SDK API in the manifest ; it doesn't mean the patched app will work correctly (!), it only allow it to be loaded
import re, pathlib
target_version_major = 2
target_version_minor = 0
"""md
* https://github.com/flipperdevices/flipperzero-firmware/blob/0.69.1/lib/flipper_application/flipper_application.c#L45
* https://github.com/flipperdevices/flipperzero-firmware/blob/0.69.1/lib/flipper_application/flipper_application.c#L116
* https://github.com/flipperdevices/flipperzero-firmware/blob/0.69.1/lib/flipper_application/application_manifest.c#L12
* https://github.com/flipperdevices/flipperzero-firmware/blob/0.69.1/lib/flipper_application/application_manifest.h#L15
@u1735067
u1735067 / asgi.py
Created September 20, 2022 15:35
Django ASGI Locale middleware `LocaleAsgiMiddleware` (not well-tested)
"""
ASGI config for MyApp project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/
"""
import os
@u1735067
u1735067 / filter_plugins__as_unsafe.py
Created June 1, 2022 15:37
Simple filter to mark an Ansible variable as unsafe (untested)
#!/usr/bin/env python
"""Simple filter to mark a variable as unsafe"""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.utils.unsafe_proxy import wrap_var
def as_unsafe(var):
---
# ---Setup:
# > ansible-playbook -i mytest.ini mytest.yml --limit test2
# ./mytest.ini:
# test1 site=ams
# test2 site=ams
# test3 site=blg
#
# ---Result:
# PLAY [TEST] ********************************************************************
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
#!/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')
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 March 27, 2021 22:05
United We Stream audio downloader, with corrected meta & cover (dirty script)
#!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 January 29, 2021 20:05
Windows Sandbox launcher with French localization (keyboard layout, datetime, .. without UI)
<!-- Fr -->
<Configuration>
<LogonCommand>
<Command>powershell.exe -Command "Set-WinUserLanguageList -Force -LanguageList fr-FR"</Command>
</LogonCommand>
</Configuration>