2014-11-01から1ヶ月間の記事一覧

Three.jsを使ったSTLのビューワ

https://gist.github.com/bellbind/477817982584ac8473efhttps://github.com/shohei/STLViewer

movをm4vにコマンドラインで圧縮変換する

http://stackoverflow.com/questions/15524776/ffmpeg-convert-mov-file-to-mp4-for-html5-video-tag-ie9 5分の1くらいに圧縮できた. $ ffmpeg -i input.mov -vcodec h264 output.m4v

Macからffmpegでサーバにストリーミングデータを投げる

ffmpegインストール brew install ffmpegサイズを320x240にしたらうまくいった. linuxでvideo4linux2にしてたところはqtkitにする. 参考: http://marctv.de/blog/tutorial-hd-pvr-twitch-mac-os-ffmpeg/ $ ffmpeg -f qtkit -i "default" -f mpeg1video -s…

SSH通信の遮断を防ぐ

http://askubuntu.com/questions/127369/how-to-prevent-write-failed-broken-pipe-on-ssh-connection VPSにSSHで入っていると,SSH: Broken pipeとなってSSH通信が遮断されることが多い. /etc/ssh/ssh_config(Linux) ~/.ssh/config(Mac)に以下を追加する.…

パブリックWi-fiでプロキシを使う(SSHポートフォワーディング)

ローカルの80番へのアクセスをVPSのsquidポートに転送する. 1023番以下のフォワーディングには管理者権限が必要. http://ts-engine.net/wp/archives/463うまくまとまってた. http://qiita.com/mechamogera/items/b1bb9130273deb9426f5

さくらVPSにsquidをインストール

http://ameblo.jp/yuu-sys-guard/entry-11858192189.html設定ファイルの変更と,ファイアウォールの設定でポートを開ける. /etc/squid/squid.conf 変更点 ... acl allow_hosts src xxx.xxx.xxx.xxx http_access allow allow_hosts ... http_port 31283 ... …

リバースポートフォワーディングしてRaspberry piに外からSSHで入る

やってみたらできた. raspberry pi側 ssh -N -R 8022:127.0.0.1:22 USER@VPS_ADDRESS -p VPS_PORT -i ~/.ssh/id_rsa_mbp2014mac側 VPSの仮想ポート(8022)に入ってraspiにリダイレクトしてもらう ssh pi@VPS_ADDRESS -p 8022 -i ~/.ssh/id_rsa

Raspberry piでライブストリーミング

http://phoboslab.org/log/2013/09/html5-live-video-streaming-via-websockets Websocketを使ってストリーミングする. 8082番のHTTPと8084のWSのポート開放は必要なかった. 構成 jsmpegを使う. https://github.com/phoboslab/jsmpegサーバ(VPS)側 git cl…

node.jsでUDPのサーバークライアント通信

外部とやる場合はポート開放、ポートフォワーディングが必要そう http://www.hacksparrow.com/node-js-udp-server-and-client-example.htmlclient.js var PORT = 33333; var HOST = '127.0.0.1'; var dgram = require('dgram'); var message = new Buffer('M…

STUNサーバを中継したUDPチャットのテスト

