Skip to content

Instantly share code, notes, and snippets.

View inovizz's full-sized avatar
🐍
Focusing

Sanchit Balchandani inovizz

🐍
Focusing
View GitHub Profile
@shubham1172
shubham1172 / container.py
Last active March 4, 2020 14:01
HydPy February Container Snippet
import os
import sys
import unshare
import random
import string
import cgroups
if len(sys.argv) == 1:
print(f"Usage {sys.argv[0]} cmd args")
sys.exit(1)
@coltenkrauter
coltenkrauter / fix-wsl2-dns-resolution
Last active April 24, 2024 17:00
Fix DNS resolution in WSL2
More recent resolution:
1. cd ~/../../etc (go to etc folder in WSL).
2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line).
3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line).
4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian).
5. cd ~/../../etc (go to etc folder in WSL).
6. sudo rm -Rf resolv.conf (Delete the resolv.conf file).
7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and
secondary.
@vasanthk
vasanthk / System Design.md
Last active April 24, 2024 17:22
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@kracekumar
kracekumar / hashmap.py
Last active November 25, 2021 08:05
Hash Map implementation in Python
### Hash implementation in python
def custom_hash(key):
"""
Return the hash value of the given key. Uses dbj2
@param key: String or unicode
"""
result = 5381
multiplier = 33
@yosemitebandit
yosemitebandit / openpyxl-install-with-pip
Created June 4, 2012 17:42
reading xlsx files in python with openpyxl
$ pip install -E ~/conf/virtualenvs/xyuml https://bitbucket.org/ericgazoni/openpyxl/get/1.5.8.zip