Skip to content

Instantly share code, notes, and snippets.

View pmalhaire's full-sized avatar

pmalhaire

  • Cisco
  • Paris
View GitHub Profile
@jvranish
jvranish / stack_traces.c
Last active April 25, 2024 15:51
An example of catching exceptions and printing stack traces in C on Windows, Linux and OS X
/* compile with:
on linux: gcc -g stack_traces.c
on OS X: gcc -g -fno-pie stack_traces.c
on windows: gcc -g stack_traces.c -limagehlp
*/
#include <signal.h>
#include <stdio.h>
#include <assert.h>
@grejdi
grejdi / main.cpp
Created March 5, 2014 05:36
Using openssl to encrypt and decrypt a message with public/private key.
using namespace std;
#include <openssl/evp.h>
#include <openssl/pem.h>
#include <iostream>
#include <string>
int main()
{
@mondain
mondain / public-stun-list.txt
Last active June 9, 2024 04:39
Public STUN server list
23.21.150.121:3478
iphone-stun.strato-iphone.de:3478
numb.viagenie.ca:3478
s1.taraba.net:3478
s2.taraba.net:3478
stun.12connect.com:3478
stun.12voip.com:3478
stun.1und1.de:3478
stun.2talk.co.nz:3478
stun.2talk.com:3478
@subfuzion
subfuzion / curl.md
Last active June 11, 2024 00:17
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@engelmarkus
engelmarkus / producer_consumer.cpp
Created July 14, 2016 01:16
C++17 implementation of the producer-consumer problem.
#include <algorithm>
#include <experimental/any>
#include <array>
#include <condition_variable>
#include <functional>
#include <iostream>
#include <iterator>
#include <mutex>
#include <thread>
#include <vector>
@dmnsgn
dmnsgn / WebGL-WebGPU-frameworks-libraries.md
Last active June 6, 2024 15:56
A collection of WebGL and WebGPU frameworks and libraries

A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.

Engines and libraries ⚙️

Name Stars Last Commit Description
three.js ![GitHub
@Integralist
Integralist / 1. Memory Allocation Summary.md
Last active February 9, 2024 06:27
[Golang Memory Allocation] #go #golang #memory #allocation

Here’s a list of some patterns we’ve found which typically cause variables to escape to the heap:

  • Sending pointers or values containing pointers to channels. At compile time there’s no way to know which goroutine will receive the data on a channel. Therefore the compiler cannot determine when this data will no longer be referenced.
  • Storing pointers or values containing pointers in a slice. An example of this is a type like []*string. This always causes the contents of the slice to escape. Even though the backing array of the slice may still be on the stack, the referenced data escapes to the heap.
  • Backing arrays of slices that get reallocated because an append would exceed their capacity. In cases where the initial size of a slice is known at compile time, it will begin its allocation on the stack. If this slice’s underl
@stefanbschneider
stefanbschneider / networking_datasets.md
Last active May 29, 2024 14:46
List of datasets related to networking. Useful for data-driven evaluation or machine learning approaches. Feel free to comment with updates.
@dksmiffs
dksmiffs / multicast-rcv.cpp
Last active June 23, 2022 09:20
Linux C++ UDP multicast example, guidance here: https://www.tenouk.com/Module41c.html
// Guidance: https://www.tenouk.com/Module41c.html
#include <arpa/inet.h>
#include <array>
#include <iostream>
#include <netinet/in.h>
#include "udpSock.hpp"
#include "zz_diagnose.hpp"
int main()
{
@cspinetta
cspinetta / docker-compose.yml
Created May 21, 2020 12:26
Promtail example extracting data from json log
version: "3.6"
services:
promtail:
image: grafana/promtail:1.4.0
container_name: promtail
command: [ "-config.file=/etc/promtail/local-config.yaml" ]
volumes:
- './promtail.yml:/etc/promtail/local-config.yaml:ro'
- '__path_to_logs_directory__:/app/log:ro'