Skip to content

Instantly share code, notes, and snippets.

Avatar

Narasimha nnelluri928

  • CISCO SYSTEMS
  • Cupertino CA
View GitHub Profile
View os_module_notes.md

In [22]: import os

In [23]: os.path.dirname("/Users/nnelluri/Desktop/nnelluri/python3-proj/add_device.py") Out[23]: '/Users/nnelluri/Desktop/nnelluri/python3-proj'

In [24]: import pathlib

In [25]: path=pathlib.Path("/Users/nnelluri/Desktop/nnelluri/python3-proj/add_device.py")

In [26]: path.parent

View itertools_module_notes.md

In [30]: num_list = [1, 2, 3]

In [31]: from itertools import combinations

In [32]: comb = combinations(num_list,2)

In [33]: for pair in list(comb): ...: print(pair) ...: (1, 2)

View os_module_notes.md

In [22]: import os

In [23]: os.path.dirname("/Users/nnelluri/Desktop/nnelluri/python3-proj/add_device.py") Out[23]: '/Users/nnelluri/Desktop/nnelluri/python3-proj'

In [24]: import pathlib

In [25]: path=pathlib.Path("/Users/nnelluri/Desktop/nnelluri/python3-proj/add_device.py")

In [26]: path.parent

View DcokerNotes.md

1.create Docker File azureuser@netbox01:~/docker$ cat > Dockerfile << EOF

FROM centos:latest RUN apt-get install -y httpd COPY file1.txt /var/www/html CMD ["/sbin/httpd", "-D", "FOREGROUND"] EOF azureuser@netbox01:~/docker$ cat Dockerfile FROM centos:latest RUN apt-get install -y httpd