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 ここには来ない |
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@tencore:~/tmp/nasa$ zcat access_log.nasa.gz | awk '{print $4,$0}' | | |
| sed 's/^\[//' | awk '{gsub(/[\/:]/," ",$1);print}' | | |
| awk '{$2=$2=="Jul"?"07":$2;$2=$2=="Aug"?"08":$2;print}' | | |
| sed 's;^\(..\) \(..\) \(....\) \(..\) \(..\) \(..\);\3\2\1 \4\5\6;' > access_log | |
| ueda@tencore:~/tmp/danger$ zcat access.log.shellshock.gz | awk '{print $4,$0}' | | |
| sed 's/^\[//' | awk '{gsub(/[\/:]/," ",$1);print}' | | |
| sed -e 's/Sep/09/' -e 's/Oct/10/' -e 's/Nov/11/' -e 's/Dec/12/' | | |
| sed 's;^\(..\) \(..\) \(....\) \(..\) \(..\) \(..\);\3\2\1 \4\5\6;' > danger_log |
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
| syntax on | |
| let g:neocomplcache_enable_at_startup = 1 | |
| let g:neocomplcache_snippets_dir = $HOME.'/.vim/snippets' | |
| syntax enable | |
| " <C-k> にマッピング | |
| imap <C-k> <Plug>(neocomplcache_snippets_expand) |
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
| import PATH | |
| ### ヒアドキュメントを実装する ### | |
| ### 代わりに改行できる変数を実装 ### | |
| file awkcode = '{print NR,$1}' | |
| ### 変数は直接パイプに突っ込める### | |
| 'a | |
| b | |
| c' >>= awk -f awkcode |
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
| import PATH | |
| ############################# | |
| # fizzbuzz.glue (for Mac) # | |
| ############################# | |
| # make a file "nums" | |
| file nums = seq 1 100 | |
| #gsed can be installed after "brew install coreutils" |
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
| import PATH | |
| sleep 3 >> echo 'abc' >>= rev &a | |
| sleep 2 >> echo 'def' >>= rev &b | |
| in.wait a b | |
| echo 'OK' |
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
| uedambp:GlueLang ueda$ ./glue -v hoge.glue | |
| + pid 90998 fork a | |
| + pid 91000 fork | |
| + pid 91000 exec line 3 /bin/echo | |
| + pid 91001 fork | |
| + pid 91001 exec line 2 /bin/sleep | |
| a | |
| + pid 91000 exit 0 | |
| + pid 91001 exit 0 | |
| + pid 91002 fork |