Skip to content

Instantly share code, notes, and snippets.

View robinvanemden's full-sized avatar
🌳
⏩ ⏩

Robin van Emden robinvanemden

🌳
⏩ ⏩
View GitHub Profile
#!/bin/bash
default_branch=`basename $(git symbolic-ref --short refs/remotes/origin/HEAD)`
git checkout --orphan tmp
git add -A # Add all files and commit them
git commit
git branch -D $default_branch # Deletes the default branch
git branch -m $default_branch # Rename the current branch to default
git push -f origin $default_branch # Force push default branch to github
@robinvanemden
robinvanemden / reset.sh
Last active January 29, 2022 19:33
Reset Scailable Edge AI Manager
#!/bin/bash
echo ""
echo "========================================================================"
echo "= Welcome to the Scailable Edge AI Manager Test Install ="
echo "========================================================================"
echo ""
# run as:
#
@robinvanemden
robinvanemden / howtojetsonxrdp.md
Last active November 7, 2021 18:27
How to setup xrdp on jetson

How to enable RDP (Remote Desktop) on JETSON NANO

Steps

Install xrdp

$ sudo apt install xrdp -y 
@robinvanemden
robinvanemden / cudnn_convolution_forward.cu
Created July 31, 2021 18:46 — forked from odashi/cudnn_convolution_forward.cu
Example usage of cuDNN convolution forward functions.
#include <iomanip>
#include <iostream>
#include <cstdlib>
#include <vector>
#include <cuda.h>
#include <cudnn.h>
#define CUDA_CALL(f) { \
cudaError_t err = (f); \
@robinvanemden
robinvanemden / postman-echo.c
Created April 28, 2021 16:30 — forked from leiless/postman-echo.c
[Test] Simple program to POST a HTTP request to postman-echo.com
/**
* Simple program to POST a HTTP request
*
* see:
* https://docs.postman-echo.com/?version=latest
* https://aticleworld.com/http-get-and-post-methods-example-in-c/
* https://stackoverflow.com/questions/11208299/how-to-make-an-http-get-request-in-c-without-libcurl
* https://stackoverflow.com/questions/22077802/simple-c-example-of-doing-an-http-post-and-consuming-the-response
*/
@robinvanemden
robinvanemden / fully-static-curl.sh
Last active April 27, 2021 15:01
Cross-compile fully static curl library.
#!/bin/bash
# Static libcurl crosscompiler #########################################################################################
# This is script to cross-compiles a **fully static** curl library.
# It builds WolfSSL and C-Ares, then LibCurl - therein supporting most SSL protocols including TSL 1.3.
# Helper variables, leave as is
export BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

Installing darknet nnpack to run YOLOv3 on Raspberry pi 4

Build Instructions

1. Some of that you might need

1.1. Log in to Raspberry Pi using SSH. Always update upgrade first!

sudo apt-get update && sudo apt-get upgrade
#import <Foundation/Foundation.h>
static const uint8_t huffman_table[] =
{
0xFF, 0xC4, 0x01, 0xA2, 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02,
0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x01, 0x00, 0x03,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
0x0A, 0x0B, 0x10, 0x00, 0x02, 0x01, 0x03, 0x03, 0x02, 0x04, 0x03, 0x05,
@robinvanemden
robinvanemden / GCC compiler optimization for ARM-based systems.md
Last active April 11, 2021 16:36
GCC compiler optimization for ARM-based systems

GCC compiler optimization for ARM-based systems

The gcc compiler can optimize code by taking advantage of CPU specific features. Especially for ARM CPU's, this can have impact on application performance. ARM CPU's, even under the same architecture, could be implemented with different versions of floating point units (FPU). Utilizing full FPU potential improves performance of heavier operating systems such as full Linux distributions.

-mcpu, -march: Defining the CPU type and architecture

These flags can both be used to set the CPU type. Setting one or the other is sufficient.

GCC supports all Cortex-A processors up to A15 (2010). Example are 'cortex-a5', 'cortex-a7', 'cortex-a8', 'cortex-a9', 'cortex-a15'. For specific values on popular boards see table below.

@robinvanemden
robinvanemden / ttyecho.c
Created February 14, 2021 10:18 — forked from FUT/ttyecho.c
Send terminal command to a TTY terminal
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <string.h>
#include <unistd.h>
void print_help(char *prog_name) {
printf("Usage: %s [-n] DEVNAME COMMAND\n", prog_name);