Skip to content

Instantly share code, notes, and snippets.

install on unix like systems

sh <(curl -L https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume
# restart terminal session
nix --version

create nix shell

@lamoboos223
lamoboos223 / esp8266_output_to_arduino_uno.md
Last active April 1, 2024 03:17
connect esp8266 to output a value to arduino uno where arduino reads this value and do some action

Arduino code

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);   // Initialize the serial communication

  pinMode(7, INPUT);

}
from flask import Flask, request
from graphene import ObjectType, String, Schema, List, Field
'''
Pre-requesities: python3 -m pip install graphene flask
USAGE: open Postman and create new QraphQL request then paste this url: http://localhost:5000/graphql and these Queries ...
pip install jaeger-client
from jaeger_client import Tracer, SpanContext, Config

# Replace these with your actual configuration
SERVICE_NAME = "your-application-name"
COLLECTOR_HOST = "localhost"
import pika
import json

# Connect to RabbitMQ
connection = pika.BlockingConnection(
    pika.ConnectionParameters('localhost', 5672)
)
channel = connection.channel()
docker pull docker.elastic.co/elasticsearch/elasticsearch:7.17.15
docker pull docker.elastic.co/kibana/kibana:7.17.15
docker run -d --name elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.17.15
docker run -d --name kibana --link elasticsearch:elasticsearch -p 5601:5601 docker.elastic.co/kibana/kibana:7.17.15
sudo yum install rpm-build rpmdevtools
rpmdev-setuptree
cd /root
mkdir -p rpmbuild/sources/lama_git-1.0 rpmbuild/SPECS
cd rpmbuild/sources/lama_git-1.0
printf "
#!/bin/bash
git add .
git commit -m \"updated code\"
sudo raspi-config
sudo reboot
lsmod | grep spi
sudo apt-get update -y && sudo apt-get upgrade -y && sudo apt-get install -y python3-dev python3-pip && sudo pip install spidev mfrc522 && mkdir ~/pi-rfid && cd ~/pi-rfid
printf "
import RPi.GPIO as GPIO
from mfrc522 import SimpleMFRC522
reader = SimpleMFRC522()

print kernels for each video device

udevadm info --attribute-walk --name=/dev/video5 | grep "KERNELS"
sudo nano /etc/udev/rules.d/99-custom-camera.rules

add the following rules

@lamoboos223
lamoboos223 / rpicam-gstreamer.txt
Created June 27, 2023 10:44 — forked from muellermartin/rpicam-gstreamer.txt
Stream video from Raspberry Pi with camera attached to CSI port via RTP (UDP) using GStreamer
Useful Links:
- http://stackoverflow.com/questions/25941171/how-to-get-gstreamer1-0-working-with-v4l2-raspicam-driver
- http://raspberrypi.stackexchange.com/questions/26675/modern-way-to-stream-h-264-from-the-raspberry-cam
- http://stackoverflow.com/questions/13154983/gstreamer-rtp-stream-to-vlc
- http://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/gst/rtp/README
- http://archpi.dabase.com/#sending-and-receiving-pi-camera-video-over-the-network
- http://emmanuelgranatello.blogspot.de/2013/10/raspberry-pi-gstreamer-streaming-h264.html
- http://stackoverflow.com/questions/15712983/why-rtp-streaming-of-a-avi-video-file-fails-to-be-received