It is possible to use curl to query the LXD unix.socket directly:
curl --unix-socket /var/lib/lxd/unix.socket http:/1.0/containers | jq .
Example output:
{
It is possible to use curl to query the LXD unix.socket directly:
curl --unix-socket /var/lib/lxd/unix.socket http:/1.0/containers | jq .
Example output:
{
#!/usr/bin/env bash | |
## | |
# @author Jay Taylor [@jtaylor] | |
# @date 2013-08-15 | |
# | |
# @description CloudFlare management script. | |
# | |
# Path ENV VAR override. |
#!/usr/bin/env python3 | |
""" | |
JSON object merge tool. | |
Based on mergedeep and Python3 JSON Stream State Machine. | |
References: | |
https://github.com/clarketm/mergedeep |
Python programs to remove or modify files without changing the modification time of the parent directory.
curl -fSLO https://gist.github.com/jaytaylor/e2e0b53baf224f4e973b252370499de7/raw/bc175ba7008626ebc3f356c16f8240ebe578c5a0/rm_preserving_parent_mtime.py
curl -fSLO https://gist.github.com/jaytaylor/e2e0b53baf224f4e973b252370499de7/raw/bc175ba7008626ebc3f356c16f8240ebe578c5a0/mv_preserving_parent_mtime.py
chmod a+x rm_preserving_parent_mtime.py mv_preserving_parent_mtime.py
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Removes a file or directory while preserving the modification time (mtime) of | |
the parent directory. | |
Pure-python implementation. | |
See also: |
Author: Jay Taylor
Date: 2019-07-08
Purpose: Created as a C++ reference for SO: How do I create a URL shortener?.
# | |
# Mac OS-X does not come with the delightfully useful `timeout` program. Thankfully a rough BASH equivalent can be achieved with only 2 perl statements. | |
# | |
# Originally found on SO: http://stackoverflow.com/questions/601543/command-line-command-to-auto-kill-a-command-after-a-certain-amount-of-time | |
# | |
function timeout() { perl -e 'alarm shift; exec @ARGV' "$@"; } | |
## Example usage: | |
# |
import time | |
from werkzeug.serving import BaseRequestHandler | |
class MyFancyRequestHandler(BaseRequestHandler): | |
"""Extend werkzeug request handler to suit our needs.""" | |
def handle(self): | |
self.fancyStarted = time.time() | |
rv = super(MyFancyRequestHandler, self).handle() | |
return rv |
Sort .gitmodules, also easily adaptable to sort files in blocks (e.g. 4 lines at a time, or arbitrary region at a time).
See also:
#!/usr/bin/env bash
#!/usr/bin/env bash | |
## | |
# | |
# @author Jay E. Taylor <jay@jaytaylor.com> | |
# | |
# @description Math functions for bash! | |
# | |
## |