Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@uorat
uorat / haproxy.spec
Created May 29, 2016 08:21
HAProxy SPEC file for v1.6.4
Summary: HA-Proxy is a TCP/HTTP reverse proxy for high availability environments
Name: haproxy
Version: 1.6.4
Release: 1
License: GPL
Group: System Environment/Daemons
URL: http://haproxy.1wt.eu/
Source0: http://haproxy.1wt.eu/download/1.5/src/devel/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: pcre-devel openssl-devel
@uorat
uorat / hls-scenario.xml
Created June 10, 2016 09:26
JMeter's Scenario for HLS live streaming
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.8" jmeter="2.13 r1665067">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="hls-scenario" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="ユーザー定義変数" enabled="true">
<collectionProp name="Arguments.arguments">
<elementProp name="HOSTNAME" elementType="Argument">
@uorat
uorat / zabbix_config.py
Created June 15, 2016 03:54
zabbix-host-controller/bin/zabbix_config.py
class ZabbixConfig:
ZABBIX_API_URL = "http://your-zabbix.local/zabbix/api_jsonrpc.php"
HEADERS = {
"Content-Type": "application/json"
}
USER = "Admin"
PASSWORD = "zabbix"
@uorat
uorat / sysbench_tsv.sh
Created July 27, 2016 01:17
The shell script to convert the result of sysbench to tsv format
#!/bin/sh
set -eu
readonly DB_HOST="your-cluster.local"
readonly DB_SHORTHOST=$(echo ${DB_HOST} | sed -e "s/\..*//")
readonly DB_USER="sbtest"
readonly DB_PASS="sbtest"
readonly THREADS=$1
readonly SYSBENCH_TEST="--test=oltp --oltp-test-mode=complex "
@uorat
uorat / package.json
Created September 19, 2016 07:20
package.json for Socket.IO sample code
{
"name": "socket.io-sample-code",
"version": "1.0.0",
"description": "Sample code for Socket.IO",
"main": "app.js",
"repository": {
"type": "git",
"url": "https://gist.github.com/uorat/"
},
"author": "uorat",
@uorat
uorat / nginx-websocket-proxy.conf.diff
Created September 19, 2016 10:38
Nginx Reverse Proxy for WebSocket w/ SSL/TLS
--- nginx-websocket-proxy.conf.bk 2016-09-19 16:25:00.918484594 +0900
+++ nginx-websocket-proxy.conf 2016-09-19 16:52:51.863111735 +0900
@@ -3,9 +3,13 @@
}
server {
- listen 80;
+ listen 443;
server_name localhost;
@uorat
uorat / app.js
Last active September 19, 2016 10:39
Sample server code for Socket.IO
// sockcet.io sample code
var socketIO = require('socket.io');
var io = socketIO.listen(3000);
// event that clietns connect
io.sockets.on('connection', function(socket) {
console.log("connection");
// event when recieving messages
@uorat
uorat / sample.html
Last active September 19, 2016 10:46
Sample client code for Socket.IO (/usr/share/nginx/html/sample.html)
<html>
<head>
<title>hello node.js!</title>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="/socket.io/socket.io.js"></script>
<script>
$(document).ready(function(){
var socket = io.connect(location.host);
socket.on('connect', function() {
@uorat
uorat / sample.html
Created September 24, 2016 13:57
Sample client code for Socket.IO w/ ALB
<html>
<head>
<title>hello node.js!</title>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="https://your.domain.or.ip/socket.io/socket.io.js"></script>
<script>
$(document).ready(function(){
var socket = io.connect('https://your.domain.or.ip');
socket.on('connect', function() {
console.log("connect [sessid = " + socket.id + "]");
@uorat
uorat / hello-apex-project_dev.json
Created July 31, 2017 03:06
hello-apex/project_dev.json
{
"name": "hello-apex",
"description": "hello-apex: sample programs",
"memory": 128,
"timeout": 5,
"nameTemplate": "dev-{{.Project.Name}}_{{.Function.Name}}"
}