This file contains hidden or 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
//----------------------------------------------------------------------------- | |
// Toggle write protection on USB drives | |
// | |
// See http://support.microsoft.com/kb/555443 | |
// [ HKLM\System\CurrentControlSet\Control\StorageDevicePolicies\WriteProtect: reg_dw: 1 ] | |
// | |
// NOTES: | |
// - This registry hack (KB555443) works only starting from XP SP2; I don't check for the SP. | |
// - If a drive is already attached, write enable seems to come in effect immediately; | |
// Write disable becomes effective only after the drive is re-attached. |
This file contains hidden or 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/python3 | |
''' | |
Converts a binary file into an intel hex file | |
Usage: Bin2Hex.py [-A base_address] [-n] [-F yes|no] -b <binary_file> -o <hex_to_be_created> | |
[email protected] 05-aug-2022 | |
Original: https://community.silabs.com/s/article/converting-binary-firmware-image-files-to-intel-hex-files-bin-to-hex-x | |
''' |
This file contains hidden or 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/python3 | |
""" | |
Echo client / TCP | |
Parameters: set below: server IP address, port=7, timeouts | |
Message random generated, binary; length and data random : see make_random_msg() | |
NOTE: First message takes very long time, don't set REPLY_TIMEOUT too short! | |
pa01 23-dec-2019 | |
""" | |
import socket |
This file contains hidden or 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
// Phys monitor control via DDC/CI or VESA commands | |
// (David Lowndes) | |
// From https://social.msdn.microsoft.com/Forums/en-US/5437ddb8-af86-4cf0-8061-798e6601e08e/how-to-control-system-brightness-using-windows-api-?forum=windowsgeneraldevelopmentissues#554b7b7f-0aab-429d-9c36-fd39608979b0 | |
#include <Windows.h> | |
#include <physicalmonitorenumerationapi.h> | |
#include <highlevelmonitorconfigurationapi.h> | |
#pragma comment( lib, "Dxva2.lib" ) | |
void |
This file contains hidden or 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
// Read EDIDs from all displays via WMI ... | |
// https://docs.microsoft.com/en-us/windows/desktop/wmicoreprov/wmimonitorraweedidv1block | |
using System; | |
using System.Management; | |
namespace edid_dump { | |
class edid_dump | |
{ | |
static void Main(string[] args) |
This file contains hidden or 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
// Detect the proper COM ports for paired BT devices by name prefix | |
// [email protected] 12-feb-2019 | |
#include "pch.h" | |
#define _CRT_SECURE_NO_WARNINGS 1 | |
#include <vector> | |
#include <tuple> | |
#include <string> | |
#include <process.h> | |
#include <iostream> |
This file contains hidden or 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
: Pass path to sanitize as arg 1 | |
@echo off | |
echo Original path=[%~1] | |
call :chkspaces "%~1" | |
if /I NOT "%_sp%" == "%~1" call :shrt "%~1" | |
echo uglified=[%_sp%] | |
goto :EOF | |
:chkspaces |
This file contains hidden or 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
//////////////////////////////////////////////////////////////////////////////////////////////////////// | |
/// Print to kernel debugger from user mode | |
/// | |
/// Usage: | |
/// | |
/// ULONG getKdPrintPointers(void); | |
/// int isKdPrintAvailable(void); | |
/// | |
/// ULONG KdPrintEx((ULONG ComponentId, ULONG Level, PCHAR Format, ...)); | |
/// ULONG KdPrintExWithPrefix((PCHAR prefix, ULONG ComponentId, ULONG Level, PCHAR Format, ...)); |
This file contains hidden or 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
KBD KbdRuPh "Russian Phonetic Smile v1 (Linux style)" | |
COPYRIGHT "(c) 2006-2008 [email protected]" | |
COMPANY "[email protected]" | |
LOCALENAME "ru-RU" | |
LOCALEID "00000419" |
This file contains hidden or 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
This is a preprocessor that converts C printf-like statements in C code to something like Linux bprintf and extracts format strings. | |
It can be used in small embedded systems to save memory and processing time on target. | |
The following describes our custom implementation for a 32-bit LE machine (Tensilica Xtensa CPU & xcc toolchain). One can tweak it as needed. | |
Limitations: | |
* Limitation of the parser: ...... see in the py file | |
* Limitation of codegen: ....... ditto. | |
Mainly, all arguments must be scalar. | |
Format %s is supported only for constant strings (string literals, __func__ or __FUNCTION__) |
NewerOlder