Skip to content

Instantly share code, notes, and snippets.

View shreyaskarnik's full-sized avatar
🤖

Shreyas Karnik shreyaskarnik

🤖
View GitHub Profile
2015/04/29 20:03:15 [error] 9#0: *1 "/etc/nginx/html/index.html" is not found (2: No such file or directory), client: 209.163.206.98, server: , request: "GET / HTTP/1.1", host: "myreg-xyz.com"
209.163.206.98 - - [29/Apr/2015:20:03:15 +0000] "GET / HTTP/1.1" 404 169 "-" "curl/7.35.0" "-"
2015/04/29 20:03:24 [error] 9#0: *2 upstream sent no valid HTTP/1.0 header while reading response header from upstream, client: 209.163.206.98, server: , request: "GET /v2/ HTTP/1.1", upstream: "http://0.0.0.0:5000/v2/", host: "myreg-xyz.com"
209.163.206.98 - - [29/Apr/2015:20:03:24 +0000] "GET /v2/ HTTP/1.1" 009 7 "-" "curl/7.35.0" "-"
2015/04/29 20:03:31 [error] 9#0: *4 upstream sent no valid HTTP/1.0 header while reading response header from upstream, client: 209.163.206.98, server: , request: "GET /v2/_ping HTTP/1.1", upstream: "http://0.0.0.0:5000/v2/_ping", host: "myreg-xyz.com"
209.163.206.98 - - [29/Apr/2015:20:03:31 +0000] "GET /v2/_ping HTTP/1.1" 009 7 "-" "curl/7.35.0" "-"
2015/04/29 20:04:29 [error] 9#0: *6 upstrea
$> docker push myreg-xyz.com/registryv2nginx
The push refers to a repository [myreg-xyz.com/registryv2nginx] (len: 1)
Sending image list
FATA[0000] Error: Status 405 trying to push repository registryv2nginx: "<html>\r\n<head><title>405 Not Allowed</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>405 Not Allowed</h1></center>\r\n<hr><center>nginx/1.7.12</center>\r\n</body>\r\n</html>\r\n"
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
$> curl -iv http://myreg-xyz.com/v2/
* Hostname was NOT found in DNS cache
* Trying 52.13.92.158...
* Connected to myreg-xyz.com (52.13.92.158) port 80 (#0)
> GET /v2/ HTTP/1.1
> User-Agent: curl/7.35.0
> Host: myreg-xyz.com
> Accept: */*
>

@shreyaskarnik
shreyaskarnik / logstash.conf
Last active November 3, 2016 01:29
Logstash-gelf-conf
input {
gelf {}
}
output {
elasticsearch {
host => "elasticsearch"
protocol => "http"
workers=> 10
}
stdout {
@shreyaskarnik
shreyaskarnik / Instructions.md
Last active March 24, 2023 15:35
Route Docker Logs to ELK Stack
  • With Docker 1.8.0 shipped new log-driver for GELF via UDP, this means that the logs from Docker Container(s) can be shipped directly to the ELK stack for further analysis.
  • This tutorial will illustrate how to use the GELF log-driver with Docker engine.
  • Step 1: Setup ELK Stack:
    • docker run -d --name es elasticsearch
    • docker run -d --name logstash --link es:elasticsearch logstash -v /tmp/logstash.conf:/config-dir/logstash.conf logstash logstash -f /config-dir/logstash.conf
    • Note the config for Logstash can be found at this link
    • docker run --link es:elasticsearch -d kibana
  • Once the ELK stack is up now let's fire up our nginx container which ships its logs to ELK stack.
  • LOGSTASH_ADDRESS=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' logstash)
  • `docker run -d --net=host --log-driver=gelf --log-opt gelf-address=u
@shreyaskarnik
shreyaskarnik / json-view.css
Last active January 5, 2017 18:19
JSONView Theme
body {
white-space: pre;
font-family: 'Ubuntu Mono';
font-size: 16px;
line-height:20px;
color: white;
background-color: #2B2A27;
}
.property {
@shreyaskarnik
shreyaskarnik / ha.yaml
Last active February 28, 2017 01:01
ha
homeassistant:
# Name of the location where Home Assistant is running
name: Home
# Location required to calculate the time the sun rises and sets
# Impacts weather/sunrise data (altitude above sea level in meters)
elevation: 180
# metric for Metric, imperial for Imperial
unit_system: metric
# Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
time_zone: America/Chicago
@shreyaskarnik
shreyaskarnik / keybase.md
Created November 21, 2017 04:35
Keybase Github Verification

Keybase proof

I hereby claim:

  • I am shreyu86 on github.
  • I am shreyask (https://keybase.io/shreyask) on keybase.
  • I have a public key whose fingerprint is 3348 CCD4 3ADF DDD8 948D F9BE 46BD E9D8 91DB 4C6E

To claim this, I am signing this object:

@shreyaskarnik
shreyaskarnik / custom.css
Created February 19, 2018 03:46
Custom Logo in Jupyter Notebook
#ipython_notebook {
height: 40px !important;
}
#ipython_notebook img{
display:block;
background: url(logo.png) no-repeat;
background-size: contain;
width: 233px;
height: 33px;
padding-left: 233px;