Skip to content

Instantly share code, notes, and snippets.

@n13i
n13i / AndroidManifest.xml
Created Nov 22, 2020
Just connect to BT-PAN NAP and die
View AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.m2hq.pannacotta">
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
View asacocopusher.py
#!/usr/bin/env python3
import sys
import re
import json
import urllib.request
import pychromecast
from pychromecast.controllers.youtube import YouTubeController
# Your Chromecast device name here
View recfsusb2n_watch
#!/bin/sh
/usr/local/bin/recfsusb2n $@
PID=`pgrep --parent 1 --oldest recfsusb2n`
if [ -z "${PID}" ]; then
exit 1
fi
echo "recfsusb2n running: PID=${PID}"
View BonDriver_HTTP_inipath.patch
--- BonDriver.cpp Thu Aug 22 19:52:37 2013
+++ BonDriver.cpp Thu Aug 22 19:55:00 2013
@@ -9,10 +9,21 @@
BOOL APIENTRY DllMain(HINSTANCE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
+ INT size = 0;
+ LPTSTR p = NULL;
+
switch(ul_reason_for_call){
View recfsusb2n+http_patch2+connect_card_retry_on_init+no_gethostbyaddr.patch
diff -Nru arib25/b_cas_card.c.orig arib25/b_cas_card.c
--- arib25/b_cas_card.c.orig 2013-08-22 00:40:00.740962104 +0900
+++ arib25/b_cas_card.c 2013-08-22 00:42:34.592962106 +0900
@@ -135,6 +135,7 @@
static int init_b_cas_card(void *bcas)
{
int m;
+ int retry_count;
B_CAS_CARD_PRIVATE_DATA *prv;
@n13i
n13i / Makefile
Created Aug 14, 2017
Shutdown the Raspbian when GPIO24 is continuously HIGH for 5 seconds
View Makefile
gpio_shutdown: gpio_shutdown.o
cc -o $@ $^ -lwiringPi
.c.o:
cc -c $<
clean:
@rm gpio_shutdown
@rm gpio_shutdown.o
@n13i
n13i / 60-gpsd.rules
Created May 4, 2017
Raspbian with u-blox 7 /etc/udev/rules.d/60-gpsd.rules
View 60-gpsd.rules
SUBSYSTEM!="tty", GOTO="gpsd_rules_end"
# u-blox AG, u-blox 7 [linux module: cdc_acm]
ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a7", SYMLINK+="gps%n", TAG+="systemd", ENV{SYSTEMD_WANTS}="gpsdctl@%k.service"
ACTION=="remove", TAG+="systemd", ENV{SYSTEMD_WANTS}="gpsdctl@%k.service"
LABEL="gpsd_rules_end"
View dated-commit.sh
#!/bin/sh
LIST=`find . -type d -name ".git" -prune -or -type f -print`
# lsコマンドのオプションはFreeBSD 10.1のlsコマンドを想定しているので注意
for f in ${LIST}; do
FDATE=`LANG=C ls -l -D "%a, %d %b %Y %T %z" "$f" | cut -d " " -f 9-14`
FNAME=`basename "$f"`
echo "[$FDATE] [$FNAME] [$f]"
git add "$f"
View gollum-macro-listtree.rb
module Gollum
class Macro
class ListTree < Gollum::Macro
def render(tree_expr, heading_level = 3)
re = Regexp.new("^(" + tree_expr + ")\/");
subtree = {}
result = ''
if @wiki.pages.size > 0
View pw2hfs.rb-convlink.patch