Skip to content

Instantly share code, notes, and snippets.

View laf's full-sized avatar

Neil Lathwood laf

View GitHub Profile
@laf
laf / 00-button
Last active December 30, 2021 08:12 — forked from abstrask/00-button
Scripts for OpenWrt on TP-Link TL-MR3020 to change network configs using 3-position sliding switch
# based on
# https://dev.openwrt.org/browser/trunk/target/linux/atheros/base-files/etc/hotplug.d/button/00-button
# https://forum.openwrt.org/viewtopic.php?pid=172110#p172110
. /lib/functions.sh
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
do_button () {
local button
#!/usr/bin/env python
"""Yale Smart Alarm python client which interacts with the Yale Smart Alarm products.
See https://github.com/laf/yale-smart-alarm for more information.
"""
import logging
import requests
_LOGGER = logging.getLogger(__name__)
Contributor Agreement
---------------------
By contributing code to LibreNMS (whether by a GitHub pull request, or by
any other means), you assert that:
- You have the rights to include the code, either as its original author,
or due to it being released to you under a compatible license.
- You are not aware of any third party claims on the code, including
@laf
laf / gist:4d31652016fef0b40d721384e4f6315c
Created March 5, 2018 09:58
Oxidized install from source
cd /root
git clone https://github.com/laf/oxidized/
git checkout ssh-auth-methods
gem build *.gemspec
gem uninstall oxidized
gem install oxidized-0.21.0.gem
@laf
laf / cisco-asa.php
Created January 31, 2018 15:46
Generate list of Cisco ASA vuln to cisco-sa-20180129-asa1
<?php
chdir(dirname($argv[0]));
$init_modules = array();
require realpath(__DIR__ . '/..') . '/includes/init.php';
$devices = dbFetchRows("SELECT `devices`.`device_id`, `hostname`, `version`, `hardware`, `mempool_total` FROM `devices` LEFT JOIN `mempools` ON `mempools`.`device_id`=`devices`.`device_id` WHERE `os`='asa' AND `mempool_descr` LIKE '%System Memory' GROUP BY `hostname`");
$v = [];
@laf
laf / keybase.md
Created January 19, 2018 15:31
keybase.md

Keybase proof

I hereby claim:

  • I am laf on github.
  • I am laf (https://keybase.io/laf) on keybase.
  • I have a public key ASDVQcByNq7vxQvF17XWIo956n64_f5sleeuGuyXSnkUbgo

To claim this, I am signing this object:

aad821c20 docs: Added alert rule mapping doc (#7748)
133313020 docs: Added how to add graph ports to dashboards (#7749)
864ee84e8 fix: enexus do not disable the os discovery module (#7745)
47a36b1ce fix: Fixed bgpPeers_cbgp discovery for junos (#7743)
22f4974eb docs: Add sudo guidelines for Proxmox (#7739)
ae1cb5e6c docs: Add sudo suggestion for SMART monitoring (#7738)
600b2f332 device: Added additional APC rPDU2 Sensors (#7490)
e6ba1ee79 (Rosiak/master) Merge pull request #7741 from murrant/two_gets_getHostOS
e4a775a9c docs: fix for VM images doc. (#7740)
d59695f08 fix: revert to two gets for sysDescr and sysObjectID Some devices don't like asking for them in one get for some reason.
rules:
- name: Lights
entities:
- light.ash_grove
states:
- state: 'on'
class: 'light-on'
- state: 'off'
class: 'light-off'
action:
dot1qTpFdbPort[0][6:0:a0:1d:51:d2].209 = 65
dot1qTpFdbPort[0][6:0:a0:1d:51:d2].210 = 65
dot1qTpFdbPort[0][6:0:a0:1d:51:d2].211 = 65
dot1qTpFdbPort[0][6:0:a0:1d:51:d2].212 = 65
dot1qTpFdbPort[0][6:0:a0:1d:51:d2].213 = 65
dot1qTpFdbPort[0][6:0:a0:1d:51:d2].214 = 65
dot1qTpFdbPort[0][6:0:a0:1d:51:d2].215 = 65
dot1qTpFdbPort[0][6:0:a0:1d:51:d2].216 = 65
dot1qTpFdbPort[0][6:0:a0:1d:51:d2].218 = 65
dot1qTpFdbPort[0][6:1:0:c:cc:cc].204 = 65
+----------------------------+--------------+------+-----+-------------------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------------------------+--------------+------+-----+-------------------+-------+
| port_id | int(11) | NO | PRI | NULL | |
| port_adsl_updated | timestamp | NO | | CURRENT_TIMESTAMP | |
| adslLineCoding | varchar(8) | NO | | NULL | |
| adslLineType | varchar(16) | NO | | NULL | |
| adslAtucInvVendorID | varchar(8) | NO | | NULL | |
| adslAtucInvVersionNumber | varchar(8) | NO | | NULL | |
| adslAtucCurrSnrMgn | decimal(5,1) | NO | | NULL | |