Skip to content

Instantly share code, notes, and snippets.

@Ayke
Ayke / OpenCV on TX2.md
Last active January 1, 2024 19:02
Install OpenCV 4 on Jetson TX2

OpenCV version: 4.3.0 Python version: 3.6

Prerequisite

Required libraries

sudo apt-get update
sudo apt-get install curl libssl-dev
sudo apt-get install ffmpeg
package frc.robot.util;
public class Deadband {
private double minValue;
private double m;
private double deadband;
public Deadband(double minValue, double deadband) {
this.minValue = minValue;
m = calcM(minValue, deadband);
@mathiasvr
mathiasvr / cie1931.py
Last active October 21, 2024 21:08
Convert LED brightness to PWM value based on CIE 1931 curve.
# Generate lookup table for converting between perceived LED brightness and PWM
# Adapted from: https://jared.geek.nz/2013/feb/linear-led-pwm
# See also: https://ledshield.wordpress.com/2012/11/13/led-brightness-to-your-eye-gamma-correction-no/
from sys import stdout
TABLE_SIZE = 256 # Number of steps (brightness)
RESOLUTION = 2**10 # PWM resolution (10-bit = 1024)
@arastu
arastu / fucker.sh
Created August 11, 2018 14:44
delete all docker resource
#!/usr/bin/env bash
docker ps -a -q | xargs docker rm -f
docker images -a -q | xargs docker rmi -f
docker volume ls -q | xargs docker volume rm -f
docker network ls | xargs docker network rm
docker system prune -f
@nohamelin
nohamelin / xseei.import.js
Last active October 28, 2022 10:45
Import search engines in only-WebExtensions Mozilla Firefox builds
// -sp-context: browser
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
* xseei.import.js
* ===============
* code-revision 2
* https://gist.github.com/nohamelin/8e2e1b50dc7d97044992ae981487c6ec
@hrshovon
hrshovon / build_opencv_ARM_cross
Last active May 21, 2022 17:10
Cross compile opencv3.3.0 for your raspberry pi and similar ARM devices with python support
This is a note on how to cross compile opencv for pretty much any ARM device(HardFP supported in this case) and deploy. Native
compiling in ARM devices can be painfully slow and they seem to hang often during build(mine got stuck at 43%). So if you happen
to have a desktop/laptop/server running ubuntu or similar linux distro, u can build opencv in fractionth of the time taken for
native compiling without any issues.
Building opencv3 with TBB and NEON and VFP support can boost opencv performance. Thanks to Adrian at pyimagesearch for pointing
that out.
Both my PC and target machine aka orange pi zero are running ubuntu 16.04 with python2.7 and python 3.5.
Let us use the term "build machine" for your PC where you are building opencv and "target machine" for the ARM single board computer.
1.Run the following commands in both machines(I think installing these in target machine only would do) to install the necessary libraries etc.(mine worked with them,so they should be enough
@grenade
grenade / 01-generate-ed25519-ssh-key.sh
Last active December 4, 2024 13:28
generate ed25519 ssh and gpg/pgp keys and set file permissions for ssh keys and config
#!/bin/bash
mkdir -p ~/.ssh
# generate new personal ed25519 ssh keys
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob thijssen <rthijssen@gmail.com>"
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_robtn -C "rob thijssen <rob@rob.tn>"
# generate new host cert authority (host_ca) ed25519 ssh key
# used for signing host keys and creating host certs