Skip to content

Instantly share code, notes, and snippets.

View fujieda's full-sized avatar

Kazuhiro Fujieda fujieda

View GitHub Profile
@fujieda
fujieda / arc_miss.txt
Created December 14, 2012 11:44
Data about ARC misses in ZFS on ftp.jaist.ac.jp
tracing...
arc
nscd, fop_read, 1
sched, fop_lookup, 1
sshd, fop_read, 1
rsync, fop_mkdir, 2
httpd, others, 3
dosync, fop_lookup, 4
rsync, fop_create, 4
kcfd, fop_readdir, 5
@fujieda
fujieda / gist:4427166
Created January 1, 2013 12:47
【これが海の十二支だ!】をパクリツイートしたアカウント一覧。パクリツイートの嫌いな人は http://kill1000favs.exsen.org/?r4s=1 でR4Sするといいよ。
614_zeus
Angelic_LaLa
Aoi_sgt
ArcanistN
BLACK__LAGOON
Eternal1996
GasyapokeXTREME
Gyo__Rai
KiyAto28
MASSEpiano
@fujieda
fujieda / gist:4743730
Created February 9, 2013 03:41
Set c-basic-offset to 2.
(add-hook 'c++-mode-hook
(lambda ()(setq c-basic-offset 2)))
@fujieda
fujieda / raspberrypi.pl
Last active December 12, 2015 09:29
A Perl script to mirror SD card images of Raspberry Pi
#!/usr/bin/env perl
# A script to mirror SD card images of Raspberry Pi
# Licensed under the MIT license: http://fujieda.mit-license.org/2013
use strict;
use HTTP::Tiny;
use HTTP::Date;
use File::Path qw(mkpath);
my $rpi = "raspberrypi";
@fujieda
fujieda / ConfigFileSettingsProvider.cs
Created March 22, 2013 14:18
Formの設定プロパティを実行ファイルのあるディレクトリに"アプリケーション名.conf"で保存するための設定プロバイダー。 Settings.csでSettingsクラスに属性として[SettingsProvider(typeof(MyNamespace.ConfigSettingsProvider))]のように指定する。Settings.csはかなり見付けにくい。プロジェクトのプロパティから「設定」を選んで表示されるデザイナーからコードの表示を選ぶと開ける。 This program is licensed under the MIT License: http://fujieda.mit-license.org/2013
// Formの設定プロパティを実行ファイルのあるディレクトリに"アプリケーション名.conf"で保存するための設定プロバイダー。
// Settings.csでSettingsクラスに属性として[SettingsProvider(typeof(MyNamespace.ConfigSettingsProvider))]のように指定する。
// Settings.csはかなり見付けにくい。プロジェクトのプロパティから「設定」を選んで表示されるデザイナーからコードの表示を選ぶと開ける。
// This program is licensed under the MIT License:
// http://fujieda.mit-license.org/2013
using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
@fujieda
fujieda / arc_miss.txt
Created February 1, 2016 15:43
ARC misses by vnode operations on ftp.jaist.ac.jp
arc
bash, fop_lookup, 1
cron, fop_read, 1
dosync, fop_read, 1
ntpd, fop_write, 1
sshd, fop_getpage, 1
sshd, fop_read, 1
rsync, fop_create, 2
cron, fop_lookup, 3
ksh93, fop_lookup, 3
@fujieda
fujieda / gist:8c4e8e30861d4ae1df5a
Last active March 9, 2016 05:10
Status of Intel SSD 750 on ftp.jaist.ac.jp
[Controller]
PCI Vendor ID: 0x8086
PCI Subsystem Vendor ID: 0x8086
Model Number: INTEL SSDPEDMW012T4
Serial Number: CVCQ5466016U1P2BGN
Firmware Revision: 8EV10174
Recommended Arbitration Burst: 0
IEEE OUI Identifier: E4-D2-5C
Multi_interface Capabilities: 0
Maximum Data Transfer Size: 5
@fujieda
fujieda / PushBullet.cs
Created May 19, 2017 12:58
Push a note to all devices via PushBullet
using System.Net;
using System.Text;
namespace KancolleSniffer
{
public class PushBullet
{
public static void PushNote(string token, string title, string body)
{
using (var wc = new WebClient())
// https://fujieda.mit-license.org/
static IEnumerable<IEnumerable<T>> Permutation<T>(T[] items)
{
return items.Length == 1
? new[] {items}
: items.SelectMany(item =>
Permutation(items.Where(x => !x.Equals(item)).ToArray())
.Select(perms => new[] {item}.Concat(perms)));
}
@fujieda
fujieda / PriorityQueue.cs
Created July 22, 2020 08:23
Priority Queue for C#
// Copyright (c) 2020 Kazuhiro Fujieda
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR