Skip to content

Instantly share code, notes, and snippets.

View lrodorigo's full-sized avatar

Luigi Rodorigo lrodorigo

  • Italy
View GitHub Profile
import traceback
import requests
import time
while True:
try:
c = requests.get("http://www.google.com")
print("Connection Alive.")
except Exception:
print(traceback.format_exc())
import random
import networkx as nx
from networkx.exception import NetworkXNoCycle
class Node(object):
def __init__(self, name, dependencies):
self.name = name
{
"daily_profiles": {
"giorno_lavorativo": [
{
"start": 0,
"end": 3600, // Secondi a partire dalla mezzanotte
"target_temperature": 19
},
{
@lrodorigo
lrodorigo / advanced-docker-cleaner.py
Created June 18, 2018 16:29
advanced-docker-cleaner.py
import re
from glob import glob
import docker
import os
from subprocess import Popen, PIPE
try:
from config import BALENA_HOST
#ifndef MIND_DDS_PROCESSINGQUEUE_H
#define MIND_DDS_PROCESSINGQUEUE_H
#include <condition_variable>
#include <vector>
#include <functional>
#include <thread>
#include <iostream>
#include <third_party/easylogging/easylogging++.h>
#include <queue>
[ 277.499132] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work mailbox command 6
[ 277.601864] falcon 154c0000.nvenc: Direct firmware load for tegra18x/nvhost_nvenc061.fw failed with error -2
[ 277.611905] falcon 154c0000.nvenc: Falling back to user helper
[ 277.619602] falcon 154c0000.nvenc: failed to get firmware
[ 277.625097] falcon 154c0000.nvenc: failed to get firmware
[ 277.630554] falcon 154c0000.nvenc: nvhost_flcn_init_sw: failed
[ 277.636598] __arm_smmu_context_fault: 87048 callbacks suppressed
[ 277.642656] arm-smmu 12000000.iommu: Unhandled context fault: iova=0x00000000, fsynr=0x1, cb=19, sid=7(0x7 - NVENC), pgd=0, pud=0, pmd=0, pte=0
[ 283.723193] host1x 13e10000.host1x: vision-manager: syncpoint id 24 (154c0000.nvenc_videosource:src_0) stuck waiting 1, timeout=-1
[ 283.735056] ---- syncpts ----
@lrodorigo
lrodorigo / watch.sh
Created March 17, 2019 10:17
Watch for file changes in sh
#!/bin/sh
FILE_TO_WATCH=$1
OLD=`sha1sum $FILE_TO_WATCH`
NEW=$OLD
while true; do
sleep 1
static xmodem_status xmodem_handle_packet(uint8_t header) {
/* Contains received data and 2 bytes CRC16 */
uint8_t received_data[X_PACKET_1024_SIZE + X_PACKET_CRC_SIZE];
/* Contains the remaining part of the header: the packet number and the 1-complement of the packet number
Note: does not contains the first-byte of the header (which is passed to this function) */
uint8_t received_header[X_PACKET_HEADER_SIZE];
xmodem_status status = X_OK;
@lrodorigo
lrodorigo / CMakeLists.txt
Last active February 22, 2024 13:21
Memcpy Benchmark
cmake_minimum_required(VERSION 3.16)
project(test_memcpy)
add_compile_options(-march=native)
set(CMAKE_CXX_STANDARD 14)
add_executable(test_memcpy main.cpp)
target_link_libraries(test_memcpy pthread)
class Prova {
public:
bool dataValid() {
return abs(this->data - INVALID_VALUE) > 1;
}
protected: