<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Tip on Blog - uTIcARdI</title><link>https://blog.gainskills.top/tags/tip/</link><description>Recent content in Tip on Blog - uTIcARdI</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 04 Aug 2025 18:51:32 +1200</lastBuildDate><atom:link href="https://blog.gainskills.top/tags/tip/index.xml" rel="self" type="application/rss+xml"/><item><title>Run Arista VM 4.2.2 and later version on EVE(UNL)</title><link>https://blog.gainskills.top/2019/12/08/evengaristabooting/</link><pubDate>Sun, 08 Dec 2019 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2019/12/08/evengaristabooting/</guid><description>&lt;p&gt;One of my friends did his VXLAN practices, he came to me for help because he was unable to start the Arista instance on EVE-NG.&lt;/p&gt;
&lt;p&gt;The Arista vm can be started and stuck at:&lt;/p&gt;















&lt;div align="center"&gt;
 &lt;figure style="padding: 0.8rem; margin: 2rem 0; border: thin #c0c0c0 solid; border-radius: 10px; width: 2071px; max-width: 88%; "&gt;
 &lt;a href="https://blog.gainskills.top/img/postimgs/2019/12/3-opt_hu_9639c8bfbdbacc11.png" data-fancybox data-caption=Issue &gt;
 &lt;img data-src="https://blog.gainskills.top/img/postimgs/2019/12/3-opt_hu_423781357455df10.png" class="img-responsive img-lazyload" alt=Issue style="height: 350px;"/&gt;
 &lt;/a&gt;
 &lt;figcaption class="text-capitalize"&gt;
 &lt;small&gt;Issue&lt;/small&gt;
 &lt;/figcaption&gt;
 &lt;/figure&gt;
&lt;/div&gt;

