异步加载css文件
2015年3月26日 10:45
$("<link>") .attr({ rel: "stylesheet", type: "text/css", href: "/static/videojs/video.js" }) .appendTo("head");
$("<link>") .attr({ rel: "stylesheet", type: "text/css", href: "/static/videojs/video.js" }) .appendTo("head");
http://www.videojs.com/
wget http://www.videojs.com/downloads/video-js-4.12.5.zip
unzip video-js-4.12.5.zip
➜ video-js python -m SimpleHTTPServer Serving HTTP on 0.0.0.0 port 8000 ...
<!DOCTYPE html> <html> <head> <title>Video.js | HTML5 Video Player</title> <!-- Chang URLs to wherever Video.js files will be hosted --> <link href="video-js.css" rel="stylesheet" type="text/css"> <!-- video.js must be in the <head> for older IEs to work. --> <script src="video.js"></script> <!-- Unless using the CDN hosted version, update the URL to the Flash SWF --> <script> <!--支持播放flv --> videojs.options.flash.swf = "video-js.swf"; </script> </head> <body> <!-- poster封面 preload预加载 --> <video id="example_video_1" class="video-js vjs-default-skin" controls preload="none" width="640" height="264" poster="http://video-js.zencoder.com/oceans-clip.png" data-setup="{}"> <!-- 三种播放格式--> <source src="http://video-js.zencoder.com/oceans-clip.mp4" type='video/mp4' /> <source src="http://video-js.zencoder.com/oceans-clip.webm" type='video/webm' /> <source src="http://video-js.zencoder.com/oceans-clip.ogv" type='video/ogg' /> <!-- 字幕 --> <track kind="captions" src="demo.captions.vtt" srclang="en" label="English"></track><!-- Tracks need an ending tag thanks to IE9 --> <track kind="subtitles" src="demo.captions.vtt" srclang="en" label="English"></track><!-- Tracks need an ending tag thanks to IE9 --> <p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a></p> </video> </body> </html>
➜ video-js ls -sh video 总用量 303M 25M demo.flv 96M demo.ogv 40M demo.webm 120M demo.mp4 25M demo.swf
<source src="/video/demo.flv" type='video/x-flv' /> <!-- <source src="/video/demo.ogv" type='video/ogg' /> <source src="/video/demo.mp4" type='video/mp4' /> <source src="/video/demo.webm" type='video/webm' /> -->
location / { root /home/wyq/workspace/video-js/; #root html; index index.html index.htm; }
location / { root /home/wyq/workspace/video-js/; limit_rate_after 5m; #下载5M以后开始限速 limit_rate 512k; #每个链接速度限制为512K #root html; index index.html index.htm; }
https://github.com/jekyll/jekyll-sitemap
gem install jekyll-sitemap
gems: - jekyll-sitemap
sitemap: false
location / { limit_rate_after 5m; #下载5m以后开始限速 limit_rate 100k; #每个链接限速100k }
➜ ~ source .bash_profile /etc/bashrc:37: command not found: shopt /etc/bashrc:fc:38: event not found: -a /etc/bashrc:40: command not found: shopt /etc/bashrc:51: command not found: shopt
sudo yum install ifstat
root@DEV-server:~# ifstat eth0 KB/s in KB/s out 73.53 66.34 1.14 0.99 89.65 22.87 5.62 2.62 1.79 1.15 2.22 1.46 62.26 62.24
➜ ~ ifstat #kernel Interface RX Pkts/Rate TX Pkts/Rate RX Data/Rate TX Data/Rate RX Errs/Drop TX Errs/Drop RX Over/Rate TX Coll/Rate lo 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 p2p1 0 0 1 0 0 0 62 0 0 0 0 0 0 0 0 0
➜ bin tar -zxvf commons-daemon-native.tar.gz
➜ unix ./configure ... ➜ unix make
cp jsvc /home/wyq/software/apache-tomcat-7.0.59/bin/
TOMCAT_USER=wyq
sh daemon.sh start/stop
pkenv=/home/wyq/pkenv JAVA_HOME=$pkenv/jdk1.7.0_75 CATALINA_HOME=$pkenv/apache-tomcat-7.0.59 CATALINA_BASE=$pkenv/apache-tomcat-7.0.59 DAEMON_HOME=$pkenv/apache-tomcat-7.0.59/bin TOMCAT_USER=wyq
cd /etc/init.d ln -s xxxx/bin/daemon.sh tomcat
sudo service tomcat start/stop
8005 用于停止Tomcat的端口 8009 Apache的侦听端口 8080 默认的连接端口
#!/bin/bash # ### BEGIN INIT INFO # Provides: hello # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Should-Start: $network $time # Should-Stop: $network $time # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Description: hello world ### END INIT INFO # echo "hello world" > /home/wyq/a.log
wyq@localhost:/etc/init.d$ sudo update-rc.d hello defaults 90 update-rc.d: using dependency based boot sequencing update-rc.d: error: unable to read /etc/init.d/hello
wyq@localhost:/etc/init.d$ sudo insserv /etc/init.d/hello.sh insserv: warning: script 'hello.sh' missing LSB tags and overrides
insserv myserver #添加服务 insserv -r myserver #删除服务 insserv -d myserver #使用默认的runlevels
httpsqs -d -x /opt/httpsqs/data
pkill httpsqs
-l <ip_addr> 监听的IP地址,默认值为 0.0.0.0 -p <num> 监听的TCP端口(默认值:1218) -x <path> 数据库目录,目录不存在会自动创建(例如:/opt/httpsqs/data) -t <second> HTTP请求的超时时间(默认值:3) -s <second> 同步内存缓冲区内容到磁盘的间隔秒数(默认值:5) -c <num> 内存中缓存的最大非叶子节点数(默认值:1024) -m <size> 数据库内存缓存大小,单位:MB(默认值:100) -i <file> 保存进程PID到文件中(默认值:/tmp/httpsqs.pid) -a <auth> 访问HTTPSQS的验证密码(例如:mypass123) -d 以守护进程运行 -h 显示这个帮助
http://localhost:1218/?name=your_queue_name&opt=put&data=经过URL编码的文本消息&auth=mypass123
http://localhost:1218/?name=your_queue_name&opt=put&auth=mypass123
HTTPSQS_PUT_OK 入队成功 HTTPSQS_PUT_ERROR 入队失败 HTTPSQS_PUT_END 队列已满
http://localhost:1218/?charset=utf-8&name=your_queue_name&opt=get&auth=mypass123
http://localhost:1218/?charset=gb2312&name=your_queue_name&opt=get&auth=mypass123
HTTPSQS_GET_END 没有未读消息
http://localhost:1218/?name=your_queue_name&opt=status&auth=mypass123
HTTP Simple Queue Service v1.7 ------------------------------ Queue Name: wyq 队列名 Maximum number of queues: 1000000 最大数 Put position of queue (1st lap): 18 入队位置 Get position of queue (1st lap): 18 出队位置 Number of unread queue: 0 未读数量
http://localhost:1218/?name=your_queue_name&opt=status_json&auth=mypass123
{ "name":"wyq", "maxqueue":1000000, "putpos":18, 入队位置 "getpos":18, 出队位置 "putlap":1, 队列写入初始点 "getlap":1, 队列读取初始点 "unread":0 未读数量 }
http://localhost:1218/?name=your_queue_name&opt=reset&auth=mypass123
HTTPSQS_RESET_OK 重置成功 HTTPSQS_RESET_ERROR 重置失败
http://localhost:1218/?name=your_queue_name&opt=maxqueue&num=1000000000&auth=mypass123
HTTPSQS_MAXQUEUE_OK 更改最大队列数成功 HTTPSQS_MAXQUEUE_CANCEL 操作被取消
http://localhost:1218/?name=your_queue_name&opt=synctime&num=10&auth=mypass123
HTTPSQS_SYNCTIME_CANCEL 本次操作被取消 HTTPSQS_SYNCTIME_OK 修改间隔时间成功