Skip to content

Instantly share code, notes, and snippets.

Avatar

Chen, Xiaoqiang feuvan

  • Hangzhou, Zhejiang
View GitHub Profile
@feuvan
feuvan / gist:5589882
Created May 16, 2013
Compile VIM 7.3 for CentOS5.x or other legacy Linux distro for Python2.7 w/o root access
View gist:5589882
# for all patches up to date, or download tgz from vim.org
hg clone https://vim.googlecode.com/hg/ vim
cd vim
# override vi_cv_path_python with your preferred python 2.x location
./configure --disable-selinux --enable-gui=no --enable-pythoninterp --enable-perlinterp --enable-rubyinterp --enable-multibyte --prefix=$HOME vi_cv_path_python=/usr/local/bin/python2.7
make -j 20
make install
@feuvan
feuvan / patch for output_ismv.c
Created Feb 4, 2013
mp4split-2.2.0 OSX build support
View patch for output_ismv.c
#if defined(WIN32)
#elif defined(__MACH__)
static inline unsigned short bswap_16(unsigned short x) {
return (x>>8) | (x<<8);
}
static inline unsigned int bswap_32(unsigned int x) {
return (bswap_16(x&0xffff)<<16) | (bswap_16(x>>16));
}
@feuvan
feuvan / gist:1410113
Created Nov 30, 2011
Parse bilibili.tv video page and return acg.tv short url, vid.
View gist:1410113
<?php
$url = $_GET["url"];
$vid = 0;
$acgtv = "";
if (preg_match("/http:\/\/www.bilibili.tv\/video\/(av\\d+)/", $url, $matches)) {
$acgtv = $matches[1];
$response = file_get_contents($url);
preg_match("/vid=(\\d+)/", $response, $matches);
$vid = $matches[1];
}
@feuvan
feuvan / transcode.php
Created Nov 30, 2011
Grab (implicitly assume recent as x264/aac) iask share video and convert it to mp4.
View transcode.php
<?php
define('FFMPEG', '/usr/bin/ffmpeg');
define('WGET', '/usr/bin/wget');
set_time_limit(3600); /* we are working with small chunks of files */
ignore_user_abort(true); /* do not terminate script execution if disconnect */
@ini_set("output_buffering", 0);
@ini_set('implicit_flush', 1);
header("Connection: close");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
@feuvan
feuvan / LocalRun.cpp
Created Feb 16, 2011
LocalRun: Run application in specified locale (chs as hard-coded).
View LocalRun.cpp
/**
* Local(e)Run: Run application in specified locale (chs as hard-coded).
*
* Originial purpose: run fterm.exe in non-Chinese(PRC) locale.
*
* Author: feuvan@feuvan.net
*/
#include <stdio.h>
#include <tchar.h>
@feuvan
feuvan / datapipe6.c
Created Jan 16, 2011
Datapipe6 - ipv6-aware fork of datapipe.c
View datapipe6.c
/*
* Datapipe6 - ipv6-aware fork of datapipe.c
* Sample usage:
* datapipe6 localipv4addr 23 remoteipv6addr 23
*
*
* Written by feuvan <feuvan@feuvan.net>
* Original ipv4 version by Jeff Lawson <jlawson@bovine.net>
* See statement below
*