Skip to content

Instantly share code, notes, and snippets.

@n13i
n13i / gist:5421671
Last active Jul 23, 2016
#moyasearch
View gist:5421671
#!/usr/bin/perl
use warnings;
use strict;
use utf8;
use FindBin qw($Bin);
use Encode;
use YAML;
use Net::Twitter::Lite::WithAPIv1_1;
use DateTime;
View update-l2tp-outside-address
#!/bin/vbash
source /opt/vyatta/etc/functions/script-template
SET=${SBIN_PATH}/my_set
COMMIT=${SBIN_PATH}/my_commit
configure
current_set_ipaddr=$($API returnValue vpn l2tp remote-access outside-address)
current_ext_ipaddr=$(echo -n "$(run show interfaces pppoe pppoe0)" | grep inet | cut -d' ' -f6)
View convlink.pl
View pw2hfs.rb-convlink.patch
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 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"
@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"
@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
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;
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){