Skip to content

Instantly share code, notes, and snippets.

@jkent
jkent / openocd_ft2232_tumpa.patch
Created November 13, 2012 16:47
OpenOCD: adds proper TIAO USB Multi-Protocol Adapter (TUMPA) support
diff --git a/src/jtag/drivers/ft2232.c b/src/jtag/drivers/ft2232.c
index 6758dc7..091c396 100644
--- a/src/jtag/drivers/ft2232.c
+++ b/src/jtag/drivers/ft2232.c
@@ -194,6 +194,7 @@ static int lisa_l_init(void);
static int flossjtag_init(void);
static int xds100v2_init(void);
static int digilent_hs1_init(void);
+static int tumpa_init(void);
@jkent
jkent / rootfs.sh
Last active December 15, 2021 13:30
#!/bin/bash
##### BEGIN SETTINGS #####
SYSTEM=debian
ARCH=armhf
SUITE=testing
DEVICE=image.bin
HOSTNAME=unknown
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ts=4 et sw=4 sts=4 ai
#
# Makes slideshow XML files for gnome/mate desktop using a
# parameter list of image files.
#
# Example usage;
# make_slideshow.py earthporn/* earthporn/slideshow.xml
@jkent
jkent / make_m3u.sh
Created March 3, 2013 10:43
bash m3u playlist generator
#!/bin/bash
add_song() {
file=`readlink -e "$1"`
name=`basename "$1" | sed 's/\(.flac\|\.m4a\|\.mp3\|\.ogg\|\.wma\)$//i'`
echo "#EXTINF:0,$name" >> $playlist
echo "$file" >> $playlist
}
playlist=$1
@jkent
jkent / ftdi.py
Last active December 14, 2015 17:49
wrapper class for libftdi1 and mpsse i2c bus and device classes
# -*- coding: utf-8 -*-
# vim: ts=4 et sw=4 sts=4 ai
import ftdi1
NONE = ftdi1.NONE
ODD = ftdi1.ODD
EVEN = ftdi1.EVEN
MARK = ftdi1.MARK
SPACE = ftdi1.SPACE
#!/usr/bin/env python
# -*- coding: utf8 -*-
# vim: set ts=4 et
from serial import Serial
import sys
from threading import Thread, Condition
class Reader(Thread):
def __init__(self, ser):
@jkent
jkent / squashfs-special.patch
Created June 10, 2013 07:59
Adds support for an odd lzma image format to unsquashfs. To be used against http://sourceforge.net/projects/squashfs/files/squashfs/squashfs4.2/squashfs4.2.tar.gz
diff -Nrup squashfs-tools/compressor.c squashfs-tools/compressor.c
--- squashfs-tools/compressor.c 2011-02-11 09:49:24.000000000 -0600
+++ squashfs-tools/compressor.c 2013-06-10 02:11:35.096301000 -0500
@@ -59,6 +59,7 @@ static struct compressor xz_comp_ops = {
extern struct compressor xz_comp_ops;
#endif
+extern struct compressor special_comp_ops;
static struct compressor unknown_comp_ops = {
@jkent
jkent / rm04-tool.html
Created June 10, 2013 12:02
Another backdoor for the rm04, need I say any more?
<html>
<head>
<title>HLK-RM04 Tool</title>
<style>
form {
display: inline;
}
</style>
</head>
@jkent
jkent / hlkcrypt.c
Last active January 16, 2024 03:23
This tool encrypts and decrypts uImage formatted firmware for Hilink HLK-RM04 wireless modules. It will also truncate a dump of mtd6 and make it an image suitable for flashing via the stock firmware upgrade page. Build instructions: gcc hlkcrypt.c -lcrypto -o hlkcrypt
/* vim: set ts=4
*
* Copyright (C) 2013 Jeff Kent <jeff@jkent.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@jkent
jkent / linux-2.6.35.7-wheezy-udev-fix.patch
Created December 18, 2013 18:45
Fix for running debian wheezy using FriendlyARM's 2.6.35.7 kernel. Also fixes build with Android arm-eabi-4.6 toolchain
diff -ru linux-2.6.35.7.orig/arch/arm/include/asm/unistd.h linux-2.6.35.7/arch/arm/include/asm/unistd.h
--- linux-2.6.35.7.orig/arch/arm/include/asm/unistd.h 2011-08-07 23:52:04.000000000 -0500
+++ linux-2.6.35.7/arch/arm/include/asm/unistd.h 2013-12-18 11:50:52.123791000 -0600
@@ -392,6 +392,7 @@
#define __NR_rt_tgsigqueueinfo (__NR_SYSCALL_BASE+363)
#define __NR_perf_event_open (__NR_SYSCALL_BASE+364)
#define __NR_recvmmsg (__NR_SYSCALL_BASE+365)
+#define __NR_accept4 (__NR_SYSCALL_BASE+366)
/*