Skip to content

Instantly share code, notes, and snippets.

Avatar
🏕️
In the Woods.

Kohta Kunishima lorentzca

🏕️
In the Woods.
View GitHub Profile
View reviewkun
##
## reviewkun
##
$the_cow = <<EOC;
$thoughts ∞
$thoughts (👀 )
m(👄 )m
EOC
@lorentzca
lorentzca / sammy-the-shark.txt
Created Feb 15, 2017
Sammy The Shark ASCII Art
View sammy-the-shark.txt
■■■
■■ ■■■■
■■ ■■■
■■■ ■■ ■■
■ ■■ ■■ ■■
■ ■■ ■■ ■■
■ ■■ ■■ ■■
■ ■■ ■■ ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
■ ■■ ■■■ ■■ ■■■■
■■ ■■■■ ■■■■■■ ■ ■ ■ ■■■■■■■ ■■■■
@lorentzca
lorentzca / highlight.min.js
Created Feb 12, 2017
highlight.js custom language
View highlight.min.js
/*! highlight.js v9.9.0 | BSD3 License | git.io/hljslicense */
!function(e){var n="object"==typeof window&&window||"object"==typeof self&&self;"undefined"!=typeof exports?e(exports):n&&(n.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return n.hljs}))}(function(e){function n(e){return e.replace(/[&<>]/gm,function(e){return I[e]})}function t(e){return e.nodeName.toLowerCase()}function r(e,n){var t=e&&e.exec(n);return t&&0===t.index}function i(e){return k.test(e)}function a(e){var n,t,r,a,o=e.className+" ";if(o+=e.parentNode?e.parentNode.className:"",t=B.exec(o))return R(t[1])?t[1]:"no-highlight";for(o=o.split(/\s+/),n=0,r=o.length;r>n;n++)if(a=o[n],i(a)||R(a))return a}function o(e,n){var t,r={};for(t in e)r[t]=e[t];if(n)for(t in n)r[t]=n[t];return r}function u(e){var n=[];return function r(e,i){for(var a=e.firstChild;a;a=a.nextSibling)3===a.nodeType?i+=a.nodeValue.length:1===a.nodeType&&(n.push({event:"start",offset:i,node:a}),i=r(a,i),t(a).match(/br|hr|img|input/)||n.push({event:"stop"
@lorentzca
lorentzca / algolia-search.go
Created Feb 7, 2017
Search algolia index data with golang
View algolia-search.go
package main
import (
"bytes"
"encoding/json"
"fmt"
"github.com/algolia/algoliasearch-client-go/algoliasearch"
"github.com/jessevdk/go-flags"
"os"
)
@lorentzca
lorentzca / mackerel-graph-annotation.sh
Last active Jan 29, 2017
とにかくmackerelのグラフアノテーション機能をapiから叩いてみたいときに実行するコマンド
View mackerel-graph-annotation.sh
curl -X POST -H "X-Api-Key: $MACKEREL_APIKEY" -H "Content-Type:application/json" -d "{\"title\": \"test\", \"description\": \"test-$(date +%Y%m%d%H%M)\", \"from\": $(date +%s), \"to\": $(date +%s), \"service\": \"サービス名\", \"roles\": [\"ロール名\"]}" https://mackerel.io/api/v0/graph-annotations
@lorentzca
lorentzca / allow_from_japan_apache
Last active Nov 17, 2016
Allow from japan ip address
View allow_from_japan_apache
allow from 1.0.16.0/20
allow from 1.0.64.0/18
allow from 1.1.64.0/18
allow from 1.5.0.0/16
allow from 1.21.0.0/16
allow from 1.33.0.0/16
allow from 1.66.0.0/15
allow from 1.72.0.0/13
allow from 1.112.0.0/14
allow from 14.0.8.0/22
@lorentzca
lorentzca / attack.sh
Last active Oct 20, 2016
サーバヒットポイントが0以下になったらシャットダウンする(見た目だけ)
View attack.sh
#!/bin/bash
hp=$(curl -s -X GET \
-H "X-Api-Key: $MACKEREL_APIKEY" \
https://mackerel.io/api/v0/hosts/$MACKEREL_HOSTID/metadata/HP | jq -r .HP)
damage=$(expr $RANDOM % 500)
remaining_hp=$(expr $hp - $damage)
hostname=$1
echo HP is $hp
@lorentzca
lorentzca / index.html
Created Oct 4, 2016
ghost blog insite search box by algolia
View index.html
<html>
<head>
<meta charset="utf-8" />
<style type="text/css">
.algolia-autocomplete {
width: 80%;
max-width: 710px;
}
.algolia-autocomplete .aa-input, .algolia-autocomplete .aa-hint {
width: 100%;
View keybase.md

Keybase proof

I hereby claim:

  • I am lorentzca on github.
  • I am lorentzca (https://keybase.io/lorentzca) on keybase.
  • I have a public key ASD3TgppFzs5SyzJCQXrnu_MhWdO3Xhgy3VAqy0RMs378Qo

To claim this, I am signing this object:

@lorentzca
lorentzca / Dockerfile
Created Feb 9, 2016
run vault server
View Dockerfile
FROM lorentzca/vault_on_centos7
COPY ./config.hcl /root/config.hcl
You can’t perform that action at this time.