Working with time in Go is pretty straightforward.
Get the current local time:
now := time.Now() // 02 Apr 15 14:03
Construct a time with Date(y, m, d, h, m, s, ns, loc):
| # one way w/o web interface: | |
| # java -jar lib/playbooks/servers/files/logstash-1.1.1-monolithic.jar agent -f lib/playbooks/servers/files/logstash.conf | |
| # another with a web interface(http://localhost:9292) : | |
| # java -jar lib/playbooks/servers/files/logstash-1.1.1-monolithic.jar agent -f lib/playbooks/servers/files/logstash.conf -- web --backend 'elasticsearch:///?local' | |
| # nc localhost 3333 < logfile | |
| # | |
| # When you are all done, you can delete the 'data' folder to delete the database. | |
| input { | |
| tcp { |
| # stacktrace java as one message | |
| multiline { | |
| #type => "all" # no type means for all inputs | |
| pattern => "(^.+Exception: .+)|(^\s+at .+)|(^\s+... \d+ more)|(^\s*Caused by:.+)" | |
| what => "previous" | |
| } | |
| foo@bar:~$ redis-cli | |
| 127.0.0.1:6379> dbsize | |
| (integer) 0 | |
| 127.0.0.1:6379> set user:1 1 | |
| OK | |
| 127.0.0.1:6379> set use:the:force luke | |
| OK | |
| 127.0.0.1:6379> set non:user a | |
| OK | |
| foo@bar:~$ redis-cli --eval scanregex.lua , "^user" |
Working with time in Go is pretty straightforward.
Get the current local time:
now := time.Now() // 02 Apr 15 14:03
Construct a time with Date(y, m, d, h, m, s, ns, loc):
| That’s one of the real strengths of Docker: the ability to go back to a previous commit. The secret is simply to docker tag the image you want. | |
| Here’s an example. In this example, I first installed ping, then committed, then installed curl, and committed that. Then I rolled back the image to contain only ping: | |
| $ docker history imagename | |
| IMAGE CREATED CREATED BY SIZE | |
| f770fc671f11 12 seconds ago apt-get install -y curl 21.3 MB | |
| 28445c70c2b3 39 seconds ago apt-get install ping 11.57 MB | |
| 8dbd9e392a96 7 months ago 131.5 MB |
| development: | |
| adapter: mysql2 | |
| encoding: utf8 | |
| database: my_database | |
| username: root | |
| password: | |
| apt: | |
| - somepackage | |
| - anotherpackage |
| development: | |
| adapter: mysql2 | |
| encoding: utf8 | |
| database: my_database | |
| username: root | |
| password: | |
| apt: | |
| - somepackage | |
| - anotherpackage |
This gist assumes:
| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| name: kube-dns | |
| namespace: kube-system | |
| labels: | |
| k8s-app: kube-dns | |
| kubernetes.io/cluster-service: "true" | |
| kubernetes.io/name: "KubeDNS" | |
| spec: |