Skip to content

Instantly share code, notes, and snippets.

View cpieper78's full-sized avatar
🏠
Working from home

Christopher Pieper cpieper78

🏠
Working from home
View GitHub Profile

Keybase proof

I hereby claim:

  • I am cpieper78 on github.
  • I am cpieper_trhc (https://keybase.io/cpieper_trhc) on keybase.
  • I have a public key ASA5f-h8MrZzyQXSAq1H0LeUrwd0KSDkoUbYk0cNa2ok2wo

To claim this, I am signing this object:

@cpieper78
cpieper78 / sentry_data_export.py
Created January 31, 2025 02:35 — forked from y-young/sentry_data_export.py
Export project data from sentry.io
"""Export Sentry project data from sentry.io."""
import os
import json
import requests
SENTRY_AUTH_TOKEN = os.environ.get("SENTRY_AUTH_TOKEN")
SENTRY_ORGANIZATION_SLUG = os.environ.get("SENTRY_ORGANIZATION_SLUG")
SENTRY_PROJECT_SLUG = os.environ.get("SENTRY_PROJECT_SLUG")
@cpieper78
cpieper78 / .curlrc
Created June 25, 2024 09:22 — forked from eiri/.curlrc
Adding a new node to CouchDB cluster primer
-s
-H "Content-Type: application/json"
-H "Accept: application/json"
-u admin:god
@cpieper78
cpieper78 / .curlrc
Created June 25, 2024 09:22 — forked from eiri/.curlrc
Adding a new node to CouchDB cluster primer
-s
-H "Content-Type: application/json"
-H "Accept: application/json"
-u admin:god
@cpieper78
cpieper78 / config_aws_raid.sh
Last active March 12, 2024 16:50 — forked from sgtoj/config_aws_raid.sh
Configure Raid for AWS Instance (NVME Supported)
#!/usr/bin/env bash
# ========================================================== configurations ===
RAID_NAME=ephemeral_raid
RAID_DEVICE=/dev/md0
RAID_MOUNT_PATH=/mnt/data
# =============================================================== functions ===
function install_deps {
@cpieper78
cpieper78 / couchdb_changes.md
Created December 21, 2023 03:22 — forked from nolanlawson/couchdb_changes.md
Anatomy of the CouchDB changes feed

Anatomy of the CouchDB changes feed

I just spent a lot of time finally understanding CouchDB's changes feed, so I thought I'd do a short writeup here.

The mystery

Let's imagine the following changes to the database. There are two documents, A and B:

_id seq rev winner?
@cpieper78
cpieper78 / aws-couchdb-setup.md
Created December 21, 2023 03:19 — forked from Ravenstine/aws-couchdb-setup.md
Fast CouchDB setup in AWS

Fast CouchDB setup in AWS

CouchDB is a NoSQL database for storing JSON documents. It comes with a REST API out of the box so your client applications can persist data while requiring you to write little or no server-side code. CouchDB's killer feature is its ability to easily replicate, which allows for horizontal scaling, easy backup, and for client adapters to synchronize documents. This is perfect if you want to write an application that is offline-first. It's become my go-to database when creating new

@cpieper78
cpieper78 / Cluster setup hints
Created December 21, 2023 03:14 — forked from SinanGabel/Cluster setup hints
CouchDB 2.* on Ubuntu 16.04
# See also: http://docs.couchdb.org/en/latest/cluster/index.html
# Before you can add nodes to form a cluster, you have to have them listen on a public ip address
# and set up an admin user (use same admin:password for all nodes).
# Do this, once per node:
# If you have installed couchdb in /opt (else change the Path)
cd /opt/couchdb/etc
cp local.ini local.ini.orig
cp vm.args vm.args.orig
## December 11, 2019 - Test installation of CouchDB on Amazon Linux AMI (Amazon Linux AMI 2018.03.0 (HVM), SSD Volume Type - ami-05c859630889c79c8)
sudo yum update -y
sudo yum --enablerepo=epel update
sudo yum groupinstall "Development Tools"
mkdir ~/src && cd ~/src
curl -O https://ftp.mozilla.org/pub/js/js185-1.0.0.tar.gz
@cpieper78
cpieper78 / bash_aws_jq_cheatsheet.sh
Created December 16, 2022 13:06 — forked from lukeplausin/bash_aws_jq_cheatsheet.sh
AWS, JQ and bash command cheat sheet. How to query, cut and munge things in JSON generally.
# Count total EBS based storage in AWS
aws ec2 describe-volumes | jq "[.Volumes[].Size] | add"
# Count total EBS storage with a tag filter
aws ec2 describe-volumes --filters "Name=tag:Name,Values=CloudEndure Volume qjenc" | jq "[.Volumes[].Size] | add"
# Describe instances concisely
aws ec2 describe-instances | jq '[.Reservations | .[] | .Instances | .[] | {InstanceId: .InstanceId, State: .State, SubnetId: .SubnetId, VpcId: .VpcId, Name: (.Tags[]|select(.Key=="Name")|.Value)}]'
# Wait until $instance_id is running and then immediately stop it again
aws ec2 wait instance-running --instance-id $instance_id && aws ec2 stop-instances --instance-id $instance_id
# Get 10th instance in the account