<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[阿Tim日志]]></title> 
<link>https://atim.cn/index.php</link> 
<description><![CDATA[专业的php开发者.开发团队的带队人]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[阿Tim日志]]></copyright>
<item>
<link>https://atim.cn/post/1161/</link>
<title><![CDATA[配置debian基础系统]]></title> 
<author>bkkkd &lt;partybase@gmail.com&gt;</author>
<category><![CDATA[开发应用]]></category>
<pubDate>Tue, 12 Nov 2024 08:24:35 +0000</pubDate> 
<guid>https://atim.cn/post/1161/</guid> 
<description>
<![CDATA[ 
	<div class="code">cp /etc/apt/sources.list /etc/apt/sources.list-bak<br/><br/>echo &quot;deb http://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib<br/>deb-src http://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib<br/>deb http://mirrors.aliyun.com/debian-security bookworm-security main<br/>deb-src http://mirrors.aliyun.com/debian-security bookworm-security main<br/>deb http://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib<br/>deb-src http://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib<br/>deb http://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contrib<br/>deb-src http://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contrib&quot;&gt;/etc/apt/sources.list<br/><br/><br/>apt install -y apt-transport-https ca-certificates curl software-properties-common gnupg2 mariadb-client vim wireguard<br/>curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg &#124; apt-key add -<br/>echo&quot;deb &#91;arch=amd64&#93; https://mirrors.aliyun.com/docker-ce/linux/debian $(lsb_release -cs) stable&quot; &gt;/etc/apt/sources.list.d/docker.list<br/>apt update<br/>apt -y install docker-ce<br/></div>
]]>
</description>
</item><item>
<link>https://atim.cn/post/1155/</link>
<title><![CDATA[回滚代码]]></title> 
<author>bkkkd &lt;partybase@gmail.com&gt;</author>
<category><![CDATA[开发应用]]></category>
<pubDate>Fri, 28 Apr 2023 05:54:36 +0000</pubDate> 
<guid>https://atim.cn/post/1155/</guid> 
<description>
<![CDATA[ 
	更新一个版本到更新后,发现有bug.需要进行回滚代码(只限代码出现bug,未出现数据结构或数据更新)<br/><br/>1.在本地的开发副本中,查看需要回溯的分支<br/><div class="code"><br/>git log<br/><br/>commit dc2f72f51522665980e474013dfc577a7a6fb054 (HEAD -&gt; 6.0, origin/HEAD, origin/6.0)<br/>Merge: f96be7b dcd39c8<br/>Author: thinkphp &lt;thinkphp@qq.com&gt;<br/>Date:&nbsp;&nbsp; Tue May 31 12:54:26 2022 +0800<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;Merge branch &#039;6.0&#039; of github.com:top-think/think into 6.0<br/><br/>commit f96be7b7ede70f5c52aa32d5616eb08a0b252b95<br/>Author: thinkphp &lt;thinkphp@qq.com&gt;<br/>Date:&nbsp;&nbsp; Tue May 31 12:53:51 2022 +0800<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;去除腾讯统计<br/></div><br/><br/><br/><br/>2. 复制提交码(commit后的代码),并强制切换到该 版本<br/><div class="code"><br/>git reset --hard f96be7b7ede70f5c52aa32d5616eb08a0b252b95<br/></div><br/>3. 强制更新到远程的分支<br/><div class="code"><br/>git push -f -u origin master<br/></div><br/>4. 然后到服务端的的副本,新代码切换回到最新<br/><div class="code"><br/>git pull<br/>git reset origin/master<br/>git checkout -- .<br/>git clean -fd<br/></div><br/>服务端的副本即可还原到原来的版本.后面需要再合并到代码到master也不会受到影响<br/>
]]>
</description>
</item><item>
<link>https://atim.cn/post/1154/</link>
<title><![CDATA[创建swap文件的命令]]></title> 
<author>bkkkd &lt;partybase@gmail.com&gt;</author>
<category><![CDATA[开发应用]]></category>
<pubDate>Mon, 20 Mar 2023 03:46:31 +0000</pubDate> 
<guid>https://atim.cn/post/1154/</guid> 
<description>
<![CDATA[ 
	<div class="code"><br/>fallocate -l 1G /swapfile<br/>mkswap /swapfile<br/>chmod 600 /swapfile<br/>swapon /swapfile<br/>echo &quot;/swapfile swap swap defaults&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;0&quot; &gt;&gt; /etc/fstab<br/></div>
]]>
</description>
</item><item>
<link>https://atim.cn/post/1153/</link>
<title><![CDATA[edge真坑]]></title> 
<author>bkkkd &lt;partybase@gmail.com&gt;</author>
<category><![CDATA[开发应用]]></category>
<pubDate>Wed, 15 Mar 2023 00:46:09 +0000</pubDate> 
<guid>https://atim.cn/post/1153/</guid> 
<description>
<![CDATA[ 
	昨天出差,发现电脑的续航竟然变成1个小时.原来起码是能玩6,7个小时的.<br/>然后打开任务管理器一看,竟然启用了一堆edge程序,<br/>但我还没有启用过呢.<br/>在任务管理器强制关闭后续航时间就马上可以恢复到6个小时.<br/>最后细看了配置,原来还有一个这样的配置.<br/><a href="https://atim.cn/attachment.php?fid=83" target="_blank"><img src="https://atim.cn/attachment.php?fid=83" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a>
]]>
</description>
</item><item>
<link>https://atim.cn/post/1146/</link>
<title><![CDATA[segmentation fault(core dump)]]></title> 
<author>bkkkd &lt;partybase@gmail.com&gt;</author>
<category><![CDATA[开发应用]]></category>
<pubDate>Fri, 29 Oct 2021 01:00:18 +0000</pubDate> 
<guid>https://atim.cn/post/1146/</guid> 
<description>
<![CDATA[ 
	周一的时候发现测试环境有一个命令执行后报<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">segmentation fault(core dump)</div></div><br/><br/>网上基本减于这个错误,基本上是c语言的编译问题,但我大php怎么会有这样的错误?<br/>所以怀疑是系统内核错误.把容器重新打包一次.结果没有改善.<br/><br/>最后发现原为是同事在CommonLogic::__call(),再调用了一次,call_user_func_array([$this, $method_name], $agrs);<br/><br/><div class="code"><br/>class CommonLogic&#123;<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;function __call($method_name,$agrs)&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(anycheck())&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //and function<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#125;else&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 如果不符合的,就再调用一次,这个就变成了一个死循环.<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 因为__call就是类里没有对应的方法才会去调用,但这里又再调用一个不存在的方法<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return call_user_func_array(&#91;$this, $method_name&#93;, $agrs)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#125;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/>&#125;<br/></div><br/><br/>这个错误算是概念不清引起的错误.
]]>
</description>
</item><item>
<link>https://atim.cn/post/1145/</link>
<title><![CDATA[git常用命令]]></title> 
<author>bkkkd &lt;partybase@gmail.com&gt;</author>
<category><![CDATA[开发应用]]></category>
<pubDate>Fri, 10 Sep 2021 03:22:00 +0000</pubDate> 
<guid>https://atim.cn/post/1145/</guid> 
<description>
<![CDATA[ 
	场景一<br/>我把develop分合并到master,但还没有推到服务端,这时候我想这个合并不要了.<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content"><br/>git reset origin/master<br/>git checkout -- .<br/>git clean -fd<br/></div></div>
]]>
</description>
</item><item>
<link>https://atim.cn/post/1143/</link>
<title><![CDATA[若依后台系统整合oauth]]></title> 
<author>bkkkd &lt;partybase@gmail.com&gt;</author>
<category><![CDATA[开发应用]]></category>
<pubDate>Mon, 21 Jun 2021 03:15:18 +0000</pubDate> 
<guid>https://atim.cn/post/1143/</guid> 
<description>
<![CDATA[ 
	最近公司准备开始一个新项目,而这次客户要求是使用java.<br/>为了节省时间的我,选择了若依后台系统.但发现没有整合oauth<br/>(虽然其它版本有整合,但使用分离开发成本有点高.对于我们这种没有前后端分离的小团队不划算.)<br/><br/>在 ruoyi-framework/pom.xml添加以下的依赖<br/><div class="code"><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;dependency&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;artifactId&gt;spring-boot-starter-security&lt;/artifactId&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/dependency&gt;<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;dependency&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;groupId&gt;org.springframework.security.oauth&lt;/groupId&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;artifactId&gt;spring-security-oauth2&lt;/artifactId&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;version&gt;2.3.8.RELEASE&lt;/version&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/dependency&gt;<br/></div><br/><br/>ruoyi-framework/src/main/java/com/ruoyi.framework/config/AuthorizationServerConfiguration.java<br/>这个文件主要的作用是启用认证服务,其中的关键代码以下内容.其它的都是配置Bean<br/>[quote]<br/>// 启动认证服务<br/>@EnableAuthorizationServer<br/>//用来配置令牌端点(Token Endpoint)的安全约束。<br/>public void configure(AuthorizationServerSecurityConfigurer security);<br/>//配置OAuth2的客户端相关信息<br/>public void configure(AuthorizationServerEndpointsConfigurer endpoints);<br/>//配置授权服务器端点的属性<br/>public void configure(ClientDetailsServiceConfigurer clients)<br/>[/code]<br/>ruoyi-framework/src/main/java/com/ruoyi.framework/config/ResourceServerConfiguration.java<br/>这里主要配置资源route的拦截.<br/><div class="code"><br/>// 启动资源服务<br/>@EnableResourceServer<br/>&nbsp;&nbsp;&nbsp;&nbsp;public void configure(HttpSecurity http) throws Exception &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;http.requestMatchers().antMatchers(&quot;/api/**&quot;) //仅拦截资源服务相关请求<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.and().authorizeRequests().anyRequest().authenticated();<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/></div><br/><br/>另外要修改ShiroConfig.java.因为若依的后台是使用shiro进行验证.与spring-security-oauth不是同一个拦截器.所以先要在ShiroConfig.java中忽略/oauth/**和/api/**.<br/>ruoyi-framework/src/main/java/com/ruoyi.framework/config/ShiroConfig.java<br/><div class="code"><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;filterChainDefinitionMap.put(&quot;/oauth/**&quot;, &quot;anon&quot;);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;filterChainDefinitionMap.put(&quot;/api2/**&quot;, &quot;anon&quot;);<br/></div><br/><br/>具体的接口类<br/><div class="code"><br/><br/>@RestController // 直接返回数据<br/>@RequestMapping(&quot;/api/group&quot;) // 路由地址<br/>public class Group &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;@RequestMapping(&quot;hello&quot;) // 方法的处理项<br/>&nbsp;&nbsp;&nbsp;&nbsp;public AjaxResult hello() &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return AjaxResult.success(&quot;success&quot;); // 返回成功<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/>&#125;<br/></div><br/><br/>后记:<br/>org.springframework.security.oauth 将会被放弃.而会统一使用spring 
]]>
</description>
</item><item>
<link>https://atim.cn/post/1135/</link>
<title><![CDATA[使用apache反向代码后端服务]]></title> 
<author>bkkkd &lt;partybase@gmail.com&gt;</author>
<category><![CDATA[开发应用]]></category>
<pubDate>Fri, 27 Nov 2020 07:31:44 +0000</pubDate> 
<guid>https://atim.cn/post/1135/</guid> 
<description>
<![CDATA[ 
	最近在一台生产服务器上部署一个应用，因为原来的web服务器是使用apache，为了不影响原来的应用，所以新的服务也使用apache来运行。<br/><br/><div class="code"><br/>&lt;VirtualHost *:80&gt;<br/>&nbsp;&nbsp;ServerName myweb.com<br/><br/>&nbsp;&nbsp;AllowEncodedSlashes&nbsp;&nbsp;on # 确定是否允许通过 URL 中的编码路径分隔符<br/>&nbsp;&nbsp;&lt;IfModule proxy_module&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;ProxyPreserveHost On # 使用传入的主机 HTTP 请求 Headers 进行代理请求<br/>&nbsp;&nbsp;&nbsp;&nbsp;ProxyRequests Off # 启用转发(标准)代理请求<br/>&nbsp;&nbsp;&nbsp;&nbsp;ProxyPass&nbsp;&nbsp;&quot;/&quot; &quot;http://localhost:9000/&quot; nocanon # 将远程服务器 Map 到本地服务器 URL 空间<br/>&nbsp;&nbsp;&nbsp;&nbsp;ProxyPassReverse &quot;/&quot; &quot;http://localhost:9000/&quot; nocanon # 调整从反向代理服务器发送的 HTTP 响应 Headers 中的 URL<br/>&nbsp;&nbsp;&lt;/IfModule&gt;<br/><br/>&nbsp;&nbsp;# 转发websocket<br/>&nbsp;&nbsp;RewriteEngine on<br/>&nbsp;&nbsp;RewriteCond %&#123;HTTP:UPGRADE&#125; ^WebSocket$ &#91;NC&#93;<br/>&nbsp;&nbsp;RewriteCond %&#123;HTTP:CONNECTION&#125; ^Upgrade$ &#91;NC&#93;<br/>&nbsp;&nbsp;RewriteRule .* ws://localhost:15674%&#123;REQUEST_URI&#125; &#91;P&#93;<br/>&lt;/VirtualHost&gt;<br/></div><br/><br/>nocanon 是指原样转发<br/><br/>https://httpd.apache.org/docs/2.4/mod/core.html#allowencodedslashes<br/><br/>
]]>
</description>
</item><item>
<link>https://atim.cn/post/1132/</link>
<title><![CDATA[c,golang,java,php,nodejs,python,pypy运算速度粗焅比较]]></title> 
<author>bkkkd &lt;partybase@gmail.com&gt;</author>
<category><![CDATA[开发应用]]></category>
<pubDate>Wed, 22 Apr 2020 15:40:13 +0000</pubDate> 
<guid>https://atim.cn/post/1132/</guid> 
<description>
<![CDATA[ 
	先把结果抛出来,<br/><div class="code"><br/>run java:<br/>end i:1000000000 count:499999999500000000 time:0.638<br/>run C:<br/>end i:1000000000 count 499999999500000000 time:0.641424<br/>run go:<br/>end i:1000000000 count:499999999500000000 time:1.277728 <br/>run pypy:<br/>end i:1000000000 count:499999999500000000 time:3.81583285332<br/>run php<br/>end i:1000000000 count:499999999500000000 time:26.515455007553<br/>run nodejs:<br/>end i:1000000000 count:499999999500000000 time:148.331<br/>run python:<br/>^Tend i:1000000000 count:499999999500000000 time:193.98550415<br/></div><br/>以上的结果进行了golang和c的性能优化.<br/><br/><br/><br/>这个结果是超出了我的预期的.<br/><br/>1,c和golang都没有启动优化,所以性能只是算是中间位置.作为参考时间<br/>2,java,nodejs和pypy,使用了JIT的都能运算的很快.(和目前这个测试算法有关,但确实明显对重复运算是有帮助)<br/>3,静态语言和动态语言的运营速度没有明显的差异,重点是有没有JIT<br/>4,python实在是太慢了,一直都知道python慢,但没有想到在运算方面会比php慢.<br/>5,nodejs在大数处理未如理想.如果不使用BigInt确实比php,python,pypy都要快.<br/><br/>ps:<br/>1.最终期待php8,因为php8带有jit.<br/>2.php确实错过了更好的发展.在2011年的时候如果接受了HHVM,也许不一个状态了.世事就是这样,在你最火的时候,后面就是开始走下坡.只有不段变更才会处于不败之地.<br/><br/>测试代码:<br/>https://gitee.com/goodtim/LangTest<br/><br/><br/><br/>未对golang和c进行优化的结果,nodejs未采用BigInt处理:<br/><div class="code"><br/>run C:<br/>end i:1000000000 count 499999999500000000 time:5.403450<br/>run go:<br/>end i:1000000000 count:499999999500000000 time:4.085926 <br/>run nodejs:<br/>end i:1000000000 count:499999999067109000 time:2.568<br/>run java:<br/>end i:1000000000 count:499999999500000000 time:1.281<br/>run php<br/>end i:1000000000 count:499999999500000000 time:27.162304878235<br/>run python:<br/>end i:1000000000 count:499999999500000000 time:200.668512821<br/>run pypy:<br/>end i:1000000000 count:499999999500000000 time:3.82159590721<br/></div><br/>
]]>
</description>
</item><item>
<link>https://atim.cn/post/1126/</link>
<title><![CDATA[重装deepin系统]]></title> 
<author>bkkkd &lt;partybase@gmail.com&gt;</author>
<category><![CDATA[开发应用]]></category>
<pubDate>Tue, 28 Jan 2020 00:38:36 +0000</pubDate> 
<guid>https://atim.cn/post/1126/</guid> 
<description>
<![CDATA[ 
	之前的deepin被我玩坏了.有些软件版本混乱特别是deepin-wine根本不能正常使用只能使用sudo来运行.其它方式都运行不了.<br/><br/>1,列表一下我的硬盘挂载<br/>/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;安装系统的<br/>/home/ 用户的文件<br/>/data 安装docker等相关软件<br/><br/>2,在安装系统的时候,我是没有挂载 home 和data 目录的.先保证安装完成后再把相关文件挂载回来.<br/><br/>3,然后建立一个/data/etc目录.这个目录主要体一些需要重装后保留的配置,如:<br/>/etc/hosts<br/>/etc/fstabs<br/>/etc/apt/source.list.d/<br/>/etc/apache2/sites-enabled<br/><br/> 然后再ln回去.<br/>
]]>
</description>
</item><item>
<link>https://atim.cn/post/1124/</link>
<title><![CDATA[centos 的firewalld应用]]></title> 
<author>bkkkd &lt;partybase@gmail.com&gt;</author>
<category><![CDATA[开发应用]]></category>
<pubDate>Thu, 05 Sep 2019 03:02:35 +0000</pubDate> 
<guid>https://atim.cn/post/1124/</guid> 
<description>
<![CDATA[ 
	一 概念:<br/>firewalld是centos7的一大特性，最大的好处有两个：支持动态更新，不用重启服务；第二个就是加入了防火墙的“zone”概念<br/> <br/>firewalld有图形界面和工具界面，由于我在服务器上使用，图形界面请参照官方文档，本文以字符界面做介绍<br/>firewalld的字符界面管理工具是 firewall-cmd <br/>firewalld默认配置文件有两个：/usr/lib/firewalld/ （系统配置，尽量不要修改）和 /etc/firewalld/ （用户配置地址）<br/><br/>zone概念：<br/>硬件防火墙默认一般有三个区，firewalld引入这一概念系统默认存在以下区域（根据文档自己理解，如果有误请指正）：<br/>drop：默认丢弃所有包<br/>block：拒绝所有外部连接，允许内部发起的连接<br/>public：指定外部连接可以进入<br/>external：这个不太明白，功能上和上面相同，允许指定的外部连接<br/>dmz：和硬件防火墙一样，受限制的公共连接可以进入<br/>work：工作区，概念和workgoup一样，也是指定的外部连接允许<br/>home：类似家庭组<br/>internal：信任所有连接<br/><br/>service概念<br/>与系统中的service一样,只是这里只配置开放的端口<br/><br/>二 常见用命令:<br/>查看firewall是否运行,下面两个命令都可以<br/><div class="code">systemctl status firewalld.service<br/>firewall-cmd --state</div><br/>查看default zone和active zone<br/>我们还没有做任何配置，default zone和active zone都应该是public<br/><br/>firewall-cmd --get-default-zone<br/>firewall-cmd --get-active-zones<br/>查看当前开了哪些端口<br/>其实一个服务对应一个端口，每个服务对应/usr/lib/firewalld/services下面一个xml文件。<br/><br/>firewall-cmd --list-services<br/>查看还有哪些服务可以打开<br/>firewall-cmd --get-services<br/>查看所有打开的端口： <br/>firewall-cmd --zone=public --list-ports<br/>更新防火墙规则： <br/>firewall-cmd --reload<br/>添加一个服务到firewalld<br/>firewall-cmd --add-service=http //http换成想要开放的service<br/>这样添加的service当前立刻生效，但系统下次启动就失效，可以测试使用。要永久开发一个service，加上 --permanent<br/><br/>firewall-cmd --permanent --add-service=http<br/><br/><br/>如果要添加的端口并没有服务对应<br/>就要新建一个服务，在/etc/firewalld/services，随便拷贝一个xml文件到一个新名字，比如myservice.xml,把里面的<br/>ps:/usr/lib/firewalld/services 是系统默认的服务,不建议在这里新建.<br/>复制代码<br/><?xml version="1.0" encoding="utf-8"?><br/><br/><service><br/><short>Transmission-client</short><br/><description>Transmission is a lightweight GTK+ BitTorrent client.</description><br/><port protocol="tcp" port="51413"/><br/></service><br/>复制代码<br/>short改为想要名字（这个名字只是为了人来阅读，没有实际影响。重要的是修改 protocol和port。修改完保存。我的经验是这是要重启firewalld服务，systemctl restart firewalld.service，否则可能提示找不到刚才新建的service。然后把新建的service添加到<br/>firewalld<br/><br/>firewall-cmd --permanent --add-service=myservice<br/>重启firewalld 生效<br/>5分钟理解Centos7防火墙firewalld&nbsp;&nbsp;&nbsp;&nbsp;http://www.cnblogs.com/stevenzeng/p/5152324.html&nbsp;&nbsp;<br/><br/>-------------------------------------------------------------------------------------------------------------<br/><br/>1、firewalld的基本使用<br/>启动： systemctl start firewalld<br/>查看状态： systemctl status firewalld <br/>停止： systemctl disable firewalld<br/>禁用： systemctl stop firewalld<br/> <br/>2.systemctl是CentOS7的服务管理工具中主要的工具，它融合之前service和chkconfig的功能于一体。<br/>启动一个服务：systemctl start firewalld.service<br/>关闭一个服务：systemctl stop firewalld.service<br/>重启一个服务：systemctl restart firewalld.service<br/>显示一个服务的状态：systemctl status firewalld.service<br/>在开机时启用一个服务：systemctl enable firewalld.service<br/>在开机时禁用一个服务：systemctl disable firewalld.service<br/>查看服务是否开机启动：systemctl is-enabled firewalld.service<br/>查看已启动的服务列表：systemctl list-unit-files&#124;grep enabled<br/>查看启动失败的服务列表：systemctl --failed<br/><br/>3.配置firewalld-cmd<br/><br/>查看版本： firewall-cmd --version<br/>查看帮助： firewall-cmd --help<br/>显示状态： firewall-cmd --state<br/>查看所有打开的端口： firewall-cmd --zone=public --list-ports<br/>更新防火墙规则： firewall-cmd --reload<br/>查看区域信息:&nbsp;&nbsp;firewall-cmd --get-active-zones<br/>查看指定接口所属区域： firewall-cmd --get-zone-of-interface=eth0<br/>拒绝所有包：firewall-cmd --panic-on<br/>取消拒绝状态： firewall-cmd --panic-off<br/>查看是否拒绝： firewall-cmd --query-panic<br/> <br/>那怎么开启一个端口呢<br/>添加<br/>firewall-cmd --zone=public --add-port=80/tcp --permanent&nbsp;&nbsp;&nbsp;&nbsp;（--permanent永久生效，没有此参数重启后失效）<br/>重新载入<br/>firewall-cmd --reload<br/>查看<br/>firewall-cmd --zone= public --query-port=80/tcp<br/>删除<br/>firewall-cmd --zone= public --remove-port=80/tcp --permanent<br/><br/><br/>参考:<br/><a href="https://linux.cn/article-8098-1.html" target="_blank">https://linux...e-8098-1.html</a><br/><a href="https://www.cnblogs.com/hubing/p/6058932.html" target="_blank">https://www.c.../6058932.html</a>
]]>
</description>
</item><item>
<link>https://atim.cn/post/1122/</link>
<title><![CDATA[使用laravel创建项目]]></title> 
<author>bkkkd &lt;partybase@gmail.com&gt;</author>
<category><![CDATA[开发应用]]></category>
<pubDate>Mon, 05 Aug 2019 03:18:10 +0000</pubDate> 
<guid>https://atim.cn/post/1122/</guid> 
<description>
<![CDATA[ 
	最近做了几个项目,使用了laravel去实现.确实很快.如果业务逻辑简单,只需要一个下午可以写七八个模块.当然业务复杂的,就不能用这个作为评价.<br/><br/>laravel+laravel-admin可以简化大部分的开发工作.但存在适应度问题,如果提供组件不能满足你的需求,你可能需要自己去开发组件.<br/><br/>好吧.这里我也只是想记录一下,laravel的经验而已.<br/><br/><br/>一 创建laravel项目<br/><div class="code">composer create-project --prefer-dist laravel/laravel blog &quot;5.*&quot;<br/>cd blog/<br/></div><br/><br/>二配置<br/>修改项目配置, 主要修改数据库<br/>vim .env<br/><div class="code"><br/>DB_CONNECTION=mysql<br/>DB_HOST=127.0.0.1<br/>DB_PORT=3306<br/>DB_DATABASE=blog<br/>DB_USERNAME=tim<br/>DB_PASSWORD=111111<br/></div><br/><br/>解决laravel 字段长度问题,以及将sql打印出来.<br/>vim app/Providers/AppServiceProvider.php<br/><div class="code"><br/>use Illuminate&#92;Support&#92;Facades&#92;Schema;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/>use Illuminate&#92;Support&#92;Facades&#92;DB;<br/>use Illuminate&#92;Support&#92;Facades&#92;Log;<br/><br/>&nbsp;&nbsp; public function boot()<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Schema::defaultStringLength(191);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DB::listen(function ($sql) &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foreach ($sql-&gt;bindings as $i =&gt; $binding) &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ($binding instanceof &#92;DateTime) &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$sql-&gt;bindings&#91;$i&#93; = $binding-&gt;format(&#039;&#92;&#039;Y-m-d H:i:s&#92;&#039;&#039;);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#125; else &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (is_string($binding)) &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$sql-&gt;bindings&#91;$i&#93; = &quot;&#039;$binding&#039;&quot;;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/> <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Insert bindings into query<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$query = str_replace(array(&#039;%&#039;, &#039;?&#039;), array(&#039;%%&#039;, &#039;%s&#039;), $sql-&gt;sql);<br/> <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$query = vsprintf($query, $sql-&gt;bindings);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log::debug($query);<br/> <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#125;);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/></div><br/><br/>三 常用命令<br/>执行数据库语句<br/><div class="code">php artisan migrate</div><br/><br/> 添加 laravel-admin<br/><div class="code">composer require encore/laravel-admin</div><br/><br/>发布laravel-admin用到的资源到项目代码中<br/><div class="code">php artisan vendor:publish --provider=&quot;Encore&#92;Admin&#92;AdminServiceProvider&quot;</div><br/><br/># 安装laravel-admin到程序中<br/><div class="code">php artisan admin:install</div><br/><br/>创建一个模块以及数据库版本<br/><div class="code"><br/># php artisan make:migration create_表名_table --create = 表名<br/># -m 创建migrate版本<br/>php artisan make:model -m Models&#92;&#92;Blog<br/></div><br/><br/>修改表结构<br/><div class="code"><br/># php artisan make:migration add_字段名_column_to_表名 --table = 表名<br/>php artisan make:migration add_intro_column_to_blogs --table=blogs<br/></div><br/><br/>创建一个后台使用的controller<br/><div class="code"><br/># php artisan admin:make 控制器名Controller --model=模型名<br/>php artisan admin:make Data&#92;&#92;BlogController --model=App&#92;&#92;Models&#92;&#92;Blog<br/></div><br/><br/>laravle 创建数据表时所用到的字段方法<br/>https://laravel.com/docs/5.8/migrations#columns<br/><br/>laravel-admin在显示表单时所用到的表单形式<br/>https://laravel-admin.org/docs/zh/model-form-fields
]]>
</description>
</item><item>
<link>https://atim.cn/post/1121/</link>
<title><![CDATA[建立自己的邮件系统centos+docker+poste.io]]></title> 
<author>bkkkd &lt;partybase@gmail.com&gt;</author>
<category><![CDATA[开发应用]]></category>
<pubDate>Tue, 12 Mar 2019 07:56:17 +0000</pubDate> 
<guid>https://atim.cn/post/1121/</guid> 
<description>
<![CDATA[ 
	因为业务的需要,之前一直是使用第三方的邮件系统.因为是共享ip.所以总会出现block的情况.<br/><br/>针对通知类业务的邮件,独立ip是最好的.<br/><br/>所以在发送量不是很多的时候,最好考虑自建邮箱系统. <br/><br/>注意,这里有个问题,就是安全性.毕竟自己维护邮箱,还是挺多安全问题的.<br/><br/>好了不废话.干货来了.<br/><br/><strong>先验证你的ip是否进入了blocklist</strong><br/>https://mxtoolbox.com/blacklists.aspx<br/><br/>一 搭建邮件系统<br/>&nbsp;&nbsp;&nbsp;&nbsp;1.安装docker<br/>&nbsp;&nbsp;&nbsp;&nbsp;2.创建邮件系统实例<br/>&nbsp;&nbsp;&nbsp;&nbsp;3.其它配置<br/>二 配置解析<br/><br/>一 搭建邮件系统<br/>采用docker里的poste.io进行搭建,我是基于Centos系统进行搭建.<br/>1,安装docker<br/><div class="code"><br/> # 删除老旧的docker版本<br/>yum remove docker docker-common docker-selinux docker-engine<br/><br/># 安装yum相关的配置软件<br/>yum install -y yum-utils&nbsp;&nbsp; device-mapper-persistent-data&nbsp;&nbsp; lvm2<br/><br/># 添加docker相关的源<br/>#yum-config-manager&nbsp;&nbsp;&nbsp;&nbsp; --add-repo&nbsp;&nbsp;&nbsp;&nbsp; https://download.docker.com/linux/centos/docker-ce.repo<br/># 使用aliyun的源<br/>yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo<br/><br/># 安装 docker <br/>yum -y install docker-ce<br/><br/>如果出现报错,<br/>&#91;quote&#93;Problem: package docker-ce-3:19.03.5-3.el7.x86_64 requires containerd.io &gt;= 1.2.2-3, but none of the providers can be installed&#91;/quote&#93;<br/><br/>可以尝试手动安装<br/>dnf install https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm<br/><br/># 启动 docker<br/>systemctl start docker<br/><br/># 设置为开始启动<br/>systemctl enable docker<br/></div><br/><br/>2,创建邮件系统实例<br/><div class="code"><br/># 拉取镜像<br/>docker pull analogic/poste.io<br/><br/># 创建数据目录<br/>mkdir -p /data/poste<br/><br/># 运行实例<br/>docker run -p 25:25 -p 80:80 -p 110:110 -p 143:143 &#92;<br/>&nbsp;&nbsp;-p 443:443 -p 587:587 -p 993:993 -p 995:995 &#92;<br/>&nbsp;&nbsp;-v /etc/localtime:/etc/localtime:ro &#92;<br/>&nbsp;&nbsp;-v /data/poste:/data &#92;<br/>&nbsp;&nbsp;-e &quot;HTTPS=OFF&quot; &#92;<br/>&nbsp;&nbsp;-e &quot;DISABLE_CLAMAV=TRUE&quot;&nbsp;&nbsp;&#92;<br/>&nbsp;&nbsp;--name &quot;PosteServ&quot; -h &quot;atim.cn&quot; &#92;<br/>&nbsp;&nbsp;-d -t analogic/poste.io<br/></div><br/><br/>3,其它配置<br/>&nbsp;&nbsp;&nbsp;&nbsp;a.防火墙注意要把使用到的端口启动,<br/>&nbsp;&nbsp;&nbsp;&nbsp;b.dns配置,主要收三个配置<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; i.mx 记录<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ii. 防垃圾邮件配置<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; iii.dkim配置<br/>&nbsp;&nbsp;&nbsp;&nbsp;c.ptr配置<br/>&nbsp;&nbsp;&nbsp;&nbsp;d.申请开通25端口,大部分的云商默认都是没有开通的.<br/><br/><div class="code"><br/>atim.cn.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;600&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MX&nbsp;&nbsp;45.32.163.243<br/>atim.cn.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 600&nbsp;&nbsp;IN&nbsp;&nbsp;TXT&nbsp;&nbsp;&quot;v=spf1 ip4:45.32.163.243 ~all&quot;<br/>_dmarc.atim.cn&nbsp;&nbsp; 600&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IN&nbsp;&nbsp;&nbsp;&nbsp; TXT&nbsp;&nbsp;&quot;v=DMARC1; p=quarantine; fo=1; ruf=mailto:xxx@atim; rua=mailto:xxx@atim.cn&quot;<br/></div><br/><br/>spf记录是用于告诉用户那个通过那个ip发出来的才是我们域名有效的邮箱<br/>DMARC1记录用于,如果错误时怎么处理,应该通知那个邮箱<br/><br/>DKIM ,它的流程是:<br/>1,邮件内容加密信息,即所有发出去的邮件都增加一个核验码(DKIM-Signature),<br/>2,目标邮件服务商收到邮件后,在dns里查到这个公钥,<br/>3,使用公钥与邮件内容生成核验码.与邮件内容自带的核验码对比,<br/>4,得出邮件是否被修改过.<br/><br/>ptr,这个是通过ip反查得到域名.需要供应商沟通以及配置.<br/><br/>一个邮件测试的工具:<br/>http://www.mail-tester.com/<br/>搭建完系统,再发送一个过去,看看你的邮件能得到几分<br/><br/>一个商誉检查的工具:<br/>https://www.senderscore.org<br/><br/>发得量少.估计也不好评价.<br/><br/><br/><br/>
]]>
</description>
</item><item>
<link>https://atim.cn/deepin-vpn/</link>
<title><![CDATA[deepin的vpn连接成功,但无法使用内网]]></title> 
<author>bkkkd &lt;partybase@gmail.com&gt;</author>
<category><![CDATA[开发应用]]></category>
<pubDate>Sat, 02 Feb 2019 01:24:41 +0000</pubDate> 
<guid>https://atim.cn/deepin-vpn/</guid> 
<description>
<![CDATA[ 
	为了多个不同网络的电脑能同正常访问使用能同时使用,所以需要使用了vpn.<br/>但在deepin下vpn链接成功后却不能正常访问vpn内的网络资源.<br/><br/>一直就是登录成功,无法访问站内的资源.查了deepin论坛里的帖子都没有和我的相似.<br/><br/>然后我查看了路由表.<br/>未登录vpn时<br/><div class="code"><br/>$route<br/>Kernel IP routing table<br/>Destination&nbsp;&nbsp;&nbsp;&nbsp; Gateway&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Genmask&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Flags Metric Ref&nbsp;&nbsp;&nbsp;&nbsp;Use Iface<br/>default&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 172.18.66.1&nbsp;&nbsp;&nbsp;&nbsp; 0.0.0.0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UG&nbsp;&nbsp;&nbsp;&nbsp;100&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 enp2s0f1<br/>172.18.66.0&nbsp;&nbsp;&nbsp;&nbsp; 0.0.0.0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 255.255.255.0&nbsp;&nbsp; U&nbsp;&nbsp;&nbsp;&nbsp; 100&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 enp2s0f1<br/></div><br/><br/>登录vpn后,其中xxx.xxx.xxx.xxx是外网ip<br/><div class="code"><br/>$route<br/>Kernel IP routing table<br/>Destination&nbsp;&nbsp;&nbsp;&nbsp; Gateway&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Genmask&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Flags Metric Ref&nbsp;&nbsp;&nbsp;&nbsp;Use Iface<br/>default&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 172.18.66.1&nbsp;&nbsp;&nbsp;&nbsp; 0.0.0.0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UG&nbsp;&nbsp;&nbsp;&nbsp;100&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 enp2s0f1<br/>xxx.xxx.xxx.xxx&nbsp;&nbsp;&nbsp;&nbsp;172.18.66.1&nbsp;&nbsp;&nbsp;&nbsp; 255.255.255.255 UGH&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 enp2s0f1<br/>xxx.xxx.xxx.xxx&nbsp;&nbsp;&nbsp;&nbsp;172.18.66.1&nbsp;&nbsp;&nbsp;&nbsp; 255.255.255.255 UGH&nbsp;&nbsp; 100&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 enp2s0f1<br/>172.18.66.0&nbsp;&nbsp;&nbsp;&nbsp; 0.0.0.0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 255.255.255.0&nbsp;&nbsp; U&nbsp;&nbsp;&nbsp;&nbsp; 100&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 enp2s0f1<br/>172.18.66.1&nbsp;&nbsp;&nbsp;&nbsp; 0.0.0.0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 255.255.255.255 UH&nbsp;&nbsp;&nbsp;&nbsp;100&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 enp2s0f1<br/>192.168.29.1&nbsp;&nbsp;&nbsp;&nbsp;0.0.0.0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 255.255.255.255 UH&nbsp;&nbsp;&nbsp;&nbsp;50&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 ppp0<br/></div><br/>其中xxx.xxx.xxx.xxx是外网ip<br/>172.18.66.x是本地网段<br/>192.168.29.x是vpn网段<br/><br/>看出问题了.<span style="color: #FF0000;">只指定192.168.29.1这个ip使用ppp0</span>,但我实际是要把vpn整网段都使用ppp0访问 <br/><br/><div class="code"><br/>$ sudo route add -net 192.168.29.0/24 dev ppp0<br/></div><br/>添加条件,只要是访问192.168.29.*的ip都使用ppp0访问 
]]>
</description>
</item><item>
<link>https://atim.cn/post/1117/</link>
<title><![CDATA[wine中文乱码]]></title> 
<author>bkkkd &lt;partybase@gmail.com&gt;</author>
<category><![CDATA[开发应用]]></category>
<pubDate>Tue, 18 Sep 2018 05:50:56 +0000</pubDate> 
<guid>https://atim.cn/post/1117/</guid> 
<description>
<![CDATA[ 
	网上搜索一通,全是一样的,让增加字体,修改注册表.全是浮云<br/><br/>结果在一个8年前的博客里找到解决方案.只需要不见了/usr/share/wine/fonts&nbsp;&nbsp;就会从系统中获取有效的字体.<br/><div class="code"><br/>sudo mv /usr/share/wine/fonts&nbsp;&nbsp;/usr/share/wine/fonts.bak<br/></div><br/><br/><br/>来源:https://www.yumao.name/read/winecn/
]]>
</description>
</item><item>
<link>https://atim.cn/post/1116/</link>
<title><![CDATA[fcitx丢失的五笔输入法]]></title> 
<author>bkkkd &lt;partybase@gmail.com&gt;</author>
<category><![CDATA[开发应用]]></category>
<pubDate>Tue, 18 Sep 2018 05:20:04 +0000</pubDate> 
<guid>https://atim.cn/post/1116/</guid> 
<description>
<![CDATA[ 
	今天更新了deepin系统,但更新完后竟然不见了五笔输入法.<br/>找了好久,都没有说fcitx丢失五笔输入法的解决方案.<br/>然后尝试安装ibux,但deepin竟然不支持iBUS<br/><br/>最后,死马当活马医,删除了fcitx的配置(路径是:~/.config/fcitx ),重启就好了.<br/>
]]>
</description>
</item><item>
<link>https://atim.cn/certbot-case/</link>
<title><![CDATA[使用certbot自动生成证书]]></title> 
<author>bkkkd &lt;partybase@gmail.com&gt;</author>
<category><![CDATA[开发应用]]></category>
<pubDate>Sat, 20 Jan 2018 09:44:46 +0000</pubDate> 
<guid>https://atim.cn/certbot-case/</guid> 
<description>
<![CDATA[ 
	现在已经是https时代,趋势是使用https替换http.这样会更安全.<br/>之前使用aliyun或者腾讯云也可以申请证书,然后手动配置,但经常会忘记更新.<br/>所以采用certbot让服务器可以自动进行更新.<br/><div class="code"><br/># 下载certbot的脚本,也有其它安装方法,但我个人试过,这个是最简单的方法.<br/>wget https://dl.eff.org/certbot-auto<br/>chmod a+x ./certbot-auto<br/>mv ./certbot-auto /usr/local/bin/certbot<br/># 注册信息<br/>certbot&nbsp;&nbsp;register --agree-tos -m name@yourdomail.com<br/><br/># 创建证书并验证,但最方便的是使用 standalone方式, 但问题就是原来的web服务需要先关闭.<br/># 其实一共有三个方式<br/># --standalone&nbsp;&nbsp; 使用脚本的服务器进行验证<br/># --webroot 基于现有网站根目录进行验证<br/># --manual&nbsp;&nbsp; 手动验证,(我没有试过这个方式)<br/><br/>certbot certonly --standalone -d atim.cn -d www.atim.cn<br/><br/></div><br/>验证完成后,会显示证书的路径.<br/>在/etc/letsencrypt/live/ 目录下生成对应域名的目录,证书都在目录里面.<br/>然后修改nginx站点配置(apache的配置自己去找)<br/><div class="code"><br/>server &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;listen&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 443;<br/>&nbsp;&nbsp;&nbsp;&nbsp;server_name&nbsp;&nbsp;atim.cn *.atim.cn;<br/>&nbsp;&nbsp;&nbsp;&nbsp;# SSL<br/>&nbsp;&nbsp;&nbsp;&nbsp;ssl on;<br/>&nbsp;&nbsp;&nbsp;&nbsp;ssl_certificate /etc/letsencrypt/live/atim.cn/fullchain.pem;<br/>&nbsp;&nbsp;&nbsp;&nbsp;ssl_certificate_key /etc/letsencrypt/live/atim.cn/privkey.pem;<br/>&nbsp;&nbsp;&nbsp;&nbsp;location ~ .* &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;proxy_pass&nbsp;&nbsp; http://webserver;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;proxy_set_header Host $host;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;proxy_set_header X-Real-IP $remote_addr;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/>&#125;<br/></div><br/>主要是就增加这三句<br/><div class="code"><br/>&nbsp;&nbsp;&nbsp;&nbsp;ssl on;<br/>&nbsp;&nbsp;&nbsp;&nbsp;ssl_certificate /etc/letsencrypt/live/atim.cn/fullchain.pem;<br/>&nbsp;&nbsp;&nbsp;&nbsp;ssl_certificate_key /etc/letsencrypt/live/atim.cn/privkey.pem;<br/></div><br/>重启服务器就好了.<br/>最后就是编写定时任务自动更新证书了(vim的使用方法可网上找)<br/><div class="code">crontab -e</div><br/>增加以下代码<br/><div class="code"><br/>38 3 20 */2 * /usr/local/bin/certbot renew --pre-hook &quot;systemctl stop nginx.service&quot; --post-hook &quot;systemctl start nginx.service&quot;<br/></div><br/>其中 --pre-hook 和-- post-hook分别是前置命令和后置命令,详细可以通过查看.由于使用了certbot内置服务器进行验证,所以需要停止nginx更新完成再启动<br/><div class="code">certbot --help renew</div><br/>
]]>
</description>
</item><item>
<link>https://atim.cn/post/1110/</link>
<title><![CDATA[不好的事件绑定方式]]></title> 
<author>bkkkd &lt;partybase@gmail.com&gt;</author>
<category><![CDATA[开发应用]]></category>
<pubDate>Fri, 15 Sep 2017 01:09:28 +0000</pubDate> 
<guid>https://atim.cn/post/1110/</guid> 
<description>
<![CDATA[ 
	<a href="https://atim.cn/attachment.php?fid=67" target="_blank"><img src="https://atim.cn/attachment.php?fid=67" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/>
]]>
</description>
</item><item>
<link>https://atim.cn/post/1109/</link>
<title><![CDATA[浏览器优先使用极速模式]]></title> 
<author>bkkkd &lt;partybase@gmail.com&gt;</author>
<category><![CDATA[开发应用]]></category>
<pubDate>Sat, 02 Sep 2017 09:12:22 +0000</pubDate> 
<guid>https://atim.cn/post/1109/</guid> 
<description>
<![CDATA[ 
	最近弄公司的官网，在考虑要兼容浏览器事 通过百度流量研究院基本可以看出，使用量超过5%的是chrome,ie8,ie9,QQ和2345，因些需要兼容的浏览器就需要包括这五个浏览器。<br/><a href="https://atim.cn/attachment.php?fid=66" target="_blank"><img src="https://atim.cn/attachment.php?fid=66" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>而其中ie8,ie9需要重点开发兼容。而360,QQ和2345由于他们均有极速模式（即webkit内核）,所以只需提示让他们<span style="color: #FF0000;">优先以极速模式显示</span>我们的站点即可。<br/><br/>ie8和ie9兼容开发，由于问题很多很杂，就不详细说了。<br/>然后360，QQ和2345<br/><div class="code"><br/>&nbsp;&nbsp;&nbsp;&nbsp; &lt;!-- 360 支持--&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp; &lt;meta name=&quot;renderer&quot; content=&quot;webkit&quot;&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp; &lt;!-- QQ 浏览器支持 --&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp; &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp; &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;chrome=1&quot;&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp; &lt;!-- 2345 默认就是优先使用webkit所以有没指定一说 --&gt;<br/></div><br/><br/>相关链接<br/>http://tongji.baidu.com/data/browser<br/>http://se.360.cn/v6/help/meta.html<br/>http://browser.qq.com/wiki/index.html#!index.md<br/>http://haoma.sogou.com/bbs/forum.php?mod=viewthread&tid=2682325
]]>
</description>
</item><item>
<link>https://atim.cn/post/1108/</link>
<title><![CDATA[ubuntu以太网 未托管]]></title> 
<author>bkkkd &lt;partybase@gmail.com&gt;</author>
<category><![CDATA[开发应用]]></category>
<pubDate>Thu, 18 May 2017 01:18:50 +0000</pubDate> 
<guid>https://atim.cn/post/1108/</guid> 
<description>
<![CDATA[ 
	自从由16.04升级到17.04后原来的以太网卡一直显示未托管。但在window下网卡是正常使用的。<br/>所以百分百是配置问题。<br/><br/>然而在中文搜索找到的都是让配置<br/>/etc/NetworkManager/NetworkManager.conf<br/><br/>即是改为也是不能正常运行。<br/><br/>只能搜索英文网站了。<br/>有两个配置方案：<br/>1,配置以太网卡使用networkmanager管理。可能是部分网卡被限制了<br/><div class="code">sudo nmcli dev set enp8s0 managed yes</div><br/>2,创建配置文件<br/><div class="code"><br/># 如果没有这个配置文件，可以忽略备份<br/>sudo mv /etc/NetworkManager/conf.d/10-globally-managed-devices.conf&nbsp;&nbsp;/etc/NetworkManager/conf.d/10-globally-managed-devices.conf_orig<br/># 创建一个新的配置文件<br/>sudo touch /etc/NetworkManager/conf.d/10-globally-managed-devices.conf&nbsp;&nbsp;<br/></div><br/><br/>所有修改后都要重启服务<br/><div class="code">sudo systemctl restart network-manager.service</div><br/><br/>参考网址：<br/><br/>https://askubuntu.com/questions/882806/ethernet-device-not-managed
]]>
</description>
</item>
</channel>
</rss>