Skip to content

Instantly share code, notes, and snippets.

@NeoCat
NeoCat / New Data
Last active December 30, 2015 15:59
LED FAN data
0 02 [][][][][] [] 40 37 [] []
1 0e [][][] [] 41 37 [] []
2 7f 42 40 [][][][][][]
3 7f 43 00 [][][][][][][]
4 02 [][][][][] [] 44 77 []
5 7f 45 77 []
6 7f 46 77 []
7 51 [] [][][] 47 00 [][][][][][][]
8 36 [] [] [] 48 09 [][][] [][]
9 36 [] [] [] 49 76 [] []
@NeoCat
NeoCat / Makefile
Created November 18, 2013 21:18
にゃんぱすー と表示するカーネルモジュール 使用方法: make && sudo insmod nyanpasu.ko && cat /dev/renchon
obj-m = nyanpasu.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
@NeoCat
NeoCat / yurex-de-eject.sh
Created November 13, 2013 21:52
YUREX de eject
while :;do x=$y;sleep 2;y=$(cat /dev/yurex0);o=;[ $(($y-x)) -gt 2 ]&&o=-t;eject $o;done
@NeoCat
NeoCat / gist:7094377
Created October 22, 2013 02:37
kobo nickel stack dump
OH THE HUMANITY!
pid: 521, tid: 521, rev: ra7895c24594703fbed76484252e6d4c55a06d355
>>> /usr/local/Kobo/nickel <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 03e40000
r0 03e40000 r1 2d875c90 r2 00000000 r3 00000000
r4 2d875c90 r5 03e40000 r6 2d875d08 r7 00000001
r8 008426c8 r9 2bd83170 10 00805d54 fp 00805d40
ip 2dc0d828 sp 7ece76e8 lr 2da05e03 pc 2e9618c0 cpsr 200d0030
#00 sp: 0x7ece76e8 ip: 0x2e9618c0 /lib/libc-2.11.1.so: _IO_str_pbackfail+0x1563
--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
@NeoCat
NeoCat / gist:6690302
Last active December 23, 2015 20:29
tcpdump of Siri connection with MPTCP option Captured with https://github.com/multipath-tcp/tcpdump on the gateway server (Linux with MPTCP patch). DNS server is modified to answer the gateway server's IP address for guzzoni.apple.com "LTE" means iPhone's LTE network address.
22:28:46.003820 IP iPhone.1024 > daisy.apple.com.https: Flags [S], seq 3599195999, win 65535, options [mss 1460,nop,wscale 3,mptcp capable {0x72d38468f5b08cec},nop,nop,TS val 172462590 ecr 0,sackOK,eol], length 0
22:28:46.005030 IP daisy.apple.com.https > iPhone.1024: Flags [S.], seq 486719052, ack 3599196000, win 14280, options [mss 1460,sackOK,TS val 12199698 ecr 172462590,nop,wscale 7,mptcp capable csum {0x2bbdacfe975af7bf}], length 0
22:28:46.028714 IP iPhone.1024 > daisy.apple.com.https: Flags [.], ack 1, win 8211, options [nop,nop,TS val 172462684 ecr 12199698,mptcp capable csum {0x72d38468f5b08cec,0x2bbdacfe975af7bf}], length 0
22:28:46.093564 IP iPhone.1024 > daisy.apple.com.https: Flags [P.], seq 1:141, ack 1, win 8211, options [nop,nop,TS val 172462699 ecr 12199698,mptcp dss ack 330982975 seq 3246344230 subseq 1 len 140 csum 0xeb65], length 140
22:28:46.093958 IP daisy.apple.com.https > iPhone.1024: Flags [.], ack 141, win 232, options [nop,nop,TS val 12199791 ecr 172462699,mptcp add-addr id 1 local
@NeoCat
NeoCat / yurex
Created May 7, 2013 22:17
munin plugin for YUREX
#!/bin/sh
# check the /dev/yurex0 is readable from user 'munin'!
if [ "$1" = "config" ]; then
cat << EOM
graph_title Yurex BBU
graph_vlabel BBU
yurex.label yurex
EOM
@NeoCat
NeoCat / RC-heli.ino
Created December 9, 2012 08:02
Kinect Controller for Helicopter FS-IRH100
// Arduino Sketch to send IR signal to FS-IRH100
// Connect Infra-red LED to pin 3 & GND
// bit set / clear
#ifndef cbi
#define cbi(PORT, BIT) (_SFR_BYTE(PORT) &= ~_BV(BIT))
#endif
#ifndef sbi
#define sbi(PORT, BIT) (_SFR_BYTE(PORT) |= _BV(BIT))
@NeoCat
NeoCat / fb2bmp.c
Created October 20, 2012 16:32
Kobo Screen captute via HTTP
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
struct __attribute__((packed)) bitmapFileHeader {
unsigned char bfType[2];
unsigned int bfSize;
unsigned short bfReserved1;
unsigned short bfReserved2;
/*アイコン縮小*/
.uicon{width:16px;height:16px;}
/*行間*/
.status{line-height: 1.5;}
/*リンク背景透明化*/
span.status a.link,span.status a.resolved,span.status a.link:hover{background-color:transparent !important;border:0;}
/*RTアイコン非表示*/
@NeoCat
NeoCat / mv_sata_standby.c
Created September 27, 2012 14:26
HDD Spin down driver for marvell SATA controller (mvSATA) in LS-GL
#include <linux/module.h>
#include <linux/kernel.h>
#include <scsi/scsi_host.h>
#define MV_LINUX
#define MV_ARM
#define MV_CPU_LE
#include "mvSata.h"
#include "mvLinuxIalHt.h"