Skip to content

Instantly share code, notes, and snippets.

View higebu's full-sized avatar
🏠
Working from home

Yuya Kusakabe higebu

🏠
Working from home
View GitHub Profile
<Item ovf:required="false">
<rasd:AddressOnParent>0</rasd:AddressOnParent>
<rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
<rasd:ElementName>CD-ROM 1</rasd:ElementName>
<rasd:InstanceID>8</rasd:InstanceID>
<rasd:Parent>4</rasd:Parent>
<rasd:ResourceSubType>vmware.cdrom.passthrough</rasd:ResourceSubType>
<rasd:ResourceType>15</rasd:ResourceType>
<vmw:Config ovf:required="false" vmw:key="backing.exclusive" vmw:value="false"/>
</Item>
% git submodule update --init
Submodule 'better_code_samples' (https://github.com/ChrislS/better_code_samples.git) registered for path 'better_code_samples'
Submodule 'bootstrapify' (https://github.com/ingwinlu/pelican-bootstrapify.git) registered for path 'bootstrapify'
Submodule 'cjk-auto-spacing' (https://github.com/yuex/cjk-auto-spacing.git) registered for path 'cjk-auto-spacing'
Submodule 'image_process' (https://github.com/whiskyechobravo/image_process) registered for path 'image_process'
Submodule 'multi_neighbors' (https://github.com/davidlesieur/multi_neighbors.git) registered for path 'multi_neighbors'
Submodule 'pandoc_reader' (https://github.com/liob/pandoc_reader.git) registered for path 'pandoc_reader'
Submodule 'panorama' (git://github.com/romainx/panorama.git) registered for path 'panorama'
Submodule 'pelican-flickr' (https://github.com/La0/pelican-flickr.git) registered for path 'pelican-flickr'
Submodule 'pelican-genealogy' (https://github.com/zappala/pelican-genealogy) registered for path '
#!/bin/bash
# ./build_coreos.sh Alpha 494
CHANNEL=$1
VERSION=$2
git config --global color.ui false
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
@higebu
higebu / lets_chat.sh
Created May 27, 2015 14:09
Zabbix alertscript for Let's chat
#!/bin/bash
URL=http://yourdomain/messages
TOKEN='token'
TO=$1
SUBJECT=$2
MESSAGE=$(echo "$3"|perl -p -e 's/\n/\\n/g')
TEXT="${SUBJECT}:\\n${MESSAGE}"
PAYLOAD="{\"text\":\"${TEXT}\", \"room\":\"${TO}\"}"
@higebu
higebu / serf
Created May 28, 2015 07:37
/etc/init.d/serf for ubuntu
#!/bin/bash
### BEGIN INIT INFO
# Provides: serf
# Required-Start: $remote_fs $network
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start serf daemon
# Description: Start serf daemon
### END INIT INFO
@higebu
higebu / zabbix_trends_uint_csv.yml
Last active August 29, 2015 14:22
Embulk outside valid range for the datatype BIGINT error.
2015-06-04 17:40:01.925 +0900: Embulk v0.6.11
2015-06-04 17:40:03.415 +0900: Loaded plugin embulk-input-mysql (0.4.0)
2015-06-04 17:40:03.452 +0900 [INFO] (transaction): Fetch size is 10000. Using server-side prepared statement.
2015-06-04 17:40:03.796 +0900 [INFO] (transaction): {done: 0 / 1, running: 0}
2015-06-04 17:40:03.832 +0900 [INFO] (task-0000): Writing local file 'zabbix_trends_uint_.000.00csv'
2015-06-04 17:40:03.847 +0900 [INFO] (task-0000): Fetch size is 10000. Using server-side prepared statement.
2015-06-04 17:40:03.853 +0900 [INFO] (task-0000): SQL: SELECT i_h.itemid, i_h.key_, i_h.type, i_h.units, item_name, host_name, FROM_UNIXTIME(t.clock) as timestamp, t.num, t.value_min, t.value_avg, t.value_max fr
om trends_uint as t INNER JOIN (SELECT i.itemid, i.key_, i.type, i.name as item_name, i.units, h.name as host_name FROM items as i INNER JOIN hosts as h ON i.hostid = h.hostid) as i_h ON i_h.itemid = t.itemid WH
ERE clock = UNIX_TIMESTAMP(FROM_UNIXTIME(UNIX_TIMESTAMP(DATE_ADD(NOW(), INTERVAL -
@higebu
higebu / zabbix_add_datacenter_name.patch
Last active August 29, 2015 14:24
Add {#DATACENTER.NAME} to zabbix proxy
diff -uprN a/src/zabbix_server/poller/checks_simple_vmware.c b/src/zabbix_server/poller/checks_simple_vmware.c
--- a/src/zabbix_server/poller/checks_simple_vmware.c 2015-04-22 16:56:00.000000000 +0900
+++ b/src/zabbix_server/poller/checks_simple_vmware.c 2015-07-10 16:38:46.590815221 +0900
@@ -570,6 +570,7 @@ int check_vcenter_cluster_discovery(AGEN
zbx_json_addobject(&json_data, NULL);
zbx_json_addstring(&json_data, "{#CLUSTER.ID}", cluster->id, ZBX_JSON_TYPE_STRING);
zbx_json_addstring(&json_data, "{#CLUSTER.NAME}", cluster->name, ZBX_JSON_TYPE_STRING);
+ zbx_json_addstring(&json_data, "{#DATACENTER.NAME}", "{{ datacenter }}", ZBX_JSON_TYPE_STRING);
zbx_json_close(&json_data);
}
org.h2.jdbc.JdbcSQLException: 一般エラー: "java.lang.ArrayIndexOutOfBoundsException: 10"
General error: "java.lang.ArrayIndexOutOfBoundsException: 10"; SQL statement:
select x2.x3, x2.x4, x2.x5, x2.x6, x2.x7, x2.x8, x2.x9, x2.x10 from (select x11.x12 as x9, x11.x13 as x6, x11.x14 as x5, x11.x15 as x4, x11.x16 as x8, x11.x17 as x10, x11.x18 as x3, x11.x19 as x7 from (select x20."ACTIVITY_DATE" as x12, x20."ACTIVITY_TYPE" as x13, x20."ACTIVITY_USER_NAME" as x14, x20."REPOSITORY_NAME" as x15, x20."ADDITIONAL_INFO" as x16, x20."ACTIVITY_ID" as x17, x20."USER_NAME" as x18, x20."MESSAGE" as x19 from "ACTIVITY" x20) x11 inner join (select x21."UPDATED_DATE" as x22, x21."PARENT_REPOSITORY_NAME" as x23, x21."DEFAULT_BRANCH" as x24, x21."DESCRIPTION" as x25, x21."ORIGIN_REPOSITORY_NAME" as x26, x21."ORIGIN_USER_NAME" as x27, x21."PARENT_USER_NAME" as x28, x21."PRIVATE" as x29, x21."REPOSITORY_NAME" as x30, x21."USER_NAME" as x31, x21."REGISTERED_DATE" as x32, x21."LAST_ACTIVITY_DATE" as x33 from "REPOSITORY" x21) x34 on (x1
org.h2.jdbc.JdbcSQLException: 一般エラー: "java.lang.ArrayIndexOutOfBoundsException"
General error: "java.lang.ArrayIndexOutOfBoundsException"; SQL statement:
select x2."USER_NAME", x2."FULL_NAME", x2."MAIL_ADDRESS", x2."PASSWORD", x2."ADMINISTRATOR", x2."URL", x2."REGISTERED_DATE", x2."UPDATED_DATE", x2."LAST_LOGIN_DATE", x2."IMAGE", x2."GROUP_ACCOUNT", x2."REMOVED" from "ACCOUNT" x2 where x2."REMOVED" = ? order by x2."USER_NAME" [50000-180]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:168)
at org.h2.message.DbException.convert(DbException.java:295)
at org.h2.command.Command.executeQuery(Command.java:209)
at org.h2.jdbc.JdbcPreparedStatement.execute(JdbcPreparedStatement.java:192)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.execute(NewProxyPreparedStatement.java:1392)
at scala.slick.jdbc.StatementInvoker.results(StatementInvoker.scala:38)
@higebu
higebu / install_go.sh
Created October 3, 2015 13:04
Script for golang installation
#!/bin/bash -e
GO_VERSION=1.5.1
dir=$(mktemp -d)
pushd $dir
# Remove old version
sudo rm -rf /usr/local/go