Skip to content

Instantly share code, notes, and snippets.

@tnmt
tnmt / stns-query-wrapper.te
Created December 19, 2017 10:20
STNSのsshクエリラッパー用SELinuxのポリシーファイル
module stns-query-wrapper 1.0;
require {
type bin_t;
type chkpwd_t;
type policykit_t;
type sshd_t;
type sysctl_net_t;
type sysfs_t;
type system_dbusd_t;
@tnmt
tnmt / ghost-to-hugo.py
Created September 25, 2017 11:57
data exporter from Ghost (ready for 1.X) to Hugo (also Octopress) data format.
#!/bin/env python
# coding: utf-8
import os
import json
from datetime import datetime
def main():
# Read the Ghost export file
f = open('GhostData.json', 'r')
InnoDBの要注意パラメータをピックアップしてってる
innodb_adaptive_flushing_lwm
innodb_change_buffer_max_size
innodb_io_capacity
innodb_io_capacity_max
@tnmt
tnmt / wp-xml-octopress-import.rb
Created November 15, 2011 12:31
Import XML of Wordpress to Octopress
# -*- coding: utf-8 -*-
require 'fileutils'
require 'date'
require 'yaml'
require 'uri'
require 'rexml/document'
include REXML
doc = Document.new File.new(ARGV[0])
@tnmt
tnmt / idea.yml
Created January 20, 2016 08:05 — forked from kentaro/idea.yml
---
service: minne
enable:
- h2
- mruby
mrbgems:
- mruby-foo
- mruby-bar
@tnmt
tnmt / pretty_format_fio.pl
Created August 8, 2013 01:53
fioの出力をgithub wikiのtable形式にフォーマットする
#!/usr/bin/perl
use strict;
use warnings;
print <<EOT;
- | bandwidth | iops
--------------|-------------|--------
EOT
TAG_PREFIX=""
LOGS=$(cat <<"EOF"
tag001 /tmp/log001.log
tag002 /tmp/log002.log
EOF
)
PRIMARY_SERVER="0.0.0.0:24224"
@tnmt
tnmt / cgi_main.diff
Created May 4, 2012 08:32
php 5.2.17 patch to CVE-2012-1823
diff -ur php-5.2.17/sapi/cgi/cgi_main.c php-5.2.17_patched/sapi/cgi/cgi_main.c
--- php-5.2.17/sapi/cgi/cgi_main.c 2010-01-03 18:23:27.000000000 +0900
+++ php-5.2.17_patched/sapi/cgi/cgi_main.c 2012-05-24 20:16:28.000000000 +0900
@@ -62,6 +62,7 @@
#include "php_main.h"
#include "fopen_wrappers.h"
#include "ext/standard/php_standard.h"
+#include "ext/standard/url.h"
#ifdef PHP_WIN32
#include <io.h>
@tnmt
tnmt / mosh-cygwin
Created April 17, 2012 02:13 — forked from eerohele/mosh-cygwin.md
Compiling Mosh (http://mosh.mit.edu/) under Cygwin
1. Download Cygwin: http://www.cygwin.com
2. Run setup.exe and install the following packages in addition to the default ones:
- make
- boost
- libncurses-devel
- pkg-config
- perl
3. Download and compile Protocol Buffers: http://code.google.com/p/protobuf/
@tnmt
tnmt / edit-vm-network-setting.py
Created November 15, 2011 03:01
Modify KVM VM (stopped) network setting using libguestfs
#!/bin/env python
import sys
import libvirt
import guestfs
from lxml import etree
if (len(sys.argv) != 4):
sys.exit('Usage: # sudo python %s domain eth0 eth1' % sys.argv[0])
domain = sys.argv[1]