うまくいかなかった. vs-stun, sync-prompt, dgram利用udpTest.js var stun = require('vs-stun'); var socket, server = { host: 'stun.l.google.com', port: 19302 } var callback = function callback ( error, value ) { if ( !error ) { socket = valu…

node.jsで複数のユーザ入力を受け取る

https://github.com/shovon/sync-prompt npm install -g sync-promptvar prompt = require('sync-prompt').prompt; var name = prompt('What is your name? '); // User enters "Mike". console.log('Hello, ' + name + '!'); // -> Hello, Mike! var passwo…

node.jsでSTUNサーバにアクセスする

vs-stun NPMを使う var stun = require('vs-stun'); var socket, server = { host: 'stun.l.google.com', port: 19302 } var callback = function callback ( error, value ) { if ( !error ) { socket = value; console.log(socket.stun); socket.close(); …

node.jsでUDP通信を行なう

http://blog.katamari.co.jp/archives/550

BibTeXでnocite{}を使った時に引用順にする

Tex

nocite{*}だと.bibファイルに現れた順になるので, nocite{,}として指定する. http://tex.stackexchange.com/questions/56634/bibtex-ordering-by-appearence-of-the-bib-file-instead-of-the-tex-filekeyはgsedで抜き出す. http://unicus.jp/skmk/archive…

NAT越えに関するメモ

http://www.kisato.net/wp/html5/com-webrc_1/

リバースポートフォワーディングしてローカルサーバにアクセスするシェルスクリプト(簡易NAT越え)

node.js, sinatra, rails,SimpleHTTPServerとかを使って ローカルで開発中のものをシェアする際に使えそう. もう少し凝れば簡易Dropbox的にも使えるかも. 8022ポートにアクセスしてるものの,8022は開けなくても良さそうなところが使えるポイントか. /us…

Raspberry pi上にVPN構築(PPP)

http://qiita.com/sumyapp/items/b7300a9ffa316d676aa1

Raspberry piにZoneminderをインストール

sudp apt-get update sudo apt-get install zoneminder --fix-missing

CentOSにZoneminderをインストール

http://www.zoneminder.com/wiki/index.php/CentOS wget http://zmrepo.connortechnology.com/el/6/i386/zmrepo-6-4.el6.noarch.rpm sudo yum install --nogpgcheck zmrepo-6-4.el6.noarch.rpm sudo yum install zoneminder less /usr/share/doc/zoneminder-…

Raspberry piでwrtc NPMパッケージを使う

Raspberry piでgetUserMediaする

Raspberry piのストリーミングテスト

ここを参考に. http://taman515.dip.jp/linux_motion/motion.htmlmotionを使う デーモンじゃなくて,コンソール起動したいので 以下のように設定した. /etc/motion/motion.conf # Rename this distribution example file to motion.conf # # This config f…

Raspiをシグナリングサーバにする

https://github.com/buildar/getting_started_with_webrtc

Ubuntuにnodebrewでnode.jsをインストール

コンパイラにはg++-4.7を使う.http://qiita.com/kimama1997/items/a6a22e3ee0f86af829fd

raspi on webrtcサーベイ

http://bloggeek.me/webrtc-raspberripi-nodejs/http://www.html5rocks.com/ja/tutorials/webrtc/datachannels/

WebRTCでシグナリング

http://blog.livedoor.jp/kotesaki/archives/1794148.html http://blog.wnotes.net/blog/article/webrtc-beginning http://www.html5rocks.com/en/tutorials/webrtc/infrastructure/?redirect_from_locale=jahttp://html5experts.jp/mganeko/5349/

WebRTCのStreamAPI

http://slowquery.hatenablog.com/entry/2013/01/30/001310https://github.com/shohei/WebRtcCamera

lsコマンドの結果をツリー形式で表示する

Treeコマンドはカレントディレクトリを表示するが サブディレクトリに対してツリー構造を表示させたかった. ls /path/to/dir/ | treeとかパイプを通しても駄目だったので,以下を使う. http://www.molecularsciences.org/linux/using_ls_to_display_a_file…

ターミナルでQuicklookを起動して画像を見る

qlmanageを使う 画像にしか使えないみたい.htmlとかmdとかは駄目だった. http://www.macworld.com/article/1131923/qlterminal.html $ qlmanage -p hoge.jpg.zshrcに以下を記述してエイリアスを貼っておく alias qlf='qlmanage -p "$@" >& /dev/null'めんど…

manコマンドの結果に色を付ける

http://kaworu.jpn.org/kaworu/2012-05-02-1.php .zshrc export MANPAGER='less -R' man() { env \ LESS_TERMCAP_mb=$(printf "\e[1;31m") \ LESS_TERMCAP_md=$(printf "\e[1;31m") \ LESS_TERMCAP_me=$(printf "\e[0m") \ LESS_TERMCAP_se=$(printf "\e[0m"…