Skip to content

Instantly share code, notes, and snippets.

#include <iostream>
#include <functional>
#include <string_view>
#include <mutex>
#include <map>
#include <thread>
#include <chrono>
#include <future>
template <typename ...Args>
@theanalyst
theanalyst / atomic.cpp
Created March 3, 2022 20:45
test syntax
std::atomic<int> sum {0};
struct Point {int x, int y};
struct D3 {int x, int y, int z};
022-02-05T20:01:21+01:00
Running ./src/randgen
Run on (8 X 24.1218 MHz CPU s)
CPU Caches:
L1 Data 64 KiB (x8)
L1 Instruction 128 KiB (x8)
L2 Unified 4096 KiB (x2)
Load Average: 1.65, 1.91, 2.07
----------------------------------------------------------------------------
Benchmark Time CPU Iterations
#!/usr/bin/env python
import argparse
import logging
import string
import random
import boto3
from botocore.client import Config
import pytest

v15.2.1 Octopus

This is the first bugfix release of Ceph Octopus, we recommend all Octopus users upgrade.

Changelog

#!/bin/bash
# 2 clusters dc1 and dc2 started via mstart (+ patch for rgw ports)
# Cluster 1, Zone 1 : Realm: EU, Zonegroup: DE , Zone : NUE master
# export CEPH_CONF=/path/to/ceph.conf cluster1 otherwise all commands has to have a -c with path to conf file
echo "export ZONE_ACCESS_KEY=1555b35654ad1656d804" >> ~/.s3zone
echo "export ZONE_SECRET_KEY=h7GhxuBLTrlhVUyxSPUKUV8r/2EI4ngqJxD7iBdBYLhwluN30JaT3Q==" >> ~/.s3zone
. ~/.s3zone
export CEPH_CONF=~/spells/storage/ceph/src/run/dc1/ceph.conf
./radosgw-admin realm create --rgw-realm=eu
./radosgw-admin zonegroup create --rgw-zonegroup=de --endpoints=http://localhost:8001 --master
@theanalyst
theanalyst / base_branch.py
Last active February 5, 2020 17:14
change_base_branch
#!/usr/bin/env python
# do a `pip install githubpy` before running the script
import os
import github
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("target_sha", metavar="target_sha",
help="sha1 of the branch to update to")
  • ceph-volume zap always skips block.db, leaves them around (issue#40664, pr#30305, Alfredo Deza)
  • ceph-volume lvm.zap fix cleanup for db partitions (issue#40664, pr#30302, Dominik Csapak)
  • ceph-volume tests set the noninteractive flag for Debian (pr#29901, Alfredo Deza)
  • ceph-volume: do not fail when trying to remove crypt mapper (pr#30556, Guillaume Abrioux)
  • ceph-volume: fix stderr failure to decode/encode when redirected (pr#30299, Alfredo Deza)
  • ceph-volume: pre-install python-apt and its variants before test runs (pr#30296, Alfredo Deza)
  • ceph-volume: use the OSD identifier when reporting success (pr#29771
@theanalyst
theanalyst / pushbullet.el
Last active January 28, 2019 01:20
Easily push from your emacs to Android phone??
;;; pushbullet.el --- An emacs client for the pushbullet android app
;;; Using the pushbullet api at https://pushbullet.com/api
;;; Uses grapnel for http requests https://github.com/leathekd/grapnel
;;;
;;; Commentary:
;;;
;;; Code:
(require 'grapnel)
(require 'json)
@theanalyst
theanalyst / fibs.c
Last active November 23, 2018 14:02
Hy, Python & C play nicely with each other
#include "fibs.h"
long fib(int n)
{
if (n == 0)
return 1;
else if (n == 1)
return 1;
else
return fib(n-1) + fib(n-2);