This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
template < typename Func > | |
inline void f_with_ref( Func &func ) | |
{ | |
func() ; | |
} | |
template < typename Func > | |
inline void f_with_cpy( Func func ) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'highline' | |
require 'net/imap' | |
require 'optparse' | |
$config = {} | |
$config[:ssl] = true | |
opts = OptionParser.new | |
opts.on("-h", "--host HOST" ){|v| $config[:host] = v } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
Win32::Registry::Error.new(259) | |
rescue ArgumentError => e | |
if e.message == "invalid byte sequence in UTF-8" | |
class Win32::Registry::Error | |
FormatMessageW = Kernel32.extern "int FormatMessageW(int, void *, int, int, void *, int, void *)", :stdcall | |
def initialize(code) | |
@code = code | |
msg = "\0\0".force_encoding(Encoding::UTF_16LE) * 1024 | |
len = FormatMessageW.call(0x1200, 0, code, 0, msg, msg.size, 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;------------------------------------------------------------------------------ | |
; Scan with Windows Defender | |
; Copyright (c) 2014 Koichi OKADA | |
; | |
; License: | |
; The MIT Licensee. | |
; Reference: | |
; http://msdn.microsoft.com/en-us/library/windows/hardware/ff547433.aspx | |
; http://www.atmarkit.co.jp/ait/articles/1307/05/news055.html | |
;------------------------------------------------------------------------------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Copyright (c) 2014 Koichi OKADA. All right reserved. | |
# This script is distributed under the MIT license. | |
# http://www.opensource.org/licenses/mit-license.php | |
require "optparse" | |
SECTOR_SIZE = 512 | |
UFS2_SBLK_LIST = [128, 16, 0, 512] | |
UFS2_SBLK_SIZE = 0x560 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; MBR test for PC/AT | |
;; | |
;; @assemble | |
;; nasm mbr_test.asm -f bin -o mbr_test.bin | |
;; | |
;; @run | |
;; qemu-system-i386 -hda mbr_test.bin | |
;; | |
[bits 16] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Recover timestamp which is destroyed by the default file manager (com.kyocera.filemanager) of KYOCERA DIGNO T 302KC. | |
# Copyright (c) 2014 Koichi OKADA. All rights reserved. | |
# This script is distributed under the MIT license. | |
# http://www.opensource.org/licenses/mit-license.php | |
# | |
[ -n "$DEBUG" ] && set -x |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(Re)calculating baseline now | |
[Note] /bin/findmnt: Accept to baseline? | |
([Y]es,[N]o,[A]ll yes, [D]isregard new entries) [auto] | |
[Note] /bin/chgrp: Accept to baseline? | |
([Y]es,[N]o,[A]ll yes, [D]isregard new entries) [auto] | |
[Note] /bin/ln: Accept to baseline? | |
([Y]es,[N]o,[A]ll yes, [D]isregard new entries) [auto] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Copyright (c) 2015 Koichi OKADA. All rights reserved. | |
# This script is destributed under the MIT license. | |
# | |
if (( $# != 3 )); then | |
cat <<EOD | |
Usage: $(basename $0) key peerkey file | |
Encrypt file by AES256 and ssh ECDSA key pairs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Copyright (c) 2015 Koich OKADA. All rights reserved. | |
# This script is distributed under the MIT license. | |
# | |
# dummy command for unknown sum. | |
# Usage: unknownsum | |
function unknownsum () | |
{ |
OlderNewer