Skip to content

Instantly share code, notes, and snippets.

View quintessence's full-sized avatar
💾
Always learning stuff

Quintessence quintessence

💾
Always learning stuff
View GitHub Profile
I, [2015-06-01T14:37:47.423515 #2036] [task:4] INFO -- : Downloading remote stemcell from https://bosh.io/d/stemcells/bosh-warden-boshlite-centos-go_agent
E, [2015-06-01T14:37:48.134834 #2036] [task:4] ERROR -- : Downloading remote stemcell from https://bosh.io/d/stemcells/bosh-warden-boshlite-centos-go_agent failed: Found
E, [2015-06-01T14:37:48.136214 #2036] [task:4] ERROR -- : Downloading remote stemcell failed. Check task debug log for details.
/var/vcap/packages/director/gem_home/ruby/2.1.0/gems/bosh-director-1.2749.0/lib/bosh/director/download_helper.rb:25:in `block (2 levels) in download_remote_file'
/var/vcap/packages/ruby/lib/ruby/2.1.0/net/http.rb:1415:in `block (2 levels) in transport_request'
/var/vcap/packages/ruby/lib/ruby/2.1.0/net/http/response.rb:162:in `reading_body'
/var/vcap/packages/ruby/lib/ruby/2.1.0/net/http.rb:1414:in `block in transport_request'
/var/vcap/packages/ruby/lib/ruby/2.1.0/net/http.rb:1405:in `catch'
/var/vcap/packages/ruby/lib/ruby/2.1.0/net/http.rb:1405:in `transport_re
@quintessence
quintessence / create_user
Last active August 29, 2015 14:19
BASH Script to create user in Unix
#!/bin/bash
help(){
echo "\
${termBold}Usage:${termNorm} ${0} <username> <password> [options]
username: desired user name
password: desired password - will be prompted if not supplied
${termBold}Options:${termNorm} (h) displays help, (x) enables set x
-h: help, displays this output
-x: Enables set -x"
@quintessence
quintessence / app.js
Created March 13, 2015 01:56
Two "frozen" buttons in the graph section...?
function plot(data) {
var xp = ['data1'];
var qp = ['data2'];
var xm = ['data3'];
var qm = ['data4'];
for (i in data) {
console.log(data[i])
if (data[i].Id == '265974') {
@quintessence
quintessence / docker error.sh
Last active August 29, 2015 14:16
Docker error
#UPDATE 23:33
#I had it output the struct and it looks like only two elements are MIA, "ServiceId" and "Host":
echo -e "ServiceId: \n"
+ echo -e 'ServiceId: \n'
echo -e "Archive: 7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old@1425700200.zfs.xz\n"
+ echo -e 'Archive: 7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old@1425700200.zfs.xz\n'
echo -e "Volume: 7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old\n"
+ echo -e 'Volume: 7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old\n'
echo -e "Filesystem: zfs\n"
@quintessence
quintessence / PGconf.md
Last active August 29, 2015 14:16
Jr Engineering Project PG Files

pg_hba.conf:

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            ident
# IPv6 local connections:
host    all             all             ::1/128                 ident
@quintessence
quintessence / output
Last active August 29, 2015 14:15
upgrade ouput
$ go run main.go
Launching API Server...
Listening and Serving...
Processing POST /snapshots?host=172.16.255.250&name=mongo-old
docker.Create(): Creating Snapshot.
server.RunCommand(/tmp/mongo-old-snapshot-2015-02-21T20:01:53-05:00)
server.RunCommand(/tmp/mongo-old-snapshot-2015-02-21T20:01:53-05:00)
docker.Create(): Result: {Cmd:/tmp/mongo-old-snapshot-2015-02-21T20:01:53-05:00 Script: Stdout:Container mongo-old not found.
Stderr:Sat Feb 21 17:01:52 PST 2015 Snapshot mongo-old
ExitStatus:1 Server:0xc2080321c0 Err:<nil>}
@quintessence
quintessence / upgrade.sh
Last active August 29, 2015 14:15
Trying to restore mongodb from one node to another
#!/bin/bash
#
# Scenario:
# * Deploy mongodb version 2.6.6 using flocker to node 1
# * Deploy mongodb version 2.6.7 using flocker to node 2 (can use same application.yml)
# * Insert v2.6.6 presnapshot data into container on version 2.6.6
# * CURL the API to snapshot v2.6.6 data targeting v2.6.6 container on node 1
# * CURL the API to restore v2.6.6 snapshot to v2.6.7 container on node 2
# * Insert v2.6.6 presnapshot data into container on version 2.6.6
@quintessence
quintessence / gist:f3f6afc8f23a57345e8a
Created February 18, 2015 03:52
transformServers.sql
-- transforms JSONB row data to columns
CREATE OR REPLACE FUNCTION transformServers(data jsonb)
RETURNS SETOF RECORD as $$
DECLARE
serversSet RECORD;
BEGIN
return query
SELECT jsonb_to_recordset(data->'data') INTO
serversSet (
2015-02-04T20:05:44.60-0500 [App/0] OUT [martini] Started GET /robots.txt for 66.249.64.72, 173.245.54.23, 10.10.66.156
2015-02-04T20:05:44.60-0500 [App/0] OUT [martini] Completed 404 Not Found in 2.583466ms
2015-02-04T20:05:44.60-0500 [RTR] OUT trycf.starkandwayne.com - [05/02/2015:01:05:44 +0000] "GET /robots.txt HTTP/1.1" 404 43 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" 10.10.66.156:1591 x_forwarded_for:"66.249.64.72, 173.245.54.23" vcap_request_id:f449ff3e-49ed-40be-5c23-3943ab42368d response_time:0.005195547 app_id:74b10ab6-f847-454e-bb07-abaae0f71931
2015-02-04T20:05:45.65-0500 [App/0] OUT [martini] Started GET /robots.txt for 66.249.64.7, 173.245.54.23, 10.10.66.156
2015-02-04T20:05:45.66-0500 [App/0] OUT [martini] Completed 404 Not Found in 8.128842ms
2015-02-04T20:05:45.66-0500 [RTR] OUT trycf.starkandwayne.com - [05/02/2015:01:05:45 +0000] "GET /robots.txt HTTP/1.1" 404 43 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.htm
--- Feb 3 2015 20:47 ---
Listening and Serving...
Processing POST /flocker/flocker--mongodb-volume-example/snapshots
flocker.Create(): Creating Snapshot.
server.RunCommand(/tmp/flocker--mongodb-volume-example-snapshot-2015-02-03T20:46:19-05:00)
server.RunCommand(/tmp/flocker--mongodb-volume-example-snapshot-2015-02-03T20:46:19-05:00)
flocker.Create(): Result: {Cmd:/tmp/flocker--mongodb-volume-example-snapshot-2015-02-03T20:46:19-05:00 Script: Stdout: Stderr: ExitStatus:0 Server:0xc2080320c0 Err:<nil>}
flocker.Create(): Result: {Cmd:/tmp/flocker--mongodb-volume-example-snapshot-2015-02-03T20:46:19-05:00 Script: Stdout:SnapshotFileName: fc5caf9b-d51d-4ab1-bb89-e494b936c208.default.mongodb-volume-example@1423014378.zfs.xz
Stderr: ExitStatus:0 Server:0xc208032d80 Err:<nil>}
flocker.Create(): Examining Node Results: [{Cmd:/tmp/flocker--mongodb-volume-example-snapshot-2015-02-03T20:46:19-05:00 Script: Stdout: Stderr: ExitStatus:0 Server:0xc2080320c0 Err:<nil>} {Cmd:/tmp/flocker--mongodb-volume-example-snapshot-201