k2p刷breed和op-boot

查询mtd

cat /proc/mtd
dev:    size   erasesize  name
mtd0: 01000000 00010000 "ALL"
mtd1: 00030000 00010000 "Bootloader"
mtd2: 00010000 00010000 "Config"
mtd3: 00010000 00010000 "Factory"
mtd4: 00050000 00010000 "permanent_config"
mtd5: 00f60000 00010000 "firmware"
mtd6: 00c48b96 00010000 "rootfs"
mtd7: 00200000 00010000 "rootfs_data"

得知 mtd1为bootloader

刷op-boot,上传至/tmp然后

mtd -r write /tmp/opboot1.0.4.bin Bootloader

路由器单独添加去广告 hosts+计划任务自动更新

用了yhosts的去广告hosts,解决小米电视的各种广告和视频app的广告

老毛子固件

#30 5 * * * cd /etc/storage/dnsmasq;rm -rf hosts;wget --no-check-certificate https://raw.githubusercontent.com/vokins/yhosts/master/hosts;restart_dhcpd

LEDE

#30 5 * * * cd /etc;rm -rf hosts;wget --no-check-certificate https://raw.githubusercontent.com/vokins/yhosts/master/hosts;/etc/init.d/dnsmasq restart

在LEDE Stones版本中好像长命令无法执行,写了文件yhosts_ad.sh,执行文件后自动添加计划任务
LEDE Stones版本测试ok

#!/bin/sh

#仅添加yhosts的hosts,适用于手机和盒子
cd /etc/
# 删除原有hosts,下载yhosts
rm -rf /etc/hosts
wget --no-check-certificate https://raw.githubusercontent.com/vokins/yhosts/master/hosts

# 删除想删除的拦截
sed -i '/taobao/d' hosts

# 手动添加想拦截的
cat >> hosts <<EOF
# 手动添加
EOF

#重启服务
/etc/init.d/dnsmasq restart

# 删除旧的每天更新一次,注入新的每天更新一次的任务
sed -i '/更新hosts规则/d' /etc/crontabs/root
sed -i '/yhosts_ad.sh/d' /etc/crontabs/root
cat >> /etc/crontabs/root <<EOF
# 每天5点30分更新hosts规则
30 5 * * * /bin/sh /root/yhosts_ad.sh
EOF

以上是写法,使用时直接运行这段命令即可,默认目录/root/

cd /root; wget samzz.tk/tmp/lede_stones/yhosts_ad.sh;sh yhosts_ad.sh

老毛子路由器添加dnsmasq去广告等

hiboy 老毛子 潘多拉固件 (荒野无灯在尾部)

一、手动添加

手动添加到自定义脚本的【在 WAN 上行/下行启动后执行】里,实现网络连接上时自动更新。也可以直接在命令行里直接运行。

#自由上网dnsmasq:
wget --no-check-certificate https://raw.githubusercontent.com/sy618/hosts/master/dnsmasq/dnsfq -O /etc/storage/dnsmasq/dnsmasq.d/dnsfq.conf;sed -i "1 i\## update:$(date "+%Y-%m-%d %H:%M:%S")" /etc/storage/dnsmasq/dnsmasq.d/dnsfq.conf;restart_dhcpd

#去广告hosts:
wget --no-check-certificate https://raw.githubusercontent.com/vokins/yhosts/master/hosts -O /etc/storage/dnsmasq/hosts;sed -i "1 i\## update:$(date "+%Y-%m-%d %H:%M:%S")" /etc/storage/dnsmasq/hosts;restart_dhcpd

手动添加到定时任务crontab(在 系统管理 - 服务 -计划任务 (Crontab) 里)

#自由上网dnsmasq:
01 00 * * * wget --no-check-certificate https://raw.githubusercontent.com/sy618/hosts/master/dnsmasq/dnsfq -O /etc/storage/dnsmasq/dnsmasq.d/dnsfq.conf;restart_dhcpd

#去广告hosts
02 00 * * * wget --no-check-certificate https://raw.githubusercontent.com/vokins/yhosts/master/hosts  -O /etc/storage/dnsmasq/hosts;restart_dhcpd

当然用SS的可以只添加yhosts的去广告

二、自动化脚本,不会手动添加的用以下一键脚本命令 适用 hiboy大和荒野无灯大的【padavan固件】

固件地址:http://www.right.com.cn/forum/thread-161324-1-1.html

一键运行命令fq+ad:

mkdir -p /etc/storage/dnsmasq/dns;wget --no-check-certificate https://raw.githubusercontent.com/sy618/hosts/master/dnsmasq/sh/setting.sh -O /etc/storage/dnsmasq/dns/setting.sh;sh /etc/storage/dnsmasq/dns/setting.sh

一键运行命令ad(在start.sh里把下载dnsmasq文件的部分注释掉了):

mkdir -p /etc/storage/dnsmasq/dns;wget --no-check-certificate http://www.samzz.tk/tmp/laomaozi/ad/ad.sh -O /etc/storage/dnsmasq/dns/setting.sh;sh /etc/storage/dnsmasq/dns/setting.sh

一键还原命令相同:

sh /etc/storage/dnsmasq/dns/del.sh

详细看https://github.com/sy618/hosts/tree/master/dnsmasq/sh

荒野无灯 潘多拉固件

因dnsmasq配置文件里conf-dir目录和hiboy的不同,添加计划任务略有不同,见下

#自由上网dnsmasq:
01 00 * * *wget --no-check-certificate https://raw.githubusercontent.com/sy618/hosts/master/dnsmasq/dnsfq -O /etc/storage/dnsmasq/conf.d/dnsfq.conf;restart_dhcpd

#去广告hosts:
02 00 * * * wget --no-check-certificate https://raw.githubusercontent.com/vokins/yhosts/master/hosts -O /etc/storage/dnsmasq/hosts;restart_dhcpd

重点是一键脚本也完全适用荒野无灯!!原因是一键脚本是在配置文件里指定了新的规则文件目录,都是/etc/storage/dnsmasq/dns

来源

去广告项目:
https://github.com/vokins/yhosts

FQ项目:
https://github.com/sy618/hosts

Linux命令备忘

追加写入
echo "123" >> test.txt

覆盖写入
echo "123" > test.txt

删除含有'abc'的行
sed -i '/abc/d' a.txt

查找 abc开头的文件
find -name abc*

显示第5行到第10行
sed -n '5,10p' filename

显示最后5行
tail -n 1 filename

修改文件权限 4 2 1
chmod 777 filename
修改文件夹及其下文件
chmod -R 777 filename

查找当前目录下包含hello,world!的所有文件
grep -rn "hello,world!" *

18luck 365bet 888zhenren aomenduchang aomenjinshayule baijiale bbin beplay bet007 betvictor betway bifa bst hg0088 bwin fenghuangyule jinbobao lebaijia long8 manbet quanxunwang shenbotaiyangcheng tengbohui ule vwin w88 wellbet WilliamHill yulepingtai laohuji