Skip to content

Instantly share code, notes, and snippets.

@kou1okada
kou1okada / opencv-3.1.0-cygwin.patch
Created January 16, 2016 11:56
OpenCV 3.1.0 patch for cygwin.
*** opencv-3.1.0.orig/modules/core/src/parallel.cpp 2016-01-16 20:39:07.880186500 +0900
--- opencv-3.1.0/modules/core/src/parallel.cpp 2016-01-16 20:46:56.376797500 +0900
***************
*** 50,56 ****
#undef abs
#endif
! #if defined __linux__ || defined __APPLE__
#include <unistd.h>
#include <stdio.h>
@kou1okada
kou1okada / vcvars.bat
Created January 13, 2016 02:10
VCVARS Wrapper
@ECHO OFF
SET VER=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
SET ARCH=\bin\x86_amd64\vcvarsx86_amd64.bat
:OPTPARSE
IF "%1" == "" GOTO :MAIN
IF "%1" == "2003" GOTO :OPTPARSE7.1
IF "%1" == "2005" GOTO :OPTPARSE8
IF "%1" == "2008" GOTO :OPTPARSE9
@kou1okada
kou1okada / Ricty-4.0.1-1.cygport
Last active August 7, 2023 09:44
cygports - Cygwin ports
HOMEPAGE="http://www.rs.tus.ac.jp/yyusa/ricty.html"
SRC_URI="
https://github.com/google/fonts/raw/master/ofl/inconsolata/Inconsolata-Regular.ttf
https://github.com/google/fonts/raw/master/ofl/inconsolata/Inconsolata-Bold.ttf
https://osdn.jp/projects/mix-mplus-ipa/downloads/63545/migu-1m-20150712.zip
http://www.rs.tus.ac.jp/yyusa/ricty/ricty_generator-${PV}.sh
http://www.rs.tus.ac.jp/yyusa/ricty/os2version_reviser.sh
"
@kou1okada
kou1okada / benchmark_cygwin_mirrors.bat
Last active November 2, 2021 23:13
Benchmark cygwin mirrors.
@ECHO OFF
ECHO Benchmark cygwin mirrors.
powershell -Command ^
"^
$len = 0;^
$min = 1e9;^
$best = """nothing""";^
Import-Module BitsTransfer;^
Start-BitsTransfer https://cygwin.com/mirrors.lst;^
foreach($mirror in Get-Content mirrors.lst) {^
@kou1okada
kou1okada / hash_check.sh
Last active August 29, 2015 14:18
Read md5 and sha{1,224,256,384,512} sums from the FILEs and check them.
#!/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 ()
{
@kou1okada
kou1okada / ec-aes256.sh
Last active August 29, 2015 14:17
Encrypt file by AES256 and ssh ECDSA key pairs.
#!/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.
@kou1okada
kou1okada / README.md
Last active April 4, 2017 17:44
An initscript for zram.

An initscript for zram

Installation

# for CentOS 6.6
( cd /etc/init.d; export $(grep ^proxy= /etc/yum.conf)>/dev/null; curl -LO ${proxy:+-x $proxy} https://gist.github.com/kou1okada/c22e32283c472490e214/raw/zram && chmod +x zram )
chkconfig --add zram
chkconfig zram on

Configuration

/etc/init.d/zram loads below configuration files.

@kou1okada
kou1okada / fsicout.txt
Created March 20, 2015 15:47
F-Secure Linux Security Full Edition, result of create baseline for lineinteglity check.
This file has been truncated, but you can view the full file.
(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]
@kou1okada
kou1okada / cpufeatures_x86.sh
Last active January 11, 2022 11:53
Show the details of x86 cpu flags found in /proc/cpuinfo.
#!/usr/bin/env bash
function have_command ()
{
type "$1" >& /dev/null
}
function get_local_features ()
{
grep ^flags /proc/cpuinfo \
@kou1okada
kou1okada / morse.sh
Last active April 24, 2022 07:10
Echo by the Morse code of beeps.
#!/usr/bin/env bash
#
# morsh.sh - Echo by the Morse code of beeps.
# Copyright (c) 2015 Koichi OKADA. All rights reserved.
# This script is distributed under the MIT license.
# http://www.opensource.org/licenses/mit-license.php
#
: ${freq:=10000}
: ${delay:=100}