Skip to content

Instantly share code, notes, and snippets.

@gileri
gileri / cwl.py
Last active February 28, 2023 04:15
Cloudwatch logs length test
#!/bin/env python3
from time import time, sleep
import boto3
LOG_STREAM = str(int(time()))
LOG_GROUP = "CHANGEME"
cwl = boto3.client("logs")
@gileri
gileri / main.py
Created June 20, 2020 21:42
Move rTorrent torrent download directories via XMLRPC
#!/bin/env python3
import logging
import sys
import xmlrpc.client
logging.basicConfig(level=logging.INFO)
def move_all_torrents(server: str, old_prefix: str, new_prefix: str):
with xmlrpc.client.ServerProxy(server) as proxy:
@gileri
gileri / log
Created October 7, 2019 13:33
Instance IP 403
2019-10-07T14:56:30.425+0200 [DEBUG] plugin.terraform-provider-scaleway_v1.11.0_x4: -----------------------------------------------------
2019-10-07T14:56:31.494+0200 [DEBUG] plugin.terraform-provider-scaleway_v1.11.0_x4: 2019/10/07 14:56:31 [DEBUG] Scaleway API Request Details:
2019-10-07T14:56:31.494+0200 [DEBUG] plugin.terraform-provider-scaleway_v1.11.0_x4: ---[ REQUEST ]---------------------------------------
2019-10-07T14:56:31.494+0200 [DEBUG] plugin.terraform-provider-scaleway_v1.11.0_x4: GET /ips/ce912f19-cd6c-47ab-a504-204958d51164 HTTP/1.1
2019-10-07T14:56:31.494+0200 [DEBUG] plugin.terraform-provider-scaleway_v1.11.0_x4: Host: cp-par1.scaleway.com
2019-10-07T14:56:31.494+0200 [DEBUG] plugin.terraform-provider-scaleway_v1.11.0_x4: User-Agent: scaleway-sdk
2019-10-07T14:56:31.494+0200 [DEBUG] plugin.terraform-provider-scaleway_v1.11.0_x4: Content-Type: application/json
2019-10-07T14:56:31.494+0200 [DEBUG] plugin.terraform-provider-scaleway_v1.11.0_x4: X-Auth-Token: REDACTED
2019-10-07T14:56:31.494+0
@gileri
gileri / hls_bp.py
Created October 11, 2018 06:26
blackpills.com HTTP Live Streaming (HLS) playlist ripper
import re
from subprocess import run
import sys
import os
import urllib.request
import requests
EPISODES = (
'https://e-cdn-stream.blackpills.com/stream/<id>/hls/<id>.m3u8',
)
@gileri
gileri / etc_config_network
Created June 24, 2018 15:47
Configuration OpenWRT pour IPv6 Orange via ONT, en remplacement d'une Livebox V3
config interface 'WAN6'
option ifname 'eth1.832' # Utiliser le VLAN 832
option _orig_ifname 'eth1.832'
option _orig_bridge 'false'
option proto 'dhcpv6'
option reqaddress 'try'
option reqprefix 'auto'
# option 16 : Vendor Class, valeur spécifique au fabricant Sagem
# option 15 : User Class. Sur la version "mainline" (intégrée à OpenWRT/LEDE au 2018-02-24, puis dans Turris-OS le 2018-03-27), doit être spécifié en texte simple, dans les anciennes version patchées, cette valeur doit être renseignée en hexa comme les autres
# option 11 : Authentification. Correspond à 00:00:00:00:00:00:00:00:00:00:00 + identifiant Orange en hexadécimal (fti/xxxxx). Attention à la casse
@gileri
gileri / Adept decrypt on Windows, OSX and Wine
Last active July 17, 2023 05:03
ADEPT DRM-protected decryption with fixes for more recent version of PyCrypto
Tested under on 2017-04 under wine, python-2.7.13.msi, pycrypto-2.6.win32-py2.7.exe
From https://thescienceofdestruction.wordpress.com/2011/08/10/downloading-and-decrypting-adobe-adept-drm-protected-ebooks-on-linux/ :
Fixes by rknop : https://thescienceofdestruction.wordpress.com/2011/08/10/downloading-and-decrypting-adobe-adept-drm-protected-ebooks-on-linux/#comment-696
This howto shows how to download eBooks using Adobe’s ADEPT DRM (Digital Rights Management) scheme on Linux and how to decrypt those books so that you can use your eBook viewer of choice to read them and copy them to any device you wish.
To download content protected with ADEPT, we need the Adobe Digital Editions eBook viewer. Sadly there is no Linux version, so we need to run the Windows version with Wine. Get the Windows installer from here.
Go to the folder where you downloaded the installer and run it with the command
@gileri
gileri / autosub.lua
Created September 24, 2015 07:56 — forked from selsta/autosub.lua
Automatically download subtitles in mpv using subliminal.
-- requires subliminal, version 1.0 or newer
-- default keybinding: b
-- add the following to your input.conf to change the default keybinding:
-- keyname script_binding auto_load_subs
-- Forked from https://gist.github.com/selsta/ce3fb37e775dbd15c698
local utils = require 'mp.utils'
function load_sub_fn()
mp.msg.info("Searching subtitle")
mp.osd_message("Searching subtitle")
t = {}
@gileri
gileri / derive_changes.sh
Created March 20, 2015 23:49
OSM phone number normalisation
#!/bin/bash
osmosis \
--fast-read-xml file="out.xml" \
--buffer \
--sort \
--read-pbf-fast file="lyon_france.osm.pbf" \
--sort \
--buffer \
@gileri
gileri / PKGBUILD.diff
Created September 7, 2014 14:46
Brogue application file
14c14,15
< 'brogue.sh')
---
> 'brogue.sh'
> 'brogue.desktop')
16c17,18
< '9de3fa32ba7fe562b0224417eaea5c26')
---
> '9de3fa32ba7fe562b0224417eaea5c26'
> '0629a669cb3054ee32c6f0d44681b535')
@gileri
gileri / Send multiple floats from Arduino to Raspberry through I2C
Last active November 27, 2023 21:54
Sending float from arduino to raspberry pi using Wire (arduino) and smbus (python) libraries
http://bradsrpi.blogspot.fr/2013/03/sending-data-from-arduino-to-raspberry.html