Skip to content

Instantly share code, notes, and snippets.

View emaxerrno's full-sized avatar
💭
I may be slow to respond.

Alexander Gallego emaxerrno

💭
I may be slow to respond.
View GitHub Profile
@emaxerrno
emaxerrno / bolt_executor.cc
Created August 28, 2015 16:04
enable_dumps.cc
#include <glog/logging.h>
#include <mesos/executor.hpp>
#include <sstream>
#include <sys/resource.h> // core dumps
#include "gen-cpp/bolt_types.h"
#include "bolt/mesos/BoltMesosExecutor.hpp"
void enableCoreDump() {
// Try to enable core dumps
struct rlimit core_limit;
@emaxerrno
emaxerrno / *scratch*
Created August 12, 2015 19:18
test.bash
g++ -shared -Wl,-soname -Wl,librocksdb.so.3.11 -g -W -Wextra -Wall -Wsign-compare -Wshadow -Wno-unused-parameter -I. -I./include -std=c++11 -DROCKSDB_PLATFORM_POSIX -DOS_LINUX -fno-builtin-memcmp -DROCKSDB_FALLOCATE_PRESENT -DSNAPPY -DGFLAGS=google -DZLIB -DBZIP2 -DLZ4 -march=native -isystem ./third-party/gtest-1.7.0/fused-src -O2 -fno-omit-frame-pointer -momit-leaf-frame-pointer -DNDEBUG -Woverloaded-virtual -Wnon-virtual-dtor -Wno-missing-field-initializers -fPIC db/builder.cc db/c.cc db/column_family.cc db/compaction.cc db/compaction_job.cc db/compaction_picker.cc db/db_filesnapshot.cc db/dbformat.cc db/db_impl.cc db/db_impl_debug.cc db/db_impl_readonly.cc db/db_impl_experimental.cc db/db_iter.cc db/experimental.cc db/event_logger_helpers.cc db/file_indexer.cc db/filename.cc db/flush_job.cc db/flush_scheduler.cc db/forward_iterator.cc db/internal_stats.cc db/log_reader.cc db/log_writer.cc db/managed_iterator.cc db/memtable_allocator.cc db/memtable.cc db/memtable_list.cc db/merge_helper.cc db/merge_ope
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
#!/bin/bash
set -o errexit
# Author: David Underhill
# Script to permanently delete files/folders from your git repository. To use
# it, cd to your repository's root and then run the script with a list of paths
# you want to delete, e.g., git-delete-history path1 path2
if [ $# -eq 0 ]; then
exit 0
  1. General Background and Overview
@emaxerrno
emaxerrno / taaaaaaaaafuck.sh
Created March 26, 2015 21:25
taaaaaaafuck.sh
#0 0x0000000000000000 in ?? ()
#1 0x00007ffff0a1b6d6 in folly::wangle::ThreadPoolExecutor::addThreads (this=this@entry=0x61700002f880, n=n@entry=1) at wangle/concurrent/ThreadPoolExecutor.cpp:95
#2 0x00007ffff0a0ff01 in folly::wangle::IOThreadPoolExecutor::IOThreadPoolExecutor (this=0x61700002f880, numThreads=1, threadFactory=..., __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at wangle/concurrent/IOThreadPoolExecutor.cpp:71
#3 0x00007ffff14ead4b in void __gnu_cxx::new_allocator<folly::wangle::IOThreadPoolExecutor>::construct<folly::wangle::IOThreadPoolExecutor, int, std::shared_ptr<folly::wangle::NamedThreadFactory> >(folly::wangle::IOThreadPoolExecutor*, int&&, std::shared_ptr<folly::wangle::NamedThreadFactory>&&) () from /usr/local/lib/libthriftcpp2.so.23
#4 0x00007ffff14ea99c in std::enable_if<std::allocator_traits<std::allocator<folly::wangle::IOThreadPoolExecutor> >::__construct_helper<folly::wangle::IOThreadPoolExecutor, int, std::shared_ptr<folly::wangle::NamedThreadFactory> >::value, voi
@emaxerrno
emaxerrno / anonymous-gist.el
Created March 19, 2015 16:11
type repeast string
(set-variable 'ycmd-server-command
'("python2" (file-truename
(concat user-emacs-directory
"agallego/bin/ycmd/ycmd/__main__.py"))
)
)
@emaxerrno
emaxerrno / Error.hpp
Created March 18, 2015 20:48
error.hpp
#pragma once
#include <boost/optional.hpp>
namespace bolt {
// TODO(agallego) - AbstractError_t should really inherit from
// an template<left,right>either_t; type - refactor later
template <typename T> struct AbstractError {
using type = T;
boost::optional<T> error = boost::none;
int code = 0;
@emaxerrno
emaxerrno / reconciliation_tests.cpp
Created March 16, 2015 16:44
task_reconciliation.cp
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@emaxerrno
emaxerrno / anonymous-gist.h
Created February 26, 2015 22:08
mplmap.hpp
using RoutingEntryMap = boost::mpl::map<
std::pair<StreamGrouping::GROUP_BY, ConsistentRoutingEntry>
std::pair<StreamGrouping::SHUFFLE, ShuffleRoutingEntry>
std::pair<StreamGrouping::ROUND_ROBIN, RoundRobinRoutingEntry>
>;