Friday, 15 March 2019

Tuesday, 12 March 2019

Top 10 Machine learning python packages

Numpy
Scipy
Pandas
Matplotlib
Scikit-learn
Six
Tensorflow
Requests
Python-dateutil
Pytz

Friday, 22 February 2019

compare two different paragraph line by line in Python


from difflib import HtmlDiff

text_A= """
1) line number 1
2) line number 2
3) line number n
"""

text_B= """
2) line number 2
3) line number n
4) line number raghu
"""




delta_html = HtmlDiff().make_file(text_A.splitlines(),
                                  text_B.splitlines())

with open('diff.html', 'w') as f:
     f.write(delta_html)

Thursday, 21 February 2019

compare two different files line by line in Python

import difflib
from difflib import HtmlDiff


with open('show_run_SW-VSS_2019-02-05.txt') as f1:
    f1_text = f1.read()
with open('show_run_SW-VSS_2019-02-01.txt') as f2:
    f2_text = f2.read()



delta_html = HtmlDiff().make_file(f1_text.splitlines(),
                                  f2_text.splitlines())

with open('diff22.html', 'w') as f:
     f.write(delta_html)

Tuesday, 19 February 2019

mongo db query ( group , aggregate ) to fetch latest network backup




 db.backup.aggregate({$unwind: '$backupDoc'},{$match: { "backupDoc.status": "success" }},{$group: {"_id" : "$deviceIp",lastdate: {$max: "$backupDoc.datetime"}}

Saturday, 9 February 2019

Checking Firewall Status and Stopping Firewall in centos



[root@DSCenWeb01 ~]# sudo firewall-cmd --state
running
[root@DSCenWeb01 ~]# sudo systemctl stop firewalld

Friday, 8 February 2019

Celery Beat To Schedule Multiple Tasks




CELERY_BROKER_URL = 'redis://localhost:6379'
CELERY_RESULT_BACKEND = 'redis://localhost:6379'
CELERY_ACCEPT_CONTENT = ['application/json']
CELERY_RESULT_SERIALIZER = 'json'
CELERY_TASK_SERIALIZER = 'json'
CELERY_TIMEZONE = 'Asia/Kolkata'
CELERY_BEAT_SCHEDULE = {
    'NetworkBackup': {
      'task': 'NetworkAutomation.views.bkpSchedule',
      #'schedule': timedelta(seconds=3600),
      'schedule': crontab(minute=0, hour="*/6"),
    },
    'copyBkpFromAnsibletoJenkins': {
      'task': 'NetworkAutomation.views.copyBkpFromAnsibletoJenkins',
      #'schedule': crontab(minute="*/3"),
      'schedule': crontab(minute=0, hour="*/1"),
    },
    'copyBkpFromJenkinstoDjango': {
      'task': 'NetworkAutomation.views.copyBkpFromJenkinstoDjango',
      #'schedule': crontab(minute="*/2"),
      'schedule': crontab(minute=0, hour="*/1"),
    },

}

Git

1 git add ↳ It lets you add changes from the working directory into the staging area 2 git commit ↳ It lets you save a snapshot of currently...