Skip to content

Instantly share code, notes, and snippets.

Avatar
🌳
home

Robin van Emden robinvanemden

🌳
home
View GitHub Profile
@robinvanemden
robinvanemden / cudnn_convolution_forward.cu
Created Jul 31, 2021 — forked from odashi/cudnn_convolution_forward.cu
Example usage of cuDNN convolution forward functions.
View cudnn_convolution_forward.cu
#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 Apr 28, 2021 — forked from leiless/postman-echo.c
[Test] Simple program to POST a HTTP request to postman-echo.com
View postman-echo.c
/**
* 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 Apr 27, 2021
Cross-compile fully static curl library.
View fully-static-curl.sh
#!/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)"
View darknet_pi4.md

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
View JpegFixer.h
#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 Apr 11, 2021
GCC compiler optimization for ARM-based systems
View GCC compiler optimization for ARM-based systems.md

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 Feb 14, 2021 — forked from FUT/ttyecho.c
Send terminal command to a TTY terminal
View ttyecho.c
#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);
View install-linux-perf-on-wsl2.sh
set -x
apt install flex bison
git clone https://github.com/microsoft/WSL2-Linux-Kernel --depth 1
cd WSL2-Linux-Kernel/tools/perf
make -j8
sudo cp perf /usr/local/bin
@robinvanemden
robinvanemden / install_latest_protobuf_ubuntu.sh
Last active Dec 30, 2020
Install latest protobuf c/c++ lib (at time of writing, 3.14.0) on Ubuntu 18.04 x86_64
View install_latest_protobuf_ubuntu.sh
#!/bin/bash
sudo apt-get install autoconf automake libtool curl make g++ unzip
##### EITHER LATEST FULL ####
# git clone --recurse-submodules https://github.com/protocolbuffers/protobuf.git /root/protobuf
##### OR C/C++ VERSION ####
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.14.0/protobuf-cpp-3.14.0.tar.gz
tar -zxvf protobuf-cpp-3.14.0.tar.gz
View wasm-summit-2020-notes.md

WebAssembly Summit 2020

https://webassembly-summit.org/

Lin Clark's Talk - "WebAssembly Nanoprocess"

  • the missing functionality alongside WASI and Interface Types is something that provides "capability-based security".
  • Delegation of permissions to propagate down transitive dependencies
  • plan to use fine-grain form of per-module virtualization
  • A "WebAssembly nanoprocess" is just wasm, but follows a particular pattern.