Skip to content

Instantly share code, notes, and snippets.

@afaqk9394
afaqk9394 / claim-device-into-network.py
Created November 3, 2019 07:33
claim device into network
from meraki import meraki
api_key = 'e1cf05af36ef9fccf579a556537112fe66a60549'
org_id = '641762946900403561'
#New Network Details
my_name = 'FSN Dmeo'
@afaqk9394
afaqk9394 / Update-device-attribute.py
Created November 3, 2019 07:34
Update device attribute
from meraki import meraki
api_key = 'e1cf05af36ef9fccf579a556537112fe66a60549'
org_id = '641762946900403561'
#New Network Details
my_name = 'FSN Dmeo'
@afaqk9394
afaqk9394 / Interpret-unified-diff.py
Created November 3, 2019 07:40
Interpret a unified diff
import sys, os, difflib, argparse
from datetime import datetime, timezone
def file_mtime(path):
t = datetime.fromtimestamp(os.stat(path).st_mtime,
timezone.utc)
@afaqk9394
afaqk9394 / Interpret-unified-diff-Modified.py
Created November 3, 2019 07:41
Modified Python Code -Interpret a unified diff
import sys, os, difflib, argparse
from datetime import datetime, timezone
def file_mtime(path):
t = datetime.fromtimestamp(os.stat(path).st_mtime,
timezone.utc)
{
"items": [
{
"id": "Y2lzY29zcGFyazovL3VzL1JPT00vNjkyOTgyMzAtZWQyZC0xMWU5LThlNGItZGI4NmQ3ZGMwNmFl",
"title": "Unicorn",
{
"response": [
{
"family": "Switches and Hubs",
"errorCode": "DEV-UNREACHED",
{
"version": "1.0",
"response": [
{
"time": "2019-10-13T07:20:00.000+0000",
{
"response": {
"sites": [
{
"id": "e1e52245-62ea-4481-9b8f-222acd4dbc6e",
#!/bin/bash
# A simple two-variable example
myvariable=Hello
anothervar=World!
echo $myvariable $anothervar
---
- name: Network Available
hosts: all
connection: local #telling ansible to run the modules locally
gather_facts: false #telling ansible to not to collect variable information from the network devices