Skip to content

Instantly share code, notes, and snippets.

View shield-9's full-sized avatar

Daisuke Takahashi shield-9

View GitHub Profile
WEBHOOK_URL="https://hooks.slack.com/services/XXXXXX/XXXXXX/XXXXXXX"
IP=$1
MSG=$2
DATE=$3
TIME=$4
SEVERITY=$5
SERVICETAG=$6
RESOLUTION=$7
CATEGORY=$8
ASSETTAG=$9
FROM bitnami/mongodb:3.6.14-debian-9-r62
COPY libmongodb.sh /
@shield-9
shield-9 / install.sh
Created November 13, 2018 18:32
mackerel-agentをラズパイに入れるスクリプト
#! /bin/bash
curl -LO https://mackerel.io/file/agent/deb/mackerel-agent_latest.all.deb
sudo dpkg -i mackerel-agent_latest.all.deb
curl -LO https://github.com/mackerelio/mackerel-agent/releases/download/v0.58.0/mackerel-agent_linux_arm.tar.gz
tar xf mackerel-agent_linux_arm.tar.gz
sudo mv mackerel-agent_linux_arm/mackerel-agent /usr/local/bin/mackerel-agent
sudo chown root:root /usr/local/bin/mackerel-agent
sudo cp /usr/local/bin/mackerel-agent /usr/bin/
sudo mackerel-agent init -apikey="${MACKEREL_AGENT_API_KEY}"

mackerel-plugin-iostat

apiVersion: v1
kind: Service
metadata:
name: nginx-svc
labels:
app: nginx
spec:
type: NodePort
ports:
- port: 10080
@shield-9
shield-9 / benchmark_get.php
Last active February 9, 2018 09:20
Redis Benchmark in PHP
<?php
$cluster = new RedisCluster(NULL, [
'cluster-1:7000', 'cluster-2:7000',
'cluster-3:7000', 'cluster-4:7000',
'cluster-5:7000',
]);
for ($i = 0; $i < 1000000; $i++) {
$cluster->get($i);
@shield-9
shield-9 / git_remote_migration.sh
Last active December 26, 2017 19:11
[ACA17] gitの既存レポジトリを移動する方法
for i in `git branch|sed -e 's/^[* ]*//'`
do
git checkout $i
git stash
git rebase origin/$i
done
git checkout master
for i in `git branch -r|grep -v HEAD|grep -v master|sed 's:origin/::g'`
do
@shield-9
shield-9 / file.php
Last active February 24, 2017 07:12
Improvement of get_filesystem_method()
<?php
/**
* Determines which Filesystem Method to use.
* The priority of the Transports are: Direct, SSH2, FTP PHP Extension, FTP Sockets (Via Sockets class, or fsockopen())
*
* Note that the return value of this function can be overridden in 2 ways
* - By defining FS_METHOD in your <code>wp-config.php</code> file
* - By using the filesystem_method filter
* Valid values for these are: 'direct', 'ssh2', 'ftpext' or 'ftpsockets'
* Plugins may also define a custom transport handler, See the WP_Filesystem function for more information.
@shield-9
shield-9 / config
Created March 8, 2014 10:46
GitでPullを高速化する方法。.git/configを次のように編集
[remote "origin"]
+ url = git://github.com/shield-9/opcache-dashboard.git
+ pushurl = git@github.com:shield-9/opcache-dashboard.git
- url = git@github.com:shield-9/opcache-dashboard.git
#include <SakuraIO.h>
//SakuraIO_SPI sakuraio(10);
SakuraIO_I2C sakuraio;
void setup() {
Serial.begin(9600);
Serial.print("Waiting to come online");
}