Dec 21

1.Aria2 源码下载
http://sourceforge.net/projects/aria2/files/stable/

2.安装必须的库文件

sudo apt-get install gcc c++ autoconf automake libcppunit-dev  autopoint openssl libtool sphinx-common sphinxsearch libgcrypt11-dev libxml2-dev pkg-config

3.编译安装

tar zxvf aria2-1.17.tar.gz  
cd aria2-1.17.1  
./configure ARIA2_STATIC=yes --enable-bittorrent --enable-metalink

如果编译不能通过,可以删掉 ARIA2_STATIC=yes 选项:

./configure --enable-bittorrent --enable-metalink
make
sudo make install

4.添加启动脚本
/etc/init.d/aria2

#!/bin/sh  
  
### BEGIN INIT INFO  
# Provides:          aria2  
# Required-Start:  
# Required-Stop:  
# Default-Start:  
# Default-Stop:  
# Short-Description: aria2  
### END INIT INFO  
  
case $1 in  
        start)  
                touch /etc/aria2/session.txt  
                /usr/bin/aria2c --conf-path=/etc/aria2/aria2.conf -D  
                ;;  
        stop)  
                killall aria2c  
                ;;  
        *)  
                echo "Usage: /etc/init.d/aria2 {start|stop}"  
                exit 1  
                ;;  
esac  
exit 0

5.增加启动项

sudo update-rc.d aria2 defaults

6.添加 Aria2 配置文件

enable-rpc=true  
rpc-allow-origin-all=true  
rpc-listen-all=true  
rpc-listen-port=6800  
#event-poll=select  
disable-ipv6=true  
  
max-concurrent-downloads=2  
continue=true  
max-connection-per-server=5  
min-split-size=10M  
split=5  
max-overall-download-limit=0  
max-download-limit=0  
max-overall-upload-limit=15k  
max-upload-limit=15k  
#lowest-speed-limit=0  
#referer=*  
input-file=/etc/aria2/session.txt  
save-session=/etc/aria2/session.txt  
save-session-interval=30  
dir=/nas/aria2  
disk-cache=16M  
enable-mmap=true  
  
file-allocation=none  
force-save=true   
  
follow-torrent=true  
bt-hash-check-seed=true  
bt-seed-unverified=true  
bt-save-metadata=true  
#bt-request-peer-speed-limit=2M  
bt-save-metadata=true  
#seed-time=10  
seed-ratio=0.1  
   
log=/etc/aria2/aria2.log  
log-level=error  
max-download-result=50  
Dec 21

1.下载源代码
目前 MiniDLNA 最新版本 1.1.5, 下载地址:
https://sourceforge.net/projects/minidlna/files/minidlna/

2.修改源文件
metadata.c

//line 840  
else if( strncmp(ctx->iformatctx->name, "matroska", 8) == 0 )  
    xasprintf(&m.mime, "video/x-matroska");  
else if( strcmp(ctx->iformatctx->name, "flv") == 0 )  
    xasprintf(&m.mime, "video/x-flv");  
//----add----  
else if( strcmp(ctx->iformat->name, "rm") == 0 )  
    xasprintf(&m.mime, "video/x-pn-realvideo");  
else if( strcmp(ctx->iformat->name, "rmvb") == 0 )  
    xasprintf(&m.mime, "video/x-pn-realvideo");  
//---end----  
if( m.mime )  
    goto video_nodlna;  

upnpglobalvars.h

// Line 169  
    "http-get:*:audio/mp4:*," \  
    "http-get:*:audio/x-wav:*," \  
    "http-get:*:audio/x-flac:*," \  
    "http-get:*:application/ogg:*," \  
//----add----  
    "http-get:*:video/x-pn-realvideo:*"  
//----end----  
  
#define DLNA_FLAG_DLNA_V1_5      0x00100000
#define DLNA_FLAG_HTTP_STALLING  0x00200000

utils.c

//line 381  
        ends_with(file, ".m2t") || ends_with(file, ".mkv")   ||  
        ends_with(file, ".vob") || ends_with(file, ".ts")    ||  
        ends_with(file, ".flv") || ends_with(file, ".xvid")  ||  
//----add----  
        ends_with(file, ".rm")  || ends_with(file, ".rmvb")  ||  
//----end----  
#ifdef TIVO_SUPPORT  
        ends_with(file, ".TiVo") ||  
#endif  
        ends_with(file, ".mov") || ends_with(file, ".3gp"));

3.编译安装

sudo apt-get install build-essential libexif-dev libjpeg-dev \  
libid3tag0-dev libFLAC-dev libvorbis-dev libsqlite3-dev libavformat-dev \  
autoconf automake  
  
./autogen.sh  
./configure  
make  
make install  
sudo cp ./linux/minidlna.inot.d.script.tmpl  /etc/init.d/minidlna  
sudo cp ./minidlna.conf  /etc/minidlna.conf  
  
# 第一次启动使用-d –v选项看有没有出错  
sudo /usr/local/sbin/minidlnad -d -v  
# 没出错就ctrl+c 结束进程  
  
# 正常启动  
sudo service minidlna start  
# 刷新列表  
sudo service minidlna restart  

4.MiniDLNA 配置

# port for HTTP (descriptions, SOAP, media transfer) traffic  
port=8200  
  
# network interfaces to serve, comma delimited  
#network_interface=eth0  
  
# specify the user account name or uid to run as  
#user=jmaggard  
  
