Skip to content

Instantly share code, notes, and snippets.

@jeamland
jeamland / tarpaulin-output.txt
Created May 13, 2020 01:34
Tarpaulin output from tide-rs
> cargo tarpaulin -v
[INFO tarpaulin] Creating config
[INFO tarpaulin] Running Tarpaulin
[INFO tarpaulin] Building project
Compiling libc v0.2.70
Compiling proc-macro2 v1.0.12
Compiling unicode-xid v0.2.0
Compiling autocfg v1.0.0
Compiling cfg-if v0.1.10
Compiling syn v1.0.20
@jeamland
jeamland / fakedevice.py
Created December 2, 2019 04:23
Attempt at a fake device in Python
#!/usr/bin/env python
import os
import select
import subprocess
import time
import traceback
import functionfs
import functionfs.ch9
@jeamland
jeamland / fishbash.txt
Last active October 17, 2018 04:39
fish vs bash
# Necessary establishing information...
fish$ fish --version
fish, version 2.7.1
# Let's create a file that contains newlines.
fish$ cat > testfile.txt
foo
bar
@jeamland
jeamland / playlist_extractor.py
Last active September 14, 2021 21:29
iTunes Library (non-XML) playlist extractor
#!/usr/bin/env python
# Extract playlists from a non-XML iTunes Library file (.itl)
# Copyright (c) 2018 Benno Rice, released under the BSD (2 Clause) Licence.
# Important information on the encryption used in the .itl file found here:
# https://mrexodia.cf/reversing/2014/12/16/iTunes-Library-Format-1
# Highly useful information on the .itl format itself found here:
# https://github.com/josephw/titl/blob/master/titl-core/src/main/java/org/kafsemo/titl/ParseLibrary.java
@jeamland
jeamland / thing.c
Created August 7, 2018 05:38
Benno's Misadventures in libusb
$ uname -a
Darwin benno-mac.local 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64 x86_64$ cc -o thing -I/usr/local/include/libusb-1.0 -L/usr/local/lib thing.c -lusb-1.0
$ ./thing
thing: set config failed: No such device (it may have been disconnected): No such file or directory
thing: claim interface failed: Access denied (insufficient permissions)
import curses
import paho.mqtt.client as mqtt
MQTT_SERVER = '127.0.0.1'
MQTT_TOPIC = 'lolibot/esp32_4e8854/in'
client = mqtt.Client()
client.connect(MQTT_SERVER, 1883, 60)
client.publish(MQTT_TOPIC, '(led:write 255 0 0)')
Python 3.6.4 (default, Dec 19 2017, 15:26:29)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import parse
>>> parse.parse('r{:d}', 'r4')
<Result (4,) {}>
>>> parse.parse('r{:d}', 'r 4')
<Result (4,) {}>
>>> parse.parse('r{:0d}', 'r 4')
<Result (4,) {}>
@jeamland
jeamland / failtest.c
Created August 3, 2017 21:54
Example of jemalloc test failure code
#include <errno.h>
#include <stdio.h>
#include "jemalloc/jemalloc.h"
int
main(int argc, char **argv)
{
int *thing, frob, res;
size_t frobsize;
> invoke --debug build_image --clean build --clean
invoke.program._parse: No default namespace provided, trying to load one from disk
invoke.loader.find: FilesystemLoader find starting at '/src/kth'
invoke.loader.find: Found module: '/src/kth/tasks.py'
invoke.parser.__init__: Adding <parser/Context 'build_image': {'clean': <Argument: clean (c) [bool]>}>
invoke.parser.__init__: Adding <parser/Context 'build': {'clean': <Argument: clean (c) [bool]>}>
invoke.program.parse_tasks: Parsing tasks against <Collection 'tasks': build, build_image>
invoke.parser.__init__: Initialized with context: <parser/Context: {'complete': <Argument: complete [bool]>, 'debug': <Argument: debug (d) [bool]>, 'write-pyc': <Argument: write-pyc [bool]>, 'echo': <Argument: echo (e) [bool]>, 'config': <Argument: config (f)>, 'help': <Argument: help (h) ?>, 'hide': <Argument: hide>, 'list': <Argument: list (l) [bool]>, 'pty': <Argument: pty (p) [bool]>, 'version': <Argument: version (V) [bool]>, 'warn-only': <Argument: warn-only (w) [bool]>
@jeamland
jeamland / bot_ips.csv
Last active February 28, 2017 23:36
Addresses of the bot herd that's been lurking on my IRC channel
timestamp hostname ip
1482994205.3429942 58.65.240.98 58.65.240.98
1482994916.135309 183.88.114.86 183.88.114.86
1482997224.2518485 node-wlx.pool-125-24.dynamic.totbb.net 125.24.165.21
1483000350.4510095 223.206.68.87 223.206.68.87
1483185632.0538342 190.131.223.210 190.131.223.210
1483186654.5194867 178.62.196.230 178.62.196.230
1483186708.4797575 64-199-12-222.ip.mcleodusa.net 64.199.12.222
1483186841.3642223 181.211.145.226 181.211.145.226
1483187355.7932973 181.211.145.226 181.211.145.226