This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Exit immediately if any step fails | |
set -eo pipefail | |
# Variables | |
host=<hostname> | |
datetime=$(date +"%Y-%m-%dT%H%M") | |
tmp_folder=/tmp/restore_test_${datetime} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule FizzBuzz do | |
defguard is_fizz(value) when is_integer(value) and rem(value, 3) == 0 | |
defguard is_buzz(value) when is_integer(value) and rem(value, 5) == 0 | |
def run(val) do | |
1..val | |
|> Enum.each(fn val -> word(val) |> IO.inspect() end) | |
end | |
defp word(val) when is_fizz(val) and is_buzz(val), do: "fizzbuzz" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import deque | |
import Queue | |
import time | |
import gevent.queue | |
def queue_test(n): | |
q = Queue.Queue() | |
start = time.time() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sh-4.2# e ./filebeat | |
fatal error: concurrent map read and map write | |
goroutine 392 [running]: | |
runtime.throw(0x160e97d, 0x21) | |
/usr/local/go/src/runtime/panic.go:596 +0x95 fp=0xc4206f88f0 sp=0xc4206f88d0 | |
runtime.mapaccess1_faststr(0x14ad120, 0xc42013fc50, 0xc4202866fb, 0x40, 0x0) | |
/usr/local/go/src/runtime/hashmap_fast.go:217 +0x4cf fp=0xc4206f8950 sp=0xc4206f88f0 | |
github.com/elastic/beats/libbeat/processors/add_docker_metadata.(*watcher).Container(0xc42013fc80, 0xc4202866fb, 0x40, 0x1460d60) | |
/go/src/github.com/elastic/beats/libbeat/processors/add_docker_metadata/watcher.go:88 +0x4f fp=0xc4206f8988 sp=0xc4206f8950 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: ResourceQuota | |
metadata: | |
name: khightower-compute-resources | |
namespace: khightower | |
spec: | |
hard: | |
services: "5" | |
pods: "5" | |
requests.cpu: "2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
client = boto3.client('sns') | |
response = client.publish( | |
TopicArn='<your topic arn>', | |
Message='<your message>' | |
) | |
print("Response: {}".format(response)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Codegram Technologies | |
- Full Stack Fest | |
- https://www.youtube.com/channel/UCwoOpKfkyCQHW562hXXQAGg | |
- My Code School | |
- https://www.youtube.com/user/mycodeschool/playlists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/docker/docker/issues/30441#issuecomment-275124802 | |
You can still use the same volume for two services. If I understand correctly, you have a separate image holding the data, purely for propagating the volume? Say that that image is named mydataimage, you can do something like this; | |
version: "3.0" | |
services: | |
init: | |
image: mydataimage | |
volumes: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GenServer callbacks and return values | |
## init(args) | |
{:ok, state} | |
{:ok, state, timeout} | |
:ignore | |
{:stop, reason} | |
## handle_call(msg, {from, ref}, state) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Html exposing (..) | |
import Html.App exposing (beginnerProgram) | |
import Html.Attributes as HA exposing (..) | |
import Html.Events exposing (onClick, onInput) | |
import String | |
main = | |
beginnerProgram { model = model, view = view, update = update } | |
NewerOlder