安装 dlna 让局域网电视机观看 lede 影片

安装

opkg update
opkg install minidlna

// 可选
opkg install luci-app-minidlna

配置文件

vim /etc/config/minidlna

#------------------------------------------------------#
# port for HTTP (descriptions, SOAP, media transfer) traffic
#------------------------------------------------------#
port=8200

#------------------------------------------------------#
# network interfaces to serve, comma delimited
#------------------------------------------------------#
network_interface=br-lan

#------------------------------------------------------#
# set this to the directory you want scanned.
# * if have multiple directories, you can have multiple media_dir= lines
# * if you want to restrict a media_dir to a specific content type, you
#   can prepend the type, 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)
#------------------------------------------------------#
# Directory of media is depend on your storage
#------------------------------------------------------#
media_dir=/mnt/sdb2/downloads
media_dir=/mnt/sda3/downloads
#------------------------------------------------------#
# set this if you want to customize the name that shows up on your clients
#------------------------------------------------------#
friendly_name=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/run/minidlna

#------------------------------------------------------#
# set this if you would like to specify the directory where you want MiniDLNA to store its log file
#------------------------------------------------------#
log_dir=/var/log/minidlna

#------------------------------------------------------#
# 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://192.168.1.1:8200/

#------------------------------------------------------#
# 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"
# if you specify "B" and client device is audio-only then "Music/Folders" will be used as root
#------------------------------------------------------#
#root_container=.

启动

minidlna -f /etc/config/minidlna

其他

如果 opkg update 不了,修改源

cp /etc/opkg/distfeeds.conf /etc/opkg/distfeeds_bak.conf
vim /etc/opkg/distfeeds.conf

源地址

src/gz openwrt_koolshare_mod_core http://openwrt.rinvay.cc/snapshots/targets/x86/64/packages
src/gz openwrt_koolshare_mod_base http://openwrt.rinvay.cc/snapshots/packages/x86_64/base
src/gz openwrt_koolshare_mod_luci http://openwrt.rinvay.cc/snapshots/packages/x86_64/luci
src/gz openwrt_koolshare_mod_packages http://openwrt.rinvay.cc/snapshots/packages/x86_64/packages
src/gz openwrt_koolshare_mod_routing http://openwrt.rinvay.cc/snapshots/packages/x86_64/routing
src/gz openwrt_koolshare_mod_telephony http://openwrt.rinvay.cc/snapshots/packages/x86_64/telephony

OPENWRT 自动清理内存,lede 自动清理内存

使用 OPENWRT/LEDE 做aria2下载,然后就是使用samba, dlna,共享文件给电视,看电影,也就是做一个家庭媒体中心,不过有些路由器系统中SAMBA共享看电影的时候,内存不断的下降,虽然本质是 LINUX 系统的路由,内存管理方式和 WIN 不一样,但是经过观察,确实不会恢复内存,而且低于 100 后,系统会变慢,登录路由反应都很慢。所以还是有必要自动清理内存。方法如下:

  1. 建立 SH 脚本文件填入如下命令:

$free -le 1846000 这个数字,个人建议是总量的一半

脚本第一个 log > 为覆盖, 防止日志爆炸

#!/bin/sh

used=`free -m | awk 'NR==2' | awk '{print $3}'`
free=`free -m | awk 'NR==2' | awk '{print $4}'`

echo "===========================" > /var/log/mem.log
date >> /var/log/mem.log
echo "Memory usage | [Use:${used}KB][Free:${free}KB]" >> /var/log/mem.log

if [ $free -le 1846000 ] ; then
sync && echo 1 > /proc/sys/vm/drop_caches
sync && echo 2 > /proc/sys/vm/drop_caches
sync && echo 3 > /proc/sys/vm/drop_caches
echo "OK" >> /var/log/mem.log
else
echo "Not required" >> /var/log/mem.log
fi

保存后,放在路由器上,例如保存为以下路径:/root/memclean.sh

  1. 加入任务

修改 /etc/crontabs/root 文件,添加一行, 表示 50 分钟检测一次内存余量,低于 1.8G 就清理!!

*/50 * * * * /root/memclean.sh

最常用的方式,用 shadowsocks 对应的客户端方式

macOs

