Skip to content

Instantly share code, notes, and snippets.

View mnogu's full-sized avatar

Muneyuki Noguchi mnogu

View GitHub Profile
diff --git a/src/Graph.cpp b/src/Graph.cpp
index e4385fb..7431ce3 100644
--- a/src/Graph.cpp
+++ b/src/Graph.cpp
@@ -709,6 +709,7 @@ bool Graph::getEffectiveNodeOrOptimalFunnel(uint32_t &effectiveNode, uint32_t &n
}
}
}
+ return true;
}
@mnogu
mnogu / post.py
Created October 17, 2023 09:47
post with a mention
#
# $ python -m pip install chitose
# $ IDENTIFIER=xxx.bsky.social PASSWORD=aaaa-bbbb-cccc-dddd ACTOR=yyy.bsky.social python3 post.py
#
import json
import os
from datetime import datetime
from datetime import timezone
from chitose import BskyAgent
@mnogu
mnogu / Cargo.toml
Last active November 24, 2022 14:38
ICMP test with a TUN interface tun0 on Ubuntu 22.04.1 LTS using Rust
[package]
name = "pareiodon"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
nix = "0.25.0"
@mnogu
mnogu / Cargo.toml
Created November 12, 2022 13:29
Make the state of tap0 up on Ubuntu 22.04.1 LTS with Rust (mkdir src && mv main.rs src && sudo cargo run)
[package]
name = "pareiodon"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
nix = "0.25.0"
@mnogu
mnogu / Cargo.toml
Created November 12, 2022 12:03
Create a TAP interface on Ubuntu 22.04.1 LTS with Rust (mkdir src && mv main.rs src && sudo cargo run)
[package]
name = "pareiodon"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
nix = "0.25.0"
@mnogu
mnogu / Cargo.toml
Last active November 23, 2022 23:27
Assign 192.0.2.1 to tap0 on Ubuntu 22.04.1 LTS with Rust (mkdir src && mv main.rs src && sudo cargo run)
[package]
name = "pareiodon"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
nix = "0.25.0"
@mnogu
mnogu / clang_error.txt
Created September 15, 2022 12:49
Please ensure Xcode packages are up-to-date — try running 'xcodebuild -runFirstLaunch'.
2022-09-15 21:41:29.694 xcodebuild[5077:210143] [MT] DVTPlugInLoading: Failed to load code for plug-in com.apple.dt.IDESimulatorAvailability (/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin), error = Error Domain=NSCocoaErrorDomain Code=3588 "dlopen(/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability, 0x0109): Symbol not found: (_OBJC_CLASS_$_SimDiskImage)
Referenced from: '/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability'
Expected in: '/Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator'" UserInfo={NSLocalizedFailureReason=The bundle couldn’t be loaded., NSLocalizedRecoverySuggestion=Try reinstalling the bundle., NSFilePath=/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability, NSDebugDescription=dlopen(/Applications/Xcode.app/Contents/PlugIns/IDESimulat
@mnogu
mnogu / bs.py
Created August 30, 2020 09:18
binary search memo
from typing import List
import bisect
def binary_search(a: List[int], num: int):
min_idx = 0
max_idx = len(a) - 1
while min_idx <= max_idx:
mid_idx = (min_idx + max_idx) // 2
curr = a[mid_idx]
@mnogu
mnogu / fix_for_big_ip_edge_client.sh
Created December 29, 2018 04:25
Workaround for a bug in BIG-IP Edge Client
#!/bin/bash
# Workaround for a bug in BIG-IP Edge Client 7130.2015.0807.1 on macOS Mojave
#
# You can find the following error log messages if you encounter this bug:
# "Disconnected state, Error code, Routing table cannot be patched"
# "EXCEPTION - Initial patching for v6 failed, 4294967295"
# "Adding include route was failed"
# NET_IF depends on your Mac environment.
# You can find candidates of NET_IF with the following command:
@mnogu
mnogu / gist:6ae02c53cfbe520e6c112259e4fd7818
Last active May 3, 2016 04:18
NullPointerException from StructuredSyntaxDocumentFilter.replaceMetaCharacters() with groovyConsole in groovy 2.4.6 and Google Japanese Input 2.17.2400.1
$ bin/groovyConsole
2016-05-03 12:44:30.764 java[2439:206562] An uncaught exception was raised
2016-05-03 12:44:30.764 java[2439:206562] NSConcreteAttributedString initWithString:: nil value
2016-05-03 12:44:31.114 java[2439:206562] (
0 CoreFoundation 0x00007fff903554f2 __exceptionPreprocess + 178
1 libobjc.A.dylib 0x00007fff88c7073c objc_exception_throw + 48
2 CoreFoundation 0x00007fff903bc4bd +[NSException raise:format:] + 205
3 Foundation 0x00007fff8e4b5255 -[NSConcreteAttributedString initWithString:] + 132
4 liblwawt.dylib 0x000000010f9473fe -[AWTView attributedSubstringForProposedRange:actualRange:] + 135
5 AppKit 0x00007fff87fba58d -[NSTextInputContext(NSInputContext_WithCompletion) attributedSubstringForProposedRange:completionHandler:] + 105