Skip to content

Instantly share code, notes, and snippets.

View jschneiderhan's full-sized avatar

Jon-Erik Schneiderhan jschneiderhan

View GitHub Profile
@jschneiderhan
jschneiderhan / gist:6391447
Created August 30, 2013 16:08
Error while trying to push to private docker registry (replaced real domain name with my.docker.registry.com)
$ sudo docker push my.docker.registry.com:443/private/testing123
The push refers to a repository [my.docker.registry.com:443/private/testing123] (len: 1)
Sending image list
Pushing repository my.docker.registry.com:443/private/testing123 (1 tags)
Pushing 27cf784147099545
2013/08/30 16:06:54 Failed to upload metadata: Put https://docker-registry/v1/images/27cf784147099545/json: dial tcp 199.101.28.20:443: connection timed out
ec2-107-20-55-241.compute-1.amazonaws.com Mixlib::ShellOut::ShellCommandFailed
ec2-107-20-55-241.compute-1.amazonaws.com ------------------------------------
ec2-107-20-55-241.compute-1.amazonaws.com Expected process to exit with [0], but received '1'
ec2-107-20-55-241.compute-1.amazonaws.com ---- Begin output of "bash" "/tmp/chef-script20131112-19676-1gxnkc5" ----
ec2-107-20-55-241.compute-1.amazonaws.com STDOUT: AssetSync: YAML file found /data/dcm/releases/65e3b0dc744074104c298aed45654c762d12405a/config/asset_sync.yml settings will be merged into the configuration
ec2-107-20-55-241.compute-1.amazonaws.com STDERR: ** Invoke assets:precompile (first_time)
ec2-107-20-55-241.compute-1.amazonaws.com ** Execute assets:precompile
ec2-107-20-55-241.compute-1.amazonaws.com /usr/local/rbenv/versions/2.0.0-p247/bin/ruby /data/dcm/releases/65e3b0dc744074104c298aed45654c762d12405a/vendor/bundle/ruby/2.0.0/bin/rake assets:precompile:all RAILS_ENV=staging RAILS_GROUPS=assets --trace
ec2-107-20-55-241.compute-1.a
@jschneiderhan
jschneiderhan / gist:8528201
Created January 20, 2014 20:17
Dockerfile for compiling mongo from source with ssl support
FROM ubuntu:12.04
MAINTAINER operations@meyouhealth.com
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y git-core build-essential scons openssl libssl-dev && rm -rf /var/cache/apt/archives/* # trying to reduce the size of the image
RUN mkdir /tmp/mongodb && cd /tmp/mongodb && git clone git://github.com/mongodb/mongo.git /tmp/mongodb && git checkout r2.4.6 && cd /tmp/mongodb && scons install -j $(( $(nproc) * 2)) --64 --ssl && rm -rf /tmp/mongodb # again combining commands and removing source files to reduce the size of the image
RUN mkdir -p /data/db
EXPOSE 27017
ENTRYPOINT ["/usr/local/bin/mongod"]
$ fleetctl list-units
UNIT STATE LOAD ACTIVE SUB DESC MACHINE
deis-cache.service loaded loaded active running deis-cache 9b461c4a.../10.183.46.35
deis-database.service loaded loaded active running deis-database 9b461c4a.../10.183.46.35
deis-logger.service loaded loaded active running deis-logger 9b461c4a.../10.183.46.35
deis-registry.service loaded loaded active running deis-registry 8a70a8de.../10.230.135.136
deis-router.service loaded loaded active running deis-router 9b461c4a.../10.183.46.35
$ fleetctl submit ../../controller/systemd/deis-controller.service
@jschneiderhan
jschneiderhan / gist:97b2c8bf32043a85e18c
Created August 18, 2014 18:46
Getting exit code 3 from slugbuilder
# Cat tar contents into container
docker@boot2docker:~$ id=$(cat source.tar | docker run -i -a stdin flynn/slugbuilder)
docker@boot2docker:~$ docker wait $id
3
docker@boot2docker:~$ docker logs $id
-----> Ruby app detected
-----> Compiling Ruby/Rails
...
-----> Compiled slug size is 71M
# Updated CMD="" and ran `docker build .`, which resulted in a7ac85520739
$ id=$(git archive master | docker run -i -a stdin a7ac85520739)
$ docker inspect $id
[{
"Args": [
"/bin/sh",
"-c",
"\"\""
],
"Config": {
@jschneiderhan
jschneiderhan / gist:42aaba7ec8327f204d2d
Last active August 29, 2015 14:08
Shipyard: How do you use '&' in environment variable values?
$ cat add-container.json
{
"name": "flynn/slugrunner",
"cpus": 0.1,
"memory": 256,
"type": "service",
"hostname": "",
"domain": "",
"labels": ["sample-web"],
"args": [],
#!/usr/bin/env ruby
require "socket"
require "pry"
require "pry-byebug"
Socket.udp_server_loop(53) do |msg, msg_src|
id, flags, qdcount, ancount, nscount, arcount = msg.unpack("nnnnnn")
qr = (flags & 0x8000) >> 15
#!/usr/bin/env ruby
require 'resolv'
Resolv::DefaultResolver.replace_resolvers(
[Resolv::Hosts.new, Resolv::DNS.new(nameserver: '127.0.0.1', search: ['bad1.com', 'bad2.com', 'good.com'], ndots: 5)]
)
puts Resolv.getaddress("example")

Keybase proof

I hereby claim:

  • I am jschneiderhan on github.
  • I am jschneiderhan (https://keybase.io/jschneiderhan) on keybase.
  • I have a public key whose fingerprint is BDBD 1045 5C0B DF79 08DD 9510 B7FA F694 7B6F 6C4F

To claim this, I am signing this object: