Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View seefor's full-sized avatar
🎯
Focusing on work

Sif Baksh seefor

🎯
Focusing on work
View GitHub Profile
@NWMichl
NWMichl / check_website.py
Created March 13, 2022 16:33
Simple Website Checker: Compares the number of <keyword> mentions to a static value and notifies of changes by email
import requests
import smtplib
from email.mime.text import MIMEText
# Website Checker: Compares the number of <keyword> mentions to a static value and notifies of changes by email
url = 'www.example.com'
header = {'User-Agent': 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0'}
keyword = 'example'
@NWMichl
NWMichl / ise.yml
Created June 10, 2021 05:50
REST-Call to provision new device with Cisco ISE for TACACS access via Ansible
# REST-Call to provision new device with Cisco ISE for TACACS access
#
# The 'NetworkDeviceGroupList' in the request body needs to be adapted to your environment, or substituted with variables.
---
- name: ISE
hosts: test_switch
gather_facts: false
connection: network_cli
vars:
@pccasto
pccasto / LinkedInRecentPlease.user.js
Last active January 20, 2023 23:56
tampermonkey script to force LinkedIn feed to 'Recent', rather than 'Top'
// ==UserScript==
// @name LinkedIn Recent Feed
// @namespace http://tampermonkey.net/
// @version 0.4
// @description I always want my LinkedIn feed in chronological order!
// @downloadURL https://gist.github.com/pccasto/708b097ecbf1b9b8e22c30e450df804e/raw/ae930ab765918d7d0d74622e4176b300f2b85e12/LinkedInRecentPlease.user.js
// @author pcasto
// @include https://linkedin.com/*
// @include https://www.linkedin.com/*
// @exclude https://www.linkedin.com/tscp-serving/*
@Akendo
Akendo / netmask_to_cidr.py
Created May 24, 2017 11:23
Converting a netmask to CIDR with vanilla python
def netmask_to_cidr(m_netmask):
return(sum([ bin(int(bits)).count("1") for bits in m_netmask.split(".") ]))
@tianp
tianp / today_interval.js
Created May 5, 2015 06:59
Moment.js Get Today (24 hours) Timeframe Interval
var moment = require('moment')
// get this midnight and next moment object and convert into unix timestamp
// this midnight (1 minute after last midnight)
var thisMidnight = moment( moment().format('YYYY-MM-DD') + ' 00:01:00' ).unix()
// next midnight (1 minute before next midnight)
var nextMidnight = moment( moment().format('YYYY-MM-DD') + ' 23:59:00' ).unix()
@marcelom
marcelom / pysyslog.py
Created December 5, 2012 18:06
Tiny Python Syslog Server
#!/usr/bin/env python
## Tiny Syslog Server in Python.
##
## This is a tiny syslog server that is able to receive UDP based syslog
## entries on a specified port and save them to a file.
## That's it... it does nothing else...
## There are a few configuration parameters.
LOG_FILE = 'youlogfile.log'