Skip to content

Instantly share code, notes, and snippets.

View robinvanemden's full-sized avatar
🌳
⏩ ⏩

Robin van Emden robinvanemden

🌳
⏩ ⏩
View GitHub Profile
@david-hammond
david-hammond / postgres_ubuntu.sh
Last active May 20, 2021 03:47
base database server setup
#!/bin/bash
sudo apt update
sudo apt upgrade -y
sudo apt install postgresql postgresql-contrib -y
#To allow database to be accessed remotely follow this https://linuxize.com/post/how-to-install-postgresql-on-ubuntu-18-04/
#you need to edit the follwoing 2 files using vim - the most difficult part, vim instructions here https://vim.rtorr.com/
#sudo vim /etc/postgresql/10/main/postgresql.conf
sudo sed -i s/"#listen_addresses = 'localhost'"/"listen_addresses = '*' "/g /etc/postgresql/12/main/postgresql.conf
#sudo vim /etc/postgresql/10/main/pg_hba.conf
sudo sed -i '96s@127.0.0.1/32@0.0.0.0/0@' /etc/postgresql/12/main/pg_hba.conf
@szihs
szihs / test.cpp
Last active August 15, 2021 11:33
Sample code to compute convolution output
#include <iostream>
#include "include/libnpy/npy.hpp"
#include "arm_compute/runtime/NEON/NEFunctions.h"
#include "arm_compute/core/Types.h"
#include "arm_compute/runtime/Allocator.h"
#include "arm_compute/runtime/BlobLifetimeManager.h"
#include "arm_compute/runtime/MemoryManagerOnDemand.h"
#include "arm_compute/runtime/PoolManager.h"
#include "utils/Utils.h"
@jahe
jahe / rest-api-cheatsheet.md
Last active April 12, 2022 06:30
REST API Cheatsheet

REST API Cheatsheet

Source: https://www.youtube.com/watch?v=5WXYw4J4QOU

  • POST, GET, PUT, DELETE != CRUD
  • no verbs -> just nouns for Resources: /applications or /applications/123
  • Possible Responses: Collection of Resources (e.g. with Links) or One instance of a Resource
  • Keep your API course grained to be scaleble to future requirements
  • For Resources: Be as specific as possible: /customers vs. /newsletter-customers and /registered-customers
  • PUT for Create: Can be used when the Client has the ability to create an identifier for the Resource himself. But it has to contain a full replacement of the dataset: PUT /applications/123
@FUT
FUT / ttyecho.c
Last active May 6, 2022 04:55
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);
@robinvanemden
robinvanemden / gstreamer-tips.md
Created September 1, 2022 11:58 — forked from flufy3d/gstreamer-tips.md
gstreamer remote streaming

simple test

gst-launch-1.0 -v videotestsrc ! video/x-raw,width=1280,height=640 ! glimagesink

streaming mpegts

gst-launch-1.0 -v videotestsrc ! video/x-raw,width=1280,height=640 ! videoconvert ! x264enc key-int-max=12 byte-stream=true ! mpegtsmux ! tcpserversink port=8888 host=0.0.0.0

vlc using tcp://192.168.1.192:8888

@rozifus
rozifus / Python SimpleHTTPServer with SSL
Last active October 9, 2022 22:40
Python SimpleHTTPServer with SSL
# useful for running ssl server on localhost
# which in turn is useful for working with WebSocket Secure (wss)
# copied from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# Make sure you grab the latest version
curl -OL https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-linux-x86_64.zip
# Unzip
unzip protoc-3.5.1-linux-x86_64.zip -d protoc3
# Move protoc to /usr/local/bin/
sudo mv protoc3/bin/* /usr/local/bin/
# Move protoc3/include to /usr/local/include/
@mhaberler
mhaberler / ptpd
Last active June 13, 2023 12:29
ptpd (Precision Time Protocol) config files for debian
# /etc/default/ptpd
# Set to "yes" to actually start ptpd automatically
START_DAEMON=yes
# Add command line options for ptpd
PTPD_OPTS="-c /etc/ptpd.conf"
@joni
joni / toUTF8Array.js
Last active June 30, 2023 04:02
toUTF8Array: Javascript function for encoding a string in UTF8.
function toUTF8Array(str) {
var utf8 = [];
for (var i=0; i < str.length; i++) {
var charcode = str.charCodeAt(i);
if (charcode < 0x80) utf8.push(charcode);
else if (charcode < 0x800) {
utf8.push(0xc0 | (charcode >> 6),
0x80 | (charcode & 0x3f));
}
else if (charcode < 0xd800 || charcode >= 0xe000) {
@goldsborough
goldsborough / conv.cu
Last active November 27, 2023 05:59
Convolution with cuDNN
#include <cudnn.h>
#include <cassert>
#include <cstdlib>
#include <iostream>
#include <opencv2/opencv.hpp>
#define checkCUDNN(expression) \
{ \
cudnnStatus_t status = (expression); \
if (status != CUDNN_STATUS_SUCCESS) { \