macOs 目前来看还是 surge 最好用, 但是 surge 作者也比较作(作为一个老用户,它升级到 2,3,4 每个软件都要付费过来)

目前还是用的 surge 2, 没法支持 v2ray ,通过另外间接 socks5 方式支持

v2ray 设置为手动模式,采用 socks5, 127.0.0.1, 1080, , 方式串联

另外 surge 4, 直接用 vmess 协议即可

ios

ios app 就多了

shadowrocket, quantumult x, kitsunebi, surge

update

atrandys 一键脚本

curl -O https://raw.githubusercontent.com/atrandys/v2ray-ws-tls/master/v2ray_ws_tls1.3.sh && chmod +x v2ray_ws_tls1.3.sh && ./v2ray_ws_tls1.3.sh

// bbr 加速
cd /usr/src && wget -N --no-check-certificate "https://raw.githubusercontent.com/chiakge/Linux-NetSpeed/master/tcp.sh" && chmod +x tcp.sh && ./tcp.sh

cd /usr/src && ./tcp.sh

准备工作

  1. 准备一个域名,并将 A 记录添加好。
  2. V2ray 官方说明,了解 TLS WebSocket 及 V2ray 相关信息
  3. 安装好 curl

安装方式(不兼容,二选一)

Vmess+websocket+TLS+Website without(nginx)

bash <(curl -L -s https://raw.githubusercontent.com/graceshare/V2Ray_ws-tls_bash_onekey/master/installwithoutnginx.sh) | tee v2ray_ins.log

Vmess+websocket+TLS+Nginx+Website

bash <(curl -L -s https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/master/install.sh) | tee v2ray_ins.log

Vmess + HTTP2 over TLS

bash <(curl -L -s https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/master/install_h2.sh) | tee v2ray_ins_h2.log

启动方式

启动 V2ray:systemctl start v2ray

停止 V2ray:systemctl stop v2ray

启动 Nginx:systemctl start nginx

停止 Nginx:systemctl stop nginx

相关目录

Web 目录:/home/wwwroot/3DCEList Nginx 目录:/etc/nginx 证书目录: /data/v2ray.key/data/v2ray.crt

V2ray 服务端配置:/etc/v2ray/config.json V2ray 客户端配置: 执行安装时所在目录下的 v2ray_info.txt

今天介绍一款防止 UDP 干扰的软件,我们一般都知道当 UDP 传输流量较大时,运营商为了保证整体宽度质量,会对于 UDP 进行限速或禁止,但一般都是临时性的。今天介绍的这款软件 udp2raw,就是可以将 UDP 伪装为 TCP 的软件,从而逃过 UDP 干扰。适合 UDP 干扰比较严重的地区,尤其某些南方电信,呵呵哒

github udp2raw

软件:适用于采用 udp 协议传输数据的软件,例如 openvpn(udp)、wireguard、kcptun 等。

使用方式:无论 openvpn 还是 wireguard,亦或 kcptun,udp2raw 的使用方式都是一样的,udp2raw 只需要开启服务端和客户端组成传输隧道,隧道两端则是 openvpn/wireguard/kcptun 等软件,openv/wg/kcptun 客户端—–>udp2raw 客户端—–>udp2raw 服务端——->openv/wg/kcptun 服务端。

udp2raw 单独搭配 openvpn、wireguard 时,必须要设置一下 openvpn/wireguard 的 MTU,设置为 1200,超过 1300 软件会崩溃。

1、服务端

修改wireguardMTU,如果是一键脚本安装的,那么使用下面命令修改/etc/wireguard/wg0.conf文件,如果不是,自行解决。

sed -i "s/1420/1200/" /etc/wireguard/wg0.conf

重启 wg

wg-quick down wg0
wg-quick up wg0

wg命令查看wireguard监听的端口,下面要用。

获取udp2raw服务端

curl -o udp2raw https://raw.githubusercontent.com/atrandys/onekeyopenvpn/master/udp2raw && chmod +x udp2raw

开启服务

nohup ./udp2raw -s -l0.0.0.0:9898 -r 127.0.0.1:你的wireguard端口 --raw-mode faketcp -a -k passwd > udp2raw.log 2>&1 &

2、客户端

win+mac 客户端下载

udp2raw -c -r你的服务器IP:9898 -l 127.0.0.1:2090 --raw-mode faketcp -k passwd