This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "「.*」" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ps aux | | |
grep js | | |
grep Cloud | | |
awk '{print $2}' | | |
xargs kill -KILL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <wiringPi.h> | |
#include <stdlib.h> | |
const int gpio21 = 21; | |
int main(int argc, char const* argv[]) | |
{ | |
if(wiringPiSetupGpio() == -1) | |
exit(1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo $$ | |
sleep 30 | |
exec sleep 100 #ここでプロセスがsleep に置き換わる | |
echo ここには来ない |