Instructions how to install Debian using debootstrap. Below instructions were verified to work with debootstrapping Debian 11.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import typing | |
import datetime | |
class Period(typing.NamedTuple): | |
""" | |
Value object representing a period in time | |
""" | |
start_dt: datetime.datetime # noqa (as flake8 doesn't support this syntax as of v3.3) | |
end_dt: datetime.datetime # noqa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
loop = asyncio.get_event_loop() | |
async def hello(): | |
await asyncio.sleep(3) | |
print('Hello!') | |
if __name__ == '__main__': | |
loop.run_until_complete(hello()) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Get running config from an IOS-XR device and print out some | |
# interface information. Shows how to use the jxmlease library | |
# for when you'd rather have JSON but have to deal with XML! | |
# | |
from ncclient import manager | |
import jxmlease | |
HOST = '127.0.0.1' | |
PORT = 8303 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
from BaseHTTPServer import HTTPServer | |
from SimpleHTTPServer import SimpleHTTPRequestHandler | |
class MyHandler(SimpleHTTPRequestHandler): | |
def do_GET(self): | |
if self.path == '/ip': | |
self.send_response(200) | |
self.send_header('Content-type', 'text/html') | |
self.end_headers() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# coding: utf-8 | |
""" Filename: __init__.py | |
Purpose: This file is required to structure the web service as a | |
package, to be able to define routes in multiple modules. | |
This is the most basic design pattern for multiple files | |
Flask apps: http://flask.pocoo.org/docs/patterns/packages/ | |
Requirements: | |
Author: Cédric Beuzit | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
## Tiny Syslog Server in Python. | |
## | |
## This is a tiny syslog server that is able to receive UDP based syslog | |
## entries on a specified port and save them to a file. | |
## That's it... it does nothing else... | |
## There are a few configuration parameters. | |
LOG_FILE = 'youlogfile.log' |