Skip to content

Instantly share code, notes, and snippets.

View tobstarr's full-sized avatar

Tobias Schwab tobstarr

View GitHub Profile
@tobstarr
tobstarr / Dockerfile
Last active December 20, 2015 00:49
FROM ubuntu
RUN sed 's/main$/main universe/' -i /etc/apt/sources.list && apt-get update
RUN apt-get install -y git-core python-pip build-essential python-dev libevent1-dev -y
RUN git clone https://github.com/dotcloud/docker-registry.git /docker-registry
RUN cd /docker-registry && pip install -r requirements.txt
RUN cp /docker-registry/config_sample.yml /docker-registry/config.yml
EXPOSE 5000
require "socket"
require "time"
require "syslog/logger"
module Syslog
class UDPLogger < Logger
attr_reader :socket
def initialize(tag, host = "127.0.0.1", port = 514)
@host = host
@tobstarr
tobstarr / Dockerfile
Last active November 2, 2018 18:05
Jenkins for go projects with docker
FROM ubuntu:12.04
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y openjdk-6-jdk curl git-core build-essential bzr
RUN mkdir -p /tmp/downloads
# install go
RUN curl -sf -o /tmp/downloads/go1.1.1.linux-amd64.tar.gz -L https://go.googlecode.com/files/go1.1.1.linux-amd64.tar.gz
RUN mkdir -p /opt && cd /opt && tar xfz /tmp/downloads/go1.1.1.linux-amd64.tar.gz
# install jenkins
RUN curl -sf -o /opt/jenkins-1.523.war -L http://mirrors.jenkins-ci.org/war/1.523/jenkins.war
require "yaml"
require "awesome_print"
ap YAML.load(DATA.read)
__END__
a:
name: John
email: [email protected]
root@tobstarr002:~# docker build -t test - << EOF
> FROM ubuntu
> RUN echo 1
> EOF
Uploading context 2048 bytes
Step 1 : FROM ubuntu
---> 8dbd9e392a96
Step 2 : RUN echo 1
---> Running in 3756c0b5a3f9
---> 303730c5adc4
@tobstarr
tobstarr / README.md
Last active December 18, 2015 22:49
Prime Tests

1048576 should be around 30 seconds for ruby 1.9.3p327

ping -c 20 rpm.newrelic.com
PING rpm.newrelic.com (204.93.223.152): 56 data bytes
64 bytes from 204.93.223.152: icmp_seq=0 ttl=243 time=126.194 ms
64 bytes from 204.93.223.152: icmp_seq=1 ttl=243 time=127.827 ms
64 bytes from 204.93.223.152: icmp_seq=2 ttl=243 time=129.254 ms
Request timeout for icmp_seq 3
64 bytes from 204.93.223.152: icmp_seq=4 ttl=243 time=125.912 ms
Request timeout for icmp_seq 5
64 bytes from 204.93.223.152: icmp_seq=6 ttl=243 time=126.097 ms
Request timeout for icmp_seq 7
class SystemProcess
def initialize(pid)
@pid = pid
end
def started_at
self.class.time_of_boot + started_seconds_after_boot
end
class << self
@tobstarr
tobstarr / .bookmarks
Created August 31, 2012 14:40
Bookmark System
first,link: http://www.some.url
second,link: http://www.someother.url
require "redis"
Redis.current.del("test")
def do_set!
did_set = nil
Redis.current.pipelined do
did_set = Redis.current.setnx("test", "ja")
Redis.current.expire("test", 3600)