Skip to content

Instantly share code, notes, and snippets.

View cirocosta's full-sized avatar

Ciro S. Costa cirocosta

View GitHub Profile
@cirocosta
cirocosta / docker-compose.yml
Created October 16, 2019 12:59
a three-worker Concourse `docker-compose.yml` with Jaeger
version: '3'
services:
db:
image: postgres
ports:
- 6543:5432
environment:
POSTGRES_DB: concourse
POSTGRES_USER: dev
@cirocosta
cirocosta / sigev_thread2.c
Created August 29, 2015 18:27
Posix Interval Timer example w/ threads
/*
* ORIGINAL HEADER
*
* sigev_thread.c
*
* Demonstrate use of the SIGEV_THREAD signal mode to handle
* signals by creating a new thread.
*
* Special notes: This program will not compile on Solaris 2.5.
* It will compile on Digital UNIX 4.0 but will not work.
@cirocosta
cirocosta / USAGE
Last active October 21, 2020 11:53
example showing how MADV_FREE does not incur in RSS reduction right away
1. compile it
gcc -O2 -static -o sample ./madvise-sample.c
2. run it in a terminal that has the current proc in a cgroup
mkdir /sys/fs/cgroup/memory/test
echo $$ > /sys/fs/cgroup/memory/test/cgroup.procs
./sample
3. in another terminal, observe `memory.stat` for that cgroup
cat /sys/fs/cgroup/memory/test/memory.stat
@cirocosta
cirocosta / rect_selector.cc
Created July 16, 2015 17:29
Select a few rectangles in an image using C++11 and OpenCV 2.4
#include "opencv2/opencv.hpp"
#include <vector>
#include <iostream>
using cv::WINDOW_NORMAL;
using cv::imread;
using cv::waitKey;
using cv::setMouseCallback;
using cv::imshow;
#!/bin/bash
set -o errexit
main () {
local stats_collector_pid
make_all_jobs_active
login
@cirocosta
cirocosta / instructions
Last active April 21, 2020 21:08
demonstrating ResponseWriter.Write blocking
# run a server
./a.out -server
# run a client
./a.out
# see that the server does not finish writing right away
diff --git a/atc/atccmd/command.go b/atc/atccmd/command.go
index e33d9eee8..cd7006969 100644
--- a/atc/atccmd/command.go
+++ b/atc/atccmd/command.go
@@ -11,6 +11,7 @@ import (
_ "net/http/pprof"
"net/url"
"os"
+ "runtime"
"strings"
@cirocosta
cirocosta / a
Created March 23, 2020 15:28
a
a

trying it out

There are two ways of trying this out:

local build

As long as you have access to a cluster, you can get Concourse to run workloads there.

@cirocosta
cirocosta / DraggableSvgComp.jsx
Created January 29, 2015 13:38
Draggable React SVG Element
'use strict';
/**
* DraggableSvgComp ...
*/
const findSvgRoot = (DOMNode) =>
DOMNode.parentElement.localName === 'svg' ?
DOMNode.parentElement :
findSvgRoot(DOMNode.parentElement);