This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ZSh is default shell on MAC OS now. | |
Refert to https://github.com/ohmyzsh/ohmyzsh/issues/31 | |
Execute "unsetopt nomatch" before run curl command, otherwise, it might prompots the error: \ | |
"zsh: no matches found:" | |
when sending a request with argument like: "curl http://127.0.0.1:8080/test?message=test" | |
Reason: zsh interprets the ? as a wildcard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#---- R5 | |
! | |
hostname LAN-R5 | |
! | |
enable password kztest | |
! | |
no ip domain lookup | |
ip domain name kztest.com | |
! | |
interface Loopback0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#telnet part1 | |
ansible-playbook -i inventory_telnet.yml pb_telnet.yml | |
#Telnet Part2 | |
ansible-playbook -i inventory_telnet.yml --vault-id test@prompt pb_telnet.yml | |
#SSH | |
ansible-playbook -i inventory_ssh.yml pb_first.yml | |
ansible-playbook -i inventory_ssh.yml --vault-id test@prompt pb_first.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from forcediphttpsadapter.adapters import ForcedIPHTTPSAdapter | |
import urllib3 | |
urllib3.disable_warnings() | |
def test1(): | |
ip_list = [ | |
'1.1.1.1', | |
'2.2.2.1', | |
'3.3.3.1', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
==================== | |
Outside Router: | |
crypto isakmp policy 10 | |
encr 3des | |
authentication pre-share | |
group 2 | |
crypto isakmp key vpnnatkey1 address 192.168.22.1 | |
crypto isakmp key vpnpatkey1 address 192.168.33.1 | |
! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import smtplib | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
from email.mime.image import MIMEImage | |
from email.header import Header | |
from email.utils import formataddr | |
sender = "mySendEmail1" | |
receiver = "myRecEmail1" | |
pwd = 'mypwd' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fix the error: | |
main-loop: WARNING: I/O thread spun for 1000 iterations | |
Alternative: run ASA9 on EVE/UNL, EVE version: 2.0.3-86 | |
Refer to http://www.fixedbyvonnie.com/2015/05/how-to-setup-an-5520-asa-5-2-in-gns-3-version-1-3/#.WnwYwZNuYWo | |
Update the parameters: | |
1. RAM which should be 1,024MB | |
2. Qemu binary: 2.9 and the x86_64 version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import time | |
import os | |
from selenium import webdriver | |
from PIL import Image | |
from io import BytesIO | |
url = "https://unsplash.com" | |
driver = webdriver.Firefox(executable_path=r'geckodriver') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytz | |
from datetime import datetime | |
eastern = pytz.timezone('US/Eastern') | |
cutime = datetime.now(eastern) | |
timestr = cutime.strftime("%Y-%m-%d") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import shutil | |
''' | |
administrator privliedge is needed | |
''' | |
def cpfolder(srcpath, dstpath): | |
try: | |
shutil.copytree(srcpath, dstpath) |