Copy from arago sysroot those files:
./usr
./usr/lib
./usr/bin
./usr/bin/myhomeapp
./lib
./lib/libtinfo.so.5
./lib/libdl.so.2
static void encodeBase16(char* const dst, const void* const src, const unsigned size) { | |
static const uint8_t table[] = "0123456789ABCDEF"; | |
char* d = dst; | |
const uint8_t* s = static_cast<const uint8_t*>(src); | |
const uint8_t* const sEnd = s + size; | |
while (s < sEnd) { | |
const uint8_t c = *s; | |
*d = table[c >> 4]; |
#include <chrono> | |
#include <iostream> | |
#include <thread> | |
int main() { | |
using namespace std::chrono; | |
std::string line; | |
auto t = steady_clock::now(); | |
while (std::cin >> line) { | |
const auto now = steady_clock::now(); |
; Map Caps-Lock to ESC (single press) and Ctrl (long press) | |
#InstallKeybdHook | |
SetCapsLockState, alwaysoff | |
Capslock:: | |
Send {LControl Down} | |
KeyWait, CapsLock | |
Send {LControl Up} | |
if ( A_PriorKey = "CapsLock" ) | |
{ |
bool stringsCompare(const std::string& a, const std::string& b) | |
{ | |
for (int i = 0; i < a.size() && i < b.size(); ++i) | |
{ | |
if (a[i] != b[i]) | |
{ | |
fprintf(stderr, "At index %i: %c != %c\n", i, a[i], b[i]); | |
return false; | |
} | |
else |
inline void printHex(const uint8_t* s, unsigned size) | |
{ | |
for (unsigned i = 0; i != size; ++i) | |
{ | |
if (s[i] > ' ' && s[i] <= '~') | |
{ | |
printf("'%c' %02x ", s[i], (int)s[i]); | |
} | |
else |
Copy from arago sysroot those files:
./usr
./usr/lib
./usr/bin
./usr/bin/myhomeapp
./lib
./lib/libtinfo.so.5
./lib/libdl.so.2
#!/bin/bash | |
init() { | |
ip link set can0 type can bitrate 250000 | |
ip link set can0 up | |
} | |
rawdump() { | |
candump can0 | |
} |
VirtualBox gust screen resolution doesn't work well under i3wm, sometime it get stuck at some strange resolution.
This script can fix the window size.
From the guest side, we use VBoxManage to tell the guest that a new resolution is available.
Window is made floating, then the border is removed (it count as width/height), then the window is resized.
Unmanaged C code:
typedef void(read_fun_t)(void* user_data, const char* data, int data_len);
int native_consume_all(native_handler handler, void* user_data, read_fun_t* read_fun);
Managed C++ code:
#!/bin/bash | |
init() { | |
ip link set can0 type can bitrate 250000 | |
ip link set can0 up | |
} | |
rawdump() { | |
candump can0 | |
} |