You can download Debian Live install images from the official website. Both the stable and testing releases are available. Choose the one that suits your needs.
-
Boot into the Live environment.
-
Open a terminal emulator.
You can download Debian Live install images from the official website. Both the stable and testing releases are available. Choose the one that suits your needs.
Boot into the Live environment.
Open a terminal emulator.
Timezones are a headache to begin with. Weird formats in how we represent time are even worse than having to deal with timezones. In Sri Lanka (and most of the world), when it comes to storing or sending date/time values, we go with the ISO 8601 format.
It basically avoids confusion compared to what the Americans use, as it’s more logical. We write everything in descending order. Otherwise, something like 01/02/03
could be Jan 2 or Feb 1 - and nobody would know. Sticking with ISO 8601 fixes this.
It stores your date/time like this. Note that the letter T
separates the date and time:
YYYY-MM-DDTHH\:MM\:SS
# based on: https://docs.python.org/3/library/ipaddress.html | |
import ipaddress | |
import typing | |
def is_ipcheck( | |
value: str, | |
check_type: typing.Literal[ | |
"addr", |
# based on: https://docs.python.org/3/library/ipaddress.html | |
import ipaddress | |
def is_ipaddr(input_str: str) -> bool: | |
""" | |
Checks if input string is a valid IP address (both IPv4 and IPv6). | |
Args: | |
input_str (str): The string to check. |
import re | |
def is_ipaddr(input_str: str) -> bool: | |
""" | |
Check if input string is a valid IP address (both IPv4 and IPv6). | |
Based on: | |
IPv4: https://stackoverflow.com/questions/5284147/validating-ipv4-addresses-with-regexp | |
IPv6: https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses | |
Args: |
Check weather the user request is from a mobile phone or a computer and perform actions accordingly with flask and python3
from flask import request, render_template
import re
browser = request.user_agent.browser
version = request.user_agent.version and int(request.user_agent.version.split('.')[0])
platform = request.user_agent.platform
uas = request.user_agent.string