Skip to content

Instantly share code, notes, and snippets.

View nonakap's full-sized avatar

Kimihiro Nonaka nonakap

View GitHub Profile
@nonakap
nonakap / files.amd64
Created June 29, 2012 08:25
BHyVe×NetBSD (1)
# BIOS32 routines
define bios32
file arch/amd64/amd64/bios32.c bios32 needs-flag
# BHyVe
device vmm {}
#
# System bus types
#
@nonakap
nonakap / procfs.fizzbuzz.c.diff
Created August 9, 2012 08:20
Fizz Buzz on procfs
diff --git a/sys/miscfs/procfs/procfs.h b/sys/miscfs/procfs/procfs.h
index 170368f..e093a59 100644
--- a/sys/miscfs/procfs/procfs.h
+++ b/sys/miscfs/procfs/procfs.h
@@ -110,6 +110,7 @@ typedef enum {
PFSstatm, /* process memory info (if -o linux) */
PFSversion, /* kernel version (if -o linux) */
PFStask, /* task subdirector (if -o linux) */
+ PFSfizzbuzz, /* Fizz Buzz */
#ifdef __HAVE_PROCFS_MACHDEP
@nonakap
nonakap / nbsd-dmesg-macbook_air_mid_2011.txt
Created September 14, 2012 17:23
NetBSD dmesg on Apple MacBook Air Mid 2011
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2010, 2011, 2012
The NetBSD Foundation, Inc. All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.
NetBSD 6.0_RC1 (GENERIC)
total memory = 4006 MB
avail memory = 3875 MB
timecounter: Timecounters tick every 10.000 msec
@nonakap
nonakap / dynabook_AZ-bootlog.txt
Created September 16, 2012 13:36
dynabook AZ boot log
==== Debug Console(Jul 29 2010 19:07:27) ====
Checking for android ota recovery
OS will cold boot in 0 seconds if no input is detected
No Keyboard are detected - Booting Android
Cold-booting Linux
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Linux version 2.6.29-arm2-svn1996 (si@project-laptop) (gcc version 4.4.0 (GCC) ) #1 SMP PREEMPT Thu Aug 5 02:04:36 CST 2010
@nonakap
nonakap / nbsd-per-user-tmp.diff
Created September 29, 2012 02:44
[NetBSD] buf-fix and improvement per-user tmp.
diff --git a/etc/rc.d/cleartmp b/etc/rc.d/cleartmp
index 384bfa97..4fbc0c0 100755
--- a/etc/rc.d/cleartmp
+++ b/etc/rc.d/cleartmp
@@ -39,6 +39,25 @@ cleartmp_start()
(cd ${tmp_dir} && rm -rf [a-km-pr-zA-Z]* &&
find -x . ! -name . ! -name lost+found ! -name quota.user \
! -name quota.group -exec rm -rf -- {} \; -type d -prune)
+
+ if checkyesno per_user_tmp && [ -d ${per_user_tmp_dir} ]; then
@nonakap
nonakap / netbsd-pc98-i386.txt
Created November 11, 2012 11:27
2003年頃にNetBSD/pc98をどうにかしようと思っていた頃のarch/i386分離案らしい…
i386 分離
とりあえず IBM PC/AT 互換機依存部分は arch/pcat に移動させる。
pc98 依存部分は arch/pc98 に突っ込む。
FM-R と FM-TOWNS は arch/fm かなぁ。
--
i386/acpi -> pcat/acpi
i386/bios -> pcat/bios
i386/bioscall -> pcat/bioscall
@nonakap
nonakap / marzullo.php
Created January 28, 2013 04:23
Marzullo's algorithm based on https://gist.github.com/3684493
<?php
/**
* Marzullo's algorithm
*
* @see http://en.wikipedia.org/wiki/Marzullo%27s_algorithm
* @see https://gist.github.com/3684493
*/
function marzullo_algorithm($ranges)
{
$table = array();
@nonakap
nonakap / gist:5251516
Created March 27, 2013 03:59
NetBSD: /usr/libdata
total 40
drwxr-xr-x 2 root wheel 4608 Mar 7 18:25 lint/
drwxr-xr-x 2 root wheel 512 Mar 7 18:20 ldscripts/
drwxr-xr-x 6 root wheel 512 Mar 7 15:19 debug/
drwxr-xr-x 3 root wheel 512 Mar 7 15:19 firmware/
./lint:
total 3848
-r--r--r-- 1 root wheel 464 Mar 7 17:20 llib-lre.ln
-r--r--r-- 1 root wheel 3192 Mar 7 17:20 llib-lmp.ln
function GetMD5{
param($fileName)
$stream = New-Object IO.StreamReader $fileName
$md5 = [System.Security.Cryptography.MD5]::Create()
$hash = $md5.ComputeHash($stream.BaseStream);
$result = [System.BitConverter]::ToString($hash).Replace("-","").ToLower()
$result
}
date; Get-ChildItem ***ここにディレクトリを指定する*** -recurse | ?{ !$_.PSIsContainer } |
@nonakap
nonakap / taptst10ctl.py
Last active December 19, 2015 19:38
SANWA SUPPLY TAP-TST10 control tool. Moved to https://github.com/nonakap/taptst10ctl
#!/usr/bin/env python
#
# Copyright (C) 2013 NONAKA Kimihiro <nonakap@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.