Skip to content

Instantly share code, notes, and snippets.

View myouju's full-sized avatar
💭
i am data engineer

Yuki Maeno myouju

💭
i am data engineer
View GitHub Profile
@myouju
myouju / sshrc
Last active September 28, 2015 08:36
sshでログインされたときに何かする
#!/bin/bash
DATE=`date`
CLIENT_IP=`echo ${SSH_CLIENT} | cut -d " " -f 1`
HOST_IP=`curl inet-ip.info 2>/dev/null`
HOST_NAME=`hostname`
msg="${HOST_NAME}(${HOST_IP}) [${DATE}] ${USER}が${CLIENT_IP}から接続しました!!"
## output log
# echo $msg >> /tmp/login.log
@myouju
myouju / gist:8a2552cf3f935835a789
Last active October 4, 2016 09:36
とあるhostとportにつなぐようにしたnginxの設定
server {
listen 80;
# 8080.my.example.com.nginxhost.xip.io;
server_name "~^(?:(?<proxy_port>\d+)\.)?(?<proxy_host>(.+))\.nginxhost\.xip\.io$";
access_log /var/log/nginx/dev.access.log;
client_max_body_size 100M;
location / {
@myouju
myouju / a.py
Last active October 28, 2015 07:28
compare np.dot to numba.jit
import time
import numba
def matmul1(a, b):
lenI = a.shape[0]
lenJ = a.shape[1]
lenK = b.shape[1]
c = np.zeros((lenI, lenJ))
for i in range(lenI):
for j in range(lenJ):
@myouju
myouju / rokuyo.py
Last active January 22, 2016 05:22
スピリチュアルエンジニアリング
# -*- coding: utf-8 -*-
import urllib
import urllib2
import unirest
API_URL="https://dateinfoapi.appspot.com/v1"
hubot_url = ""
rid = ""
if __name__ == "__main__":
@myouju
myouju / Dockerfile
Last active January 22, 2016 05:22
rundeckからwebhookをウケる通知bot
FROM alpine:3.2
MAINTAINER yuki-maeno
RUN apk --update add ruby ruby-bundler \
&& rm -fr /var/cache/apk/* \
&& gem install xml-simple --no-ri --no-rdoc
ADD server.rb /tmp/server.rb
EXPOSE 8000
@myouju
myouju / Dockerfile
Created January 22, 2016 05:11
install aerospike lua client
FROM ubuntu:14.04
MAINTAINER yuki-maeno
RUN echo "Asia/Tokyo" > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata \
&& apt-get update \
&& apt-get install -y git wget libc6-dev libssl-dev autoconf automake libtool g++ lua5.1 liblua5.1-0-dev ncurses-dev \
&& cd /tmp \
&& wget http://www.aerospike.com/download/client/c/3.1.25/artifact/ubuntu12 \
&& tar zxvf ubuntu12 \
&& cd aerospike-client-c-3.1.25.ubuntu12.04.x86_64 \
@myouju
myouju / Dockerfile
Created January 22, 2016 05:15
外からslackにpostするbot
FROM cataska/hubot-slack
MAINTAINER Yuki Maeno
ADD send.coffee /home/yeoman/hubot/scripts/send.coffee
ENV SLACK_TOKEN XXXXX
WORKDIR /home/yeoman/hubot
CMD HUBOT_SLACK_TOKEN=${SLACK_TOKEN} bin/hubot --adapter slack >> /tmp/hubot.log 2>&1
@myouju
myouju / a.js
Created January 22, 2016 05:18
cloudwatchのアラームからecsのインスタンス数を増やすaws lambdaスクリプト
console.log('Loading event');
var aws = require('aws-sdk');
exports.handler = function(event, context) {
var cluster = 'maeno-test'
var ecsService = 'test-service';
var ecsRegion = 'ap-northeast-1';
var maxCount = 3;
var ecs = new aws.ECS({region: ecsRegion});
@myouju
myouju / mapping.json
Last active February 25, 2016 09:10
apacheログをfluentdで動的に型変換してelasticsearchにデータを入れる
{
"template": "es-*",
"mappings": {
"fluentd":{
"properties":{
"geo_location":{
"type": "geo_point"
},
"all_path":{
"type": "string",