Skip to content

Instantly share code, notes, and snippets.

View nemesifier's full-sized avatar
🎯
Focusing

Federico Capoano nemesifier

🎯
Focusing
View GitHub Profile
@kostko
kostko / gist:9b6eb44f373e17891d65
Last active August 29, 2015 14:08
Example JSON serialization of nodewatcher v3 schema
{
"uuid": "64840ad9-aac1-4494-b4d1-9de5d8cbedd9",
"general": {
"name": "node-1",
"device": "tp-wr743ndv1",
"build_channel": "stable",
"version": null
},
"location": {
"address": "Foo Street 17",
@haggen
haggen / string.random.lua
Last active June 30, 2024 02:30
Random strings in Lua
math.randomseed(os.time())
local charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
function string.random(length)
if length > 0 then
return string.random(length - 1) .. charset:sub(math.random(1, #charset), 1)
else
return ""
end
@alces
alces / ansible_local_playbooks.md
Last active May 6, 2025 11:00
How to run an Ansible playbook locally
  • using Ansible command line:
ansible-playbook --connection=local 127.0.0.1 playbook.yml
  • using inventory:
127.0.0.1 ansible_connection=local
@asfaltboy
asfaltboy / responses-mixin.py
Last active February 22, 2019 14:24
A responses TestCase Mixin
"""
A unittest.TestCase mixin that allows using the
responses (https://pypi.python.org/pypi/responses/) package in tests.
Usage
-----
Install responses with `pip install responses`.
Add `ResponsesMixin` to your `TestCase` parent classes instead of using