Dwarf Fortress安装

  1. 官网下载

  2. 依赖库安装

    以下仅供32位用户参考,其他架构用户请自行调整

    Ubuntu 13 or below

    sudo apt-get install ia32-libs libsdl-image1.2 libsdl-sound1.2 libsdl-ttf2.0-0

    Ubuntu 14

    sudo apt-get install libgtk2.0-0:i386 libglu1-mesa:i386 libsdl-image1.2:i386 libsdl-sound1.2:i386 libsdl-ttf2.0-0:i386

    如果没有ia32-libs可以用ia32-libs-multiarch代替

  3. 错误解决

    Dynamically loading the OpenAL library ...

View comments.

more ...

Ubuntu下flv合并

软件包安装

sudo apt-get install ffmpeg mkvtoolnix gpac mencoder mediainfo

合并flv

mencoder -oac pcm -ovc copy -idx -o output.flv x.flv y.flv z.flv

视频信息查看

mediainfo file

通过flvcd生成的m3u列表下载youku视频并合并的C++代码(Linux可用 需要axel)

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <fstream>
#include <string>
#include <sstream>
using namespace std;
ifstream fin;
ofstream ...

View comments.

more ...

Nginx做反向代理时页面内超链接的重写

例如用作反向代理的网站为www.bar.com,需要反向代理的网站为www.foo.com

在反向代理的同时还希望重写超链接则可以这么做

server {
  listen 80;
  server_name www.bar.com;
  location / {
    proxy_pass http://www.foo.com;
    proxy_redirect off;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Accept-Encoding "";
    sub_filter www.foo.com www.bar.com;
    sub_filter_once off;
  }
}

其中使用的sub_filter功能需要模块支持

Ubuntu下可以这样安装

apt-get install nginx-extras

View comments.

more ...