- Uninstall all previous installation and its dependencies, e.g. ant, Java,..
brew remove java
brew remove ant
brew remove zlib
# python, etc
crontab -e need to add following PATH to run a script
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/binPATH at the top of the shell script| alias proxy="export https_proxy=http://<url>:<port>;export http_proxy=http://<url>:<port>" | |
| alias noproxy="export https_proxy='';export http_proxy='';" | |
| # How to use | |
| # call `proxy` command in terminal to setup | |
| # call `noproxy` to unset | |
| # by defalt we are setting the proxy | |
| proxy |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>CNPM Binaries Mirror</title> | |
| </head> | |
| <body> | |
| <script> | |
| // Forked from https://chromedriver.storage.googleapis.com/index.html | |
| // Split a string in 2 parts. The first is the leading number, if any, | |
| // the second is the string following the numbers. |
| import argparse | |
| # Create the parser and add arguments | |
| # parser = argparse.ArgumentParser() | |
| # # 1) init arg | |
| # parser.add_argument(dest='argument1', help="This is the first argument") | |
| # # Parse and print the results | |
| # args = parser.parse_args() |
| from distutils import util | |
| def _msg(args, msg=None): | |
| msg = "input value error, please check your inputs." if msg is None else msg | |
| return (f"{msg} {args[-1]}",) | |
| def _try(func): | |
| def wrap(*args, **kwargs): | |
| try: | |
| return func(*args, **kwargs) |
| from distutils import util | |
| def _msg(args, msg=None): | |
| msg = "input value error, please check your inputs." if msg is None else msg | |
| return (f"{msg} {args[-1]}",) | |
| def _try(func): | |
| def wrap(*args, **kwargs): | |
| try: | |
| return func(*args, **kwargs) |
| def myDecorator(arg1, arg2, arg3=None): | |
| def wrap(f): | |
| def fun_wrap(self, *args, **kwargs): | |
| # TODO: before calling function | |
| print(f"before method call, {self.arg1}") | |
| f(self, *args, **kwargs) | |
| # TODO: after calling function | |
| print(f"after method call, {self.arg1}") | |
| return fun_wrap | |
| return wrap |
| class Decorator: | |
| profile = None | |
| workspace_id = None | |
| def __init__(self, profile="default"): | |
| self.profile = profile | |
| def make_pretty(func): | |
| def inner(self): | |
| print("I got decorated") | |
| func(self, self.profile) |
| # If you want to use Python 3 alonge with old NSO version which contains pyang issue to support python3 here are few steps | |
| # 1. we are convering the python syntax to support Python2 and Python3 | |
| # a. PEP 3113 | |
| # b. importing StringIO | |
| # 2. we are not planning to correct any ned's, we request to collect latest neds to support python3 | |
| File: NSO-<version>/lib/pyang/pyang/plugins/html.py | |
| # Existing: | |
| from cStringIO import StringIO | |
| # Updates: |