Skip to content

Instantly share code, notes, and snippets.

@kou1okada
kou1okada / README.md
Last active November 28, 2017 13:29
KeePass export XML utilities
@kou1okada
kou1okada / README.md
Created October 6, 2017 14:46
patch for dvipdfmx.cfg
@kou1okada
kou1okada / httpdate.sh
Last active January 11, 2022 11:53
httpdate.sh - Get date information from http.
#!/usr/bin/env bash
#
# httpdate.sh - Get date information from http
# Copyright (c) 2017 Koichi OKADA. All rights reserved.
# This script is distributed under the MIT license.
#
function help ()
{
cat<<-EOD
@kou1okada
kou1okada / usbhub_rebind.sh
Last active September 27, 2017 12:41
usbhub_rebind.sh - USB hub rebind.
#!/usr/bin/env bash
#
# USB hub rebind
# Copyright (c) 2017 Koichi OKADA. All rights reserved.
# This script is distributed under the MIT license.
#
function usbhub_rebind () #= usb[0-9]+
{
local PCIDEV="$(realpath "/sys/bus/usb/devices/${1}")"
@kou1okada
kou1okada / gethash.cpp
Created September 8, 2017 05:01
Get a hash for `thumbcache_*.db`.
/**
* Usage: gethash FULLPATH EXT
* ex)
* gethash C:\Users\kou\Pictures\20160904_090200.PNG .PNG
*
* Copyright (c) 2017 Koichi OKADA.
* License:
* GPLv3 or later.
*/
@kou1okada
kou1okada / Dockerfile
Last active April 14, 2017 12:09
docker-xymon
FROM ubuntu
MAINTAINER kou1okada <[email protected]>
env DEBIAN_FRONTEND=noninteractive
RUN \
apt-get update &&\
apt-get install -y apache2 &&\
a2enmod rewrite &&\
apt-get install -y xymon &&\
@kou1okada
kou1okada / README.ja.md
Last active October 18, 2024 09:24
Pollard's rho algorithm

Pollard's rho algorithm

Original Papers

Pollard's rho algorithm

@kou1okada
kou1okada / vboxdu.sh
Last active January 11, 2022 11:53
VirtualBox Disk Usage
#!/usr/bin/env bash
VBoxManage list hdds|sed -r -e 's/\r//g'|awk 'match($0,/^Location: *(.+)$/,m){fn=idx[0+n]=m[1];n++;"ls -ls '\''"fn"'\''"|getline; prop[fn,"alloc"]=$1*1024;prop[fn,"size"]=$6;}match($0,/^Capacity: /){prop[fn,"capacity"]=$2*1024*1024}END{printf("%15s %15s %15s %s\n", "capacity", "allocated", "size", "filename");for(i=0;i<n;i++){fn=idx[i]; printf("%'\''15d %'\''15d %'\''15d %s\n", prop[fn,"capacity"], prop[fn,"alloc"],prop[fn,"size"],fn)}}'
@kou1okada
kou1okada / CMakeLists.txt
Created November 1, 2016 06:21
Win32 API - ReaderMode Example
cmake_minimum_required(VERSION 2.8)
set(CMAKE_LEGACY_CYGWIN_WIN32 0)
project(ReaderModeExample)
if(MSVC)
add_compile_options("/MP")
endif()
add_executable(ReaderModeExample WIN32
ReaderModeExample.c
@kou1okada
kou1okada / README.md
Last active March 19, 2018 08:22
Cygwin xhere patch for a problem about pathname that contains spaces.

A Problem which resolves with this patch

For example, if xhere called below parameters from cmd.exe,

C:\cygwin64\bin\mintty -e /bin/xhere /bin/bash "C:\Program Files"

xhere must recieve "$2" = "C:\Program Files". But currently xhere recieves "$2" = ""C:\Program Files"". :-(

Maybe this causes by argv parser of cygwin.