Skip to content

Instantly share code, notes, and snippets.

View freyes's full-sized avatar
🥑

Felipe Reyes freyes

🥑
View GitHub Profile
#!/bin/bash -eu
# THE FOLLOWING PROCEDURE TO REFORMAT AN OSD AND ITS JOURNAL HAS BEEN TESTED
# ON UBUNTU TRUSTY WITH CEPH 0.94.8-0ubuntu0.15.04.1~cloud0 FROM KILO UCA.
OSD_ID=48
OSD=osd.$OSD_ID
BLK_DEV=/dev/vdb
JOURNAL_UUID=`cat /var/lib/ceph/osd/ceph-$OSD_ID/journal_uuid`
package main
import (
"fmt"
"os"
"github.com/juju/utils"
)
const MIN_LEN = 30
package main
import (
"fmt"
"os"
"github.com/juju/utils"
)
const MIN_LEN = 30
@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active June 1, 2025 11:43
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@niedbalski
niedbalski / recover-lost-agent.py
Last active October 10, 2022 04:51
recover a lost Juju agent
#!/usr/bin/env python
"""
This is a tool for recovering a lost juju unit
Usage:
{0} controller-ip unit-from unit-to basedir
"""
import subprocess
import shlex
@olih
olih / jq-cheetsheet.md
Last active June 1, 2025 14:20
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@congto
congto / websso_federation_setup.sh
Last active January 4, 2022 19:06
setup websso environment in one shot, works with google
#!/bin/bash
fqdn=devstackctl
user=uvdc
# Install the OpenID Connect apache module
# not necessary, but will resolve any config errors when installing the module
sudo apt-get install libjansson4 libhiredis0.10 libcurl3 -y
sudo apt-get install -f -y
# TODO: figure out why v1.8.4 and 1.8.5 won't install
@niedbalski
niedbalski / update-juju-unit-hostnames.py
Created March 3, 2016 22:43
update-juju-unit-hostnames.py
#!/usr/bin/env python
"""
This script will update all the juju units using
the hostname defined on the provided dns server
Usage:
{0} ip-of-maas-dns-server
"""
#!/bin/bash -eux
repos=(
charm-swift-storage
charm-swift-proxy
charm-rabbitmq-server
charm-percona-cluster
charm-openvswitch-odl
charm-openstack-dashboard
charm-odl-controller
charm-nova-compute
@freyes
freyes / auth.py
Created January 6, 2016 21:28 — forked from niedbalski/auth.py
hmac-encrypt-request
from Crypto.Hash import HMAC
from Crypto.Hash import SHA
import hashlib
import datetime
class Auth:
@classmethod
def sign(cls, method, c_type, body, uri, key=None):