Skip to content

Instantly share code, notes, and snippets.

@florido
florido / .macos
Last active October 9, 2025 17:48
#!/usr/bin/env bash
# ~/.osx — https://mths.be/osx
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
@yaroslavvb
yaroslavvb / benchmark_grpc_recv.py
Last active December 27, 2022 06:24
Benchmark slowness of passing Tensors around between TF workers
# Dependencies:
# portpicker (pip install portpicker)
# tcmalloc4 (sudo apt-get install google-perftools)
# TF 0.12
#
#
# Benchmarks on Xeon E5-2630 v3 @ 2.40GHz
#
# export LD_PRELOAD=/usr/lib/libtcmalloc.so.4
# python benchmark_grpc_recv.py --data_mb=128
#!/bin/sh
# Edit these to match your project and setup
PROJECT=vpn-lab
NETWORK=gce-network
GATEWAY_NAME=vpn-gateway-1
TEST_INSTANCE_NAME=povm-1
TARGET_NETWORK="10.150.0.0/16"
MACHINE_TYPE=n1-standard-1
ZONE="us-central1-a"
@fmela
fmela / stacktrace.cxx
Last active August 21, 2025 21:24
A C++ function that produces a stack backtrace with demangled function & method names.
/*
* Copyright (c) 2009-2017, Farooq Mela
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright