Linux迷+Python粉 - 技术https://pythonwood.github.io/人生苦短,我用Python(这里只是blog.pythonwood.com的备份)Wed, 05 Dec 2018 15:00:00 +0800Linux释放磁盘空间——系统日志systemd-journal清理https://pythonwood.github.io/2018/12/Linux%E9%87%8A%E6%94%BE%E7%A3%81%E7%9B%98%E7%A9%BA%E9%97%B4%E2%80%94%E2%80%94%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%BF%97systemd-journal%E6%B8%85%E7%90%86/<h2 id="varlogjournal">/var/log/journal 目录占用空间很大<a class="headerlink" href="#varlogjournal" title="Permanent link">&para;</a></h2> <p>原因systemd系统通过systemd-journald.service记录日志.&nbsp;默认以二进制写入/var/log/journal/目录中的日志文件,系统安装久了发现磁盘空间逐渐变小。</p> <p>ubuntu18.04,&nbsp;centos7等新系统都使用新型系统systemd,就可能需要清理。</p> <div class="highlight"><pre><span></span>$ du -sh /var/log …</pre></div>pythonwoodWed, 05 Dec 2018 15:00:00 +0800tag:pythonwood.github.io,2018-12-05:/2018/12/Linux释放磁盘空间——系统日志systemd-journal清理/linuxsystemdjournal磁盘清理网络检测ping脚本——搬瓦工CN2机房PING测试https://pythonwood.github.io/2018/11/%E7%BD%91%E7%BB%9C%E6%A3%80%E6%B5%8Bping%E8%84%9A%E6%9C%AC%E2%80%94%E2%80%94%E6%90%AC%E7%93%A6%E5%B7%A5CN2%E6%9C%BA%E6%88%BFPING%E6%B5%8B%E8%AF%95/<h2 id="vps">项目起源:搬瓦工vps快过期<a class="headerlink" href="#vps" title="Permanent link">&para;</a></h2> <p>为决定是否upgrade到cn2机房,需要先验证<span class="caps">CN2</span>机房网络是不是更好。一直没有一个适合自己的ping工具,自己写一个。</p> <h3 id="openwrt5ping">部署在openwrt路由,定时任务每5分钟启动ping一次<a class="headerlink" href="#openwrt5ping" title="Permanent link">&para;</a></h3> <p>脚本兼容新旧版本ping(输出内容不同),使用sh标准达到最大linux兼容。已兼容openwrt。</p> <div class="highlight"><pre><span></span># ping 50次,不超过90s,丢包率每字符表示2%,延迟每字符表示10ms */5 …</pre></div>pythonwoodSun, 25 Nov 2018 20:00:00 +0800tag:pythonwood.github.io,2018-11-25:/2018/11/网络检测ping脚本——搬瓦工CN2机房PING测试/网络ping脚本搬瓦工神奇的环境bug导致python3中出现udc开头字符串https://pythonwood.github.io/2018/11/%E7%A5%9E%E5%A5%87%E7%9A%84%E7%8E%AF%E5%A2%83bug%E5%AF%BC%E8%87%B4python3%E4%B8%AD%E5%87%BA%E7%8E%B0udc%E5%BC%80%E5%A4%B4%E5%AD%97%E7%AC%A6%E4%B8%B2/<h2 id="langzh_cnutf-8langen_usutf-8">注意:<span class="caps">LANG</span>=zh_CN.<span class="caps">UTF</span>-8与<span class="caps">LANG</span>=en_US.<span class="caps">UTF</span>-8不可混淆!<a class="headerlink" href="#langzh_cnutf-8langen_usutf-8" title="Permanent link">&para;</a></h2> <p><strong><span class="caps">LANG</span>=zh_CN.<span class="caps">UTF</span>-8与<span class="caps">LANG</span>=en_US.<span class="caps">UTF</span>-8有区别</strong> ,&nbsp;所以不可混淆!想之前在python2时代吃过坑,没想到到了统一unicode的python3 …</p>pythonwoodWed, 07 Nov 2018 15:30:00 +0800tag:pythonwood.github.io,2018-11-07:/2018/11/神奇的环境bug导致python3中出现udc开头字符串/UbuntulinuxLANG环境变量pythonXUbuntu18.04(Bionic河狸)正式发布,系统安装升级记录https://pythonwood.github.io/2018/04/XUbuntu18.04%EF%BC%88Bionic%E6%B2%B3%E7%8B%B8%EF%BC%89%E6%AD%A3%E5%BC%8F%E5%8F%91%E5%B8%83%EF%BC%8C%E7%B3%BB%E7%BB%9F%E5%AE%89%E8%A3%85%E5%8D%87%E7%BA%A7%E8%AE%B0%E5%BD%95/<p>Ubuntu&nbsp;18.04发布时间是(美国)4月26号,彼时的中国已经是27号,就是今天。我花了一天时间折腾升级旧Ubuntu系统到刚发布的最新版。</p> <p>多年使用linux经验已经使得这个过程驾轻就熟,闲庭信步:)。为了不忘记,将有沉淀价值的部分,简要记录一下。</p> <h2 id="linuxubuntu">偶然得知Linux,成为Ubuntu多年用户<a class="headerlink" href="#linuxubuntu" title="Permanent link">&para;</a></h2> <h3 id="ubuntults">建议:只使用Ubuntu的<span class="caps">LTS</span>版本(长期维护 …</h3>pythonwoodFri, 27 Apr 2018 19:00:00 +0800tag:pythonwood.github.io,2018-04-27:/2018/04/XUbuntu18.04(Bionic河狸)正式发布,系统安装升级记录/Ubuntu18.04linux系统安装RSA原理:欧几里德算法与奥数内容辗转相除法——挑战PythonTiphttps://pythonwood.github.io/2017/12/RSA%E5%8E%9F%E7%90%86%EF%BC%9A%E6%AC%A7%E5%87%A0%E9%87%8C%E5%BE%B7%E7%AE%97%E6%B3%95%E4%B8%8E%E5%A5%A5%E6%95%B0%E5%86%85%E5%AE%B9%E8%BE%97%E8%BD%AC%E7%9B%B8%E9%99%A4%E6%B3%95%E2%80%94%E2%80%94%E6%8C%91%E6%88%98PythonTip/<p><a href="http://www.pythontip.com" title="PythonTip">PythonTip</a> 里未攻克的题目,如<a href="http://www.pythontip.com/coding/code_oj_case/46" title="RSA密码方程"><span class="caps">RSA</span>密码方程</a>,如今积累工作经验之后从新挑战,仍然失败未成功了。把过程记录分享下。</p> <h3 id="_1">描述:<a class="headerlink" href="#_1" title="Permanent link">&para;</a></h3> <p>在<span class="caps">RSA</span>密码体系中,欧几里得算法是加密或解密运算的重要组成部分。它的基本运算过程就是解 (x*a) % n = 1 这种方程。 其中 …</p>pythonwoodSun, 17 Dec 2017 23:00:00 +0800tag:pythonwood.github.io,2017-12-17:/2017/12/RSA原理:欧几里德算法与奥数内容辗转相除法——挑战PythonTip/python算法pythontip奥数数论欧几里得