Skip to content

Instantly share code, notes, and snippets.

@CalvinHartwell
CalvinHartwell / ceph-install-steps.yaml
Last active September 17, 2018 08:02
ceph-install-steps.yaml
First in kubernetes, check that we have the secret setup for Ceph:
calvin@calvinh-ws:~/Source/canonical-kubernetes-demos/cdk-ceph$ kubectl get secrets
NAME TYPE DATA AGE
ceph-secret kubernetes.io/rbd 1 14m
If this secret does not exist, I can give the steps to create it. Note that this secret needs to be created for every namespace in the cluster you want to use with the Ceph storage. It contains the API key which is used by k8s to interact with Ceph.
It is explained here, however: https://github.com/CanonicalLtd/canonical-kubernetes-demos/tree/master/cdk-ceph
@diegopacheco
diegopacheco / cassandra-dump-simple-backup-restore.md
Created January 19, 2017 20:18
Cassandra DUMP: Backup/Restore SIMPLE
git clone https://github.com/gianlucaborello/cassandradump
pip install cassandra-driver

python cassandradump.py --keyspace system --export-file dump.cql
@Cairnarvon
Cairnarvon / pypistats.py
Created February 5, 2013 15:17
Graphs downloads per day for PyPI packages using gnuplot, because vanity. Usage: ./pypistats.py packagename
#!/usr/bin/env python
import bz2
import datetime
import os
import sys
import time
import urllib2
import warnings
@uogbuji
uogbuji / gruber_urlintext.py
Created November 18, 2010 18:28
John Gruber's regex to find URLs in plain text, converted to Python/Unicode
#See: http://daringfireball.net/2010/07/improved_regex_for_matching_urls
import re, urllib
GRUBER_URLINTEXT_PAT = re.compile(ur'(?i)\b((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'".,<>?\xab\xbb\u201c\u201d\u2018\u2019]))')
for line in urllib.urlopen("http://daringfireball.net/misc/2010/07/url-matching-regex-test-data.text"):
print [ mgroups[0] for mgroups in GRUBER_URLINTEXT_PAT.findall(line) ]