Skip to content

Instantly share code, notes, and snippets.

@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 / honeywell_set_temp.sh
Last active August 17, 2024 15:14
Set temperature of honeywell Wi-Fi thermostat by shell script
#!/bin/bash
# Usage: ./honeywell_settmp.sh [-c|-h|-o] [<temp(F)>|schedule]
# Example: ./honeywell_settmp.sh -h 72 # set HEAT: temp=72F
# ./honeywell_settmp.sh -c schedule # set COOL: follow shceduled temp
# ./honeywell_settmp.sh -o # turn system OFF
######## Settings ########
LOGIN="YOUR_MAIL_ADDRESS"
PASSWORD="YOUR_PASSWORD"
@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"
@NeoCat
NeoCat / .emacs
Created May 23, 2012 07:40
.emacs to bind "C-c c" to `make' in the directory with the nearest Makefile
(require 'cl)
(defun* get-closest-file-dir (&optional (file "Makefile"))
"Determine the directory of the first instance of FILE starting from the current directory towards root.
This may not do the correct thing in presence of links. If it does not find FILE, then it shall return nil."
(let ((root (expand-file-name "/")))
(loop
for d = default-directory then (expand-file-name ".." d)
if (file-exists-p (expand-file-name file d)) return d
if (equal d root) return nil)))
@NeoCat
NeoCat / play-ipaddr.sh
Created April 17, 2012 16:47
flu-card - play sound based on IP address ( 0=B↓, 1=C, 2=D, 3=E, ... 7=B, 8=C↑, 9=D↑ )
ifconfig | awk '/inet addr:/{split($2,a,".");split(a[4],b,"");for(x in b) print "QUERY_STRING=\"fn=" int(246*(2**(1/12))**(b[x]*2-(b[x]>0)-(b[x]>3)-(b[x]>7))) "\" playNote"}' | sh
@NeoCat
NeoCat / LibHook.h
Created December 25, 2011 13:48
Hook hidden symbol call (x86_64)
#include <string.h>
#include <dlfcn.h>
#include <err.h>
#include <errno.h>
#include <sys/mman.h>
#define LIB_PATH "libc.so.6"
template <class RET, class... ARGV>
class LibHook {