Skip to content

Instantly share code, notes, and snippets.

View RoyBellingan's full-sized avatar

Roy Bellingan RoyBellingan

View GitHub Profile
@RoyBellingan
RoyBellingan / test.cpp
Created March 25, 2025 18:12
test.cpp
//compile with time g++ t2.cpp -std=c++23
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <iterator>
#include <chrono>
#include <format>
import serial
import serial.rs485
import time
ser = serial.Serial(
#For iot Basic afaik is this one, for the advanced should be the USB0
port='/dev/ttyS2',
baudrate=9600,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
@RoyBellingan
RoyBellingan / empro.js
Created February 12, 2025 14:53
empro.js
var lastAenergy = 0;
var minPower = 0;
var maxPower = 0;
function loop(){
const devInfo = Shelly.getDeviceInfo();
const mac = devInfo.mac;
const name = devInfo.name
Shelly.call("Shelly.GetStatus", {}, function(result, error_code, error_message) {
if (error_code === 0) {
@RoyBellingan
RoyBellingan / pwm.c
Created December 18, 2024 03:54
pwm.c
//gcc pwm.c -lwiringPi -o pwm
#include <wiringPi.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
int main (int argc, char *argv[]){
if (argc != 4) {
printf("Usage: %s <pin> <pwmClockDivisor> <pwmDutyCycle>\n", argv[0]);
@RoyBellingan
RoyBellingan / Error.log
Last active July 18, 2024 14:06
Error.log
df: cannot read table of mounted file systems: No such file or directory
root@CTF01:~# [ 316.480066] EXT4-fs (mmcblk0p1): error count since last fsck: 3
[ 316.486064] EXT4-fs (mmcblk0p1): initial error at time 1720098557: __ext4_get_inode_loc_noinmem:4457: inode 30118: block 2251
[ 316.497395] EXT4-fs (mmcblk0p1): last error at time 1720098620: __ext4_get_inode_loc_noinmem:4457: inode 1139: block 440
*****
[ 3.062384] EXT4-fs (mmcblk0p1): recovery complete
[ 3.067217] EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Opts: (null)
[ 4.842205] EXT4-fs (mmcblk0p1): Couldn't remount RDWR because of unprocessed orphan inode list. Please umount/remount instead
<domain type="qemu">
<name>debian11-aarch64</name>
<uuid>96f04eae-5873-4232-9671-796515cb8faf</uuid>
<metadata>
<libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
<libosinfo:os id="http://debian.org/debian/11"/>
</libosinfo:libosinfo>
</metadata>
<memory unit="KiB">12337152</memory>
<currentMemory unit="KiB">12337152</currentMemory>
==> /var/log/dovecot-debug.log <==
Dec 04 18:09:32 auth: Debug: client in: AUTH 14 PLAIN service=imap secured session=3esMBbMLKMwAAAAAAAAAAAAAAAAAAAAB lip=::1 rip=::1 lport=143 rport=52264 resp=<hidden>
Dec 04 18:09:32 auth: Debug: pam([email protected],::1,<3esMBbMLKMwAAAAAAAAAAAAAAAAAAAAB>): Performing passdb lookup
Dec 04 18:09:32 auth-worker(9537): Debug: conn unix:auth-worker (pid=9536,uid=102): auth-worker<27>: Handling PASSV request
Dec 04 18:09:32 auth-worker(9537): Debug: conn unix:auth-worker (pid=9536,uid=102): auth-worker<27>: pam([email protected],::1,<3esMBbMLKMwAAAAAAAAAAAAAAAAAAAAB>): Performing passdb lookup
Dec 04 18:09:32 auth-worker(9537): Debug: conn unix:auth-worker (pid=9536,uid=102): auth-worker<27>: pam([email protected],::1,<3esMBbMLKMwAAAAAAAAAAAAAAAAAAAAB>): lookup service=dovecot
Dec 04 18:09:32 auth-worker(9537): Debug: conn unix:auth-worker (pid=9536,uid=102): auth-worker<27>: pam([email protected],::1,<3esMBbMLKMwAAAAAAAAAAAAAAAAAAAAB>): #1/1 style=
@RoyBellingan
RoyBellingan / Viaggio IT-IE 2023
Created April 21, 2023 17:20
Viaggio IT-IE 2023
26
Partenza alle 11 circa
arrivo a Reggio Emilia alle 16 circa
VR e abilitazione al combattimento Aria Aria fase 1
pernotto da Isaac
27
Mattinata di codice con Isaac e Suan,
VR e abilitazione al combattimento Aria Aria fase 2
pernotto da Isaac
_marker = createMarker ["_USER_DEFINED #857363706/14/1", [5474.61,10017.1,0]];
_marker setMarkerDir -84.0316;
_marker setMarkerType "marker_PN";
_marker setMarkerShape "ICON";
_marker setMarkerSize [1.2663,1.2663];
_marker setMarkerText "Buco Recinzione 1.4";
_marker setMarkerBrush "Solid";
_marker setMarkerColor "ColorWEST";
_marker setMarkerAlpha 1;
@RoyBellingan
RoyBellingan / vnv 5.sqf
Last active January 5, 2023 20:29
vnv 5.sqf
_marker = createMarker ["_USER_DEFINED #857363706/14/1", [5473.04,10006.7,0]];
_marker setMarkerDir -84.0316;
_marker setMarkerType "marker_PN";
_marker setMarkerShape "ICON";
_marker setMarkerSize [1.2663,1.2663];
_marker setMarkerText "Buco Recinzione 1.4";
_marker setMarkerBrush "Solid";
_marker setMarkerColor "ColorWEST";
_marker setMarkerAlpha 1;