Skip to content

Instantly share code, notes, and snippets.

@Ramblurr
Ramblurr / find_iface.yml
Created Oct 28, 2020
Ansible find interface name given an ip address on Linux and FreeBSD
View find_iface.yml
---
# Answer from Vladimir Botka @ https://serverfault.com/questions/1040246/how-to-select-network-interface-given-ip-address-in-ansible-across-debian-and-fr/1040273#1040273
# Tested on Ansible 2.10
# can this be simplified? Watch https://github.com/ansible/ansible/issues/69638
- name: find interface name assigned given ip address
hosts: all
vars:
ip_find_iface: "10.1.0.51"
freebsd_query: >-
View gungnir-postgres.clj
(:requrie [next.jdbc.result-set :as rs]
[next.jdbc.prepare :as prepare]
[gungnir.model :as model]
[jsonista.core :as json]
[honeysql.format :as hf])
;; given a table
;; CREATE TABLE example ( id int GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, json_value JSONB );
;; and the corresponding model
(model/register!
View gist:57b57b6bcb40ae21944ff4c94e34d128
prebuild-install WARN install No prebuilt binaries found (target=12.16.1 runtime=node arch=x64 platform=linux)
make: Entering directory '/var/home/ramblurr/src/screeps/screepers/screeps-multimeter/node_modules/bufferutil/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
In file included from ../../nan/nan_converters.h:67,
from ../../nan/nan.h:202,
from ../src/bufferutil.cc:7:
../../nan/nan_converters_43_inl.h: In static member function ‘static Nan::imp::ToFactoryBase<v8::Boolean>::return_t Nan::imp::ToFactory<v8::Boolean>::convert(v8::Local<v8::Value>)’:
../../nan/nan_converters_43_inl.h:18:51: warning: ‘v8::MaybeLocal<v8::Boolean> v8::Value::ToBoolean(v8::Local<v8::Context>) const’ is deprecated: ToBoolean can never throw. Use Local version. [-Wdeprecated-declarations]
18 | val->To ## TYPE(isolate->GetCurrentContext()) \
| ^
View ansible-recipes.yaml
# a collection of ansible copypastas
▄▄▖▄▄▖▄▄▖▄▄▖▄▄▖▄▄▖▄▄▖▄▄▖
# get python/pip package installed version
- name: check PACKAGENAME version
shell: pip list [--user] --format=json | jq --raw-output '.[] | select(.name == "PACKAGENAME").version'
register: PACKAGENAME_installed_version
changed_when: false
▄▄▖▄▄▖▄▄▖▄▄▖▄▄▖▄▄▖▄▄▖▄▄▖
View col-small.json
[{"imdb": "tt0287467", "title": "Talk to Her"}, {"imdb": "tt0169024", "title": "Megacities"}, {"imdb": "tt0185125", "title": "All About My Mother"}, {"imdb": "tt0088763", "title": "Back to the Future"}, {"imdb": "tt0416320", "title": "Match Point"}, {"imdb": "tt0096874", "title": "Back to the Future Part II"}, {"imdb": "tt0373926", "title": "The Interpreter"}, {"imdb": "tt0099088", "title": "Back to the Future Part III"}, {"imdb": "tt0097165", "title": "Dead Poets Society"}, {"imdb": "tt0441909", "title": "Volver"}, {"imdb": "tt0276751", "title": "About a Boy"}, {"imdb": "tt0067185", "title": "Harold and Maude"}, {"imdb": "tt0347048", "title": "Head-On"}, {"imdb": "tt0162426", "title": "Short Sharp Shock"}, {"imdb": "tt0116209", "title": "The English Patient"}, {"imdb": "tt0052357", "title": "Vertigo"}, {"imdb": "tt0060196", "title": "The Good, the Bad and the Ugly"}, {"imdb": "tt0390221", "title": "Maria Full of Grace"}, {"imdb": "tt0048624", "title": "Sissi"}, {"imdb": "tt0049762", "title": "Sissi: The Youn
View DF Hack Cheat Sheet.md
@Ramblurr
Ramblurr / imgur-cleanup.js
Created Nov 24, 2017
Imgur: Mobile Cleanup
View imgur-cleanup.js
// ==UserScript==
// @name Imgur: Mobile Cleanup
// @namespace https://github.com/Zren/
// @description Cleanup m.imgur.com and always load all images in the album.
// @icon https://imgur.com/favicon.ico
// @author Zren
// @version 2
// @include https://m.imgur.com/*
// @grant GM_addStyle
// ==/UserScript==
@Ramblurr
Ramblurr / gist:f11b023d93ad94ff9ae457d59b870543
Last active Sep 27, 2017
Preact + Hyperx + Calmm/Karet (No Babel and No JSX)
View gist:f11b023d93ad94ff9ae457d59b870543
https://jsfiddle.net/2y9jes63/20/
https://jsbin.com/wesosuxifu/edit?js,output
@Ramblurr
Ramblurr / OpenWRT | OpenVPN | PIA - README.md
Created Aug 28, 2017 — forked from yan-foto/ OpenWRT | OpenVPN | PIA - README.md
OpenWRT configurations to run OpenVPN client | Private Internet Access - https://www.privateinternetaccess.com
View OpenWRT | OpenVPN | PIA - README.md

This gist contains all the OpenWRT configuraion files needed to connect to Private Internet Access (PIA) VPN servers. The following files are included:

  • network: contains configuration to add a virtual network device (i.e. tun1366) and custom DNS servers
  • openvpn: OpenVPN configuration file to connect to PIA VPN servers
  • firewall: firewall configuration which passes all traffic through VPN and rejects any request when OpenVPN is down

NOTE: there are a number of other files required to be available under /etc/openvpn for this approach to work:

  • pia.auth: VPN credentials in two lines, first the username and the second the password
View keybase.md

Keybase proof

I hereby claim:

  • I am ramblurr on github.
  • I am caseylink (https://keybase.io/caseylink) on keybase.
  • I have a public key ASCb33jInVGl6pol9gDuCX-VwHm5ylRpPYKgjFO5TmEnFQo

To claim this, I am signing this object: