Skip to content

Instantly share code, notes, and snippets.

View allomov's full-sized avatar

Aliaksandr Lomau allomov

View GitHub Profile
@voelzmo
voelzmo / release_copy.rb
Last active September 4, 2018 11:07
bosh release copy script
#!/usr/bin/env ruby
require "cli"
require "cli/release"
require "cli/blob_manager"
require "blobstore_client"
require "cli/versions/versions_index"
require 'optparse'
@dwallraff
dwallraff / create_cert.sh
Last active September 26, 2019 17:27
Commands to create a self-signed SSL cert or CSRs using the openssl conf from https://gist.github.com/dwallraff/c1ed31291ac7cf19304b
##### Commands to generate SSL certs/artifcts
# Download the temp.cnf file using the wget command below
# Edit temp.cnf and add your information
# Run the uncommented out commands to generate a self-signed cert (cert.pem) and private key (keyfile.pem)
wget https://gist.githubusercontent.com/dwallraff/c1ed31291ac7cf19304b/raw/e06feacbb85ac63659e6c1c40c70d5481522b390/temp.cnf
# Generate a new keyfile. A 2048 bit key size is TOTALLY fine. Jack it up to 4096 and wait if you must...
openssl genrsa -out keyfile.key 2048
@allomov
allomov / update-org-quota-in-cf-by-name.sh
Last active February 9, 2016 16:05
Just for case you need to update organization in CF by names. (to get quota list use `cf quotas` command). This solution is described here http://docs.pivotal.io/pivotalcf/opsguide/change-quota-plan.html.
org_name=my-org
quota_name=runaway
org_guid=$(CF_TRACE=true cf org $org_name | grep -B7 $org_name | grep guid | awk '{gsub(/\"guid\":|\ |\"|\,/,"")}1')
quota_guid=$(cf curl /v2/quota_definitions -X 'GET' | grep -B7 runaway | grep guid | awk '{gsub(/\"guid\":|\ |\"|\,/,"")}1')
cf curl /v2/organizations/$org_guid -X 'PUT' -d "{\"quota_definition_guid\":\"$quota_guid\"}"
[_webView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"function a() { try { s } catch(err) { var errorFlag = 'ERROR'; return errorFlag; } }; a()"]]
[_webView stringByEvaluatingJavaScriptFromString:@"function a() { try { JSON.stringify(require('BatchedBridge').flushedQueue) } catch(err) { return err.message; } }; a()"]
@thansmann
thansmann / 2000-bosh-vms-deployed
Created September 17, 2015 17:43
2000 VM test on AWS
± kx+kx gd |master U:2 ✗| → bosh vms
Deployment `dummy'
Director task 74
Task 74 done
+---------------+---------+---------------+------------+
| Job/index | State | Resource Pool | IPs |
+---------------+---------+---------------+------------+
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDP9Injr2SI6vcLKwrtOqnVlA9gW+I5sfo3i5yYCJZvvwrGoz4EEwSyZ2j/Y97QIp+IwZbXgsDgmWlAiC642LFSJJ98GjvOV/GKCbwymB0XeLuSo68V+/7M6kt+rWLStHP5xX1GyjBHFtGRZ6SLLRioOpVbinLN9cgx3zV2GNCHbnDpmz48XICWD1tTtBSXQX2+WOqkeKLSfuEIvaFwo3smrRcXgAc/JCDbhSBqBT3nnC+Va/GIlnh9FwbVtI1MIm89qtLs+X/CcILvdYnR3www5UduTcbSVg+1toLBRy1njsyMHh+Pr7jSx+R+gllDp5vjcAecJlXKlLrnaFwoaIul [email protected]
@drnic
drnic / nats.sh
Created June 17, 2015 14:46
Target current BOSH's current CF manifest and run nats CLI on its nats configuration
#!/bin/bash
# Assumes using nats CLI from https://github.com/soutenniza/nats/releases
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
cd $DIR/..
bosh_target=$(cat .bosh_config | yaml2json | jq -r ".target")
manifest=$(cat .bosh_config | yaml2json | jq -r ".deployment[\"$bosh_target\"]")
mbus=$(cat $manifest | yaml2json | jq -r '.properties.nats | "nats://\(.user):\(.password)@\(.address):\(.port)"')
docker rm `docker ps --no-trunc -aq`
docker rmi -f $(docker images | grep "<none>" | awk "{print \$3}")

Description

This scripts provide the way to convert your instance (or image) to BOSH stemcell (containing MicroBOSH release).

What you'll need

  1. A running instance that you want to convert to stemcell (it should run Ubuntu or CentOS with default package repositories).
  2. VMware OVF tool with version 3.0.
  3. Some Ubuntu host to run script that will generate stemcell.
@allomov
allomov / cf-openstack.yml
Last active December 24, 2015 16:29
create_secure_groups_openstack
name: lomov-cf
releases:
- name: cf
version: 176
director_uuid: ab3dec87-3877-4169-97bc-5c62c765fe46