Skip to content

Instantly share code, notes, and snippets.

@ylmrx
ylmrx / mozlz4a.py
Last active November 19, 2017 22:45 — forked from Tblue/mozlz4a.py
MozLz4a compression/decompression utility
#!/usr/bin/env python3
#
# Decompressor/compressor for files in Mozilla's "mozLz4" format. Firefox uses this file format to
# compress e. g. bookmark backups (*.jsonlz4).
#
# This file format is in fact just plain LZ4 data with a custom header (magic number [8 bytes] and
# uncompressed file size [4 bytes, little endian]).
#
# This Python 3 script requires the LZ4 bindings for Python, see: https://pypi.python.org/pypi/lz4
#
@ylmrx
ylmrx / curl_cookies.md
Last active August 30, 2018 14:36
curl and cookies

authentication with curl on modern-ish websites

You might need to auth to a nice forum from curl one day

(ie. with cookies)

Create a variable with your password : (so you won't have your password in history... This is not satisfying if you're not the only admin on the box)

$ pass=`/lib/cryptsetup/askpass "pass:"`
@ylmrx
ylmrx / multithreadedcurl.c
Last active March 22, 2019 11:30
multithreaded fast C code to benchmark stuffs fast
#include <curl/curl.h>
#include <omp.h>
#define MAX_THREAD 32
#define LASERS 100
#define URL "http://www.example.com"
int main(int argc, char *argv[]) {
int tid, i = 0;
FILE *devnull;
@ylmrx
ylmrx / tunnel_in_disguise.py
Created October 1, 2018 15:47
am i a fox?
from __future__ import print_function
import sys
import scapy
from scapy_ssl_tls.ssl_tls import *
import socket
if __name__ == "__main__":
@ylmrx
ylmrx / scratchtray.py
Created October 16, 2019 16:39
Tend une main fraternelle.
#!/usr/bin/env python3
import os
import signal
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('AppIndicator3', '0.1')
from gi.repository import Gtk, AppIndicator3
import threading
from os import path
import time
@ylmrx
ylmrx / .pandoc.bashrc.bash
Created November 20, 2019 18:45
Monitor .md, update .pdf
function pandonitor {
if [[ -f $1 ]]; then
while true; do
inotifywait -qq -e modify $1
if [[ $2 == 'slides_owl' ]]; then
pandoc ${@:3} -t beamer -V theme:owl -o /tmp/pandonitor.pdf $1
elif [[ $2 == 'slides_metro' ]]; then
pandoc ${@:3} -t beamer -V theme:metropolis -o /tmp/pandonitor.pdf $1
elif [[ $2 == 'eis' ]]; then
pandoc ${@:3} --pdf-engine=xelatex --template eisvogel -o /tmp/pandonitor.pdf $1 --listings\
@ylmrx
ylmrx / jomox.lua
Last active January 12, 2022 16:40
jomox.lua
-- random notes ranges are set according to my tastes, sorry about it.
local group_kick = Group {
name = "Kick",
Parameter {
-- not a tune per-se, it's the pitch envelope intensity.
-- we like the 909 here:
randomize_min = 70,
randomize_max = 110,
id = "ktune", name = "Tune", number = 100, type = "cc", default_value = 90 },
Parameter {
@ylmrx
ylmrx / class_midi.lua
Created January 12, 2022 17:30
adding prog_changes
--====================================================--
-- Class: Midi
--====================================================--
--Todo: midi in
class 'Midi'
function Midi:__init(midi_in_device_name,midi_out_device_name,omit_nrpn_lsb)
self.midi_channel = 1
@ylmrx
ylmrx / Configurations___MF_Twister_MIX.lua
Last active January 13, 2022 22:57
MIDI-Fighter Twister Script
--[[----------------------------------------------------------------------------
-- Duplex.MIDI-Fighter-Twister
----------------------------------------------------------------------------]]--
duplex_configurations:insert {
-- configuration properties
name = "Mix",
pinned = true,
-- device properties
@ylmrx
ylmrx / Configurations___MF_Twister_MIX.lua
Created January 14, 2022 00:23
MF Twister Patterns Mix FX
--[[----------------------------------------------------------------------------
-- Duplex.MIDI-Fighter-Twister
----------------------------------------------------------------------------]]--
duplex_configurations:insert {
-- configuration properties
name = "Mix",
pinned = true,