пятница, 18 ноября 2011 г.

bash howto's 3


#This will remove leading spaces...
echo " 1233 test " | sed 's/^ *//g'
#This will remove trailing spaces...
echo " test 543453 " | sed 's/ *$//g'


#Make the following XML file available under http://127.0.0.1:5555/
(printf "HTTP/1.1 200 OK\\r\\nContent-Type: text/xml\\r\\n"; \
printf "Content-Length: $(cat "response.xml"|wc -c)\\r\\n\\r\\n"; \
cat response.xml") | nc -l -p 5555 >/dev/zero 2>&1 &

воскресенье, 6 ноября 2011 г.

nginx mp4 streaming with audio stream selection

Tips:
compile nginx with nginx_mod_h254_streaming-2.2.7 module
nginx module debug tips:
-add to nginx.conf
worker_processes 1;
daemon off;
master_process off;
error_log /tmp/were/i/want/see/error.log debug;
-to improove rebuild time modify Makefile in nginx sources
change "rm -rf Makefile objs"
to "rm -rf objs/addon/src/* objs/nginx"

the magic is in mp4_reader.c