Skip to content

Instantly share code, notes, and snippets.

View u1735067's full-sized avatar

Alexandre L. u1735067

View GitHub Profile
@u1735067
u1735067 / whois.py
Created June 8, 2014 16:07
WhoisResEl
#!python3
import sys
import socket
import dns.resolver
import ipaddress
import re
socket.setdefaulttimeout(1)
resolver = dns.resolver.Resolver()
resolver.timeout = 1
@u1735067
u1735067 / hid-wiimote-modules.c
Last active August 29, 2015 14:05
hid-wiimote fixed Classic Controller KeyCode
/*
* Device Modules for Nintendo Wii / Wii U HID Driver
* Copyright (c) 2011-2013 David Herrmann <dh.herrmann@gmail.com>
*/
/*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
@u1735067
u1735067 / hid-wiimote-modules.c
Last active August 29, 2015 14:05
hid-wiimote fixed Classic Controller KeyCode & optimized
/*
* Device Modules for Nintendo Wii / Wii U HID Driver
* Copyright (c) 2011-2013 David Herrmann <dh.herrmann@gmail.com>
*/
/*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
@u1735067
u1735067 / hid-wiimote.log
Created August 22, 2014 15:36
hid-wiimote logs
pi@raspberrypi ~/sdl2-2.0.3/SDL2-2.0.3/test $ jstest /dev/input/js1
Driver version is 2.1.0.
Joystick (Nintendo Wii Remote Classic Controller) has 8 axes (X, Y, Rx, Ry, Hat0X, Hat0Y, Hat1X, Hat1Y)
and 11 buttons (BtnX, BtnY, BtnTL, BtnTR, BtnTR2, BtnSelect, BtnStart, BtnMode, ?, (null), (null)).
Testing ... (interrupt to exit)
Axes: 0: 0 1: 0 2: 0 3: 0 4: 0 5: 0 6:-32767 7:-32767 Buttons: 0:off 1:off 2:off 3:off 4:off 5:off 6:off 7:off 8:off 9:off 10:off ^C
pi@raspberrypi ~/sdl2-2.0.3/SDL2-2.0.3/test $ ./testjoystick 0
INFO: There are 1 joysticks attached
INFO: Joystick 0: Nintendo Wii Remote Classic Controller
@u1735067
u1735067 / rak.py
Last active August 29, 2015 14:19
Botanik - rak.py
#!/usr/bin/env python3
import urllib.request, json
from datetime import datetime, timedelta, date, time
url='http://resel.fr/services/rak/menu.json'
error = "Désolé, le RAK n'a pas publié le menu ou il s'est produit une erreur :("
prefix = 'Au menu du RAK'
next = 'suivi de'
@u1735067
u1735067 / MkBootUSB.bat
Last active June 14, 2021 12:52
Windows All-In-One bootable USB key maker script
@echo off
:: MkBootUSB
:: @author: u1735067
:: @date: 2015-07-30
:: @url: https://gist.github.com/Alex131089/0d742138b978c28a1695
setlocal enableextensions
set debug=0
:: Print some informations
@u1735067
u1735067 / !ZeScript.sh
Last active June 30, 2018 17:24
Aria automatic downloader script
#!/bin/bash
# root@omv:/export/Medias/!Dépot/Aria# ls -la
# total 16
# drwxrwsr-x 2 nobody users 4096 Aug 21 22:26 .
# -rw-r----- 1 root users 3258 Aug 21 22:25 !Archives.txt
# -rwxr-xr-- 1 root users 1.1K May 29 18:38 !IDN-Convert.py
# -rw-rw-r-- 1 alex users 0 Aug 21 22:25 !ToDL.txt
# -rwxr-xr-- 1 root users 1223 Aug 21 22:22 !ZeScript.sh
@u1735067
u1735067 / ldapimport_mod_resel.rb
Last active September 17, 2015 18:40
LDAP import & enforce script
# https://www.redmine.org/issues/1838
# https://www.redmine.org/boards/2/topics/34545
require File.expand_path('../../config/environment', __FILE__)
class AuthSourceLdap
def get_logins_filter(filter)
list = Set.new()
ldap_con = initialize_ldap_con(self.account, self.account_password)
search_filter = filter
ldap_con.search(
@u1735067
u1735067 / gist:d2b28966009d70a70928
Created September 18, 2015 21:29
TASK ERROR: clone failed: lvcreate 'vms/pve-vm-119' error: Failed to activate new LV.
root@camille:/etc/pve# lvcreate -L 16M -n vm-119-disk-1 vms
device-mapper: create ioctl on vms-vm--119--disk--1 failed: Device or resource busy
Failed to activate new LV.
root@camille:/etc/pve#
==> http://setaoffice.com/2015/03/25/device-mapper-create-ioctl-failed-device-or-resource-busy/
root@camille:/etc/pve#
root@camille:/etc/pve# dmsetup
Usage:
@u1735067
u1735067 / cacert-add.sh
Created October 12, 2015 18:16
CACert add script for Alpine
#!/bin/sh
# Cannot be a subdir (at least on Alpine)
cert_dir=/usr/local/share/ca-certificates/
cert_1=http://www.cacert.org/certs/root.crt
hash_1=3ecd6f84706512923d62fcd0340fb85c92f4d7067b66ef20d4ac41d9cabf3ff30173f1af0f3cbd6a8ce4222b9132df559fca8108b6c9ba527f93db9078d85119
cert_2=http://www.cacert.org/certs/class3.crt
hash_2=a141608eb73a065b6aa4595bd23572621e359332bb99f8cb79aafaeb82e076b4f4c697e80fbc80a8c7e456520a7bba21a637e1523229340989905c3072b1cda5
nb=2