This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"fmt" | |
"time" | |
) | |
func sleepHalfTheTime(ctx context.Context, total time.Duration) { | |
time.Sleep(total >> 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <signal.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
void handle_sig(int sig) {} | |
void wait_a_bit() { | |
if (signal(SIGINT, handle_sig) == SIG_ERR) { | |
perror("signal"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# hello-sync.py Detect quick uses of `sync` | |
# | |
# The program detects when two `sync()` calls get issued within a 1s delta. | |
# | |
# For instance, `sync; sleep 2; sync` will count `quick` as 0, but `sync;sync;sync` | |
# will. | |
# | |
# Example output: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
about: — The same page as "Help -> About" (except that, on some applications, Help → About is a much smaller popup). | |
about:about — Lists all these about: URLs (Mozilla Suite/SeaMonkey or Firefox 4 and newer only). | |
about:accounts — Firefox Sync account. New on Firefox 29. [1][2] | |
about:addons — The "new" addons manager, in trunk builds dated 2010-05-11 or later. | |
about:app-manager — new on Firefox 26. App Manager, a tool to help users build and install web apps on compatible devices (i.e. Firefox OS). | |
about:buildconfig — Reveals details about your Mozilla build options. | |
about:cache — Displays cache statistics and disk cache directory location. | |
about:cache?device=memory — Lists memory cache entries. | |
about:cache?device=disk — Lists disk cache entries. | |
about:cache-entry — Shows information about a cache entry. Used in about:cache links. Requires parameters. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main_test | |
import ( | |
"time" | |
"testing" | |
) | |
type TimeNowChecker struct { | |
lastTime time.Time | |
interval time.Duration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -o errexit | |
set -o xtrace | |
readonly dir=/Users/cirocosta/cirocosta/blog/content/notes | |
main() { | |
case $1 in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
db: | |
image: postgres | |
ports: | |
- 6543:5432 | |
environment: | |
POSTGRES_DB: concourse | |
POSTGRES_USER: dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang AS base | |
RUN apt update && \ | |
apt install -y \ | |
git gcc libseccomp-dev | |
ENV \ | |
CC=gcc \ | |
CGO_ENABLED=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Running in parallel across 6 nodes | |
• [SLOW TEST:57.335 seconds] | |
Main team role config | |
/Users/cirocosta/workspace/concourse/topgun/k8s/mainteam_role_test.go:11 | |
Adding team role config yaml to web | |
/Users/cirocosta/workspace/concourse/topgun/k8s/mainteam_role_test.go:45 | |
returns the correct user role | |
/Users/cirocosta/workspace/concourse/topgun/k8s/mainteam_role_test.go:74 | |
------------------------------ |