Skip to content

Instantly share code, notes, and snippets.

View TakashiSasaki's full-sized avatar

Takashi SASAKI TakashiSasaki

View GitHub Profile
@TakashiSasaki
TakashiSasaki / wifi-phy-test.cc
Created July 24, 2013 06:22
オリジナルのwifi-phy-test.ccから衝突を起こさせる部分だけを取り出して整理。
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2005,2006 INRIA
*
* 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
@TakashiSasaki
TakashiSasaki / .screenrc
Created August 19, 2013 06:43
$HOME/.screenrc の設定。/etc/screenrcでもいいはずだけど。
vbell on
escape ^z^z
startup_message off
defscrollback 10000
@TakashiSasaki
TakashiSasaki / safedd
Last active December 21, 2015 06:49
safedd is a wrapper script for dd which cares forbidden 'of' targets listed in /etc/safeadd.conf .
#!/bin/sh
if [ ! -e /etc/safedd.conf ]; then
echo /etc/safedd.conf is not found.
echo Each line should be regex for forbidden '"'of'"' parameter.
echo Example of /etc/safedd.conf :
echo ' .*dev/sda.*'
echo ' .*dev/md[0-9].*'
exit -1
fi
@TakashiSasaki
TakashiSasaki / id_rsa.pub
Created August 20, 2013 03:46
OpenSSH public key
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6+0NcOzPeLn48cvNIqZabmr3KZ3YlzX3vrNH5WKJP5Q+QN0fU0k7jcOJ4HlNArwt5nCy8wofMkHfzIsVBiALTGqARguBMp56Q8GcCgu1tyZl5P1GiANstnJfoZ7cSSfVLpKZDDFZXAP0eUr3oOiqVSlIBZ8L6zxBOwfzR3F+rUa75B/f4VZlr9tXq/sShiC7GGXJGOj840LqZUDKWV/4SqKsLHX1xwezgKtD3a8pG/n9gnp1bMaYveGseAHe5FtW4TFZS6SNQT49+43a923P+f8BpXKBmJDz4RYvMiR1xxZ/Altn0kjSSLvQDHHjIHAywe6qk7LpMXR4+OMdzw9diQ== sasaki@SASAKI64
@TakashiSasaki
TakashiSasaki / block_quickmail.php-new
Last active December 22, 2015 23:29
Moodle用のモジュール「クイックメール」の日本語向け言語ファイル。 block_quickmail.php-old は https://moodle.org/mod/forum/discuss.php?d=63686 からリンクを辿って入手したものなので2008年当時のもの。 block_quickmail.php-newはQuickMail 1.2.8/Moodle 2.3向けに自分で作成したもの。 両者を並べているのは比較して前者に良い表現があれば使わせていただきたいと思ったから。 moodledata/lang/ja_local/block_quickmail.php にコピーして使う。
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
@TakashiSasaki
TakashiSasaki / Tags-labels-folders.md
Last active December 23, 2015 02:39
A JSON schema to describe tags, labels and folders for generic document organizing

A JSON schema to describe tags, labels and folders for generic document organizing. It should be validated by http://jsonschemalint.com/ .

@TakashiSasaki
TakashiSasaki / Subschema-with-reference.schema.json
Last active December 23, 2015 02:58
JSONスキーマでサブスキーマを扱ってみた。 http://jsonschemalint.com/ で検証済みだが、これはdraft v3に準拠しているのでちょっと古い。現在はdraft v4。 https://datatracker.ietf.org/doc/draft-zyp-json-schema/
{
"$schema": "http://json-schema.org/draft-03/schema#",
"id": "https://gist.github.com/TakashiSasaki/6568391/raw/tags-labels-folders.schema.json#",
"type": "object",
"properties": {
"name": {
"type": "string",
"required": true
},
"y": {
@TakashiSasaki
TakashiSasaki / enum-string-null.schema.json
Last active August 29, 2018 23:43
「特定の文字列もしくはnullを取る」をJSONスキーマで表現する。 http://jsonschemalint.com/ で検証済み。ただし JSON Schema Draft v3。
{
"type": "object",
"properties": {
"x": {
"type": [
"string",
"null"
],
"required": false,
"enum": [
// 文字列 挿入マクロ(秀丸エディタ用)
// 選択範囲の行頭に入力された文字列を挿入する
#cnt = selendy - seltopy;
$wrk = input("挿入する文字列を入力してください","");
while( #cnt > 0 )
{
replacedown "^", $wrk, regular, inselect;
#cnt = #cnt - 1;
}
endmacro;
@TakashiSasaki
TakashiSasaki / wifi-multihop-test.cc
Last active December 24, 2015 15:29
2013年10月3日阿部君から貰ったファイルをそのまま貼り付け。 ただし今後は阿部君のgistページをforkしたものを編集するので、 このgistページはこれ以上触らない。
//lambda, sim_countをコマンドライン引数として与える必要あり
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/mobility-module.h"
#include "ns3/config-store-module.h"
#include "ns3/wifi-module.h"
#include "ns3/internet-module.h"
#include "ns3/propagation-module.h"
#include "ns3/olsr-helper.h"