Skip to content

Instantly share code, notes, and snippets.

View olanystrom's full-sized avatar

Ola Nyström olanystrom

  • Zadeo AB
  • Stockholm, Sweden
  • 09:58 (UTC +02:00)
View GitHub Profile
#!/bin/env python3
#
# https://adventofcode.com/2019/day/2
#
# Ola Nyström <ola@ofelbar.se>
from pprint import pprint
realcode = "1,0,0,3,1,1,2,3,1,3,4,3,1,5,0,3,2,6,1,19,1,19,5,23,2,10,23,27,2,27,13,31,1,10,31,35,1,35,9,39,2,39,13,43,1,43,5,47,1,47,6,51,2,6,51,55,1,5,55,59,2,9,59,63,2,6,63,67,1,13,67,71,1,9,71,75,2,13,75,79,1,79,10,83,2,83,9,87,1,5,87,91,2,91,6,95,2,13,95,99,1,99,5,103,1,103,2,107,1,107,10,0,99,2,0,14,0".split(',')
realcode[1] = "12"
realcode[2] = "2"
@olanystrom
olanystrom / polisapi.py
Created April 25, 2019 12:42
Polis to slack bot
#!/bin/env python3
import requests
import json
import logging
from diskcache import Cache
from datetime import datetime
logging.basicConfig(
filename='polisapi.log',
level=logging.INFO,
#!/bin/bash
#
# Written by Ola Nyström <olanys@gmail.com>
#
# Fetches Interface information and puts in a textfile, use with alias or the like to
# get information from descriptionfields and vlan id on cisco switches and routers
#
# Example in bash function
# function office() { grep "$@" /var/rancid/switchports-office;}
#