Skip to content

Instantly share code, notes, and snippets.

View alessandromrc's full-sized avatar
🤍

alessandromrc

🤍
  • Breaking stuff as a job
  • 0xC0000005
View GitHub Profile
@alessandromrc
alessandromrc / Cloudflare DNS Auto Configurator.bat
Created November 2, 2022 21:37
Auto Configurator for Cloudflare DNS made with batch for windows
@echo off
Title Cloudflare DNS Auto Configurator
set first_server= "1.1.1.1"
set second_server= "1.0.0.1"
:checkPrivileges
NET FILE 1>NUL 2>NUL
if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges )
@alessandromrc
alessandromrc / vectors.js
Created October 20, 2022 22:53
Simple implementation of Vector3 and Vector2 in Javascript
const Vector3 = class {
x = 0;
y = 0;
z = 0;
constructor(x, y, z) {
this.x = x;
this.y = y;
this.z = z;
@alessandromrc
alessandromrc / get_certificate.sh
Created July 25, 2022 14:46
Generate certificates.h for Portenta H7 in order to connect to websites that use SSL
if [ -z "$1" ];
then echo "execute ./get_certificate.sh <domain_name>";
else
openssl s_client -showcerts -connect ["$1"]:443 </dev/null | sed -n -e '/-.BEGIN/,/-.END/ p' > certifs.pem
xxd -i certifs.pem </dev/null | sed -e 's/unsigned char .* = {/const unsigned char cacert_pem[] = {/g' -e 's/unsigned int .* = .*;//g' > certificates.h
echo "unsigned int cacert_pem_len = sizeof(cacert_pem);" >> certificates.h
rm certifs.pem
echo "Done, check certificates.h!"
fi