Skip to content

Instantly share code, notes, and snippets.

View TakashiSasaki's full-sized avatar

Takashi SASAKI TakashiSasaki

View GitHub Profile
@TakashiSasaki
TakashiSasaki / squid.conf
Last active December 16, 2015 08:29
my squid.conf for QNAP TS-1079 Pro. Actually squid.conf should not modified directly. Use its own web interface.
# The user name and group name Squid will operate as
cache_effective_user httpdusr
cache_effective_group everyone
#
# Recommended minimum configuration:
#
# Auth Method
#auth_param basic program /share/MD0_DATA/.qpkg/Squid/opt/libexec/squid/ncsa_auth /etc/shadow
#auth_param basic children 5
@TakashiSasaki
TakashiSasaki / gist:5412424
Last active December 16, 2015 09:19
JSONバリデータを使ってみるためだけのダミーのJSONデータw
{}
@TakashiSasaki
TakashiSasaki / item.schema.json
Last active December 16, 2015 10:29
対象物とメタデータを関連付けるオブジェクト http://jsonschemalint.com/ でバリデート済み。 *.jsはJSONP版。
{
"$schema": "http://json-schema.org/draft-03/schema",
"id": "https://gist.github.com/TakashiSasaki/5420814/raw/schema.json",
"title": "root",
"title-authority": [
"http://json-schema.org/latest/json-schema-validation.html#anchor97",
"http://json-schema.org/latest/json-schema-core.html#anchor7"
],
"title-description": "Title is a metadata keyword and will preferrably be short.",
"description": null,
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8"/>
<title>minimul HTML document</title>
</head>
<body></body>
</html>
@TakashiSasaki
TakashiSasaki / jsdoit.css
Created April 27, 2013 09:05
forked: JavaScript のオブジェクトを可視化するやーつ
body { background-color: #DDDDDD; font: 12px sans-serif; }
td, th {
border-width: 1px;
border-color: #99a;
border-style: solid;
}
table {
margin: 4px 2px;
@TakashiSasaki
TakashiSasaki / get-all-gae-log.sh
Last active December 16, 2015 18:49
Google App Engine for Pythonアプリの全バージョンの全ログをぶっこ抜く。 Google App Engineでappcfg.pyを使ってログを取得しようとするとバージョン文字列を指定しなければならない。そこで過去にデプロイしたことがあるすべてのバージョン文字列を得る必要があった。なお、バージョン文字列が特定できれば次のコマンドで当該バージョンのログを取得することができる。
appcfg.py --secure --include_all --num_days=0 request_logs /path/to/my/gaeapp\
--version=version_string version_string.log
@TakashiSasaki
TakashiSasaki / README
Created April 29, 2013 14:02
JSONオブジェクトの可視化
jQuery 1.9からappendやafterの挙動が変わりました。
http://myjquery.blog.fc2.com/blog-entry-14.html
http://jsdo.it/ogaoga/mlE0 は jQuery 1.6で書かれていましたので 1.9 で動くようにしました。
結果として得られる画面は全く同じです。
--- 以下の記述は元のREADMEの一部です ---
テキストエリアに JSON をコピペしてボタンを押すと、そのデータ構造をテーブル形式で可視化します。
フルスクリーンにして Twitter API とかの JSON 出力を貼付けると面白いです。
@TakashiSasaki
TakashiSasaki / android_winusb.ini
Last active December 17, 2015 03:39
LifeTouch L 一般向けモデル(法人向けモデルではない)のための設定を含むINFファイルに追記する行。 [Google.NTx86]および[Google.NTamd64]の下に追記。 http://www.nec.co.jp/solution/cloud/communicator/apdev/ の情報だけでは不十分だった。 単にデバイスマネージャからデバイスIDを読み取っただけ。 http://android.kojin.biz/AdbDriverMaker/http://tmurakam.hatenablog.com/entry/2012/07/07/183215 も 参考にしたのだが、どうやらファームウェアのバージョンによって異なるようなので、 僕が今使っている Li…
;LifeTouch L (Consumer Model)
%SingleAdbInterface% = USB_Install, USB\VID_0409&PID_032F&REV_0216&MI_00
%CompositeAdbInterface% = USB_Install, USB\VID_0409&PID_032F&MI_00
; the following lines comes from http://www.nec.co.jp/solution/cloud/communicator/apdev/. Just FYI.
;LifeTouch L (Enterprise Model)
%SingleAdbInterface% = USB_Install, USB\VID_0409&PID_032F
%CompositeAdbInterface% = USB_Install, USB\VID_0409&PID_032F&MI_01
%SingleAdbInterface% = USB_Install, USB\VID_0409&PID_032D
@TakashiSasaki
TakashiSasaki / authz_ldap.conf
Created May 9, 2013 14:31
HTTPベーシック認証の情報源をLDAPにしようとしてmod_auth_ldap.soを導入。肝はAuthLDAPUrlにベース、スコープ、キーの指定まで全部入れちゃえってこと。BASIC認証なのでページ自体もhttpsで。
LoadModule authz_ldap_module modules/mod_authz_ldap.so
LDAPVerifyServerCert Off
<IfModule mod_authz_ldap.c>
<Location />
AuthzLDAPMethod ldap
AuthLDAPUrl ldaps://192.168.0.1/dc=ore,dc=no,dc=erudappu?uid
AuthzLDAPUserScope subtree
AuthzLDAPAllowPassword on
@TakashiSasaki
TakashiSasaki / collision_sample.cc
Last active February 1, 2022 12:30
7月21日に受け取ったソースコード raw socketを使うようにして待ち行列のサイズを小さくしパケット損失が正しく起こるようにした。
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2009 The Boeing Company
*
* 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