首页
关于
Search
1
为我家云,粒子云添加自动风扇及关机功能。
528 阅读
2
粒子云,我家云可用的小钢炮固件
471 阅读
3
编译Chainedbox(我家云)dtb补丁。
440 阅读
4
粒子云,我家云omv固件(带导航)
374 阅读
5
aarch64可用的导航,可单独安装
310 阅读
默认分类
linux相关
Chainedbox
Search
WindTech
累计撰写
7
篇文章
累计收到
5,178
条评论
首页
栏目
默认分类
linux相关
Chainedbox
页面
关于
搜索到
7
篇与
乘风
的结果
2019-12-05
编译Chainedbox(我家云)dtb补丁。
适用于armbian5.3官方内核(ayunfan适配的内核不适用)补丁内容:1、增加我家云内置硬盘供电。2、开启我家云USB3。3、更改主板型号为Chainedbox。4、增加Chainedbox的dtb,Makefile文件。补丁下载
2019年12月05日
440 阅读
173 评论
0 点赞
2019-12-04
为我家云,粒子云添加自动风扇及关机功能。
#复制以下代码使用root权限粘贴到ssh中。 #!/bin/bash cat <<\EOF >/lib/systemd/system-shutdown/lenovo #!/bin/bash if [[ $1 = "halt" || $1 = "poweroff" ]]; then sync hdparm -y /dev/sda hdparm -y /dev/sdb hdparm -y /dev/sdc sleep 5 echo 102 > /sys/class/gpio/export echo high > /sys/class/gpio/gpio102/direction fi EOF cat <<\EOF >/lib/systemd/system/fan.service [Unit] Description=The PWM fan Script After=syslog.target [Service] Type=forking PIDFile=/var/run/fan.pid ExecStart=/bin/bash -c "/sbin/fan "& ExecReload=/bin/kill -s HUP ExecStop=/bin/kill -s QUIT PrivateTmp=true [Install] WantedBy=multi-user.target EOF cat <<\EOF >/sbin/fan #!/bin/bash echo $ > /var/run/fan.pid echo 85 > /sys/class/gpio/export echo "high" > /sys/class/gpio/gpio85/direction echo 85 > /sys/class/gpio/unexport echo 79 > /sys/class/gpio/export echo high > /sys/class/gpio/gpio79/direction echo 0 > /sys/class/pwm/pwmchip0/export echo 10000 > /sys/class/pwm/pwmchip0/pwm0/period echo normal > /sys/class/pwm/pwmchip0/pwm0/polarity echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable while true do temp=$(cat /sys/class/thermal/thermal_zone0/temp) if [ $temp -gt 75000 ]; then echo 10000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle; elif [ $temp -gt 65000 ]; then echo 6000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle; elif [ $temp -gt 55000 ]; then echo 2000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle; else echo 0 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle; fi sleep 10 done EOF chmod +x /sbin/fan systemctl enable fan.service systemctl start fan.service
2019年12月04日
528 阅读
41 评论
1 点赞
2019-12-04
aarch64可用的导航,可单独安装
集成一些实用功能,下载类aria2,transmission,qbitorrent。网盘类:seafile,nextcloud(具体使用看说明)博客:wordpress视频服务未安装,需要单独安装。迅雷只有远程管理页面,未安装,因获取激活码太难了因此放弃了。第一次使用请进入phpMyAdmin修改mysql密码。默认为root,123456天翼云下载链接:https://cloud.189.cn/t/jmUbamBBZ7vm访问码:5463百度网盘下不动的,使用https://www.baiduyun.wiki/zh-cn/ 这个脚本,配合IDM或者aria2下载。天翼云盘,免登录下载方法按F12,控制台运行 javascript:window.open("https:"+downloadUrl);#11月25日修复qb打开报401刷新才正常的BUG,调整了下布局,以容纳更多图标。 #11月21日修复内外网无法修复的bug,更新nexcloud为17.0,新增seafile私人云,相关说明请看后面。 #!/bin/bash ####注意千万不要解压entware_navi.tgz再上传,否则权限会乱的。 #如果有端口号冲突先修改端口号,再进行下面的操作,比如omv的80号端口号改为88。 ##内外网端口或者域名可能不同,修改位置/opt/wwwroot/navi/index.php。 #1、先拷贝entware_navi.tgz 和install_navi.sh到/opt目录。 cd /opt chmod +x install_navi.sh ./install_navi.sh #2、如果系统没有bash,Onmp会报错,比如不钢炮,也不建议在小钢炮使用,很多端口会冲突。解决办法把/opt/bin/onmp和/opt/onmp/onmp.sh中的#!/bin/bash改成#!/bin/sh #3、下面适用于没有开启rc.local #直接复制粘贴到ssh即可。 cat <<\EOF >/etc/rc.local #!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. if [ -f /opt/entware_navi.tgz ];then ##entwarei flag tar -xvzf /opt/entware_navi.tgz -C /opt ##entwarei flag rm /opt/entware_navi.tgz ##entwarei flag sed -i '$a\export PATH=$PATH:/opt/bin:/opt/sbin' /etc/profile ##entwarei flag sed -i "/entwarei/d" /etc/rc.local ##entwarei flag fi ##entwarei flag /opt/entware_init.sh& exit 0 EOF chmod +x /etc/rc.local systemctl start rc-local #filebrowser 默认用户名密码为admin admin(如果提示密码错误请检查你的时间) #aria2 默认未开启密码更改位置/opt/etc/aria.conf #transmission 默认用户名密码admin admin 更改位置/opt/etc/transmission/settings.json #关于seafile #seafile因为涉及到账号安全问题,就没进行配置需要自行配置,集成好主要是解决几个小BUG。 #使用前自行进入phpMyAdmin更改root密码,默认密码为123456 export PATH=/opt/bin:/opt/sbin:$PATH export LC_ALL=en_US.UTF-8 export LANG=en_US.UTF-8 export LANGUAGE=en_US.UTF-8 export PYTHONPATH=$PYTHONPATH:/opt/lib/python2.7/site-packages:/opt/lib/python2.7/site-packages/setuptools: cd /opt/share/seafile/seafile-server/ ./setup-seafile-mysql.sh #按照提示一步步来主要是填写数据库等。 #然后按照提示启动服务 ./seafile.sh start ./seahub.sh start #默认的开机启动服务启动不了,需要加入开机启动。 sed -i '$a\#启动seafile' /opt/entware_init.sh sed -i '$a\sleep 10' /opt/entware_init.sh sed -i '$a\/opt/etc/init.d/S66seafile start' /opt/entware_init.sh sed -i '$a\/opt/etc/init.d/S67seahub start' /opt/entware_init.sh #其它问题,服务器ip必须填写本机IP,否则无法上传下载。解决办法登录后右上脚用户图标系统设置按钮。 #点击设置,SERVICE_URL及FILE_SERVER_ROOT填写你的服务器ip,不能使用localhost或者127.0.0.1 #关于nextcloud,新版本安装时数据目录如果要放到外围硬盘上请先将硬盘挂载到/opt目录, #并设置开机自动挂载,或者自行解决权限不可写问题。或者采用mount --bind的方式,再或者也可以直接ln -s软链接。 #安装完后编辑/opt/wwwroot/Nextcloud/config/config/php #加入下面这句,否则会出现内部服务器错误的问题。 'openssl' => array ( 'config' => '/opt/wwwroot/Nextcloud/3rdparty/phpseclib/phpseclib/phpseclib/openssl.cnf', ), #关于导航 #如果外网采用的是端口映射,而刚好端口号又相同,在首行添加 <?php $URL = $_SERVER['HTTP_HOST'];?> #下面相应的位置 <a href=http://<?php echo $IP?>:9080 #改成 <a href=http://<?php echo $URL;?>:9080 #这样内外网都可以访问。
2019年12月04日
310 阅读
48 评论
0 点赞
2019-12-04
粒子云,我家云可用的小钢炮固件
粒子云请使用4.4.174内核,我家云,随便选。 11月10日增加4.4.174内核版小钢炮,同时默认更改cpu工作模式为ondemand,会自动调整cpu频率。 4.4.174内核小钢炮链接:链接: https://pan.baidu.com/s/1IPRBKTdgRE8BwDwCA2osCA 提取码: 5hn5 更新5.3.0内核,增加fullcone nat和exfat支持。 5.3.0内核小钢炮链接:链接: https://pan.baidu.com/s/1ppMljyqpa2iMUJIYTzKGzQ 提取码: csmu
2019年12月04日
471 阅读
14 评论
0 点赞
2019-12-04
粒子云,我家云omv固件(带导航)
11月25日更新:我家云,所有版本随便用,粒子云建议使用4.4.174内核。5.3以上内核获取不到IP。更新内容(相对于之前的旧版本)1、增加首次开机导航安装引导(需要使用root登录ssh),可选择性安装。2、增加自动风扇脚本。3、增加关机(使用rush的脚本)。4、使用更好看的导航。(导航使用说明看最后面)百度云: https://pan.baidu.com/s/1xrX0PdvGgtRBKYx1JWu7mw 提取码: djfi天翼云: https://cloud.189.cn/t/2iQ7VbvyaYrm(访问码:9373)百度网盘下不动的,使用https://www.baiduyun.wiki/zh-cn/ 这个脚本,配合IDM或者aria2下载。天翼云盘,免登录下载方法按F12,控制台运行 javascript:window.open("https:"+downloadUrl);如果超级终端ttyd无法登录需要在vi /etc/securetty增加pts/2pts/3pts/4等root密码1234omv密码admin openmediavaultaria2 没密码(配置文件路径/opt/etc/aria2.conf)transmission admin admin(配置文件路径/opt/etc/transmission/settings.json)qbbitorrent admin adminadminfilebrowser admin admin(如果提示密码错误同步系统时间)mysql root 123456easyexplorer 未配置nextcloud已安装 需要自己配置seafile 已安装需要自己配置(配置教程见另外的帖子导航说明)dzzoffice 已安装需要自己配置lychee相册需要自己配置。WordPress需要自己配置。所有依赖mysql的建议先改密码。#11月25日修复qb打开报401刷新才正常的BUG,调整了下布局,以容纳更多图标。 #11月21日修复内外网无法修复的bug,更新nexcloud为17.0,新增seafile私人云,相关说明请看后面。 #!/bin/bash ####注意千万不要解压entware_navi.tgz再上传,否则权限会乱的。 #如果有端口号冲突先修改端口号,再进行下面的操作,比如omv的80号端口号改为88。 ##内外网端口或者域名可能不同,修改位置/opt/wwwroot/navi/index.php。 #1、先拷贝entware_navi.tgz 和install_navi.sh到/opt目录。 cd /opt chmod +x install_navi.sh ./install_navi.sh #2、如果系统没有bash,Onmp会报错,比如不钢炮,也不建议在小钢炮使用,很多端口会冲突。解决办法把/opt/bin/onmp和/opt/onmp/onmp.sh中的#!/bin/bash改成#!/bin/sh #3、下面适用于没有开启rc.local #直接复制粘贴到ssh即可。 cat <<\EOF >/etc/rc.local #!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. if [ -f /opt/entware_navi.tgz ];then ##entwarei flag tar -xvzf /opt/entware_navi.tgz -C /opt ##entwarei flag rm /opt/entware_navi.tgz ##entwarei flag sed -i '$a\export PATH=$PATH:/opt/bin:/opt/sbin' /etc/profile ##entwarei flag sed -i "/entwarei/d" /etc/rc.local ##entwarei flag fi ##entwarei flag /opt/entware_init.sh& exit 0 EOF chmod +x /etc/rc.local systemctl start rc-local #filebrowser 默认用户名密码为admin admin(如果提示密码错误请检查你的时间) #aria2 默认未开启密码更改位置/opt/etc/aria.conf #transmission 默认用户名密码admin admin 更改位置/opt/etc/transmission/settings.json #关于seafile #seafile因为涉及到账号安全问题,就没进行配置需要自行配置,集成好主要是解决几个小BUG。 #使用前自行进入phpMyAdmin更改root密码,默认密码为123456 export PATH=/opt/bin:/opt/sbin:$PATH export LC_ALL=en_US.UTF-8 export LANG=en_US.UTF-8 export LANGUAGE=en_US.UTF-8 export PYTHONPATH=$PYTHONPATH:/opt/lib/python2.7/site-packages:/opt/lib/python2.7/site-packages/setuptools: cd /opt/share/seafile/seafile-server/ ./setup-seafile-mysql.sh #按照提示一步步来主要是填写数据库等。 #然后按照提示启动服务 ./seafile.sh start ./seahub.sh start #默认的开机启动服务启动不了,需要加入开机启动。 sed -i '$a\#启动seafile' /opt/entware_init.sh sed -i '$a\sleep 10' /opt/entware_init.sh sed -i '$a\/opt/etc/init.d/S66seafile start' /opt/entware_init.sh sed -i '$a\/opt/etc/init.d/S67seahub start' /opt/entware_init.sh #其它问题,服务器ip必须填写本机IP,否则无法上传下载。解决办法登录后右上脚用户图标系统设置按钮。 #点击设置,SERVICE_URL及FILE_SERVER_ROOT填写你的服务器ip,不能使用localhost或者127.0.0.1 #关于nextcloud,新版本安装时数据目录如果要放到外围硬盘上请先将硬盘挂载到/opt目录, #并设置开机自动挂载,或者自行解决权限不可写问题。或者采用mount --bind的方式,再或者也可以直接ln -s软链接。 #安装完后编辑/opt/wwwroot/Nextcloud/config/config/php #加入下面这句,否则会出现内部服务器错误的问题。 'openssl' => array ( 'config' => '/opt/wwwroot/Nextcloud/3rdparty/phpseclib/phpseclib/phpseclib/openssl.cnf', ), #关于导航 #如果外网采用的是端口映射,而刚好端口号又相同,在首行添加 <?php $URL = $_SERVER['HTTP_HOST'];?> #下面相应的位置 <a href=http://<?php echo $IP?>:9080 #改成 <a href=http://<?php echo $URL;?>:9080 #这样内外网都可以访问。
2019年12月04日
374 阅读
4600 评论
0 点赞
2019-11-29
编译openwrt系统遇到的问题
1、提示rsa-sign.c:279:21: error: dereferencing pointer to incomplete type ‘RSA {aka struct rsa_st}’安装libssl1.0-devsudo apt-get install libssl1.0-dev2、sdl-config command not found安装sdlsudo apt-get install libsdl1.2-dev3、gdate.c:2497:7: error: format not a string literal, format string not checked。百度搜索到的解决办法打补丁tools/pkg-config/patches/001-glib-gdate-suppress-string-format-literal-warning.patch1、提示rsa-sign.c:279:21: error: dereferencing pointer to incomplete type ‘RSA {aka struct rsa_st}’安装libssl1.0-devsudo apt-get install libssl1.0-dev2、sdl-config command not found安装sdlsudo apt-get install libsdl1.2-dev3、gdate.c:2497:7: error: format not a string literal, format string not checked。百度搜索到的解决办法打补丁tools/pkg-config/patches/001-glib-gdate-suppress-string-format-literal-warning.patch1、提示rsa-sign.c:279:21: error: dereferencing pointer to incomplete type ‘RSA {aka struct rsa_st}’安装libssl1.0-devsudo apt-get install libssl1.0-dev2、sdl-config command not found安装sdlsudo apt-get install libsdl1.2-dev3、gdate.c:2497:7: error: format not a string literal, format string not checked。百度搜索到的解决办法打补丁tools/pkg-config/patches/001-glib-gdate-suppress-string-format-literal-warning.patch--- a/glib/glib/gdate.c +++ b/glib/glib/gdate.c @@ -2439,6 +2439,9 @@ win32_strftime_helper (const GDate *d, * * Returns: number of characters written to the buffer, or 0 the buffer was too small */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-nonliteral" + gsize g_date_strftime (gchar *s, gsize slen, @@ -2549,3 +2552,5 @@ g_date_strftime (gchar *s, return retval; #endif } + +#pragma GCC diagnostic pop 作者:帅得不敢出门来源:CSDN原文:https://blog.csdn.net/zmlovelx/article/details/81664043版权声明:本文为博主原创文章,转载请附上博文链接!
2019年11月29日
105 阅读
103 评论
0 点赞
2019-06-05
nginx,强制https(转载)
Nginx安装注意事项安装的时候需要注意加上 --with-http_ssl_module,因为http_ssl_module不属于Nginx的基本模块。1.配置./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module2.编译安装make && make install配置SSL证书如下两个证书文件ssl.crtssl.key配置存放路径为/usr/local/nginx/cert/server { listen 443; server_name dev.wangsl.com; root /var/www/XXX/public; ssl on; ssl_certificate /usr/local/nginx/cert/ssl.crt; ssl_certificate_key /usr/local/nginx/cert/ssl.key; ssl_session_timeout 5m; ssl_protocols SSLv2 SSLv3 TLSv1; ssl_ciphers HIGH:!aNULL:!MD5; //或者是ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP; ssl_prefer_server_ciphers on; access_log /var/www/vhosts/www.wangsl.com/logs/clickstream_ssl.log main; error_log /var/www/vhosts/www.wangsl.com/logs/clickstream_error_ssl.log; if ($remote_addr !~ ^(124.165.97.144|133.110.186.128|133.110.186.88)) { //对访问的来源ip做白名单限制 rewrite ^.*$ /maintence.php last; } location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_read_timeout 300; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; #include fastcgi_params; include fastcgi.conf; }}Http访问强制跳转到Https的几种方式:一、采用nginx的rewrite方法1) 下面是将所有的http请求通过rewrite重写到https上。例如将所有的dev.wangsl.com域名的http访问强制跳转到https。 下面配置均可以实现: 配置1:server {listen 80; server_name dev.wangsl.com; index index.html index.php index.htm; access_log /usr/local/nginx/logs/8080-access.log main; error_log /usr/local/nginx/logs/8080-error.log; rewrite ^(.*)$ https://$host$1 permanent; //这是ngixn早前的写法,现在还可以使用。 location ~ / { root /var/www/html/8080; index index.html index.php index.htm; } } ================================================================上面的跳转配置rewrite ^(.*)$ https://$host$1 permanent;也可以改为下面rewrite ^/(.*)$ http://dev.wangsl.com/$1 permanent;或者rewrite ^ http://dev.wangsl.com$request_uri? permanent;配置2:server {listen 80; server_name dev.wangsl.com; index index.html index.php index.htm; access_log /usr/local/nginx/logs/8080-access.log main; error_log /usr/local/nginx/logs/8080-error.log; return 301 https://$server_name$request_uri; //这是nginx最新支持的写法 location ~ / { root /var/www/html/8080; index index.html index.php index.htm; } } 配置3:这种方式适用于多域名的时候,即访问wangsl.com的http也会强制跳转到https://dev.wangsl.com上面server {listen 80; server_name dev.wangsl.com wangsl.com *.wangsl.com; index index.html index.php index.htm; access_log /usr/local/nginx/logs/8080-access.log main; error_log /usr/local/nginx/logs/8080-error.log; if ($host ~* "^wangsl.com$") { rewrite ^/(.*)$ https://dev.wangsl.com/ permanent; } location ~ / { root /var/www/html/8080; index index.html index.php index.htm; } } 配置4:下面是最简单的一种配置server {listen 80; server_name dev.wangsl.com; index index.html index.php index.htm; access_log /usr/local/nginx/logs/8080-access.log main; error_log /usr/local/nginx/logs/8080-error.log; if ($host = "dev.wangsl.com") { rewrite ^/(.*)$ http://dev.wangsl.com permanent; } location ~ / { root /var/www/html/8080; index index.html index.php index.htm; } }二、采用nginx的497状态码497 - normal request was sent to HTTPS 解释:当网站只允许https访问时,当用http访问时nginx会报出497错误码思路:利用error_page命令将497状态码的链接重定向到https://dev.wangsl.com这个域名上配置实例:如下访问dev.wangsl.com或者wangsl.com的http都会被强制跳转到httpsserver {listen 80; server_name dev.wangsl.com wangsl.com *.wangsl.com; index index.html index.php index.htm; access_log /usr/local/nginx/logs/8080-access.log main; error_log /usr/local/nginx/logs/8080-error.log; error_page 497 https://$host$uri?$args; location ~ / { root /var/www/html/8080; index index.html index.php index.htm; } } 也可以将80和443的配置放在一起:server {listen 127.0.0.1:443; #ssl端口 listen 127.0.0.1:80; #用户习惯用http访问,加上80,后面通过497状态码让它自动跳到443端口 server_name dev.wangsl.com; #为一个server{......}开启ssl支持 ssl on; #指定PEM格式的证书文件 ssl_certificate /etc/nginx/wangsl.pem; #指定PEM格式的私钥文件 ssl_certificate_key /etc/nginx/wangsl.key; #让http请求重定向到https请求 error_page 497 https://$host$uri?$args; location ~ / { root /var/www/html/8080; index index.html index.php index.htm; } }三、利用meta的刷新作用将http跳转到https上述的方法均会耗费服务器的资源,可以借鉴百度使用的方法:巧妙的利用meta的刷新作用,将http跳转到https可以基于http://dev.wangsl.com的虚拟主机路径下写一个index.html,内容就是http向https的跳转将下面的内容追加到index.html首页文件内[root@localhost ~]# cat /var/www/html/8080/index.html [root@localhost ~]# cat /usr/local/nginx/conf/vhosts/test.confserver {listen 80; server_name dev.wangsl.com wangsl.com *.wangsl.com; index index.html index.php index.htm; access_log /usr/local/nginx/logs/8080-access.log main; error_log /usr/local/nginx/logs/8080-error.log; #将404的页面重定向到https的首页 error_page 404 https://dev.wangsl.com/; location ~ / { root /var/www/html/8080; index index.html index.php index.htm; } }四、通过proxy_redirec方式解决办法:re-write redirects to http as to https, example: /homeproxy_redirect http:// https://;作者:赵客缦胡缨v吴钩霜雪明链接:https://www.jianshu.com/p/116fc2d08165来源:简书著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
2019年06月05日
22 阅读
4 评论
0 点赞