Skip to content

Instantly share code, notes, and snippets.

View ryuichiueda's full-sized avatar

Ryuichi Ueda ryuichiueda

View GitHub Profile
use std::env;
fn main(){
let args: Vec<String> = env::args().collect();
let num:i32 = args[1].parse::<i32>().unwrap();
println!("{0: >width$ }","人", width= 2 + 2*num as usize);
for i in 0..num {
let width_left = (2*num - i*2 - 1) as usize;
let width_right = (i*4 + 4) as usize;
🍣: 🐟 🍚
echo 🐟🍚 → 🍣
🐟: 🐛
echo 🐛 → 🐟
🌾: 💩
echo 💩 → 🌾
🐛: 🌿
echo 🌿 → 🐛
🍚: 🌾
echo 🌾 → 🍚
@ryuichiueda
ryuichiueda / tex_to_plain.bash
Created February 18, 2017 15:33
tex to plain
#!/bin/bash
###文献リスト###
cat ../rpim_book.bbl |
grep '^\\bibitem' |
sed 's/bibitem/cite/' |
awk '{print "s/\\"$1"/["NR"]/g"}' > ./cite.sed
cat ../rpim_book.bbl |
sed 's/bibitem/cite/' |
@ryuichiueda
ryuichiueda / setup controller memo
Created September 26, 2016 08:16
設計製作論のコントローラのセットアップ
pi@raspberrypi ~ $ git clone https://github.com/ryuichiueda/RobotDesign3.git
pi@raspberrypi ~ $ cd RobotDesign3/
pi@raspberrypi ~/RobotDesign3 $ sudo make
...(ログはちゃんと見ましょう)
insserv: warning: script 'K01robot_design_3.sh' missing LSB tags and overrides
(↑このワーニングは無視でOK)
pi@raspberrypi ~/RobotDesign3 $ sudo reboot
(再度接続)
#確認方法1(プロセスが立ち上がっているか調査)
pi@raspberrypi ~ $ ps aux | grep robot | grep init
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