# set this to the directory you want scanned.  
# * if you want multiple directories, you can have multiple media_dir= lines  
# * if you want to restrict a media_dir to specific content types, you  
#   can prepend the types, followed by a comma, to the directory:  
#   + "A" for audio  (eg. media_dir=A,/home/jmaggard/Music)  
#   + "V" for video  (eg. media_dir=V,/home/jmaggard/Videos)  
#   + "P" for images (eg. media_dir=P,/home/jmaggard/Pictures)  
#   + "PV" for pictures and video (eg. media_dir=PV,/home/jmaggard/digital_camera)  
media_dir=/opt  
  
# set this to merge all media_dir base contents into the root container  
# note: the default is no  
#merge_media_dirs=no  
  
# set this if you want to customize the name that shows up on your clients  
#friendly_name=My DLNA Server  
  
# set this if you would like to specify the directory where you want MiniDLNA to store its database and album art cache  
#db_dir=/var/cache/minidlna  
  
# set this if you would like to specify the directory where you want MiniDLNA to store its log file  
#log_dir=/var/log  
  
# set this to change the verbosity of the information that is logged  
# each section can use a different level: off, fatal, error, warn, info, or debug  
#log_level=general,artwork,database,inotify,scanner,metadata,http,ssdp,tivo=warn  
  
# this should be a list of file names to check for when searching for album art  
# note: names should be delimited with a forward slash ("/")  
album_art_names=Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg  
  
# set this to no to disable inotify monitoring to automatically discover new files  
# note: the default is yes  
inotify=yes  
  
# set this to yes to enable support for streaming .jpg and .mp3 files to a TiVo supporting HMO  
enable_tivo=no  
  
# set this to strictly adhere to DLNA standards.  
# * This will allow server-side downscaling of very large JPEG images,  
#   which may hurt JPEG serving performance on (at least) Sony DLNA products.  
strict_dlna=no  
  
# default presentation url is http address on port 80  
#presentation_url=http://www.mylan/index.php  
  
# notify interval in seconds. default is 895 seconds.  
notify_interval=900  
  
# serial and model number the daemon will report to clients  
# in its XML description  
serial=12345678  
model_number=1  
  
# specify the path to the MiniSSDPd socket  
#minissdpdsocket=/var/run/minissdpd.sock  
  
# use different container as root of the tree  
# possible values:  
#   + "." - use standard container (this is the default)  
#   + "B" - "Browse Directory"  
#   + "M" - "Music"  
#   + "V" - "Video"  
#   + "P" - "Pictures"  
#   + Or, you can specify the ObjectID of your desired root container (eg. 1$F for Music/Playlists)  
# if you specify "B" and client device is audio-only then "Music/Folders" will be used as root  
#root_container=.  
  
# always force SortCriteria to this value, regardless of the SortCriteria passed by the client  
#force_sort_criteria=+upnp:class,+upnp:originalTrackNumber,+dc:title  
  
# maximum number of simultaneous connections  
# note: many clients open several simultaneous connections while streaming  
#max_connections=50  

转自:http://blog.csdn.net/haven200/article/details/43039261#

Jul 19

EasyPi – 01.lantern (科学上网)
https://www.youtube.com/watch?v=V6xIgOhWBis

EasyPi – 02.shadowsocks (科学上网)
https://www.youtube.com/watch?v=YZf9G-DYLiU

EasyPi – 03.dnscrypt (科学上网)
https://www.youtube.com/watch?v=oAwy7Xq2-6Q

EasyPi – 04.dnsmasq (科学上网)
https://www.youtube.com/watch?v=WkCTOabLRHo

EasyPi – 05.polipo (科学上网)
https://www.youtube.com/watch?v=2ykZksjqwtM

EasyPi – 06.proxychains-ng (科学上网)
https://www.youtube.com/watch?v=Li54R50vHVQ

EasyPi – 07.privoxy (科学上网)
https://www.youtube.com/watch?v=guZpBC7ky4c

EasyPi – 08.squid (科学上网)
https://www.youtube.com/watch?v=9BetST0NbmQ

EasyPi – 09.curl (科学上网)
https://www.youtube.com/watch?v=XviGFL_-rGw

EasyPi – 10.haproxy (科学上网)
https://www.youtube.com/watch?v=HXDvrQGxWFY

Jul 18

1. 添加软件源

echo 'deb http://pipplware.pplware.pt/pipplware/dists/jessie/main/binary /' | sudo tee --append /etc/apt/sources.list.d/pipplware_jessie.list

2. 下载密钥

wget -O - http://pipplware.pplware.pt/pipplware/key.asc | sudo apt-key add -

3. 安装 Kodi

sudo apt-get update
sudo apt-get install kodi

4. 更新 Kodi 至最新版本

sudo apt-get upgrade
sudo apt-get dist-upgrade

5. 设置 Kodi 开机自动运行

sudo vim /etc/default/kodi
ENABLED=1

参考资料:
1. HOW-TO:Autostart Kodi for Linux
2. Kodi 15/16 Packages for Raspbian
3. Quick Tip: How to Update to Latest Kodi 16 “Jarvis” on Raspberry Pi
4. HOW-TO:Install Kodi on Raspberry Pi

Dec 21

前面在《Raspberry Pi搭建打印服务器》一文中记录了在 Raspberry Pi 搭建打印机的全过程,稳定运行了好久,昨天因为断电,导致重启后出现错误:

USB printer stopped working: "/usr/lib/cups/backend/hp failed

解决方法如下:

1.访问 https://192.168.1.110:631/printers/HPPrinter

2.Administrator-HPPrinter-Manage Printers-”Resume Printer”,然后出入管理员帐号和密码就可以了。