Skip to content

Instantly share code, notes, and snippets.

View simark's full-sized avatar

Simon Marchi simark

  • Montréal, Canada
View GitHub Profile
@simark
simark / toutv-v2.py
Last active March 9, 2016 06:27 — forked from eepp/toutv-v2.py
import requests
import mechanicalsoup as ms
import sys
import logging
import urllib
import json
import subprocess
# Uncomment this to make the requests print some debug info.
#
@simark
simark / return.c
Created May 26, 2016 13:08
gdb.base/return.exp reproduction
double
func3 ()
{
return -5.0;
}
double tmp3;
int main ()
{
@simark
simark / Makefile
Last active May 29, 2016 01:38
Segfault when dlopening/dlclosing two instrumented .so.
all: main liblol.so libmdr.so
main: main.c
gcc -o main main.c -ldl -g3 -O0
liblol.so: lol.o tracepoints_lol.o
gcc -shared -o liblol.so lol.o tracepoints_lol.o -llttng-ust
lol.o: lol.c tracepoints_lol.h
gcc -fpic -c lol.c -g3 -O0
.extern bar
.text
.globl foo
.type foo, @function
foo:
.cfi_startproc
xor %rsp, (%rsp)
// exp RA len const -8 plus dup deref xor
.cfi_escape 0x16, 0x10, 0x06, 0x09, 0xf8, 0x22, 0x12, 0x06, 0x27
@simark
simark / PKGBUILD
Created December 23, 2020 04:36
PKGBUILD for esp-idf 4.2
# Maintainer: Artyom Melnikov <[email protected]>
pkgname=esp-idf
pkgver=4.2
pkgrel=1
pkgdesc="Espressif IoT Development Framework. Official development framework for ESP32."
arch=('i686' 'x86_64' 'aarch' 'aarch64' 'armv7h')
url="https://github.com/espressif/esp-idf"
license=('APACHE')
depends=('python' 'python-click' 'python-pyserial' 'python-future' 'python-cryptography' 'python-pyparsing' 'python-pyelftools')
makedepends=('git')
@simark
simark / setup-for-benchmarks
Created April 13, 2022 14:43
Scripts to configure / unconfigure system for benchmarks
#!/usr/bin/env bash
echo "Disabling CPU boost"O
echo 0 | sudo tee /sys/devices/system/cpu/cpufreq/boost
for i in $(seq 16 31); do
echo "Disabling CPU core ${i}"
echo 0 | sudo tee /sys/devices/system/cpu/cpu${i}/online
done
@simark
simark / host.cpp
Created May 5, 2025 14:44
Illustration of OpenCL's all() function
// g++ host.cpp -lOpenCL && ./a.out
#include <CL/cl.h>
#include <stdio.h>
#include <stdlib.h>
#define VECTOR_SIZE 4
typedef struct {
int x, y, z, w;