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
std::vector<std::string> split(const std::string &text, char sep) { | |
std::vector<std::string> tokens; | |
std::size_t start = 0, end = 0; | |
while ((end = text.find(sep, start)) != std::string::npos) { | |
tokens.push_back(text.substr(start, end - start)); | |
start = end + 1; | |
} | |
tokens.push_back(text.substr(start)); | |
return tokens; | |
} |
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
#!/usr/bin/python | |
import sys | |
if __name__ == "__main__": | |
if len(sys.argv) != 3: | |
print "Usage: otp.py <plaintext> <pad>" | |
exit(1) | |
plaintext = sys.argv[1].upper() | |
pad = sys.argv[2].upper() |
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
# Display a list of all connected Android devices | |
# Set ANDROID_SERIAL environment from selected item | |
# Example of use : # adb-setdev && adb install -r myapp.apk | |
function adb-setdev() | |
{ | |
devices=($(adb devices|grep "device$"|cut -f1)) | |
devices_count=${#devices[*]} | |
if [ "$devices_count" -eq "0" ] | |
then | |
unset ANDROID_SERIAL |