Client sends a request, then server parses and then processes the request, finally send a response to the client, which parses it and consumes.
- Web, HTTP, DNS. SSH
- RPC (Remote Procedure Call)
The latest builds of Windows 10 and Windows 11 include a build-in SSH server and client that are based on OpenSSH. This means now you can remotely connect to Windows 10/11 or Windows Server 2019 using any SSH client, like Linux distros. Let's see how to configure OpenSSH on Windows 10 and Windows 11, and connect to it using Putty or any other SSH client.
OpenSSH is an open-source, cross-platform version of Secure Shell (SSH) that is used by Linux users for a long time. This project is currently ported to Windows and can be used as an SSH server on almost any version of Windows. In the latest versions of Windows Server 2022/2019 and Windows 11, OpenSSH is built-in to the operating system image.
Uses Jquery to write console-style output to pretend stuff is happening.
Code is a dmesg grabbed randomly from PasteBin.
A Pen by Andrew Tunnecliffe on CodePen.
| from requests import get | |
| response = get("https://inventwithpython.com/dictionary.txt") | |
| dictionary: list[str] = response.text.strip().split("\n") | |
| palindromes: list[str] = [] | |
| for word in dictionary: | |
| if word.lower()[:] == word.lower()[::-1]: | |
| palindromes.append(word) |
| # Python 3.6 and later have the secrets module, which uses the operating system’s source of truly random numbers (often gathered from random events, such as the time between the user’s keystrokes). The function secrets.randbelow() can return truly random numbers between 0 and up to but not including the argument passed to it. | |
| # The functions in secrets are slower than the functions in random, so the functions in random are preferred when true randomness is not needed. You can also use the secrets.choice() function, which returns a randomly chosen value from the string or list passed to it. | |
| import secrets | |
| def main() -> None: | |
| secrets.randbelow(10) | |
| secrets.choice(['cat', 'dog', 'mouse']) | |
| secrets.choice('ABCDEFGHIJKLMNOPQRSTUVWXYZ') | |
| if __name__ = "__main__": |
| def gcd(a: int | float, b: int | float): | |
| while a != 0: | |
| a, b = b % a, a | |
| return b |
| |-- | |
| | |-- main.py | |
| | |-- script.ipynb | |
| |-- .vscode | |
| | |-- settings.json | |
| |-- test | |
| | |-- test.py |
| # Matrix | |
| matrix = [ | |
| [1, 2, 3], | |
| [4, 5, 6], | |
| [7, 8, 9] | |
| ] | |
| def print_primary_diagonal(matrix: list): | |
| for i in range(0, len(matrix)): |
| # Say you have the boring task of finding every phone number and email address in a long web page or document. | |
| # If you manually scroll through the page, you might end up searching for a long time. | |
| # But if you had a program that could search the text in your clipboard for phone numbers and email addresses, you could simply press ctrl-A to select all the text, press ctrl-C to copy it to the clipboard, and then run your program. | |
| # It could replace the text on the clipboard with just the phone numbers and email addresses it finds. | |
| import re | |
| import pyperclip | |
| EMAIL_REGEX = r"([a-zA-Z0-9+._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+)" |