- com0com and com2tcp must be installed on the Windows machine (https://sourceforge.net/projects/com0com/)
- socat must be installed on the linux box.
- Optional, to log the communication (on windows) install hub4com (part of the com0com project).
This code is tested on the RX651 Test board, with the R5F565NEDDFP MCU,
Compiled using CC-RX v3.06.00, and utilizing r_bsp 7.42 and r_flash_rx v5.11
It is expected that this code can be used on at least other RX MCU's from Renesas.
Not all of the tested features are expected to work on all of the various RX MCU's.
$connectedInterfaces = Get-NetAdapter | Where-Object { $_.Status -eq 'Up' } | |
$connectedInterfaces | ForEach-Object { | |
$interfaceAlias = $_.Name | |
$dnsServers = Get-DnsClientServerAddress -InterfaceIndex $_.InterfaceIndex -AddressFamily IPv4 | Select-Object -ExpandProperty ServerAddresses | |
$interfaceMetric = (Get-NetIPInterface -InterfaceIndex $_.InterfaceIndex).InterfaceMetric | Select-Object -First 1 | |
for ($i = 0; $i -lt $dnsServers.Count; $i++) { | |
[PSCustomObject]@{ | |
InterfaceAlias = $interfaceAlias | |
InterfaceMetric = [string]$interfaceMetric |
This code is a macro written in Jinja2, a powerful template engine for Python. This macro, named var_dump, works similarly to PHP's var_dump() function. It helps to print or display structured information about variables, especially useful for debugging.
The var_dump macro takes four parameters:
-
var
: The variable you want to display. -
var_name
: The name of the variable (this is optional, and its default value is an empty string). -
space
: The indentation level (this is optional, and its default value is 0).
import pkg_resources | |
import subprocess | |
import sys | |
import importlib | |
import pprint | |
def install(package): | |
print(f'\n=======> Checking status of {package}:', flush=True) | |
try: | |
dist = pkg_resources.get_distribution(package) |
// ==UserScript== | |
// @name F1 key interception on Google Sheets to suppress the Help | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Interception of F1 keypress on Google Sheets and replaces default behavior with nothing. | |
// @author Flemming Steffensen | |
// @match https://docs.google.com/spreadsheets/* | |
// @grant none | |
// ==/UserScript== |
# | |
# $Id$ | |
# | |
# This program is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU General Public License | |
# as published by the Free Software Foundation; either version 2 | |
# of the License, or (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
def swap_bytes(byte_string): | |
""" | |
Swaps every second byte in an string. If string is uneven, the last byte is untouched. | |
1 2 3 4 becomes 2 1 4 3 | |
1 2 3 4 5 becomes 2 1 4 3 5 | |
""" | |
return b"".join([(byte_string[i:i + 2])[::-1] for i in range(0, len(byte_string), 2)]) |
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# https://github.com/jobec/rfc5424-logging-handler | |
# Documentation: https://rfc5424-logging-handler.readthedocs.io/en/latest/ | |
import sys | |
import logging | |
from rfc5424logging import Rfc5424SysLogHandler, Rfc5424SysLogAdapter | |
logger = logging.getLogger('RFC5424_Syslog_test_ApplicationName') |