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
$remoteport = bash.exe -c "ip addr show 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; | |
} |
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
def human_delta(tdelta): | |
""" | |
Takes a timedelta object and formats it for humans. | |
Usage: | |
# 149 day(s) 8 hr(s) 36 min 19 sec | |
print human_delta(datetime(2014, 3, 30) - datetime.now()) | |
Example Results: | |
23 sec |
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
// -------------------------------------- | |
// i2c_scanner | |
// | |
// Version 1 | |
// This program (or code that looks like it) | |
// can be found in many places. | |
// For example on the Arduino.cc forum. | |
// The original author is not known. | |
// Version 2, Juni 2012, Using Arduino 1.0.1 | |
// Adapted to be as simple as possible by Arduino.cc user Krodal |
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
import os | |
import sys | |
import traceback | |
from functools import wraps | |
from multiprocessing import Process, Queue | |
def processify(func): | |
'''Decorator to run a function as a process. | |
Be sure that every argument and the return value |
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
greek_alphabet = { | |
u'\u0391': 'Alpha', | |
u'\u0392': 'Beta', | |
u'\u0393': 'Gamma', | |
u'\u0394': 'Delta', | |
u'\u0395': 'Epsilon', | |
u'\u0396': 'Zeta', | |
u'\u0397': 'Eta', | |
u'\u0398': 'Theta', | |
u'\u0399': 'Iota', |