Skip to content

Instantly share code, notes, and snippets.

View jacopen's full-sized avatar

Kazuto Kusama jacopen

View GitHub Profile
package basic
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.jdbc.Predef._
import io.gatling.http.Headers.Names._
import scala.concurrent.duration._
import bootstrap._
import assertions._
@jacopen
jacopen / gist:4000599
Created November 2, 2012 11:41
ikeda-y & jacopen amida ver1.0 2012/11/2
width = ARGV[0].to_i
height = 6
margin = 3
goal = rand(100) % width.to_i
header_list = %w(A B C D E F G H I J K L M N O P Q R S T U V W X Y Z)
spacer = ''
#fixme!
margin.times do |s|
spacer = spacer + ' '
@jacopen
jacopen / nfscheck.rb
Created January 22, 2013 15:01
Check read/write to nfs.
require "timeout"
pid = fork do
require "fileutils"
filepath = "/mnt/nfs/test1/test.txt"
begin
File::open(filepath,
File::Constants::WRONLY |
File::Constants::CREAT |
File::Constants::TRUNC |
@jacopen
jacopen / js
Created December 15, 2015 12:10
Gruntfile.js
module.exports = function(grunt) {
var moment = require('moment');
var repo_dir = "/home/jacopen/Project/node_modules/node-red/config"
var files = ["king_cred.json", "king.json"]
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
flow: {
files: 'config/*.json',
tasks: ['gitcommit:task']
@jacopen
jacopen / keibot.txt
Last active December 19, 2015 21:08
kei bot
09:37 kei: bu使うぶー
10:04 kei: 恋人ウマい
11:32 kei: 仕様ならしようがない
11:50 kei: わかりました、はぁはぁ
11:26 kei: (「ぼくのことをプレミアムサポートして下さい!」
11:52 kei: ニャーン
12:17 kei: 私はカレーになりたい
12:37 kei: 快適なベッドライフ
12:52 kei: 仏滅戦隊、jinja!!
13:36 kei: まじだぶる
@jacopen
jacopen / exploit.rb
Last active December 29, 2015 07:29
CVE-2013-4164(浮動小数点数パースにおけるヒープオーバーフロー ) https://www.ruby-lang.org/ja/news/2013/11/22/heap-overflow-in-floating-point-parsing-cve-2013-4164/
require 'yajl'
require 'json'
require 'oj'
def digit_pattern
digit_pattern ||= rand(10000).to_s
end
def integer_part
digit_pattern
@jacopen
jacopen / td-agent.conf
Last active January 2, 2016 12:19
minecraftのログをIRCに流すfluentdのコンフィグ
<source>
type tail
path /home/jacopen/minecraft/data/vanilla/logs/latest.log
format /^\[.*\]\s\[.*\]:\s(?<log>.*)$/
time_format %d/%b/%Y:%H:%M:%S %z
tag minecraft.log
pos_file /var/log/td-agent/minecraft.pos
</source>
<match minecraft.log>
@jacopen
jacopen / backup.md
Last active June 9, 2016 22:51
gem backupを使ってみる

gem backup

これって何

その名の通り、backupを取るための便利なgem https://github.com/meskyanichi/backup

  • データのdump
    • ローカルファイルやディレクトリだけでなく、MySQL、Postgres、MongoDB、Redis、RiakからDumpできる
  • データの圧縮
# Ubuntu preseed file - preseed.cfg
# Works for Ubuntu 10.x, 11.x & 12.x
#
# For more information on preseed syntax and commands, refer to:
# https://help.ubuntu.com/12.04/installation-guide/i386/appendix-preseed.html
#
# For testing, you can fire up a local http server temporary.
# Download the preseed.cfg file locally, cd to the directory where the
# preseed.cfg resides and run hte following command:
# $ python -m SimpleHTTPServer
uva (ubuntu14.04)
=================
CVE-2014-3571 ?
CVE-2015-8767 ?
CVE-2016-2178 ?
CVE-2016-2179 ?
CVE-2016-2180 ?
CVE-2016-2181 ?
CVE-2016-2182 ?
CVE-2016-2183 ?