-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.xml
153 lines (153 loc) · 39.8 KB
/
index.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Blog - uTIcARdI</title><link>https://blog.gainskills.top/</link><description>Recent content on Blog - uTIcARdI</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Mon, 17 Jul 2023 00:00:00 +0000</lastBuildDate><atom:link href="https://blog.gainskills.top/index.xml" rel="self" type="application/rss+xml"/><item><title>Golang abnormal CPU usage</title><link>https://blog.gainskills.top/2023/07/17/</link><pubDate>Mon, 17 Jul 2023 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2023/07/17/</guid><description>Plan: Sleep 2.5 hours in a for loop
Implementation:
package test import ( &#34;context&#34; &#34;time&#34; ) const connChkInterval = 2.5 * time.Hour.Hours() func testFunc(ctx context.Context) { _Loop: for { select { case &lt;-ctx.Done(): break _Loop default: // code of default branch } time.Sleep(connChkInterval) } } Issue:
CPU usage goes high with the code Did analysis with golang profile, and saw runtime/internal/syscall.Syscall is the root cause The CPU usage never went to so high ever even though I run SQLite and the Golang App on the same server Troubleshooting:</description></item><item><title>openwrt DDNS, acme commands</title><link>https://blog.gainskills.top/2021/09/15/openwrt-ddns-cert/</link><pubDate>Wed, 15 Sep 2021 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2021/09/15/openwrt-ddns-cert/</guid><description>I&rsquo;m using OpenWrt R21.8.6 by compile it from coolsnowwolf/lede.
1. Install softwares on Openwrt acme ddns-scripts (This originally built when compile the firmware) 2. DDNS configuration DNS System
Creating a dynamic DNS record on your DNS service provider (Mine is running over dns.he.net)
Dynamic DNS A Record - New Generate password for DDNS
Dynamic DNS A Record password - entry Dynamic DNS A Record password - generate Configuration on Openwrt</description></item><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>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.
The Arista vm can be started and stuck at:
Issue I did a search and found a clue in the Arista forum, the instance began to work after changed the CPU number to 2:
Issue</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>Background 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).
Environment:
Python3.7.5 xls library: xlwt1.3 Developing on Mac 10.15.1 with VS Code, and finally the project will be published to a Docker environment(ritht now, it&rsquo;s Python:3.7.5-alpine3.10). Issue The converted xls file, system B doesn&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)😫.</description></item><item><title>VSCode as an IDLE for Django</title><link>https://blog.gainskills.top/2019/11/15/vscode-as-idle-for-Django/</link><pubDate>Fri, 15 Nov 2019 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2019/11/15/vscode-as-idle-for-Django/</guid><description>This blog is about using MS VSCode as Django IDLE (OS: Mac OX, the steps are referenceable on Linux, Windows).
1. Download installation files and install MS VScode, Python from following links: MS VSCode
Python3
Optional: On Mac OS, I recommend homebrew for Python Installation because third party libraries&rsquo; dependency will be processed smoothly.
Install homebrew:
/usr/bin/ruby -e &#34;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)&#34; Install Python3:
brew install python@3 2. Python Extension Launch VSCode and install the Extension: Python</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>防晒霜 - 安耐晒,遮阳帽,太阳镜 多带两件长袖的衣服 带一身质量不错的西服,衬衣(正装,面试及其它正式场合穿) 考试费贵 (因为GST),所以工作需要</description></item><item><title>os.path.join() or os.sep.join()?</title><link>https://blog.gainskills.top/2019/07/23/path-join/</link><pubDate>Tue, 23 Jul 2019 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2019/07/23/path-join/</guid><description>There are two functions join a full path. E.g.: In drive: C:
|- test | |- test.xt os.path.join
import os fullpath = os.path.join(&#39;c:&#39;, &#39;test&#39;, &#39;test.txt&#39;) Output on windows:
c:test\test.txt Output on Mac OS c:/test/test.txt
os.sep.join
import os fullpath = os.sep.join([&#39;c:&#39;, &#39;test&#39;, &#39;test.txt&#39;]) Output on windows:
c:\test\test.txt Output on Mac OS c:/test/test.txt
From the outputs, you can see the difference: os.path.join() doesn&rsquo;t work as expected on windows.
Further verification:
with open(fullpath) as test: test.</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>Error 1 Run a bat (ping.bat) to ping multiple IPs like this: set testipa=x.x.x.x echo Checking ping %testipa% (15 times), please don&#39;t close current window echo ping %testipa% (15 times) &gt;&gt; test.log ping %testipa% -w 500 -n 15 &gt;&gt; test.log
But got the following error: Checking ping x.x.x.x (15 times), please don&#39;t close current window The process cannot access the file because it is being used by another process. The process cannot access the file because it is being used by another process.</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>Curl is widely used in command lines or scripts to transfer data.
Different ways to use curl to post a file to a web server with samples (from both client-side and server: Python-Flask side) will be discussed because it took me a while on the server-side to receiving the data from client.
I would like to add samples of Python-requests, Postman later.
Started with macOS Mojave Python 3.7.2 Flask 1.0.2 Flask-RESTful 0.</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>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.
Topology: Topology Configuration Configured IP addresses on the routers
Note: The subnets of R1&rsquo;s Loopback1 and R2&rsquo;s Loopback1 belong to the class A address.
Execute command &ldquo;ip classless&rdquo; on both R1 and R2 (The command has been the default since IOS 11.3)
Configure static routes
R1(config)#ip route 0.</description></item><item><title>Python operator:single star(*)</title><link>https://blog.gainskills.top/2019/02/09/single-star-zip/</link><pubDate>Sat, 09 Feb 2019 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2019/02/09/single-star-zip/</guid><description>with Zip Read a block of pseudo Python code like comA = zip(lsA, lsB) comB = zip(*comA)
then made a try to see how * works: 1 2 3 4 5 6 7 8 a = [1, 2, 3] b = [4, 5, 6] c = zip(a,b) for j in c: print(j) d = zip(*c) for i in d: print(i) and the output: (1, 4) (2, 5) (3, 6)</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>A list about how I customize Hugo and why I did the change, the post will be updated continuously.
1. fractions Network Engineer should care about this, because it shows wrong IP/mask format with default value: fractions with default value Disable it in config.toml: [blackfriday] fractions = false
2. hrefTargetBlank This default value of the option is false which means external links(The wording was corrected to &ldquo;absolute&rdquo; from &rsquo;external&rsquo; on Hugo official doc).</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>Hugo provides the detail instructions about how to deploy it on different environment.
At first, I followed Deployment of Project Pages from /docs folder on master branch, and put all files in one repository.
I continue to check Deployment of Project Pages From Your gh-pages branch after I did some customization on hugo-theme-cleanwhite and want to publish the change to the forked branch.
Instead of the follow Hugo guide, I did some try myself.</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>I introduced why 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 posts&rsquo; images management, versioning, theme customization/something about SEO.
Before start All images will be compressed before I upload them for the post. Many tools that could do this, such as tinypng, UPNG. My choice is Tinypng because it supports variety formats and its API.</description></item><item><title>aiohttp/aiodns-Resolving using custom nameservers</title><link>https://blog.gainskills.top/2019/01/23/try-aiohttp/</link><pubDate>Wed, 23 Jan 2019 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2019/01/23/try-aiohttp/</guid><description>aiohttp is an Asynchronous HTTP client/server framework for asyncio and Python
I tried it because of the features:
Tuning the DNS cache Resolving using custom nameservers With this, verifying the CDN&rsquo;s POPs with different ISPs&rsquo; DNS on single a point should be possible.
Since the code on the official document is simple:
from aiohttp.resolver import AsyncResolver
resolver = AsyncResolver(nameservers=[&ldquo;8.8.8.8&rdquo;, &ldquo;8.8.4.4&rdquo;]) conn = aiohttp.TCPConnector(resolver=resolver)
I tried it with following code: ~~~python import aiohttp import asyncio from aiohttp.</description></item><item><title>get() in get() method of Pyhon dict</title><link>https://blog.gainskills.top/2019/01/19/get-in-dict-get/</link><pubDate>Wed, 09 Jan 2019 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2019/01/19/get-in-dict-get/</guid><description>Write down the tip for the practice: The Time in Words.
A dict was created for the time in number format to string format:
intToStrDict = { 1: &#39;one&#39;, 2: &#39;two&#39;, 3: &#39;three&#39;, 4: &#39;four&#39;, 5: &#39;five&#39;, 6: &#39;six&#39;, 7: &#39;seven&#39;, 8: &#39;eight&#39;, 9: &#39;nine&#39;, 10: &#39;ten&#39;, 11: &#39;eleven&#39;, 12: &#39;twelve&#39;, 13: &#39;thirteen&#39;, 14: &#39;fourteen&#39;, 15: &#39;quarter&#39;, 16: &#39;sixteen&#39;, 17: &#39;seventeen&#39;, 18: &#39;eighteen&#39;, 19: &#39;nineteen&#39;, 20: &#39;twenty&#39;, 30: &#39;half&#39;, 40: &#39;fourty&#39;, 50: &#39;fifty&#39; } get() is a good way get the value of a key from the dict, so I tried following function to convert minute in number format to string format:</description></item><item><title>About me</title><link>https://blog.gainskills.top/top/about/</link><pubDate>Tue, 01 Jan 2019 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/top/about/</guid><description>The owner of the blog is a developer and network engineer. He has a solid experience in the information technology for more than 10 years.
Feel free to contact him by dropping an email to kex_zh@outlook.com if you have any question about the articles.
Note: The name of the blog is not a mistake, I updated it to random characters because I don't want my name was exposed too much on the Internet.</description></item><item><title>Hello World</title><link>https://blog.gainskills.top/2019/01/01/hello-world/</link><pubDate>Tue, 01 Jan 2019 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2019/01/01/hello-world/</guid><description>Hello World!
Thanks
Hugo Git Page hugo-theme-cleanwhite I did some changes on the theme, will share it after testing. I spend days and finally get this Blog runs up. In the next days, will move the posts from WordPress: hanbaobao2005.WordPress.com to here.
Happy Holidays :-)
Update at Jan-26-2019:
I have been running blogs for years, started at NetEase(NetEase shut down its blog service at Nov-30-2018), then to Blogger(The blog was closed), and WordPress after Blogger was blocked within China.</description></item><item><title>AWS S3 Bucket Creation</title><link>https://blog.gainskills.top/2018/12/27/aws-s3-bucket-creation/</link><pubDate>Thu, 27 Dec 2018 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2018/12/27/aws-s3-bucket-creation/</guid><description>Try to create a bucket with the Python library: boto3
from boto3.session import Session session=Session(aws_access_key_id=&#39;key1&#39;, aws_secret_access_key=&#39;key2&#39;) s3 = session.resource(&#39;s3&#39;) s3.create_bucket(Bucket=&#39;kz-testbucket&#39;) but failed to run the script with errors:
botocore.exceptions.ClientError: An error occurred (IllegalLocationConstraintException) when calling the CreateBucket operation: The unspecified location constraint is incompatible for the region specific endpoint this request was sent to.
botocore.errorfactory.BucketAlreadyExists: An error occurred (BucketAlreadyExists) when calling the CreateBucket operation: The requested bucket name is not available.</description></item><item><title>Jenkins/Xcode plugin-parameterized project</title><link>https://blog.gainskills.top/2018/12/26/jenkins-xcode-plugin-parameterized-project/</link><pubDate>Wed, 26 Dec 2018 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2018/12/26/jenkins-xcode-plugin-parameterized-project/</guid><description> setting1 setting2 setting3 setting4 setting5 Reference
Link1</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>Here is the data:
testdata = { &#39;a&#39; : 1, &#39;b&#39;: 2 } There are two ways to pass the data to a function
Passing the data to the function
def loop(data): for key, value in data.items(): print(key, value) loop(testdata) Passing the data with operator: **
def loopStar(**kwargs): for key, value in kwargs.items(): print(key, value) loopStar(**testdata)</description></item><item><title>Run ASA9.1 on EVE(UNL)</title><link>https://blog.gainskills.top/2018/02/09/run-asa9.1-on-eve/</link><pubDate>Fri, 21 Dec 2018 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2018/02/09/run-asa9.1-on-eve/</guid><description>This blog discusses ASA, not ASAv. Refer to
http://missingsmth.com/gns-asa-9-15-with-asdm/ http://www.fixedbyvonnie.com/2015/05/how-to-setup-an-5520-asa-5-2-in-gns-3-version-1-3/#.WnwYwZNuYWo It’s possible to run ASA9.1 on EVE-NG (UNL, unified network lab), so I did a try:
Image preparation
No, I can’t provide the image to anyone, and I won’t respond to any question about it. Please Refer to following posts for the image file:
http://missingsmth.com/gns-asa-9-15-with-asdm/ http://binarynature.blogspot.com/2014/01/create-cisco-asa-vmware-fusion.html https://github.com/nccgroup/asafw Refer to http://www.eve-ng.net/index.php/documentation/images-table, EVE only support hda.qcow2 format disk. Covert your image to qcow2 format before the next step.</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>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:
Topology The left part is the office, and the right part is Internet 10.0.56.5 of R6 was NATed to IP: 10.0.17.3 by Palo Alto which establishes IPSec tunnel with R8: 10.</description></item><item><title>Jenkins/Xcode plugin for iOS project delivery</title><link>https://blog.gainskills.top/2018/12/18/jenkinsx-iosproject-delivery/</link><pubDate>Tue, 18 Dec 2018 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2018/12/18/jenkinsx-iosproject-delivery/</guid><description>Most of this blog is discuss the errors and how I resolve the errors when I try iOS project Continuous Delivery with Jenkins. The brief steps are:
Install Jenkins
Install Xcode plugin on Jenkins
New a ‘Freestyle project’ on Jenkins
Jenkins project configuration
‘Source Code Management’ on Jenkins ‘Build’ setting on Jenkins Jenkins Project -&gt; ‘Build Now’
Errors:
CodeSign error: Code signing is required for product type ‘Application’ in SDK ‘iOS x.</description></item><item><title>MAC OS-Wireshark/VNC与EVE-NG(UNL)的集成</title><link>https://blog.gainskills.top/2018/12/17/wireshark-vnc-integrate-eve-ngunlonosx/</link><pubDate>Mon, 17 Dec 2018 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2018/12/17/wireshark-vnc-integrate-eve-ngunlonosx/</guid><description>版权声明:以下链接是本文的原文,对本文及原文任何内容、链接的转发、引用请务必标注以下链接: https://www.802101.com/unetlab-and-wireshark-for-osx-update/ https://www.802101.com/wireshark-integration-with-unetlab-on-osx/ 解决思路: MAC OX上没有为URL中’captur</description></item><item><title>Ansible-Access Network via Netconf</title><link>https://blog.gainskills.top/2018/10/11/ansible-access-network-netconf/</link><pubDate>Thu, 11 Oct 2018 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2018/10/11/ansible-access-network-netconf/</guid><description>Continue to try ansible with the device which was configure in netconf feature on Cisco IOS/IOSXE.
Ansible Inventory:
--- netconf: hosts: netconfIos: ansible_host: &#34;172.16.254.100&#34; ansible_network_os: &#34;ios&#34; ansible_ssh_port: 22 netconfJunos: ansible_host: &#34;172.16.254.9&#34; ansible_network_os: &#34;junos&#34; ansible_ssh_port: 830 vars: ansible_connection: &#34;netconf&#34; ansible_ssh_user: test ansible_ssh_pass: test123 Note:
ansible_connnection should be ‘netconf’ Be careful on the netconf port, it should be 22 if you enable netconf over SSH (the default port is 830) PlayBook:
- name: IOS hosts: netconfIos gather_facts: false tasks: - name: Get config for IOS devices netconf_get: source: running register: iosnetconf - name: Display output debug: msg: &#34;{{ iosnetconf.</description></item><item><title>Netconf feature on Cisco IOS/IOSXE</title><link>https://blog.gainskills.top/2018/10/07/netconf-feature-on-cisco-ios-iosxe/</link><pubDate>Sun, 07 Oct 2018 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2018/10/07/netconf-feature-on-cisco-ios-iosxe/</guid><description>I tried to see how Ansible works with the netconf feature on Cisco and Juniper in past days: Juniper’s official document is clear and easy to follow. but for Cisco, I followed NETCONF over SSHv2, unfortunately, I was stuck on it for 6 days. OS Version Cisco IOS XE Software, Version 16.04.01 Cisco IOS Software, Linux Software (I86BI_LINUXL2-IPBASEK9-M), Experimental Version 15.2(20170809:194209) [dstivers-aug9_]</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>Wireshark 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.
I will show how to check the sessions of ‘Microsoft OneNote’.
Windows Microsoft provides its own product for packets capturing: Microsoft Network Monitor.
Lunch ‘Microsoft Network Monitor’ before you run OneNote:
nm-1 You will see the processes from the left panel, All related network sessions will shown in the ‘frame summary’ window once OneNote lunched:</description></item><item><title>Ansible-Access Network via SSH</title><link>https://blog.gainskills.top/2018/09/07/ansible-access-network-via-ssh/</link><pubDate>Tue, 04 Sep 2018 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2018/09/07/ansible-access-network-via-ssh/</guid><description>After Telnet, continue to discuss how to access network device via SSH with Ansible.
For SSH access, we should consider 3 methods:
Username/password Username/Public-Key without password Username/Public-Key with password Same EVE lab as the Telnet one: The Cisco IOS Router-192.168.1.99 is for SSH
Topo Enable SSH on the router Jump #1 username/password part to public key configuration, I discussed how to configure public key on IOS router with Putty before, instead of windows/putty, openssh is useful for generating keys on MAC OS.</description></item><item><title>Ansible-Access Network via Telnet</title><link>https://blog.gainskills.top/2018/09/04/ansible-access-network-via-telnet/</link><pubDate>Tue, 04 Sep 2018 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2018/09/04/ansible-access-network-via-telnet/</guid><description>I’m learning Ansible by reading the official document and some books like Ansible入门. Most of the instructions show you how to deploy or maintain the services on Linux, or file operations. But what I do is trying to explore its capability on network device management automation. The most important thing to practice routers/switches/routing protocol is accessing the device and</description></item><item><title>Mininet-ImportError: customClass</title><link>https://blog.gainskills.top/2018/07/20/mininet-importerror-customclass/</link><pubDate>Fri, 20 Jul 2018 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2018/07/20/mininet-importerror-customclass/</guid><description>I tried to run miniedit.py after I have mininet installed, unfortunately, I got the error:
ImportError: cannot import name customClass. Error Checked the py file: ~/mininet/mininet/util.py and miniedity.py, find nothing is wrong, search on the Internet, got no clue.
Suddenly I found the version is not the version I wanted to install (I forgot to take a screenshot, the version should be 2.2.2daily something).
I guess there must be something wrong with the latest version, or there is something conflict with my previous version (mininet 2.</description></item><item><title>Flask, Flask-WTF, Flask-Bootstrap, Select2, jinja2 integration</title><link>https://blog.gainskills.top/2018/04/16/flask-flask-wtf-flask-bootstrap-select2-jinja2-integration/</link><pubDate>Mon, 16 Apr 2018 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2018/04/16/flask-flask-wtf-flask-bootstrap-select2-jinja2-integration/</guid><description>I intend to acquire the Python skill on web after years&rsquo; work on data processing, so I started with Flask by the following Miguel Grinberg&rsquo;s instruction: The Flask Mega, you can learn how to integrate bootstrap with your project from it. After that, you can learn how to integrate select2 with your project by reading Flask Web开发:用Select2</description></item><item><title>Python SMTPlib/Email</title><link>https://blog.gainskills.top/2018/02/13/python-smtplib-email/</link><pubDate>Tue, 13 Feb 2018 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2018/02/13/python-smtplib-email/</guid><description>I followed the instruction which is written in Chinese to learn how to send emails by Python, here some tips from my practice:
Name of the attachment is shown as ‘ATT00002’
The name of the attachment in the receiver mailbox is shown in the format ‘ATT0000X‘ with the code:
att1[&#34;Content-Disposition&#34;] = &#39;attachment; filename=&#34;runoob.txt&#34;&#39; Issue The issue can be fixed by using .addheader() function:
att1.add_header(&#39;Content-Disposition&#39;, &#39;attachment&#39;, filename=&#34;1.cpp&#34;) Here is my code:</description></item><item><title>30分钟上手Python网络爬虫</title><link>https://blog.gainskills.top/2018/01/30/30min-python-web-scrapper/</link><pubDate>Tue, 30 Jan 2018 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2018/01/30/30min-python-web-scrapper/</guid><description>原文链接: https://hackernoon.com/30-minute-python-web-scraper-39d6d038e5da 此翻译已经获得作者许可。对原文、本文任何形式的转载、引用,必须知会作者 我想用Python和Selenium做网络爬虫有一会了,但</description></item><item><title>Run PaloAlto VM on EVE(UNL)/virtualbox/OSX</title><link>https://blog.gainskills.top/2018/01/25/run-paloalto-vm-on-eve-unl-virtualbox-osx/</link><pubDate>Thu, 25 Jan 2018 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2018/01/25/run-paloalto-vm-on-eve-unl-virtualbox-osx/</guid><description>I tried to run Palo Alto on EVE/Virtualbox/Apple MAC OS and found it fails to start the Palo Alto Firewall. So I decided to find the root cause. (EVE suggests the users use VMware, I used VirtualBox instead because I don’t have a VMware Fusion license)
I went through EVE logs 1st.
System -&gt; System logs -&gt; unl_wrapper.txt
Log and found the log:
Jan 25 05:18:13 INFO: starting /opt/unetlab/wrappers/qemu_wrapper -T 0 -D 3 -t &#34;PaloAlto&#34; -F /opt/qemu/bin/qemu-system-x86_64 -d 0 -- -nographic -device e1000,netdev=net0,mac=50:00:00:03:00:00 -netdev tap,id=net0,ifname=vunl0_3_0,script=no -device e1000,netdev=net1,mac=50:00:00:03:00:01 -netdev tap,id=net1,ifname=vunl0_3_1,script=no -device e1000,netdev=net2,mac=50:00:00:03:00:02 -netdev tap,id=net2,ifname=vunl0_3_2,script=no -device e1000,netdev=net3,mac=50:00:00:03:00:03 -netdev tap,id=net3,ifname=vunl0_3_3,script=no -smp 2 -m 4096 -name PaloAlto -uuid 934e653f-accd-4ce0-a243-369f853b4add -drive file=virtioa.</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>#!/bin/bash interface=eth0 ip1=192.168.1.1 ip2=172.16.1.1 delay1=100ms delay2=200ms tc qdisc add dev $interface root handle 1: prio tc qdisc add dev $interface parent 1:1 netem delay $delay1 10ms 25% tc filter add dev $interface parent 1: protocol ip prio 1 u32 match ip dst $ip1 flowid 1:1 tc qdisc add dev $interface parent 1:2 netem delay $delay2 10ms 25% tc filter add dev $interface parent 1: protocol ip prio 2 u32 match ip dst $ip2 flowid 1:2</description></item><item><title>OverflowError: signed char is greater than maximum</title><link>https://blog.gainskills.top/2017/06/06/overflowerror-signed-char-is-greater-than-maximum/</link><pubDate>Tue, 06 Jun 2017 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2017/06/06/overflowerror-signed-char-is-greater-than-maximum/</guid><description>Here the pseudo code about the flow:
from array import array c = array(&#39;b&#39;) with open(file, mode = &#39;rb&#39;) as f: for character in f: res = func(character) c.append(res) It runs into the error:
OverflowError: signed char is greater than maximum with a special character &lsquo;À&rsquo; which its binary value is 192:
Character My way to resolve this error is to update the type code of the array from &lsquo;b&rsquo; (signed char) to &lsquo;B&rsquo; (unsigned char).</description></item><item><title>Cisco IPS–Inline VLAN Pair mode</title><link>https://blog.gainskills.top/2017/03/24/cisco-ips-inline-vlan-pair-mode/</link><pubDate>Fri, 24 Mar 2017 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2017/03/24/cisco-ips-inline-vlan-pair-mode/</guid><description>Setup Cisco IPS on EVE
I failed to setup Cisco IPS on EVE(ver 2.0.3-53). I Downloaded Cisco IPS ova file via certcollection (mega)
Followed the [instructions](http://certcollection.org/forum/topic/266792-emulating-ips-on-unl/ http://www.cznetlab.cz/index.php?cat=cciesec&amp;subcat=unlips) for IPS Interfaces.
and met the issue:
Cisco IPS failed to ping anything out of it, I run traffic capture on IPS’s interface, no packet out when I execute the ping command.
Related post on EVE official forum, and the official answer is: This image is corrupted and not working neither on UNL nor EVE</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>Refer to how to add NX-OXv 9000 to GNS3
1. Download image files Here is the NX-OSv9k image 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.
No I can’t provide the image to anyone.
2. Copy image to eve(UNL) change file name to ‘hda.qcow2’
copy source file to ‘/opt/unetlab/addons/qemu/nxosv9k-7.0.3.I5.1’
run
/opt/unetlab/wrappers/unl_wrapper -a fixpermissions 3. Add a New node for nxosv9k Copy the php file to &lsquo;/opt/unetlab/html/templates/&rsquo;</description></item><item><title>Adding Realtek 8139 Driver to ESXi6</title><link>https://blog.gainskills.top/2016/11/29/adding-realtek-8139-driver-to-esxi6/</link><pubDate>Tue, 29 Nov 2016 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2016/11/29/adding-realtek-8139-driver-to-esxi6/</guid><description>Note: This is not an official guide, backup is required before you apply the driver. My Dell PC has two NICs:
Intel I217-LM Realtek RTl-8139 and #2 Realtek 8139 is not supported by VMware EXSi.
There are some guides about customizing EXSi installation ISO to support the NIC, but I’m trying to find a way to apply the driver without reinstall EXSi.
Here is a page which contains many NIC drivers: https://vibsdepot.</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>Background:
Here is a topology about the environment for performance testing, let’s name the servers 1st:
1 windows server as the License/Workspace server 5 windows servers as the Network Server 5 windows servers as the Automation server Topo It took us a lot of time to deploy the product and collect logs on all of these servers.
My colleague wrote a client-server application and do some of the tasks automatically. The application indeed works for log collection, but for product deployment, as the server end running as a service and fails to launch the InstallShield wizard, it doesn’t support the product installation.</description></item><item><title>VSCode for Python debug</title><link>https://blog.gainskills.top/2016/11/10/vscode-for-python-debug/</link><pubDate>Thu, 10 Nov 2016 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2016/11/10/vscode-for-python-debug/</guid><description>MS VS Code for Python debug from k z View the article here if the iframe failed to load: www.slideshare.net/slideshow/embed_code/key/3GrRaqBAXV9mK</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>Source dict:
{&#39;keyA&#39;: &#39;&#39;, &#39;keyB&#39;: &#39;&#39;} Expected dict:
{‘keyA/&#39;keyA&#39; :’’, keyA/keyB’ : ‘’} Code1:
keyPrefix = &#39;keyA&#39; for key, value in Dict.items(): newkey = &#39;/&#39;.join([keyPrefix, key]) Dict[newkey] = Dict.pop(key) Code2:
keyPrefix = &#39;keyA&#39; for key, value in Dict.keys(): newkey = &#39;/&#39;.join([keyPrefix, key]) Dict[newkey] = Dict.pop(key) Result of code1/code2 is:
{&#39;keyA/keyA/keyB&#39; : &#39;&#39;, &#39;keyA/keyA/keyA&#39;: &#39;&#39;} It doesn&rsquo;t work as expected, and I found the case only exists when prefix is the same to a key of the dict which means code1/code2 works well when the keyPrefix is neither ‘keyA’ nor ‘beyB’.</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>介绍 Sublime text是一款很好用的文本编辑器,更是一款先进的代码编辑器,支持通过插件进行功能扩展。在使用过UltraEditor, Notepad++, vim等等编辑</description></item><item><title>VSphere6, VCenter6 Installation</title><link>https://blog.gainskills.top/2016/01/08/vsphere6-vcenter6-installation/</link><pubDate>Fri, 08 Jan 2016 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2016/01/08/vsphere6-vcenter6-installation/</guid><description>Crash happened when I install Vsphere on my PC
Solution: Disable option &ldquo;Limit Maximum CPUID&rdquo; in Bios
VCenter appliance deployment
Vmware doesn&rsquo;t provide vcenter appliance in ova/ovf format anymore, follow the instruction to deploy it.
Inventory is empty in the VCenter webpage
The most important thing: Don&rsquo;t login vcenter by the account &lsquo;root&rsquo;, instead of it using SSO account. the account in the format: &lsquo;administrator@domain-name&rsquo;
Also, Vmware has a KB about this issue:</description></item><item><title>Dynagen/Dynamips error: netio_desc_create_udp: unable to connect to</title><link>https://blog.gainskills.top/2013/12/20/dynagen-dynamips-error-netio_desc-create-udp-unable-to-connect-to/</link><pubDate>Fri, 20 Dec 2013 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2013/12/20/dynagen-dynamips-error-netio_desc-create-udp-unable-to-connect-to/</guid><description>OS: CentOS 6.5 x86_64 installed on vmware Dynamips 0.2.10 There is an error when loading a .net file named as test.net with 100 devices in Dynagen.0.11.0:
netio_desc_create_udp: unable to connect to I searched on the Internet about this error msg, most of posts shared a method: specified UDP port of dynamips instance in .net file. But it doesn’t work for me.
As I found a Dynagen description in GNS3 website: however Dynagen is still updated and developed for GNS3, this means you can download GNS3 sources, find Dynagen in it.</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>About SNMP Simulator
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.
Refers to its project page for more info.
Why?
With SNMP simulator you can simulate a device by the output of SNMPwalk without considering MIB files.
This article is about how to install SNMP Simulator.</description></item><item><title>Trouble shooting: Cisco router DHCP No option 125</title><link>https://blog.gainskills.top/2013/11/13/trouble-shooting-cisco-router-dhcp-no-option125/</link><pubDate>Wed, 13 Nov 2013 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2013/11/13/trouble-shooting-cisco-router-dhcp-no-option125/</guid><description>Topology:
Topo Configure DHCP on Cisco router 2811 to assign a static IP to the italkBB: Cisco SPA 1202.
start DHCP service by command:
service dhcp debug on Cisco router to check DHCP request by the commands:
debug ip dhcp server packet terminal monitor Debug info :
DHCPD: DHCPREQUEST received from client 0100.1c23.3541.98 configure DHCP
ip dhcp pool ItalkBB host 10.0.0.127 255.255.255.0 //no mask configured, IP’s class mask assigned client-identifier 0100.</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>SSH public Key types: RSA key use with SSH1 and SSH2 protocol DSA key use with SSH2 protocol Note: DSA is weak than RSA The Key pairs: Public key: SSH.com使用的RFC 4716指定的公钥格式,而OpenSSH使用了另外的格式</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>The article is about how I setup Open LDAP on CentOS6 for SSH public key authentication.
1.Download and install CentOS6.2 CentOS-6.xx-i366-minimal.iso
2. CentOS configuration Network: IP address, DNS, and restart network service
vi /etc/resolv.conf/DNS vi /etc/sysconfig/network-scripts/ifcfg-eth0/NIC IP vi /etc/networks//Route /etc/init.d/network restart configure host file
vi /etc/hosts Modify 127.0.0.1 item to FQDN format because openldap get dc from the item automatically.
127.0.0.1 ldap.kzblog.com Stop security services
setenforce permissive getenforce service iptables stop Note: This only for the testing environment.</description></item><item><title>make error :/usr/bin/ld: cannot find -luuid</title><link>https://blog.gainskills.top/2013/11/05/make-error-usrbinld-cannot-find-luuid/</link><pubDate>Tue, 05 Nov 2013 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/2013/11/05/make-error-usrbinld-cannot-find-luuid/</guid><description>I met a make error in CentOS 6:
# make ...... /usr/bin/ld: cannot find -luuid ld returned 1 exit status make: *** Error 1 The way to fix this error is to install lib : uuid-devel
yum -y install libuuid-devel</description></item><item><title/><link>https://blog.gainskills.top/search/placeholder/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://blog.gainskills.top/search/placeholder/</guid><description/></item></channel></rss>