- Data Types and Variables - https://www.baeldung.com/java-primitives
- Access Modifiers - https://www.baeldung.com/java-access-modifiers
- If-Else
- Loops - https://www.baeldung.com/java-loops
- OOP Concepts - https://www.baeldung.com/java-oop
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
#------------------- Requirements ------------------------ | |
pip install bcrypt | |
#------------------- Hashing Password --------------------- | |
import bcrypt | |
passwd = b'xyz123' | |
salt = bcrypt.gensalt() |
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
# AES 256 encryption/decryption using pycrypto library | |
""" | |
used Python version: | |
-------------------- | |
Python3.8 | |
requirements: | |
------------ | |
pip3 install -U PyCryptodome |
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 functools | |
def memoize(obj): | |
cache = {} | |
@functools.wraps(obj) | |
def memoizer(*args, **kwargs): | |
if args not in cache: | |
cache[args] = obj(*args, **kwargs) | |
return cache[args] |
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 json | |
import aiohttp | |
url = "http://127.0.0.1:5005/webhooks/rest/webhook" | |
data = '{"sender":"218311","message":"english"}' | |
async def aiohttp_session(): | |
async with aiohttp.ClientSession() as session: | |
async with session.post(url, data=data) as r: | |
return await r.json() if r.status ==200 else await r.text |
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 aiohttp | |
async def call_url(session): | |
url = "http://127.0.0.1:5005/webhooks/rest/webhook" | |
data = '{"sender":"218311","message":"english"}' | |
response = await session.post(url=url, data=data) | |
return response | |
# async def call_with_aiohttp(): |
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
$ modprobe bridge | |
$ echo "net.bridge.bridge-nf-call-iptables = 1" >> /etc/sysctl.conf | |
$ sysctl -p /etc/sysctl.conf | |
sysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-iptables: No such file or directory sysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-ip6tables: No such file or directory | |
# SOLUTION | |
$ modprobe br_netfilter | |
$ sysctl -p /etc/sysctl.conf |
1.) Download a Nerd Font
2.) Unzip and copy to ~/.fonts
3.) Run the command fc-cache -fv
to manually rebuild the font cache
NewerOlder