This document outlines my findings after hacking with OpenVPN.
I had issues with the latest release of OpenVPN Connect but version 2.5.2 worked fine;
Download and install with the default parameters.
| package main | |
| import ( | |
| "archive/zip" | |
| "io" | |
| "os" | |
| ) | |
| func main() { | |
| a := "myArchive.zip" |
This document outlines my findings after hacking with OpenVPN.
I had issues with the latest release of OpenVPN Connect but version 2.5.2 worked fine;
Download and install with the default parameters.
| """flatlist | |
| Flatten a list of lists using list comprehension. | |
| """ | |
| from typing import List | |
| nest_list: List = [[1, 2, 3], [4, 5, 6]] | |
| flat_list: List = [item for sublist in nest_list for item in sublist] |
| n = [3, 5, 7] | |
| # This is our function `print_list` which takes `x` as an argument. | |
| # `x` is just a name we give it, it could be anything like... `cat` or `dog` | |
| # In real-world examples you would give your arguments meaningful names like `list_to_print` | |
| def print_list(x): | |
| # Likewise `i` is just a name we've given to a variable | |
| # You could call this `item` or in this case `number` | |
| for i in range(0, len(x)): | |
| # The line above is going to count from 0 to the length of the list we |
| # https://realpython.com/python-send-email/ | |
| # https://stackoverflow.com/a/12424439 | |
| import email, smtplib | |
| from email import encoders | |
| from email.mime.base import MIMEBase | |
| from email.mime.multipart import MIMEMultipart | |
| from email.mime.text import MIMEText |
This code snippet demonstrates how KwargsPower can take any number of **kwargs and it will store them as instance variables.
>>> class KwargsPower:
... def __init__(self, *args, **kwargs):
... for k, v in kwargs.items():
... self.__setattr__(k, v)
>>> kp = KwargsPower(a=1, b=2, c=3)
>>> kp.__dict__| # Here's the original string. | |
| _string = "abcdde" | |
| # Cast the string into a set of characters. | |
| # Remember sets have all unique elements. | |
| char_set = set(_string) | |
| # Create a string from the character set. | |
| unique_string = "".join(char_set) |
| class ListComp: | |
| @staticmethod | |
| def diff_a_b(a, b): | |
| """Returns difference of a and b.""" | |
| return list(set(a) - set(b)) |
| [loggers] | |
| keys=root | |
| [handlers] | |
| keys=fileHandler | |
| [formatters] | |
| keys=simpleFormatter | |
| [logger_root] |