Skip to content

Instantly share code, notes, and snippets.

View 0x4f53's full-sized avatar
😼
sleeping

Owais Shaikh 0x4f53

😼
sleeping
View GitHub Profile
@0x4f53
0x4f53 / setup.sh
Last active September 19, 2023 10:26
Set up Luna Multiplayer on Ubuntu Server 20.04+
# GCP gives you $300 in free credits for a few months. Use it to host Luna Server!
wget https://github.com/LunaMultiplayer/LunaMultiplayer/releases/download/0.29.0/LunaMultiplayer-Client-Release.zip
unzip LunaMultiplayer-Client-Release.zip
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install -y dotnet-sdk-5.0
@0x4f53
0x4f53 / similar_word.py
Last active August 5, 2023 06:37
Check if a similar-looking word exists in a given string or paragraph.
def similar_word(string, substring):
threshold=2
def levenshtein_distance(s1, s2):
m, n = len(s1), len(s2)
dp = [[0] * (n + 1) for _ in range(m + 1)]
for i in range(m + 1):
for j in range(n + 1):
if i == 0: dp[i][j] = j
@0x4f53
0x4f53 / signature_checker.py
Last active January 1, 2022 17:12
Python script to compare Java LazySodium signed messages with PyNaCl signed messages using Keypairs from both locations. Designed for Keyspace.
"""
(c) 2021 Keyspace
Compares a LazySodium / LibSodium output from Keyspace Android with PyNaCl's output and checks if LazySodium's signatures match PyNaCl's signature.
Note: LazySodium output on Android and PyNaCl output from this script must be the same due to determinism.
______________________________________________________________________________________________________________________________________________________
.-------> Public key -----> Verify data
@0x4f53
0x4f53 / getticker.py
Created June 9, 2021 22:20
Get company ticker symbol / code from name in Python
import requests
def getTicker (company_name):
url = "https://s.yimg.com/aq/autoc"
parameters = {'query': company_name, 'lang': 'en-US'}
response = requests.get(url = url, params = parameters)
data = response.json()
company_code = data['ResultSet']['Result'][0]['symbol']
return company_code