&lt;p&gt;I did a search and found a clue in the Arista forum, the instance began to work after changed the CPU number to 2:&lt;/p&gt;</description></item><item><title>An incompatible issue of xls file</title><link>https://blog.gainskills.top/2019/12/02/pyxlwtdebug/</link><pubDate>Mon, 02 Dec 2019 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2019/12/02/pyxlwtdebug/</guid><description>&lt;h4 id="background"&gt;Background&lt;/h4&gt;
&lt;p&gt;An integration project: exporting a csv file from system A, convert the csv file to xls file, and import the converted file into system B (A 3rd party system).&lt;/p&gt;
&lt;p&gt;Environment:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.python.org/downloads/release/python-375/"&gt;Python3.7.5&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;xls library: &lt;a href="https://github.com/python-excel/xlwt/releases"&gt;xlwt1.3&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Developing on Mac 10.15.1 with &lt;a href="https://blog.gainskills.top/2019/11/15/vscode-as-idle-for-django/"&gt;VS Code&lt;/a&gt;, and finally the project will be published to a Docker environment(ritht now, it&amp;rsquo;s &lt;a href="https://hub.docker.com/_/python/"&gt;Python:3.7.5-alpine3.10&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id="issue"&gt;Issue&lt;/h4&gt;
&lt;p&gt;The converted xls file, system B doesn&amp;rsquo;t support it. However, the file can be opened in Microsoft Excel, and then system B supports it after the open operation (did nothing, just open it then close)😫.&lt;/p&gt;</description></item><item><title>Tips for NewZealand</title><link>https://blog.gainskills.top/2019/10/25/tips-for-newzealand/</link><pubDate>Fri, 25 Oct 2019 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2019/10/25/tips-for-newzealand/</guid><description>&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;防晒霜 - 安耐晒，遮阳帽，太阳镜&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;多带两件长袖的衣服&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;带一身质量不错的西服，衬衣（正装，面试及其它正式场合穿）&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;考试费贵 （因为GST）,所以工作需要的认证建议来之前先考&lt;/p&gt;</description></item><item><title>File name on windows</title><link>https://blog.gainskills.top/2019/03/01/file-name-on-winos/</link><pubDate>Fri, 01 Mar 2019 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2019/03/01/file-name-on-winos/</guid><description>&lt;h3 id="error-1"&gt;Error 1&lt;/h3&gt;
&lt;p&gt;Run a bat (ping.bat) to ping multiple IPs like this:
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-bat" data-lang="bat"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;set&lt;/span&gt; testipa=x.x.x.x
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;echo&lt;/span&gt; Checking ping %testipa% (15 times), please don&amp;#39;t close current window
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;echo&lt;/span&gt; ping %testipa% (15 times) &amp;gt;&amp;gt; test.log
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ping %testipa% -w 500 -n 15 &amp;gt;&amp;gt; test.log&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;But got the following error:
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-bat" data-lang="bat"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Checking ping x.x.x.x (15 times), please don&amp;#39;t close current window
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;The process cannot access the file because it is being used by another process.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;The process cannot access the file because it is being used by another process.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/p&gt;</description></item><item><title>Post a file to Flask by Curl via API</title><link>https://blog.gainskills.top/2019/02/20/post-file-by-curl-to-flask-via-api/</link><pubDate>Wed, 20 Feb 2019 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2019/02/20/post-file-by-curl-to-flask-via-api/</guid><description>&lt;p&gt;&lt;a href="https://curl.haxx.se/docs/manpage.html"&gt;Curl&lt;/a&gt; is widely used in command lines or scripts to transfer data.&lt;br&gt;
Different ways to use curl to post a file to a web server with samples (from both client-side and server: &lt;a href="http://flask.pocoo.org/"&gt;Python-Flask&lt;/a&gt; side) will be discussed because it took me a while on the server-side to receiving the data from client.&lt;br&gt;
I would like to add samples of &lt;a href="http://docs.python-requests.org/en/master/"&gt;Python-requests&lt;/a&gt;, &lt;a href="https://www.getpostman.com/"&gt;Postman&lt;/a&gt; later.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;h5 id="started-with"&gt;Started with&lt;/h5&gt;
&lt;ul&gt;
&lt;li&gt;macOS Mojave&lt;/li&gt;
&lt;li&gt;Python 3.7.2&lt;/li&gt;
&lt;li&gt;Flask 1.0.2&lt;/li&gt;
&lt;li&gt;Flask-RESTful 0.3.7&lt;/li&gt;
&lt;li&gt;curl 7.54.0 (x86_64-apple-darwin18.0)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The Flask code:
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-Python" data-lang="Python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Py file name: simple.py&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;from&lt;/span&gt; flask &lt;span style="color:#f92672"&gt;import&lt;/span&gt; Flask, request
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;from&lt;/span&gt; flask_restful &lt;span style="color:#f92672"&gt;import&lt;/span&gt; Api, Resource, reqparse
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;import&lt;/span&gt; werkzeug
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;app &lt;span style="color:#f92672"&gt;=&lt;/span&gt; Flask(__name__)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;api &lt;span style="color:#f92672"&gt;=&lt;/span&gt; Api(app)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;class&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;kzwebfile&lt;/span&gt;(Resource):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;post&lt;/span&gt;(self, filename):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;pass&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;api&lt;span style="color:#f92672"&gt;.&lt;/span&gt;add_resource(kzwebfile, &lt;span style="color:#e6db74"&gt;&amp;#39;/&amp;lt;string:filename&amp;gt;&amp;#39;&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; __name__ &lt;span style="color:#f92672"&gt;==&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;__main__&amp;#34;&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; app&lt;span style="color:#f92672"&gt;.&lt;/span&gt;run()&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/p&gt;</description></item><item><title>IOS command:IP classless</title><link>https://blog.gainskills.top/2019/02/09/ios-ip-classless/</link><pubDate>Sat, 09 Feb 2019 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2019/02/09/ios-ip-classless/</guid><description>&lt;p&gt;I wrote down this article in 2009-03-13 when I was looking for my first job. Taking this again today as preparation for CCNP.&lt;/p&gt;
&lt;h5 id="topology"&gt;Topology:&lt;/h5&gt;















&lt;div align="center"&gt;
 &lt;figure style="padding: 0.8rem; margin: 2rem 0; border: thin #c0c0c0 solid; border-radius: 10px; width: 575px; max-width: 88%; "&gt;
 &lt;a href="https://blog.gainskills.top/img/postimgs/2019/02/02-opt_hu_113efef6f50fddc.png" data-fancybox data-caption=Topology &gt;
 &lt;img data-src="https://blog.gainskills.top/img/postimgs/2019/02/02-opt_hu_d0c6c5b0e1aa51b8.png" class="img-responsive img-lazyload" alt=Topology style="height: 130px;"/&gt;
 &lt;/a&gt;
 &lt;figcaption class="text-capitalize"&gt;
 &lt;small&gt;Topology&lt;/small&gt;
 &lt;/figcaption&gt;
 &lt;/figure&gt;
&lt;/div&gt;

&lt;h5 id="configuration"&gt;Configuration&lt;/h5&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Configured IP addresses on the routers&lt;br&gt;
Note: The subnets of R1&amp;rsquo;s Loopback1 and R2&amp;rsquo;s Loopback1 belong to the class A address.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Execute command &amp;ldquo;ip classless&amp;rdquo; on both R1 and R2 (The command has been the default since IOS 11.3)&lt;/p&gt;</description></item><item><title>Hugo-Customization</title><link>https://blog.gainskills.top/2019/02/06/hugo-customization/</link><pubDate>Wed, 06 Feb 2019 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2019/02/06/hugo-customization/</guid><description>&lt;p&gt;A list about how I customize Hugo and why I did the change, the post will be updated continuously.&lt;/p&gt;
&lt;h3 id="1-fractions"&gt;1. &lt;a href="https://gohugo.io/getting-started/configuration/"&gt;fractions&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Network Engineer should care about this, because it shows wrong &lt;em&gt;IP/mask&lt;/em&gt; format with default value:















&lt;div align="center"&gt;
 &lt;figure style="padding: 0.8rem; margin: 2rem 0; border: thin #c0c0c0 solid; border-radius: 10px; width: 310px; max-width: 88%; "&gt;
 &lt;a href="https://blog.gainskills.top/img/postimgs/2019/02/01-opt_hu_197622209dbd8d69.png" data-fancybox data-caption=fractions&amp;#32;with&amp;#32;default&amp;#32;value &gt;
 &lt;img data-src="https://blog.gainskills.top/img/postimgs/2019/02/01-opt_hu_32e1677037f5416.png" class="img-responsive img-lazyload" alt=fractions&amp;#32;with&amp;#32;default&amp;#32;value style="height: 140px;"/&gt;
 &lt;/a&gt;
 &lt;figcaption class="text-capitalize"&gt;
 &lt;small&gt;fractions with default value&lt;/small&gt;
 &lt;/figcaption&gt;
 &lt;/figure&gt;
&lt;/div&gt;

Disable it in config.toml:
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-toml" data-lang="toml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;[&lt;span style="color:#a6e22e"&gt;blackfriday&lt;/span&gt;]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;fractions&lt;/span&gt; = &lt;span style="color:#66d9ef"&gt;false&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/p&gt;
&lt;h3 id="2-hreftargetblank"&gt;2. hrefTargetBlank&lt;/h3&gt;
&lt;p&gt;This default value of the option is &lt;code&gt;false&lt;/code&gt; which means external links(The wording was corrected to &amp;ldquo;absolute&amp;rdquo; from &amp;rsquo;external&amp;rsquo; on Hugo official doc).
I prefer to change the value to &lt;code&gt;true&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Hugo-Versioning</title><link>https://blog.gainskills.top/2019/01/27/hugo-versioning/</link><pubDate>Sun, 27 Jan 2019 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2019/01/27/hugo-versioning/</guid><description>&lt;p&gt;Hugo provides the detail &lt;a href="https://gohugo.io/hosting-and-deployment/"&gt;instructions&lt;/a&gt; about how to deploy it on different environment.&lt;/p&gt;
&lt;p&gt;At first, I followed &lt;a href="https://gohugo.io/hosting-and-deployment/hosting-on-github/#deployment-of-project-pages-from-docs-folder-on-master-branch"&gt;Deployment of Project Pages from /docs folder on master branch&lt;/a&gt;, and put all files in one repository.&lt;/p&gt;
&lt;p&gt;I continue to check &lt;a href="https://gohugo.io/hosting-and-deployment/hosting-on-github/#deployment-of-project-pages-from-your-gh-pages-branch"&gt;Deployment of Project Pages From Your gh-pages branch&lt;/a&gt; after I did some customization on &lt;a href="https://themes.gohugo.io/hugo-theme-cleanwhite/"&gt;hugo-theme-cleanwhite&lt;/a&gt; and want to publish the change to the &lt;a href="https://github.com/gainskills/hugo-theme-cleanwhite"&gt;forked branch&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Instead of the follow Hugo guide, I did some try myself. I searched &amp;ldquo;change a subfolder to another repository and found the article: &lt;a href="http://gbayer.com/development/moving-files-from-one-git-repository-to-another-preserving-history/"&gt;Moving Files from one Git Repository to Another, Preserving History&lt;/a&gt; but its case is:&lt;/p&gt;</description></item><item><title>Hugo-Images management</title><link>https://blog.gainskills.top/2019/01/25/post-img-mgmt-hugo/</link><pubDate>Fri, 25 Jan 2019 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2019/01/25/post-img-mgmt-hugo/</guid><description>&lt;p&gt;I introduced &lt;a href="2019/01/01/hello-world/"&gt;why&lt;/a&gt; I migrate my blog to github and Hugo here. Most of articles have been moved to here in 30 days. Next, I just want to talk about something about &lt;a href="https://blog.gainskills.top/2019/01/25/post-img-mgmt-hugo/"&gt;posts&amp;rsquo; images management&lt;/a&gt;, &lt;a href="https://blog.gainskills.top/2019/01/27/hugo-versioning/"&gt;versioning&lt;/a&gt;, &lt;a href="https://blog.gainskills.top/2019/02/07/hugo-customization/"&gt;theme customization/something about SEO&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="before-start"&gt;Before start&lt;/h3&gt;
&lt;p&gt;All images will be compressed before I upload them for the post. Many tools that could do this, such as &lt;a href="https://tinypng.com/"&gt;tinypng&lt;/a&gt;, &lt;a href="http://upng.photopea.com/"&gt;UPNG&lt;/a&gt;. My choice is Tinypng because it supports variety formats and its &lt;a href="https://tinypng.com/developers/reference#%7Btpath(%22/developers%22)%7D"&gt;API&lt;/a&gt;.&lt;/p&gt;















&lt;div align="center"&gt;
 &lt;figure style="padding: 0.8rem; margin: 2rem 0; border: thin #c0c0c0 solid; border-radius: 10px; width: 1362px; max-width: 88%; "&gt;
 &lt;a href="https://blog.gainskills.top/img/postimgs/2019/01/01-opt_hu_7d302392f7ee3c76.png" data-fancybox data-caption=img&amp;#32;compression&amp;#32;(20M&amp;#32;to&amp;#32;5.1M) &gt;
 &lt;img data-src="https://blog.gainskills.top/img/postimgs/2019/01/01-opt_hu_e75b43c94fbfd0e8.png" class="img-responsive img-lazyload" alt=img&amp;#32;compression&amp;#32;(20M&amp;#32;to&amp;#32;5.1M) style="height: 400px;"/&gt;
 &lt;/a&gt;
 &lt;figcaption class="text-capitalize"&gt;
 &lt;small&gt;img compression (20M to 5.1M)&lt;/small&gt;
 &lt;/figcaption&gt;
 &lt;/figure&gt;
&lt;/div&gt;

&lt;p&gt;Tinypng&amp;rsquo;s APIs can be called by &lt;a href="http://docs.python-requests.org/en/master/"&gt;Python-Requests&lt;/a&gt; in this way:
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;import&lt;/span&gt; os
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;from&lt;/span&gt; os &lt;span style="color:#f92672"&gt;import&lt;/span&gt; path
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;import&lt;/span&gt; requests
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;from&lt;/span&gt; requests.auth &lt;span style="color:#f92672"&gt;import&lt;/span&gt; HTTPBasicAuth
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;picopt&lt;/span&gt;(root_path, apikey):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;for&lt;/span&gt; f &lt;span style="color:#f92672"&gt;in&lt;/span&gt; os&lt;span style="color:#f92672"&gt;.&lt;/span&gt;listdir(root_path):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; fullurl &lt;span style="color:#f92672"&gt;=&lt;/span&gt; os&lt;span style="color:#f92672"&gt;.&lt;/span&gt;sep&lt;span style="color:#f92672"&gt;.&lt;/span&gt;join([root_path, f])
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; path&lt;span style="color:#f92672"&gt;.&lt;/span&gt;isdir(fullurl):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; picopt(fullurl, apikey)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;else&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; fullurl&lt;span style="color:#f92672"&gt;.&lt;/span&gt;endswith((&lt;span style="color:#e6db74"&gt;&amp;#39;.DS_Store&amp;#39;&lt;/span&gt;, &lt;span style="color:#e6db74"&gt;&amp;#39;-opt.png&amp;#39;&lt;/span&gt;, &lt;span style="color:#e6db74"&gt;&amp;#39;-opt.jpg&amp;#39;&lt;/span&gt;, &lt;span style="color:#e6db74"&gt;&amp;#39;-opt.jpeg&amp;#39;&lt;/span&gt;)):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; print(&lt;span style="color:#e6db74"&gt;&amp;#39;ignore &amp;#39;&lt;/span&gt; &lt;span style="color:#f92672"&gt;+&lt;/span&gt; fullurl)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;continue&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; print(&lt;span style="color:#e6db74"&gt;&amp;#39;processing &amp;#39;&lt;/span&gt; &lt;span style="color:#f92672"&gt;+&lt;/span&gt; fullurl)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;with&lt;/span&gt; open(fullurl, &lt;span style="color:#e6db74"&gt;&amp;#39;rb&amp;#39;&lt;/span&gt;) &lt;span style="color:#66d9ef"&gt;as&lt;/span&gt; imgf:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; content &lt;span style="color:#f92672"&gt;=&lt;/span&gt; imgf&lt;span style="color:#f92672"&gt;.&lt;/span&gt;read()
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; res &lt;span style="color:#f92672"&gt;=&lt;/span&gt; requests&lt;span style="color:#f92672"&gt;.&lt;/span&gt;post(
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; auth&lt;span style="color:#f92672"&gt;=&lt;/span&gt;HTTPBasicAuth(&lt;span style="color:#e6db74"&gt;&amp;#34;api:&lt;/span&gt;&lt;span style="color:#e6db74"&gt;%s&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;&lt;/span&gt; &lt;span style="color:#f92672"&gt;%&lt;/span&gt;(apikey), &lt;span style="color:#e6db74"&gt;&amp;#39;&amp;#39;&lt;/span&gt;), url&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#39;https://api.tinify.com/shrink&amp;#39;&lt;/span&gt;, data&lt;span style="color:#f92672"&gt;=&lt;/span&gt;content)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; print(res&lt;span style="color:#f92672"&gt;.&lt;/span&gt;json())
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; optimgurl &lt;span style="color:#f92672"&gt;=&lt;/span&gt; res&lt;span style="color:#f92672"&gt;.&lt;/span&gt;json()[&lt;span style="color:#e6db74"&gt;&amp;#39;output&amp;#39;&lt;/span&gt;][&lt;span style="color:#e6db74"&gt;&amp;#39;url&amp;#39;&lt;/span&gt;]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# print(optimgurl)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; res &lt;span style="color:#f92672"&gt;=&lt;/span&gt; requests&lt;span style="color:#f92672"&gt;.&lt;/span&gt;get(
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; auth&lt;span style="color:#f92672"&gt;=&lt;/span&gt;HTTPBasicAuth(&lt;span style="color:#e6db74"&gt;&amp;#34;api:&lt;/span&gt;&lt;span style="color:#e6db74"&gt;%s&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;&lt;/span&gt; &lt;span style="color:#f92672"&gt;%&lt;/span&gt;(apikey), &lt;span style="color:#e6db74"&gt;&amp;#39;&amp;#39;&lt;/span&gt;), url&lt;span style="color:#f92672"&gt;=&lt;/span&gt;optimgurl)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; filename, filetypestr &lt;span style="color:#f92672"&gt;=&lt;/span&gt; fullurl&lt;span style="color:#f92672"&gt;.&lt;/span&gt;rsplit(&lt;span style="color:#e6db74"&gt;&amp;#39;.&amp;#39;&lt;/span&gt;, &lt;span style="color:#ae81ff"&gt;1&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; optfullurl &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;-opt.&amp;#39;&lt;/span&gt;&lt;span style="color:#f92672"&gt;.&lt;/span&gt;join([filename, filetypestr])
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;with&lt;/span&gt; open(optfullurl, &lt;span style="color:#e6db74"&gt;&amp;#39;wb&amp;#39;&lt;/span&gt;) &lt;span style="color:#66d9ef"&gt;as&lt;/span&gt; fd:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;for&lt;/span&gt; chunk &lt;span style="color:#f92672"&gt;in&lt;/span&gt; res&lt;span style="color:#f92672"&gt;.&lt;/span&gt;iter_content(chunk_size&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;128&lt;/span&gt;):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; fd&lt;span style="color:#f92672"&gt;.&lt;/span&gt;write(chunk)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; print(&lt;span style="color:#e6db74"&gt;&amp;#39;optimized img file: &amp;#39;&lt;/span&gt; &lt;span style="color:#f92672"&gt;+&lt;/span&gt; fullurl)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; __name__ &lt;span style="color:#f92672"&gt;==&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;__main__&amp;#34;&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; devkey &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; postimgsfolder &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; picopt(postimgsfolder, devkey)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/p&gt;</description></item><item><title>Python operator: double start(**)</title><link>https://blog.gainskills.top/2018/12/27/python-trick-double-stars/</link><pubDate>Fri, 21 Dec 2018 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2018/12/27/python-trick-double-stars/</guid><description>&lt;p&gt;Here is the data:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;testdata &lt;span style="color:#f92672"&gt;=&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;a&amp;#39;&lt;/span&gt; : &lt;span style="color:#ae81ff"&gt;1&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;b&amp;#39;&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;There are two ways to pass the data to a function&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Passing the data to the function&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;loop&lt;/span&gt;(data):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;for&lt;/span&gt; key, value &lt;span style="color:#f92672"&gt;in&lt;/span&gt; data&lt;span style="color:#f92672"&gt;.&lt;/span&gt;items():
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; print(key, value)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;loop(testdata)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Passing the data with operator: **&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-Python" data-lang="Python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;loopStar&lt;/span&gt;(&lt;span style="color:#f92672"&gt;**&lt;/span&gt;kwargs):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;for&lt;/span&gt; key, value &lt;span style="color:#f92672"&gt;in&lt;/span&gt; kwargs&lt;span style="color:#f92672"&gt;.&lt;/span&gt;items():
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; print(key, value)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;loopStar(&lt;span style="color:#f92672"&gt;**&lt;/span&gt;testdata)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;</description></item><item><title>IPSec Over Palo Alto FW Static NAT</title><link>https://blog.gainskills.top/2018/12/19/ipsec-over-paloalto-fw-static-nat/</link><pubDate>Wed, 19 Dec 2018 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2018/12/19/ipsec-over-paloalto-fw-static-nat/</guid><description>&lt;p&gt;It took me about 2 hours on the following scenario and the root cause was located: lacking a static route on Palo Alto, so I decided to summarize every step here for further reference. Here is the topology on EVE-NG:&lt;/p&gt;

















&lt;div align="center"&gt;
 &lt;figure style="padding: 0.8rem; margin: 2rem 0; border: thin #c0c0c0 solid; border-radius: 10px; width: 634px; max-width: 88%; "&gt;
 &lt;a href="https://blog.gainskills.top/img/postimgs/2018/12/14-opt_hu_2902bbfe321a8342.png" data-fancybox data-caption=Topology &gt;
 &lt;img data-src="https://blog.gainskills.top/img/postimgs/2018/12/14-opt_hu_ac22d5a500283c6.png" class="img-responsive img-lazyload" alt=Topology style="height: 180px;"/&gt;
 &lt;/a&gt;
 &lt;figcaption class="text-capitalize"&gt;
 &lt;small&gt;Topology&lt;/small&gt;
 &lt;/figcaption&gt;
 &lt;/figure&gt;
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;The left part is the office, and the right part is Internet&lt;/li&gt;
&lt;li&gt;10.0.56.5 of R6 was NATed to IP: 10.0.17.3 by Palo Alto which establishes IPSec tunnel with R8: 10.0.78.8&lt;/li&gt;
&lt;li&gt;Traffic from 5.5.5.0/24 to 8.8.8.0/24 will be forward over the #1 IPSec&lt;/li&gt;
&lt;li&gt;All device in ‘LAN’ could access ‘Internet’ via Port Translation&lt;/li&gt;
&lt;/ul&gt;
&lt;h5 id="1-initial-palo-alto"&gt;1. Initial Palo Alto&lt;/h5&gt;
&lt;p&gt;Console access Palo Alto with username/password: admin/admin, and configure MGMT IP 172.16.185.132 (I have bridged the MGMT interface of Palo Alto to my laptop). Here are the commands for the initialization:&lt;/p&gt;</description></item><item><title>Monitor network connections based on Process</title><link>https://blog.gainskills.top/2018/09/21/monitor-network-connections-based-on-process/</link><pubDate>Fri, 21 Sep 2018 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2018/09/21/monitor-network-connections-based-on-process/</guid><description>&lt;p&gt;&lt;a href="https://www.wireshark.org/"&gt;Wireshark&lt;/a&gt; is widely used in packets capturing with flexible filters, but for some particular cases, end users care about the network sessions which established by a specific application.&lt;/p&gt;
&lt;p&gt;I will show how to check the sessions of ‘Microsoft OneNote’.&lt;/p&gt;
&lt;h3 id="windows"&gt;Windows&lt;/h3&gt;
&lt;p&gt;Microsoft provides its own product for packets capturing: &lt;a href="https://www.microsoft.com/en-us/download/4865"&gt;Microsoft Network Monitor&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Lunch ‘Microsoft Network Monitor’ before you run OneNote:&lt;/p&gt;

















&lt;div align="center"&gt;
 &lt;figure style="padding: 0.8rem; margin: 2rem 0; border: thin #c0c0c0 solid; border-radius: 10px; width: 430px; max-width: 88%; "&gt;
 &lt;a href="https://blog.gainskills.top/img/postimgs/2018/09/12-opt_hu_e0c726d9724957f7.png" data-fancybox data-caption=nm-1 &gt;
 &lt;img data-src="https://blog.gainskills.top/img/postimgs/2018/09/12-opt_hu_adb9115e9eadc7bf.png" class="img-responsive img-lazyload" alt=nm-1 style="height: 300px;"/&gt;
 &lt;/a&gt;
 &lt;figcaption class="text-capitalize"&gt;
 &lt;small&gt;nm-1&lt;/small&gt;
 &lt;/figcaption&gt;
 &lt;/figure&gt;
&lt;/div&gt;

&lt;p&gt;You will see the processes from the left panel, All related network sessions will shown in the ‘frame summary’ window once OneNote lunched:&lt;/p&gt;</description></item><item><title>tc-How it work on different IPs</title><link>https://blog.gainskills.top/2017/09/22/tc-how-it-works-on-different-ips/</link><pubDate>Fri, 22 Sep 2017 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2017/09/22/tc-how-it-works-on-different-ips/</guid><description>&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;#!/bin/bash
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;&lt;/span&gt;interface&lt;span style="color:#f92672"&gt;=&lt;/span&gt;eth0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ip1&lt;span style="color:#f92672"&gt;=&lt;/span&gt;192.168.1.1
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ip2&lt;span style="color:#f92672"&gt;=&lt;/span&gt;172.16.1.1
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;delay1&lt;span style="color:#f92672"&gt;=&lt;/span&gt;100ms
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;delay2&lt;span style="color:#f92672"&gt;=&lt;/span&gt;200ms
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;tc qdisc add dev $interface root handle 1: prio
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;tc qdisc add dev $interface parent 1:1 netem delay $delay1 10ms 25%
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;tc filter add dev $interface parent 1: protocol ip prio &lt;span style="color:#ae81ff"&gt;1&lt;/span&gt; u32 match ip dst $ip1 flowid 1:1
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;tc qdisc add dev $interface parent 1:2 netem delay $delay2 10ms 25%
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;tc filter add dev $interface parent 1: protocol ip prio &lt;span style="color:#ae81ff"&gt;2&lt;/span&gt; u32 match ip dst $ip2 flowid 1:2
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Run NX-OSv 9000 on EVE(UNL)</title><link>https://blog.gainskills.top/2017/01/08/run-nx-osv-9000-on-eve-unl/</link><pubDate>Sun, 08 Jan 2017 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2017/01/08/run-nx-osv-9000-on-eve-unl/</guid><description>&lt;p&gt;Refer to &lt;a href="https://adosztal.blogspot.com/2016/12/how-to-add-nx-osv-9000-to-gns3.html"&gt;how to add NX-OXv 9000 to GNS3&lt;/a&gt;&lt;/p&gt;
&lt;h4 id="1-download-image-files"&gt;1. Download image files&lt;/h4&gt;
&lt;p&gt;Here is the NX-OSv9k &lt;a href="https://software.cisco.com/download/release.html?mdfid=286312239&amp;amp;flowid=81422&amp;amp;softwareid=282088129&amp;amp;release=7.0(3)I5(1)&amp;amp;relind=AVAILABLE&amp;amp;rellifecycle=&amp;amp;reltype=latest"&gt;image&lt;/a&gt; file from Cisco (nxosv-final.7.0.3.I5.1.qcow2). Please note that you must have a service contract with Cisco in order to download it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;No I can’t provide the image to anyone.&lt;/strong&gt;&lt;/p&gt;
&lt;h4 id="2-copy-image-to-eveunl"&gt;2. Copy image to eve(UNL)&lt;/h4&gt;
&lt;p&gt;change file name to ‘hda.qcow2’&lt;/p&gt;
&lt;p&gt;copy source file to ‘/opt/unetlab/addons/qemu/nxosv9k-7.0.3.I5.1’&lt;/p&gt;
&lt;p&gt;run&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;/opt/unetlab/wrappers/unl_wrapper -a fixpermissions
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id="3-add-a-new-node-for-nxosv9k"&gt;3. Add a New node for nxosv9k&lt;/h4&gt;
&lt;p&gt;Copy the &lt;a href="https://gitlab.com/hanbaobao2005/eve-ng-public/blob/master/html/templates/nxosv9k.php"&gt;php file&lt;/a&gt; to &amp;lsquo;/opt/unetlab/html/templates/&amp;rsquo;&lt;/p&gt;</description></item><item><title>Run Ansible on Windows</title><link>https://blog.gainskills.top/2016/11/30/run-ansible-on-windows/</link><pubDate>Tue, 29 Nov 2016 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2016/11/30/run-ansible-on-windows/</guid><description>&lt;p&gt;Background:&lt;/p&gt;
&lt;p&gt;Here is a topology about the environment for performance testing, let’s name the servers 1st:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;1 windows server as the License/Workspace server&lt;/li&gt;
&lt;li&gt;5 windows servers as the Network Server&lt;/li&gt;
&lt;li&gt;5 windows servers as the Automation server&lt;/li&gt;
&lt;/ul&gt;















&lt;div align="center"&gt;
 &lt;figure style="padding: 0.8rem; margin: 2rem 0; border: thin #c0c0c0 solid; border-radius: 10px; width: 476px; max-width: 88%; "&gt;
 &lt;a href="https://blog.gainskills.top/img/postimgs/2016/11/5-opt_hu_fb9d39317589d7fd.png" data-fancybox data-caption=Topo &gt;
 &lt;img data-src="https://blog.gainskills.top/img/postimgs/2016/11/5-opt_hu_7bb2a51c31b7b3fe.png" class="img-responsive img-lazyload" alt=Topo style="height: 300px;"/&gt;
 &lt;/a&gt;
 &lt;figcaption class="text-capitalize"&gt;
 &lt;small&gt;Topo&lt;/small&gt;
 &lt;/figcaption&gt;
 &lt;/figure&gt;
&lt;/div&gt;

&lt;p&gt;It took us a lot of time to deploy the product and collect logs on all of these servers.&lt;/p&gt;</description></item><item><title>Loop a dict to update the keys</title><link>https://blog.gainskills.top/2016/07/21/loop-a-dict-to-update-key/</link><pubDate>Thu, 21 Jul 2016 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2016/07/21/loop-a-dict-to-update-key/</guid><description>&lt;p&gt;Source dict:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;{&lt;span style="color:#e6db74"&gt;&amp;#39;keyA&amp;#39;&lt;/span&gt;: &lt;span style="color:#e6db74"&gt;&amp;#39;&amp;#39;&lt;/span&gt;, &lt;span style="color:#e6db74"&gt;&amp;#39;keyB&amp;#39;&lt;/span&gt;: &lt;span style="color:#e6db74"&gt;&amp;#39;&amp;#39;&lt;/span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Expected dict:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;{&lt;span style="color:#960050;background-color:#1e0010"&gt;‘&lt;/span&gt;keyA&lt;span style="color:#f92672"&gt;/&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#39;keyA&amp;#39;&lt;/span&gt; :&lt;span style="color:#960050;background-color:#1e0010"&gt;’’&lt;/span&gt;, keyA&lt;span style="color:#f92672"&gt;/&lt;/span&gt;keyB&lt;span style="color:#960050;background-color:#1e0010"&gt;’&lt;/span&gt; : &lt;span style="color:#960050;background-color:#1e0010"&gt;‘’&lt;/span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Code1:&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;keyPrefix &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;keyA&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;for&lt;/span&gt; key, value &lt;span style="color:#f92672"&gt;in&lt;/span&gt; Dict&lt;span style="color:#f92672"&gt;.&lt;/span&gt;items():
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;    newkey &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;/&amp;#39;&lt;/span&gt;&lt;span style="color:#f92672"&gt;.&lt;/span&gt;join([keyPrefix, key])
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;    Dict[newkey] &lt;span style="color:#f92672"&gt;=&lt;/span&gt; Dict&lt;span style="color:#f92672"&gt;.&lt;/span&gt;pop(key)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Code2:&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;keyPrefix &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;keyA&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;for&lt;/span&gt; key, value &lt;span style="color:#f92672"&gt;in&lt;/span&gt; Dict&lt;span style="color:#f92672"&gt;.&lt;/span&gt;keys():
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;    newkey &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;/&amp;#39;&lt;/span&gt;&lt;span style="color:#f92672"&gt;.&lt;/span&gt;join([keyPrefix, key])
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;    Dict[newkey] &lt;span style="color:#f92672"&gt;=&lt;/span&gt; Dict&lt;span style="color:#f92672"&gt;.&lt;/span&gt;pop(key)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Result of code1/code2 is:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;{&lt;span style="color:#e6db74"&gt;&amp;#39;keyA/keyA/keyB&amp;#39;&lt;/span&gt; : &lt;span style="color:#e6db74"&gt;&amp;#39;&amp;#39;&lt;/span&gt;, &lt;span style="color:#e6db74"&gt;&amp;#39;keyA/keyA/keyA&amp;#39;&lt;/span&gt;: &lt;span style="color:#e6db74"&gt;&amp;#39;&amp;#39;&lt;/span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It doesn&amp;rsquo;t work as expected, and I found the case only exists when &lt;strong&gt;prefix is the same to a key of the dict&lt;/strong&gt; which means code1/code2 works well when the keyPrefix is neither ‘keyA’ nor ‘beyB’.&lt;/p&gt;</description></item><item><title>Python多版本, Sublime Text, Anaconda指北</title><link>https://blog.gainskills.top/2016/06/07/python-sublimetext-anaconda/</link><pubDate>Tue, 07 Jun 2016 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2016/06/07/python-sublimetext-anaconda/</guid><description>&lt;h4 id="介绍"&gt;介绍&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.sublimetext.com/"&gt;Sublime text&lt;/a&gt;是一款很好用的文本编辑器，更是一款先进的代码编辑器，支持通过插件进行功能扩展。在使用过UltraEditor, Notepad++, vim等等编辑器后，感觉sublime text最好用 (Update @ 2019-02-07: 目前由Sublimetext转移至&lt;a href="https://code.visualstudio.com/"&gt;MS VSCode&lt;/a&gt;)。&lt;/p&gt;</description></item><item><title>SNMP simulator installation guide</title><link>https://blog.gainskills.top/2016/01/28/snmp-simulator-installation-guide/</link><pubDate>Wed, 13 Nov 2013 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2016/01/28/snmp-simulator-installation-guide/</guid><description>&lt;p&gt;&lt;strong&gt;About SNMP Simulator&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The the SNMP Simulator software is intended for testing SNMP Managers against a large number of SNMP Agents that represent a potentially very large network populated with different kinds of SNMP-capable devices.&lt;/p&gt;
&lt;p&gt;Refers to its &lt;a href="https://github.com/etingof/snmpsim"&gt;project page&lt;/a&gt; for more info.&lt;/p&gt;
&lt;p&gt;Why?&lt;/p&gt;
&lt;p&gt;With SNMP simulator you can simulate a device by the output of SNMPwalk without considering MIB files.&lt;/p&gt;
&lt;p&gt;This article is about how to install SNMP Simulator.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Install Python&lt;/p&gt;</description></item><item><title>Configuring SSH public key authentication on Cisco IOS Device</title><link>https://blog.gainskills.top/2013/11/08/ios-devices-ssh-key-auth/</link><pubDate>Fri, 08 Nov 2013 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2013/11/08/ios-devices-ssh-key-auth/</guid><description>&lt;p&gt;SSH public Key types:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;RSA key use with SSH1 and SSH2 protocol&lt;/li&gt;
&lt;li&gt;DSA key use with SSH2 protocol&lt;br&gt;&lt;br&gt;Note: DSA is weak than RSA&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The Key pairs:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Public key: SSH.com使用的RFC 4716指定的公钥格式，而OpenSSH使用了另外的格式&lt;/li&gt;
&lt;li&gt;Private Key: SSH v1私钥只有一种标准格式，但SSH v2私钥格式很多，OpenSSH、ssh.com、puty、winscp格式不同且不兼容&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id="generate-the-key"&gt;Generate the Key&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;SecureCRT

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 &lt;div align="center"&gt;
 &lt;figure style="padding: 0.8rem; margin: 2rem 0; border: thin #c0c0c0 solid; border-radius: 10px; width: 439px; max-width: 88%; "&gt;
 &lt;a href="https://blog.gainskills.top/img/postimgs/2013/11/12-opt_hu_63c2f50f9e75d256.png" data-fancybox data-caption=SecureCRT-PublicKey-1 &gt;
 &lt;img data-src="https://blog.gainskills.top/img/postimgs/2013/11/12-opt_hu_7f241b83164a8b4e.png" class="img-responsive img-lazyload" alt=SecureCRT-PublicKey-1 style="height: 100px;"/&gt;
 &lt;/a&gt;
 &lt;figcaption class="text-capitalize"&gt;
 &lt;small&gt;SecureCRT-PublicKey-1&lt;/small&gt;
 &lt;/figcaption&gt;
 &lt;/figure&gt;
 &lt;/div&gt;


 
 
 
 
 
 
 
 
 
 
 
 
 
 
 &lt;div align="center"&gt;
 &lt;figure style="padding: 0.8rem; margin: 2rem 0; border: thin #c0c0c0 solid; border-radius: 10px; width: 415px; max-width: 88%; "&gt;
 &lt;a href="https://blog.gainskills.top/img/postimgs/2013/11/13-opt_hu_e3fb489c31c0a6be.png" data-fancybox data-caption=SecureCRT-PublicKey-2 &gt;
 &lt;img data-src="https://blog.gainskills.top/img/postimgs/2013/11/13-opt_hu_1c1c5d44bf6bd2bc.png" class="img-responsive img-lazyload" alt=SecureCRT-PublicKey-2 style="height: 270px;"/&gt;
 &lt;/a&gt;
 &lt;figcaption class="text-capitalize"&gt;
 &lt;small&gt;SecureCRT-PublicKey-2&lt;/small&gt;
 &lt;/figcaption&gt;
 &lt;/figure&gt;
 &lt;/div&gt;


 
 
 
 
 
 
 
 
 
 
 
 
 
 
 &lt;div align="center"&gt;
 &lt;figure style="padding: 0.8rem; margin: 2rem 0; border: thin #c0c0c0 solid; border-radius: 10px; width: 420px; max-width: 88%; "&gt;
 &lt;a href="https://blog.gainskills.top/img/postimgs/2013/11/14-opt_hu_d0bfde43659df61e.png" data-fancybox data-caption=SecureCRT-PublicKey-3 &gt;
 &lt;img data-src="https://blog.gainskills.top/img/postimgs/2013/11/14-opt_hu_2401e31783adc544.png" class="img-responsive img-lazyload" alt=SecureCRT-PublicKey-3 style="height: 270px;"/&gt;
 &lt;/a&gt;
 &lt;figcaption class="text-capitalize"&gt;
 &lt;small&gt;SecureCRT-PublicKey-3&lt;/small&gt;
 &lt;/figcaption&gt;
 &lt;/figure&gt;
 &lt;/div&gt;

密钥类型有两种: DSA、RSA. Secure CRT提示多种服务器不支持RSA, Cisco IOS supports RSA only.

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 &lt;div align="center"&gt;
 &lt;figure style="padding: 0.8rem; margin: 2rem 0; border: thin #c0c0c0 solid; border-radius: 10px; width: 411px; max-width: 88%; "&gt;
 &lt;a href="https://blog.gainskills.top/img/postimgs/2013/11/15-opt_hu_ecf3773eec3f9bd.png" data-fancybox data-caption=SecureCRT-PublicKey-4 &gt;
 &lt;img data-src="https://blog.gainskills.top/img/postimgs/2013/11/15-opt_hu_bc0053589b756be6.png" class="img-responsive img-lazyload" alt=SecureCRT-PublicKey-4 style="height: 270px;"/&gt;
 &lt;/a&gt;
 &lt;figcaption class="text-capitalize"&gt;
 &lt;small&gt;SecureCRT-PublicKey-4&lt;/small&gt;
 &lt;/figcaption&gt;
 &lt;/figure&gt;
 &lt;/div&gt;

通行短语为对私钥加密的密码，注释为提示输入密码时的提示，两项均为可为空

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 &lt;div align="center"&gt;
 &lt;figure style="padding: 0.8rem; margin: 2rem 0; border: thin #c0c0c0 solid; border-radius: 10px; width: 418px; max-width: 88%; "&gt;
 &lt;a href="https://blog.gainskills.top/img/postimgs/2013/11/16-opt_hu_61191c8d71b27274.png" data-fancybox data-caption=SecureCRT-PublicKey-5 &gt;
 &lt;img data-src="https://blog.gainskills.top/img/postimgs/2013/11/16-opt_hu_b29676cd58ede033.png" class="img-responsive img-lazyload" alt=SecureCRT-PublicKey-5 style="height: 270px;"/&gt;
 &lt;/a&gt;
 &lt;figcaption class="text-capitalize"&gt;
 &lt;small&gt;SecureCRT-PublicKey-5&lt;/small&gt;
 &lt;/figcaption&gt;
 &lt;/figure&gt;
 &lt;/div&gt;


 
 
 
 
 
 
 
 
 
 
 
 
 
 
 &lt;div align="center"&gt;
 &lt;figure style="padding: 0.8rem; margin: 2rem 0; border: thin #c0c0c0 solid; border-radius: 10px; width: 419px; max-width: 88%; "&gt;
 &lt;a href="https://blog.gainskills.top/img/postimgs/2013/11/17-opt_hu_f1432616b8f60d74.png" data-fancybox data-caption=SecureCRT-PublicKey-6 &gt;
 &lt;img data-src="https://blog.gainskills.top/img/postimgs/2013/11/17-opt_hu_4a96cee4b01eafcc.png" class="img-responsive img-lazyload" alt=SecureCRT-PublicKey-6 style="height: 270px;"/&gt;
 &lt;/a&gt;
 &lt;figcaption class="text-capitalize"&gt;
 &lt;small&gt;SecureCRT-PublicKey-6&lt;/small&gt;
 &lt;/figcaption&gt;
 &lt;/figure&gt;
 &lt;/div&gt;


 
 
 
 
 
 
 
 
 
 
 
 
 
 
 &lt;div align="center"&gt;
 &lt;figure style="padding: 0.8rem; margin: 2rem 0; border: thin #c0c0c0 solid; border-radius: 10px; width: 411px; max-width: 88%; "&gt;
 &lt;a href="https://blog.gainskills.top/img/postimgs/2013/11/18-opt_hu_8eebf98f3fa5b673.png" data-fancybox data-caption=SecureCRT-PublicKey-7 &gt;
 &lt;img data-src="https://blog.gainskills.top/img/postimgs/2013/11/18-opt_hu_d9acee599e9ba0d1.png" class="img-responsive img-lazyload" alt=SecureCRT-PublicKey-7 style="height: 270px;"/&gt;
 &lt;/a&gt;
 &lt;figcaption class="text-capitalize"&gt;
 &lt;small&gt;SecureCRT-PublicKey-7&lt;/small&gt;
 &lt;/figcaption&gt;
 &lt;/figure&gt;
 &lt;/div&gt;

为了更好的兼容性和适用性，OpenSSH format is prefered，Choose the location to save the key files：

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 &lt;div align="center"&gt;
 &lt;figure style="padding: 0.8rem; margin: 2rem 0; border: thin #c0c0c0 solid; border-radius: 10px; width: 334px; max-width: 88%; "&gt;
 &lt;a href="https://blog.gainskills.top/img/postimgs/2013/11/19-opt_hu_37ba079b6ab849c5.png" data-fancybox data-caption=SecureCRT-PublicKey-8 &gt;
 &lt;img data-src="https://blog.gainskills.top/img/postimgs/2013/11/19-opt_hu_18b4ff7557e39f4b.png" class="img-responsive img-lazyload" alt=SecureCRT-PublicKey-8 style="height: 270px;"/&gt;
 &lt;/a&gt;
 &lt;figcaption class="text-capitalize"&gt;
 &lt;small&gt;SecureCRT-PublicKey-8&lt;/small&gt;
 &lt;/figcaption&gt;
 &lt;/figure&gt;
 &lt;/div&gt;

点击’Finish’后会弹出对话框：

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 &lt;div align="center"&gt;
 &lt;figure style="padding: 0.8rem; margin: 2rem 0; border: thin #c0c0c0 solid; border-radius: 10px; width: 283px; max-width: 88%; "&gt;
 &lt;a href="https://blog.gainskills.top/img/postimgs/2013/11/20-opt_hu_1e1d6825887bddc8.png" data-fancybox data-caption=SecureCRT-PublicKey-9 &gt;
 &lt;img data-src="https://blog.gainskills.top/img/postimgs/2013/11/20-opt_hu_6d16f2f10637958b.png" class="img-responsive img-lazyload" alt=SecureCRT-PublicKey-9 style="height: 150px;"/&gt;
 &lt;/a&gt;
 &lt;figcaption class="text-capitalize"&gt;
 &lt;small&gt;SecureCRT-PublicKey-9&lt;/small&gt;
 &lt;/figcaption&gt;
 &lt;/figure&gt;
 &lt;/div&gt;

如果选择’Yes’,会影响’快速连接’中的公钥指向保存的文件:

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 &lt;div align="center"&gt;
 &lt;figure style="padding: 0.8rem; margin: 2rem 0; border: thin #c0c0c0 solid; border-radius: 10px; width: 303px; max-width: 88%; "&gt;
 &lt;a href="https://blog.gainskills.top/img/postimgs/2013/11/21-opt_hu_86e897584bf51a36.png" data-fancybox data-caption=SecureCRT-PublicKey-10 &gt;
 &lt;img data-src="https://blog.gainskills.top/img/postimgs/2013/11/21-opt_hu_a70b6dffce8116c8.png" class="img-responsive img-lazyload" alt=SecureCRT-PublicKey-10 style="height: 290px;"/&gt;
 &lt;/a&gt;
 &lt;figcaption class="text-capitalize"&gt;
 &lt;small&gt;SecureCRT-PublicKey-10&lt;/small&gt;
 &lt;/figcaption&gt;
 &lt;/figure&gt;
 &lt;/div&gt;
&lt;/p&gt;</description></item><item><title>Open LDAP and SSH Public key</title><link>https://blog.gainskills.top/2013/11/08/openldap-ssh-public-key/</link><pubDate>Fri, 08 Nov 2013 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2013/11/08/openldap-ssh-public-key/</guid><description>&lt;p&gt;The article is about how I setup Open LDAP on CentOS6 for SSH public key authentication.&lt;/p&gt;
&lt;h4 id="1download-and-install-centos62"&gt;1.Download and install CentOS6.2&lt;/h4&gt;
&lt;p&gt;&lt;a href="http://ftp.riken.jp/Linux/centos/6/isos/i386/CentOS-6.10-i386-minimal.iso"&gt;CentOS-6.xx-i366-minimal.iso&lt;/a&gt;&lt;/p&gt;
&lt;h4 id="2-centos-configuration"&gt;2. CentOS configuration&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Network: IP address, DNS, and restart network service&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;vi /etc/resolv.conf/DNS
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;vi /etc/sysconfig/network-scripts/ifcfg-eth0/NIC IP
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;vi /etc/networks//Route
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;/etc/init.d/network restart
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;configure host file&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;vi /etc/hosts
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Modify 127.0.0.1 item to FQDN format because openldap get &lt;em&gt;dc&lt;/em&gt; from the item automatically.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;127.0.0.1 ldap.kzblog.com
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Stop security services&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;setenforce permissive
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;getenforce
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;service iptables stop
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;em&gt;Note: This only for the testing environment.&lt;/em&gt;&lt;/p&gt;</description></item></channel></rss>