View detect_marker.py
import numpy as np
import random
import math
import cv2
from PIL import Image
def detect_markers(im):
markers = []
# 輪郭線抽出のための二値化
im_gray = cv2.cvtColor(im, cv2.COLOR_BGR2GRAY)
View check_docker_container.sh
#!/bin/bash
# Author: Erik Kristensen
# Email: erik@erikkristensen.com
# License: MIT
# Nagios Usage: check_nrpe!check_docker_container!_container_id_
# Usage: ./check_docker_container.sh _container_id_
#
# Depending on your docker configuration, root might be required. If your nrpe user has rights
# to talk to the docker daemon, then root is not required. This is why root privileges are not
View main.go
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
View bench.kt
import org.apache.commons.lang.RandomStringUtils
import java.util.*
fun main(args: Array<String>) {
val tryCount = 1000000
val formatStart = Date()
for (i in 1..tryCount) {
var string = "%s%s%s"
string += RandomStringUtils.randomAlphabetic(10)
val aa = string.format(RandomStringUtils.randomAlphabetic(3), RandomStringUtils.randomAlphabetic(3), RandomStringUtils.randomAlphabetic(3))
View curl.sh
while true; do sleep 3; curl -o /dev/null -sw %{time_total}\\n https://bootjp.me/ ;done
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View append_noopener.js
Array.prototype.slice.call(document.getElementsByTagName('a')).forEach(function(element) {
if (element.target === '_blank' && element.rel.indexOf('noopener') === -1) {
element.rel += ' noopener';
}
});
View display_error_code.sh
# this file added ~/.bashrc
# fork from http://qiita.com/takayuki206/items/f4d0dbb45e5ee2ee698e
function __show_exit_code() {
local status=$(echo ${PIPESTATUS[@]})
local SETCOLOR_FAILURE="echo -en \\033[1;31m"
local SETCOLOR_NORMAL="echo -en \\033[0;39m"
for s in ${status}
do
if [ ${s} -ne 0 ]; then
View wp_ad_switch.js
(function() {
var metas = document.getElementsByTagName('head')[0].getElementsByTagName('meta');
for (var index = 0; index < metas.length; index++) {
if (metas[index].name === 'keywords' && metas[index].content.indexOf('技術系') !== -1) {
console.log('技術記事');
break;
}
}
View gist:83626973f7674e28f1ef29a250ea0b6e

設定内容

# vim /etc/sysctl.conf
# 共有メモリの最大サイズ。サーバーの搭載メモリ(1GB)に合わせて変更
kernel.shmmax      = 1073741824