Create env with docker:
docker run --rm --name buster --tty --detach debian:buster
docker exec buster bash -c 'apt-get update && apt-get install bash -y'
docker exec -ti buster /bin/bash
Create a script with the trap function in it
import re | |
import apt | |
from json import dumps | |
from distutils.version import LooseVersion | |
def cmp_to_key(mycmp): | |
'Convert a cmp= function into a key= function' | |
class K: | |
def __init__(self, obj, *args): |
Create env with docker:
docker run --rm --name buster --tty --detach debian:buster
docker exec buster bash -c 'apt-get update && apt-get install bash -y'
docker exec -ti buster /bin/bash
Create a script with the trap function in it
#!/usr/bin/env python | |
# Write a method palindrome_chain_length which | |
# - takes a positive number and | |
# - returns the number of special steps needed to obtain a palindrome. | |
# The special step is: | |
# - "reverse the digits, and add to the original number". | |
# If the resulting number is not a palindrome, | |
# repeat the procedure with the sum | |
# until the resulting number is a palindrome. | |
# |
Output of elinks
$ elinks -dump http://localhost/server-status
Apache Server Status for localhost (via ::1)
Server Version: Apache/2.4.25 (Debian)
Server MPM: event
Server Built: 2018-06-02T08:01:13
os-release:
# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
master
:Help on module memory:
NAME
memory - Class for persisting information in opsdroid.
CLASSES
builtins.object
Kwame enterprises, un nuevo startup en el valle de la silicona desea migrar sus 2 aplicaciones a un ambiente cloud computing. Applicaciones:
La infrastrutura deberá ser distribuida en GCP and AWS mediante clusters Kubernetes, deberá contar con la capacidad de poder ser facilmente re-creados.
Los componentes utilitarios para para la infrastructura entre otros son:
#!/usr/bin/python | |
import pandas as pd | |
import numpy as np | |
import matplotlib | |
matplotlib.use('agg') | |
import matplotlib.pyplot as plt | |
from newspaper import Article |
#!/usr/bin/python | |
from random import choice | |
from signal import Signals | |
from os import listdir, kill | |
def main(): | |
while true: | |
# Get random a signal | |
lucky_signal = choice(list(Signals)) |