Skip to content

Instantly share code, notes, and snippets.

View yeled's full-sized avatar

Charlie Allom yeled

  • London
View GitHub Profile
@yeled
yeled / napalm_cli.py
Last active August 1, 2017 12:18
napalm_cli.py
DOCUMENTATION = '''
---
module: napalm_cli
author: "Charlie Allom - based on napalm_ping Jason Edelman (@jedelman8)"
version_added: "2.2"
short_description: "Executes CLI commands and returns response using NAPALM"
description:
- "This module logs into the device, issues a ping request, and returns the response"
requirements:
- napalm
@yeled
yeled / lsp_bw.sh
Created July 30, 2017 14:23
snmp scrape LSP bandwidths from your router
#!/bin/bash
set -e
HOST=$1
COMMUNITY=$2
# http://www.juniper.net/documentation/en_US/junos12.3/topics/reference/mibs/mib-jnx-mpls.txt
# The number of octets that have been forwarded over current LSP active path.
LSP_BYTES=".1.3.6.1.4.1.2636.3.2.3.1.3"
-- === sizeup ===
--
-- SizeUp emulation for hammerspoon
--
-- To use, you can tweak the key bindings and the margins
local sizeup = { }
--------------
-- Bindings --
@yeled
yeled / gist:1e98d6d3074227660304e9b1d9c2cfad
Created July 7, 2017 12:35
turris lspci #450 (visible wlan0)
13:32 mp01~[] % ssh [email protected]
[email protected]'s password:
BusyBox v1.25.1 (2017-06-20 23:41:24 CEST) built-in shell (ash)
_______ _ _ _____ _____ _____ _____
|__ __|| | | || __ \ | __ \ |_ _| / ____|
| | | | | || |__) || |__) | | | | (___
| | | | | || _ / | _ / | | \___ \
11:10 YELP-CHARLIE~[[email protected]] % notmuch search --output=files id:[email protected]
/Users/charlie/Maildir//Users/charlie/1496310617.wxsvfx8agi.charlie_evilforbeginners.com
/Users/charlie/Maildir/1496310617.wxsvfx8agi.charlie_evilforbeginners.com
From 701f6f5c89e061d05734839821f3a20c149e93ad Mon Sep 17 00:00:00 2001
From: Charlie Allom <[email protected]>
Date: Wed, 31 May 2017 13:51:27 +0100
Subject: [PATCH] [PATCH] searches: Shift+tab to previous unread
---
src/modes/saved_searches.cc | 52 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
diff --git src/modes/saved_searches.cc src/modes/saved_searches.cc
@yeled
yeled / -
Created May 23, 2017 18:15
gmi broken
(venv) 19:12 YELP-CHARLIE~/Maildir/[email protected][[email protected]] % PYTHONPATH=~/src/notmuch/bindings/python/ ~/src/gmailieer/gmi sync
receiving metadata: 0%|▏ | 1/283 [00:01<08:57, 1.91s/it]remote: could not find remote message: 15c1a7da7a8b9360!
receiving metadata: 100%|███████████████████████████████████████████▊| 282/283 [00:02<00:00, 99.54it/s]
resolving changes: 0%| | 0/283 [00:00<?, ?it/s]Traceback (most recent call last):
File "/Users/charlie/src/gmailieer/gmi", line 8, in <module>
g.main ()
File "/Users/charlie/src/gmailieer/lieer/gmailieer.py", line 136, in main
args.func (args)
File "/Users/charlie/src/gmailieer/lieer/gmailieer.py", line 186, in sync
self.push (args, True)
@yeled
yeled / broken_import.applescript
Last active May 21, 2017 18:23
shouldn't this be in Logbook / aka completed?
tell application "OmniFocus"
get class of item 3 of every flattened task of default document whose in inbox = true
--> inbox task
get number of tasks of item 3 of every flattened task of default document whose in inbox = true
--> 0
(*Migrating an inbox task*)
get name of item 3 of every flattened task of default document whose in inbox = true
--> "Please Confirm Your Email Address"
get note of item 3 of every flattened task of default document whose in inbox = true
--> "[Sent to Mail Drop address yeled.rk8bv]
@yeled
yeled / which_key.c
Last active May 15, 2017 14:46
find what gdk code is pressed
#include <gtk/gtk.h>
static gboolean
key_event(GtkWidget *widget,
GdkEventKey *event)
{
g_printerr("%s\n",
gdk_keyval_name (event->keyval));
return FALSE;
}
class Astroid < Formula
desc "A graphical threads-with-tags style, lightweight and fast, email client for notmuch, inspired by sup and others"
homepage "http://astroidmail.github.io/"
# not necessary for homebrew but nice to only bump it in one place
version "0.9.1"
url "https://github.com/astroidmail/astroid/archive/v#{version}.tar.gz"
sha256 "7d58a813a9e8f840475226a254743e0caf50f1baf830256ce17e135b71f34714"
head "https://github.com/astroidmail/astroid.git"