Skip to content

Instantly share code, notes, and snippets.

View srid's full-sized avatar
🌤️
Never not this moment

Sridhar Ratnakumar srid

🌤️
Never not this moment
View GitHub Profile
@srid
srid / bash_prompt_sh
Last active August 29, 2015 14:01
stackato bash prompt
#!/bin/bash -e
redis_hostport=$(cat /s/etc/kato/redis_uri | cut -d"/" -f3)
redis_host=$(echo $redis_hostport | cut -d: -f1)
redis_port=$(echo $redis_hostport | cut -d: -f2)
redis_cli="redis-cli -h ${redis_host} -p ${redis_port}"
user=$(whoami)
endpoint=$(timeout 0.1 $redis_cli get cluster | json endpoint)
ipaddr=$(timeout 0.1 /sbin/ifconfig eth0 | grep "inet addr" | awk -F: '{print $2}' | awk '{print $1}')
roles=$(timeout 0.1 $redis_cli get node | json "[\"${ipaddr}\"]" | json roles | json -ak | paste -sd "," -)
// read-only registry API server
// TODO:
// * directly read from the .tar file (will break martini.Static)
// * UX friendly error handling
package main
import (
"encoding/json"
#!/bin/bash -ex
# Wrapper for 'docker save' fixing,
# https://github.com/dotcloud/docker/issues/3877
# In addition: this script will always save exactly one image (possibly
# multiple tags).
IMAGE=$1
TARGET=$2
NAME=`echo $IMAGE | awk -F':' '{print $1}'`
ID=`docker inspect $IMAGE | python -c "import sys,json; print json.load(sys.stdin)[0]['id']"`
// GetNameServers returns nameservers configured on the host.
func GetNameServers() ([]string, error) {
resolvFile := "/etc/resolv.conf"
f, err := os.Open(resolvFile)
if err != nil {
return nil, err
}
defer f.Close()
+ sudo docker run -e REDIS_PROVIDER_URL=redis://user@172.17.0.3:6379 -e POSTGRES_HOST=172.17.0.58 -e POSTGRES_PORT=5432 -v /home/srid/code/discourse/data/assets:/discourse/public/assets -v /discourse/public srid/discourse /discourse/init.sh 'bundle exec rails s'
lxc-start: No such file or directory - failed to mount '/home/srid/code/discourse/data/assets' on '/usr/lib/x86_64-linux-gnu/lxc///discourse/public/assets'
lxc-start: failed to setup the mount entries for '2e05edd484a05ced1f47a927a6093cecd7c098db42fefd6cfec488e8c4ca3009'
lxc-start: failed to setup the container
lxc-start: invalid sequence number 1. expected 2
lxc-start: failed to spawn '2e05edd484a05ced1f47a927a6093cecd7c098db42fefd6cfec488e8c4ca3009'
Request PUT, application/json: https://api.stackato-nightly.activestate.com/apps/env -query {
"env" : ["FOO=bar"],
"instances" : "1",
"meta" : {
"console" : "null",
"created" : "1368826688", "debug" : "null",
"version" : "4" }, "name" : "env",
"resources" : {
"disk" : "2048",
"fds" : "256",
diff --git a/deploy/app-logs.rst b/deploy/app-logs.rst
index 0c5ebe3..228c113 100644 (file)
--- a/deploy/app-logs.rst
+++ b/deploy/app-logs.rst
@@ -19,6 +19,17 @@ filtered. Application log streams can be accessed via:
Information on system logs for Stackato itself and log aggregation
settings can be found in the :ref:`Log Aggregation <logging>` documentation.
+Log streams are tailed output from actual log files in each application
+container, generally found in the */app/logs/* directory. These files
sridharr@dhcp-22 ~/g/s/logyard> make dev-install
gofmt -w .
go install -tags zmq_3_x -v logyard/... github.com/ActiveState/tail/cmd/gotail
github.com/vmihailenco/bufio
github.com/ActiveState/log
# github.com/vmihailenco/bufio
can't create $WORK/github.com/vmihailenco/bufio/_obj/_go_.6: No such file or directory
github.com/alecthomas/gozmq
# github.com/ActiveState/log
can't create $WORK/github.com/ActiveState/log/_obj/_go_.6: No such file or directory
# This module provides a quick and dirty ruby interface to docker. The
# docker team promises to implement a properly ruby client library in
# the future. The docker API is not complete; see
# https://github.com/dotcloud/docker/issues/21
require 'open3'
# FIXME: replace IO.popen/backticks with the EM variants, although the
# docker commands below return instantaneously.
class Docker
diff --git a/go/goget.manifest b/go/goget.manifest
index 8a7687b..edb7bd5 100644
--- a/go/goget.manifest
+++ b/go/goget.manifest
@@ -6,13 +6,13 @@
# IMPORT_PATH VCS_TYPE REPO_URL [HEAD]
## doozer
-code.google.com/p/go.net/ hg http://mercurial.activestate.com/stackato-mirrors/go.net/ 3a318dc9
+code.google.com/p/go.net/ hg https://code.google.com/p/go.net/ 3a318dc9