Skip to content

Instantly share code, notes, and snippets.

View ryuichiueda's full-sized avatar

Ryuichi Ueda ryuichiueda

View GitHub Profile
curl -s "http://kokkai.ndl.go.jp/api/1.0/speech?$(echo "maximumRecords=100&any=と呼ぶ声あり" | nkf -MQ | tr -d '\n' | gsed 's/=\+/%/g')" | grep -o "「.*」"
$ cat holidays | awk '{print $1,$NF}' | awk '{print $1,a,b,$2;a=b;b=$2}' | grep '1 0 1$' | awk '{print $1}' | while read d ; do echo '----' ; grep -B2 $d holidays ; done
#!/bin/sh
set -e
npm install
export PORT=8989
export PATH="node_modules/.bin:node_modules/hubot/node_modules/.bin:$PATH"
export HUBOT_SLACK_TOKEN=xxxxxx
export HUBOT_GITHUB_SECRET=yyyyyyy
# GitHubから来た通知をSlackに飛ばす
#
# 参考: Hubot経由でGitHubのイベントを通知する | SPACEMARKET BLOG
# http://blog.spacemarket.com/code/hubot-github-webhook-1/
crypto = require 'crypto'
module.exports = (robot) ->
robot.router.post "/github/webhook", (req, res) ->
event_type = req.get 'X-Github-Event'
signature = req.get 'X-Hub-Signature'
ueda@ubuntu14:~$ sudo udevadm monitor --kernel --property
[sudo] password for ueda:
monitor will print the received events for:
KERNEL - the kernel uevent
KERNEL[443.349199] remove /devices/virtual/sushi/sushi0 (sushi)
ACTION=remove
DEVNAME=/dev/sushi0
DEVPATH=/devices/virtual/sushi/sushi0
MAJOR=249
ueda@ubuntu14:~$ sudo udevadm monitor --kernel --property
monitor will print the received events for:
KERNEL - the kernel uevent
KERNEL[159.305967] add /module/sushi (module)
ACTION=add
DEVPATH=/module/sushi
SEQNUM=1568
SUBSYSTEM=module
#!/bin/bash
ps aux |
grep js |
grep Cloud |
awk '{print $2}' |
xargs kill -KILL
@ryuichiueda
ryuichiueda / main.cc
Last active November 6, 2015 15:41
blink LED without WiringPi
#include <iostream>
#include <stdint-gcc.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/mman.h>
using namespace std;
/* GPIOで一つだけLEDを点滅させるC++のコード
* written by Ryuichi Ueda
@ryuichiueda
ryuichiueda / wiringPiLedBlink.c
Created November 6, 2015 10:27
wiringPi LED blink
#!/bin/bash
echo $$
sleep 30
exec sleep 100 #ここでプロセスがsleep に置き換わる
echo ここには来ない