Skip to content

Instantly share code, notes, and snippets.

View freyes's full-sized avatar
🥑

Felipe Reyes freyes

🥑
View GitHub Profile
@niedbalski
niedbalski / manual-juju.sh
Last active August 16, 2019 07:58
Setup a ISCSI target multipath with Juju
$ juju bootstrap -e openstack_env
$ juju add-machine
$ nova interface-attach be8c7ed3-9f5c-41f8-b596-0ae7f35c773d
$ nova interface-list be8c7ed3-9f5c-41f8-b596-0ae7f35c773d
+------------+--------------------------------------+--------------------------------------+--------------+-------------------+
| Port State | Port ID | Net ID | IP addresses | MAC Addr |
+------------+--------------------------------------+--------------------------------------+--------------+-------------------+
| ACTIVE | 9c58bd7f-324a-490e-881f-65134ba17915 | 2d5c6949-ae3d-4980-99cf-b17dcb56424a | 10.5.1.30 | fa:16:3e:73:ad:dd |
| ACTIVE | c76d3bf1-9107-4f15-90e2-753c24b219b4 | 2d5c6949-ae3d-4980-99cf-b17dcb56424a | 10.5.1.31 | fa:16:3e:48:a3:4c |
+------------+--------------------------------------+--------------------------------------+--------------+-------------------+
@wolsen
wolsen / cmadison.py
Last active May 12, 2016 19:18
rmadison + cloud-archive madison
#!/usr/bin/env python
#
# Provides a rather basic version of rmadison (or dak ls if you prefer)
# for the Ubuntu cloud-archive.
#
# This script works in the following manner:
# 1) It will show the rmadison output for the selected package to show
# the values of packages within the main ubuntu archives
# 2) It will show similar output for the selected package in the ubuntu
# cloud archives.
@smoser
smoser / README.md
Last active March 30, 2023 18:42
iscsi / ibft booting test

iscsi and iBFT test using qemu/kvm and ipxe

The general goal of this doc is to show how to use qemu, ipxe and tgt to test iscsi and iBFT.

There are loads of things that could be done to make this test environment. But for now, it just shows a simple case to show parameters necessary.

Setting up iscsi test environment

In examples here, the iscsi server is available at 192.168.1.10. The qemu host system is available at 192.168.1.11. We assume port 9999 is available to run a python simple web server.

@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):
#!/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
@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
"""
@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
@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

@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
@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