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
--- testdata_original_delete 2019-07-30 12:14:25.430923889 +0000 | |
+++ testdata_original 2019-07-30 12:13:13.064253409 +0000 | |
@@ -561,6 +561,8 @@ | |
ansanotify:116/tcp | |
mcidas:112/tcp | |
gppitnp:103/tcp | |
+mpm-flags:44/tcp | |
+smtp:25/tcp | |
nimbusdb:48004/tcp | |
jvl-mactalk:47100/udp |
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
--- testdata_thash_output_sorted 2019-07-30 07:56:15.926762046 +0000 | |
+++ testdata_original 2019-07-30 07:57:44.266766721 +0000 | |
@@ -114,6 +114,7 @@ | |
adapt-sna:1365/tcp | |
adcp:7508/tcp | |
adi-gxp-srvprt:6769/tcp | |
+admind:3279/tcp | |
admind:8403/tcp | |
admins-lms:2692/tcp | |
adobeserver-1:1102/tcp |
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
(lldb) | |
Process 27249 stopped | |
* thread #1, name = 't_hash', stop reason = step over | |
frame #0: 0x00005555555554bc t_hash`h_search(hTable=0x0000555555559260, key="400") at myhash.c:134:30 | |
131 else { | |
132 // looking for the key inside the next element of the linked list | |
133 char* keyAtNextValue = hTable->h_items[resultHash]->h_next->h_key; | |
-> 134 while( nextValue->h_next != NULL) { | |
135 fprintf(stderr, "Found a collision, traversing Linked list at address %p, key is: %s", | |
136 nextValue, nextValue); |
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
Name=Later This Evening | |
ColorForeground=#959595 | |
ColorBackground=#222222 | |
ColorCursor=#424242 | |
ColorPalette=#2b2b2b;#d45a60;#afba67;#e5d289;#a0bad6;#c092d6;#91bfb7;#3c3d3d; | |
#454747;#d3232f;#aabb39;#e5be39;#6699d6;#ab53d6;#5fc0ae;#c1c2c2 |
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
type # concepts | |
BasicValue[T] = concept v | |
v.value is T | |
MinValue[T] = concept v | |
v is BasicValue[T] | |
v.min is T | |
MaxValue[T] = concept v | |
v is BasicValue[T] | |
v.max is T |
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
''' | |
Requires paramiko >=1.8.0 (paramiko had an issue with multiprocessing prior | |
to this) | |
Example code showing how to use netmiko for multiprocessing. Create a | |
separate process for each ssh connection. Each subprocess executes a | |
'show version' command on the remote device. Use a multiprocessing.queue to | |
pass data from subprocess to parent process. | |
Only supports Python2 |
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
#!/usr/bin/env python | |
#-*- coding:utf8 -*- | |
# sources | |
# 1. https://gist.github.com/tell-k/4943359#file-paramiko_proxycommand_sample-py-L11 | |
# 2. https://github.com/paramiko/paramiko/pull/97 | |
# info: http://bitprophet.org/blog/2012/11/05/gateway-solutions/ | |
# local -> proxy-server -> dest-server | |
# ~/.ssh/config | |
# | |
# Host proxy-server |
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
class MyClass(object): | |
"""A simple class example""" | |
# Class OBJECTS support two kinds of operations | |
# 1. Attribute reference | |
# 2. Instantiation | |
i = 12345 | |
def something(self): | |
print 'printing - hello world' | |
return "returning - Hi" |
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
class User(UserMixin, db.Model): | |
__tablename__ = 'users' | |
id = db.Column(db.Integer, primary_key=True) | |
name = db.Column(db.String(16), index=True, unique=True) | |
username = db.Column(db.String(16), index=True, unique=True) | |
password_hash = db.Column(db.String(64)) | |
def set_password(self, password): |
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
units = [1 << (8*i) for i in range(3,-1,-1)] | |
def ip_to_int(ip): | |
return sum(int(byte) * unit for(byte,unit) in zip(ip.split('.'), units)) | |
def int_to_ip(i): | |
return '.'.join(str((i/bit) & 0xff) for bit in units) | |
start_ip = '1.0.0.0' | |
end_ip = '1.0.0.255' |