-
Use the
h264_mp4toannexbbitstream filter to convert the mp4s (video steam only) into the AnnexB bitstream formatffmpeg -i input1.mp4 -vcodec copy -vbsf h264_mp4toannexb -acodec copy part1.ts # repeat for up to inputN -
Concat the files using cat
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
| <?php | |
| $out = htmlspecialchars( | |
| html_entity_decode($in, ENT_QUOTES, 'UTF-8'), | |
| ENT_QUOTES, 'UTF-8' | |
| ); | |
| ?> |
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
| #! /usr/bin/env python | |
| import MySQLdb | |
| host = "localhost" | |
| passwd = "" | |
| user = "root" | |
| dbname = "mydbname" | |
| db = MySQLdb.connect(host=host, user=user, passwd=passwd, db=dbname) | |
| cursor = db.cursor() |
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
| # | |
| # A virtual host using WordPress | |
| # /etc/nginx/conf.d/example.com.conf | |
| # | |
| server | |
| { | |
| listen 8080; | |
| client_max_body_size 10m; | |
| server_name .example.com; |
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
| # Get/download youtube-dl from http://rg3.github.com/youtube-dl/ | |
| # Make it executable (chmod +x <path-to-youtube-dl>/youtube-dl) | |
| # Copy it to /usr/bin to use it like a command (sudo cp <path-to-youtube-dl>/youtube-dl /usr/bin) | |
| # Open your favourite editor and copy this script and save by any name you like (I use youtube-dl-mp3). | |
| # Make it executable (chmod +x <path-to-youtube-dl-mp3>/youtube-dl-mp3) | |
| # Copy it to /usr/bin to use it like a command (sudo cp <path-to-youtube-dl-mp3>/youtube-dl-mp3 /usr/bin) | |
| # Done! :) | |
| # Usage: youtube-dl-mp3 "http://www.youtube.com/watch?v=YnA6ExlxNJU&feature=fvst" | |
| if [ -w "." ] |
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
| <?php | |
| # Nginx don't have PATH_INFO | |
| if (!isset($_SERVER['PATH_INFO'])) { | |
| $_SERVER['PATH_INFO'] = substr($_SERVER["ORIG_SCRIPT_FILENAME"], strlen($_SERVER["SCRIPT_FILENAME"])); | |
| } | |
| $request = substr($_SERVER['PATH_INFO'], 1); | |
| $file = $request; | |
| $fp = @fopen($file, 'rb'); |
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
| Select all and delete (actually move to buffer) | |
| :%d | |
| Select all and copy to buffer | |
| :%y | |
| Use p to paste the buffer. |
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
| # Configuration file for runtime kernel parameters. | |
| # See sysctl.conf(5) for more information. | |
| # See also http://www.nateware.com/linux-network-tuning-for-2013.html for | |
| # an explanation about some of these parameters, and instructions for | |
| # a few other tweaks outside this file. | |
| # | |
| # See also: https://gist.github.com/kgriffs/4027835 | |
| # | |
| # Assumes a beefy machine with lots of network bandwidth |
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
| <?php | |
| function folderSize ($dir) | |
| { | |
| $size = 0; | |
| foreach (glob(rtrim($dir, '/').'/*', GLOB_NOSORT) as $each) { | |
| $size += is_file($each) ? filesize($each) : folderSize($each); | |
| } |
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
| <?php | |
| /* Mini Gavatar Cache */ | |
| /* 注:该程序中部分代码是WordPress所用,小幅修改即可复用。 */ | |
| function my_avatar( $email, $size = '50', $default = '', $alt = false ) { | |
| $alt = (false === $alt) ? '' : esc_attr( $alt ); | |
| $f = md5( strtolower( $email ) ); | |
| $w = home_url(); //$w = get_bloginfo('url'); | |
| $a = $w. '/avatar/'. $f . '.jpg'; | |
| $e = preg_replace('/wordpress\//', '', ABSPATH) . 'avatar/' . $f . '.jpg'; | |
| $t = 604800; //设定7天, 单位:秒 |
OlderNewer