Skip to content

Instantly share code, notes, and snippets.

View henricavalcante's full-sized avatar
🏠
Working from home

Henri Cavalcante henricavalcante

🏠
Working from home
View GitHub Profile
@henricavalcante
henricavalcante / imx7-README.md
Created June 3, 2025 14:44 — forked from liquidx/imx7-README.md
Reflashing a TechNexion PICO-PI-IMX7

By: Alastair Tse @liquidx

Updated: 2021-12-05

This is a guide for installing Linux on a Technexion NXP IMX7 board. This is a board that was part of the Android Things Starter Kit (now discontinued).

There are some dead ends in this guide where I got to a point where I failed. I'm documenting this so that it can help anyone else who is trying the same thing.

Before starting, there are a few useful sources of information:

@henricavalcante
henricavalcante / gist:9079d671ee7c7c42f15e7038355d4dcd
Created March 7, 2025 12:20
Install cuda 12.4 on ubuntu 24.4 for containers
wget https://developer.download.nvidia.com/compute/cuda/12.4.0/local_installers/cuda_12.4.0_550.54.14_linux.run
sudo sh cuda_12.4.0_550.54.14_linux.run
echo 'export PATH=/usr/local/cuda-12.4/bin:$PATH' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=/usr/local/cuda-12.4/lib64:$LD_LIBRARY_PATH' >> ~/.bashrc
source ~/.bashrc
sudo apt install -y nvidia-container-toolkit
sudo systemctl restart docker
@henricavalcante
henricavalcante / stream.sh
Created December 19, 2023 21:33
ffmpeg rtsp -> rtmp
ffmpeg -f lavfi -i anullsrc \
-rtsp_transport tcp -i "rtsp://" -tune zerolatency \
-t 12:00:00 -pix_fmt + -vsync 0 \
-c:v libx264 -vcodec libx264 -b:v 13500k -s 2560x1440 \
-c:a aac -b:a 128k \
-strict experimental \
-f flv "rtmp://a.rtmp.youtube.com/live2/{key}" -nostdin -nostats
@henricavalcante
henricavalcante / async.php
Created November 15, 2023 14:39
PHP Async Example
<?php
$counter = 1;
function aJob(bool $async, int $pid) {
sleep(1);
global $counter;
echo "Async:" . ($async ? "true" : "false");
echo " Pid:" . $pid;
@henricavalcante
henricavalcante / travazap.js
Created October 20, 2023 18:06
Paste on console and gg.
async function enviarScript(scriptText){
const lines = scriptText.split(/[\n\t]+/).map(line => line.trim()).filter(line => line);
main = document.querySelector("#main"),
textarea = main.querySelector(`div[contenteditable="true"]`)
if(!textarea) throw new Error("Não há uma conversa aberta")
setInterval(() => {
textarea.focus();
@henricavalcante
henricavalcante / instrucoes.md
Last active May 8, 2019 03:37
Instruções Hackathon Now 2019

Interface para os usuários do sebraelab terem acesso à agenda de disponibilidade do espaço.

Interface para a solicitação de espaço no sebraelab bem como o gerenciamento das informações e liberação de acesso.

Script de automatização de um processo interno onde um script será executado para coletar informações e cadastrar em um calendário.

Segue abaixo credenciais para consumir a api do sistema do sebrae:

window.open(Array.prototype.slice.call(document.getElementsByClassName('_vbtk2')).map((a) => a.href ).sort(() => .5 - Math.random())[0])
@henricavalcante
henricavalcante / package.json
Last active April 26, 2017 04:13
Webpack + AngularJS Boilerplate
{
"name": "repo",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "webpack --config webpack.build.js --bail -p",
"deploy": "webpack --config webpack.build.js --bail -p && firebase deploy",
"dev": "node_modules/.bin/webpack-dev-server --history-api-fallback --hot --inline --progress"
},
@henricavalcante
henricavalcante / form-validation.js
Last active September 11, 2016 11:10
Old form validation
<!-- Hide the script from old browsers
function containsblanks(s)
{
for(var i = 0; i < s.value.length; i++)
{
var c = s.value.charAt(i);
if ((c == ' ') || (c == '\n') || (c == '\t'))
{
alert('The field must not contain whitespace');
return false;

Keybase proof

I hereby claim:

  • I am henricavalcante on github.
  • I am henricavalcante (https://keybase.io/henricavalcante) on keybase.
  • I have a public key whose fingerprint is 7668 381B E98B 142E 17CC 5489 BECE F255 256A 5AC5

To claim this, I am signing this object: