ttyrec ã§é²ç»ãããã¼ã¿ã使ã£ã¦ã¿ã¼ããã«ä¸ã§åçãã¤ã¤ããã®ã¹ã¯ãªã¼ã³ãã£ããã£ã使ã£ã¦ã¢ãã¡ã¼ã·ã§ã³GIFãçæãããã¼ã«ãGoã§ä½ã£ã¦ã¿ãã
Mac, Linux Desktopã§åä½ãåçé度ã¯ãªãã·ã§ã³ã§å¤æ´å¯è½ã
èæ¯
percolを使ってターミナル操作を早く、便利に。 - すぎゃーんメモ ã®ãããªè¨äºãæ¸ãããããéã«ãã¿ã¼ããã«æä½ãé²ç»ãã¦GIFã¢ãã¡ã«ãããéè¦ãããã
ãããã£ãç¨éã«ä½¿ããæ±ç¨ã®ãã¹ã¯ãããé²ç»ãã¼ã«ã¨ãã¦ã¯LICEcapãGifzoãªã©ãããã
ãããã¯Windows, OSXãããã対象ã§ãLinuxã®å ´åã¯ã¾ãä»ã®ãã¼ã«ãããããã(ããç¥ããªã)ã
æ±ç¨çãªãã£ããã£ãã¼ã«ã§ãè¯ãããã©ããã¡ãã¡é²ç»å¯¾è±¡ã®ã¿ã¼ããã«ã®ã¦ã£ã³ãã¦ãæå®ããã®ãé¢åã ããã¿ã¼ããã«å°ç¨ã®ãã¼ã«ããã£ã¦ãè¯ãã®ã§ã¯ãªããã
ttyrec ã¨ãããã¼ã«ããå¤ãããåå¨ãããããã使ãã¨ã³ãã³ãããã¿ã¼ããã«ã®æä½ãé²ç»ã»åçãããã¨ãã§ããã
ããã§åã³ããåçãã¤ã¤ã¿ã¼ããã«ã®ã¹ã¯ãªã¼ã³ã·ã§ãããæ®ããããããç¹ãã¦GIFã¢ãã¡ã«ãããã¨ãããã¼ã«ãæ¢ã«å¹¾ã¤ãåå¨ããã
- http://z24.github.io/tty2gif/
- https://github.com/icholy/ttygif
- https://bitbucket.org/antocuni/tty2gif
ãããã¯å¤§æµ ImageMagick ã«ä¾åãã¦ãããimport
ã³ãã³ããå©ç¨ãã¦ã¹ã¯ãªã¼ã³ã·ã§ãããæ®ã£ãããconvert
ã³ãã³ãã§GIFãçæããããã¦ãããè¨èªã¯C/C++, Pythonã§ã対象ã¯OSXã¨Linux両æ¹ã ã£ããçæ¹ã ãã ã£ããã
ã¨ãã㧠Go ã«ã¯æ¨æºããã±ã¼ã¸ã¨ãã¦GIFç»åãæ±ããã®ãç¨æããã¦ããã
ããã使ãã°ImageMagickã«ä¾åãããã¨ãªãåè¿°ã®ãããªãã¼ã«ãä½ããã®ã§ã¯ï¼ ãããPure Goã§æ¸ããã¯ãã ããã¯ãã¹ã³ã³ãã¤ã«ãã¦åç°å¢ç¨ã®ãã¤ããªãé å¸ãããã¨ãå¯è½ãªã¯ãï¼
ã¨ãããã¨ã§ä½ã£ã¦ã¿ã次第ã
(ã¾ãã¿ã¼ããã«ã®é²ç»ãæ®ãããéè¦ããã人ãªãåè¨èªã®å®è¡ç°å¢ç¨æãããImageMagickãã¤ã³ã¹ãã¼ã«ãããããã®ã«éå£ã¯ç¡ãã§ããããã©ã)
å®è£
ttyrecordã®èªã¿åã
ttyrecã¯èªåã§ã¤ã³ã¹ãã¼ã«ãã¦ãããã¨ãã¦(RPMããã±ã¼ã¸ãç¨æããã¦ãããhomebrewã§ãå
¥ãã ããã¯åé¡ãªãã¯ã)ã
ããã§æ®ã£ã¦å¾ããããã¤ããªãã¼ã¿ã¯ã
- åã³ãã®æå»ã¨ãåºåå 容ã®é·ããæ ¼ç´ããããã
- ããã«ç¶ãåºåå 容ã®ä¸èº«
ããã é çªã§æ¸ãè¾¼ã¾ãã¦ããã ããªã®ã§ãã²ãããé çªã«èªã¿åã£ã¦ããã
åç
èªã¿åã£ãå
容ãå
ã«ãåæå»ã®å·®åãè¨ç®ããããã¤ã¤ ãã ã¿ã¼ããã«ä¸ã«åºåãã¦ããã ãã§ãåçã§ããã
ãã£ããã£
åã³ããåçãã¤ã¤ãTMPDIR以ä¸ã«ã¹ã¯ãªã¼ã³ã·ã§ãããæ¾ãè¾¼ãã§ãããããããã¯çµæ§é¢åãªã¨ããã§ã
OSXã§ã¯ã
- AppleScriptã使ã£ã¦å¯¾è±¡ã¢ããªã±ã¼ã·ã§ã³(Terminal.appã ã£ããiTerm.appã ã£ãã)ã®ã¢ã¯ãã£ãã¦ã£ã³ãã¦ã®IDãåå¾
- ãã®IDãæå®ãã¦
screencapture
ã³ãã³ããå®è¡ãã
ã¨ããæé ã§ã¹ã¯ãªã¼ã³ã·ã§ãããæ®ããå®è¡ä¸ã®ã¿ã¼ããã«ã¢ããªã±ã¼ã·ã§ã³ãTerminal.appãªã®ãiTerm.appãªã®ããã¯ãã¾ãå¥ã®ã¢ããªã±ã¼ã·ã§ã³ãªã®ãï¼ã¯ãã¨ããããã¯$TERM_PROGRAM
ç°å¢å¤æ°ã§äºæã®å¤å¥ã ããã¦ããããã© ä»ã«è¯ãæ¹æ³ãªãã ãããâ¦
ãã¨ãRetina displayä¸ã§æ®ãã¨é«ã解å度ã®ãã«ãç»åãä½ããã¦ãã¾ãã®ã§ãããããããã«sips
ã³ãã³ãã使ã£ã¦dpiæ
å ±ãåå¾ãã¦èª¿æ´ãããã
OS Xã§æ®ã£ãã¹ã¯ãªã¼ã³ã·ã§ããã£ã¦Retinaã§æ®ã£ããã®ãã©ããã£ã¦å¤å¥ã§ããã®ããª
@sugyan ç»åã®ã¡ã¿æ å ±ã«dpiæ å ±ãå ¥ã£ã¦ãã¿ããã§ãã ãã ãRetinaã¨éRetinaãä½µç¨ããç¶æ ã§ã¦ã¤ã³ãã¦æå®ãã¦ãã£ããã£ããã¨ãã«éRetinaãRetinaãªdpiãå ¥ã£ã¦ãã¾ããã°ã½ãåä½ããã£ãããã¾ããURL
2014-07-14 14:46:38 via TweetDeck to @sugyan
Linux ã¨ãããX Window Systemã§ã¯ãxwd
ã¨ããã³ãã³ãã§æå®ããWINDOWIDã®ç»é¢ããã³ãã§ãããã¨ãããã¨ãªã®ã§ããã使ããã¨ã«ããã
ãã ããã¯xwdãã©ã¼ãããã¨ããç¬èªã®ããããããå½¢å¼ã§ä¿åãããã®ã§ããããèªã¿åã£ã¦ç»åãã¼ã¿ã¨ãã¦å¾ãããã®decoderã¯èªåã§æ¸ããã
OSX/Linuxåç°å¢ã§åãããããã¨ããã¨ããã§ããªããMac OS Xä¸ã§ã XQuartz ã使ã£ã¦X Window Systemãç«ã¡ä¸ãã¦ãã®ä¸ã§ã¿ã¼ããã«åããããããã®ã§ãåºæ¥ãéãã©ã¡ãã«ã対å¿ã§ããããã«ãããã¤ããã
ããã¯XQuartzä¸ã®xtermã§æ®ã£ããã®ã
xwdã§ã¯ä½è¨ãªé¨åãæ®ããããã¨ãªãã¦æ¸ãã®ã ãã©ãOSXã®screencapture
ã§ã¯ã©ããã¦ããã¦ã£ã³ãã¦å
¨ä½ããæ®ããããããã¿ã¤ãã«ãã¼ãªã©ãå«ã¾ãã¦ãã¾ãããã®é¨åãä½æ
ãã³ãã«ãã£ã¦ç½é£ã³ãã¦ãã¾ã£ããããããåºæ¥ãã°é¤å¤ãããã®ã ãã©â¦
å°ã調ã¹ãéãã§ã¯è¯ãæ¹æ³ã¯ç¡ãããã ã£ãã決ãæã¡ã§ä¸20pixelãããåã£ãããããã«ã ã¢ããªã±ã¼ã·ã§ã³ã«ãã£ã¦ ã¾ãã¯åä¸ã¿ãã®ã¨ãã¨è¤æ°ã¿ãã®ã¨ãã¨ã§ãã¼ã®é«ããå¤ãã£ããããã ããã éã«ãã«ã¹ã¯ãªã¼ã³ã¢ã¼ãã®ã¨ãã¯åæã«æ¶ãããããã®å ´åãèæ
®ããªãã¨ãããªããâ¦
ãã£ããã£ããã®GIFçæ
1ã³ããã¤åçãã¤ã¤ ã¹ã¯ãªã¼ã³ã·ã§ããåå¾->ç»åãã¡ã¤ã«èªã¿åã ã¨ãã£ã¦ããã¨åççµäºã¾ã§æéãããã£ã¦ãã¾ãã®ã§ãã¨ããããæ®ãã ãæ®ã£ã¦ä¿åã ããã¦ãããä¸éãåçãçµãã£ããããããèªã¿è¾¼ãã§GIFçæã«ã¨ãããããã¨ããããã«ãã¦ããã
ããã§æ©é pipeline and cancellation並行性パターンの勉強 - すぎゃーんメモ ã§åå¼·ããå
容ãå½¹ç«ã£ããCPU使ãå¦çãªã®ã§ä¸¦è¡åã§ããã¾ã§åçã«æ©ããªãã¨ããããã§ããªããã©ãruntime.GOMAXPROCS(runtime.NumCPU())
æå®ãã¦ã³ã¢æ°ã¶ãåãããã¨ã§å¯è½ãªéãã®å¦çããã¦ãããããã«ãªã£ããã¨æãã
TODO
Windowsã®ãã¨ã¯å®å ¨ã«ç¡è¦ãã¦ä½ã£ã(確èªã§ããç°å¢ãæã£ã¦ãªããâ¦)ãã©ãã³ãã³ãããã³ããã®ã¹ã¯ãªã¼ã³ã·ã§ãããç°¡åã«æ®ãæ¹æ³ã¯ããã®ã ãããï¼
Linux Desktopãèªåã§ã¯æ®æ®µä½¿ã£ã¦ãªããããã¾ã詳ããç¥ããªããä»ã«ããµãã¼ããã¹ããã®ã¯ããã®ããªã
ãã¤ããªé å¸ãããªãttyrecèªä½ãGoã§åå®è£ ãã¦ä½¿ããããã«ãã¦ãããæ¹ãããã£ããããã®ã ãããï¼
ã¹ãã¼ã調æ´ã¯ã§ããããã«ãããã©ãããã®åå3ã³ãã¯åããããããã®typoã®é¨åãåããããã¿ãããªå ´é¢ã¯åºã¦ããã¨æãã®ã§ãä¸åº¦åã³ãã®æå»ã¨åºåå 容æ¦è¦ããã¡ã¤ã«åºåã㦠ãããç·¨éãã¦ä½¿ããã¨ã§åã³ãã®ã¿ã¤ãã³ã°èª¿æ´ãåé¤ãã§ããããã«ããããªãã¨æã£ã¦ããã