Skip to content

Instantly share code, notes, and snippets.

@edgimar
edgimar / snmptrap_listener.py
Created November 24, 2020 01:57
Sample python3 code for listening to SNMP trap events
#!/usr/bin/env python3
"""
Heavily borrowed from https://stackoverflow.com/q/33752602
dependencies:
sudo apt install python3-pysnmp4 python3-pyasn1
To run:

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@edgimar
edgimar / archive-with-ancestors.el
Last active October 1, 2023 19:30
Org-mode archive function that includes ancestor tree structure when copying
(require 'org-archive)
; Set the function to use for org-archive-default (C-c C-x C-a)
; (setq org-archive-location (concat org-directory "/archive/%s_archive::"))
; (setq org-archive-location "archive/archived_%s::")
(setq org-archive-location "::* ARCHIVED")
; unmap org-archive-subtree
(define-key org-mode-map (kbd "C-c C-x C-s") nil)
@edgimar
edgimar / copy-org-mode-link.js
Last active July 7, 2022 21:02
User-script to copy the currently browsed web-page and selected content to the clipboard for pasting into org-mode