Skip to content

Instantly share code, notes, and snippets.

View cognivore's full-sized avatar
💭
https://doma.dev

cognivore

💭
https://doma.dev
View GitHub Profile
@cognivore
cognivore / loopy-graph.md
Created July 16, 2021 18:33
Stupid algorithm to enumerate loops in a graph
  1. Pick random vertex q
  2. Traverse the graph breadth-first until a loop is detected, then stop traversing that branch entirely
    1. If loops that have the same paths are detected on the same level, count only one of those
  3. Delete vertex q and go to 1
$remoteport = bash.exe -c "ifconfig eth0 | grep 'inet '"
$found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';
if( $found ){
$remoteport = $matches[0];
} else{
echo "The Script Exited, the ip address of WSL 2 cannot be found";
exit;
}