Skip to content

Instantly share code, notes, and snippets.

ok: run: postgresql: (pid 6922) 0s, normally down
[private-chef-upgrade] - Latest Migration Available: 1.19
[private-chef-upgrade] - Migrations to Run: [1.14, 1.15, 1.16, 1.17, 1.18, 1.19]
[private-chef-upgrade] - Current Migration Version: 1.13
[private-chef-upgrade] - Starting Migration 1.14
[private-chef-upgrade] - ****
ERROR:
TARGET"=>"@2.2.4", "OSC_TARGET"=>"@1.0.4", "DB_USER"=>"opscode-pgsql"}}
EC Target: @2.2.4 OSC Target: @1.0.4 DB User: opscode-pgsql
Sleeping for 5 seconds in case you want to cancel
@marcparadise
marcparadise / keys_list
Last active August 29, 2015 14:14
Keys - list keys use cases
## Approach
* initial pass will handle GET for client and user keys (list keys cases)
* client and user will be handled in the same module, since the actual code is operating on keys and not clients and users. The only functional difference in handling will be isolating the correct entity being operated on for ACL checks.
## Deviations from RFC (will be submitting a PR against the RFC to keep it accurate) :
* The RFC specifies we'll just return a list of URIs in response to GET. This isn't consistent with other APIs, and it is also harder for Manage to use - they would have to parse the URI to come up with the object name. Instead, return will be in the form `[ { "name" : "KEYNAME", "uri" : "URI" } ] `.
* From a usability perspective, it may also be worth adding an 'expired' boolean flag to the return from this API, so that clients have a quick way to see and flag expired keys.
* In other sections, the RFC refers to 'key_id' as the identifier returned. To reduce confusion and keep it consistent
proxy_cache_path /tmp/cache keys_zone=cookbooks:10m;
##
server {
listen 8001;
allow 127.0.0.1;
deny all;
location / {
echo "hello there young padawan! Welcome to $uri. " ;
echo "This request would $http_x_cache_status been cached. " ;
@marcparadise
marcparadise / quicksteps.md
Created July 8, 2015 15:25
Quick Steps to External Postgres Testing with DVM
  1. Make sure you've pulled down the latest changs in chef-server branch 'mp/postgres-remote-connection-support'. This will be merged into byop-phase-1 shortly.
  2. copy dev/config.example.yml dev/config.yml
  3. Edit it so that the following entries are present:
vm:
  postgresql:
    # Makes the database VM start
    start: true 
@marcparadise
marcparadise / chef-server.rb
Created July 8, 2015 17:36
External Postgres Settings
postgresql['external'] = true
postgresql['db_superuser'] = "superuser-with-remote-access"
postgresql['db_superuser_password'] = "top-secret"
postgresql['vip'] = "remote-host-name"
# Can omit this if port is standard 5432:
# postgresql['port'] = 5432
@marcparadise
marcparadise / update_acl_deadlock_shell.erl
Last active August 29, 2015 14:26
Reproduces a deadlock in oc_bifrost's update_acl stored proc.
% Run this in an oc_bifrost console to reproduce the deadlocks.
% Don't run this in a production DB as it doesn't clean up after itself.
MakeID = fun() ->
Raw = crypto:rand_bytes(16),
<<Guid:128>> = Raw,
iolist_to_binary(io_lib:format("~32.16.0b", [Guid])) end.
ActorIds = [ MakeID() || X <- lists:seq(1,5) ].
[ bifrost_db:create(actor, Id, undefined) || Id <- ActorIds ].
18,19c18,19
< require_relative "exceptions"
< require_relative "helpers"
---
> require "chef-cli/exceptions"
> require "chef-cli/helpers"
42,43c42,47
< module ChefCLI
< class ComponentTest
---
@marcparadise
marcparadise / migration.sh
Created December 17, 2019 19:36 — forked from jeremymv2/migration.sh
knife-ec-backup examples
#!/bin/bash
set -e
# Customize all these values
# youre source/destination keys and
# configs will differ
BACKUPDIR="backups"
BACKUPLOG="./migration_backup.log"
RESTORELOG="./migration_restore.log"