Skip to content

Instantly share code, notes, and snippets.

View tjl2's full-sized avatar

Tim Littlemore tjl2

  • DICE
  • Cheshire, UK
  • 13:50 (UTC +01:00)
View GitHub Profile
@tjl2
tjl2 / 1st-deployment-svc-ingress.yaml
Last active September 11, 2023 16:45
Nginx Ingress Controller Server Snippets Example
# This configuration is an example of how to get an Ingress to respond directly
# to a path, without routing to a service. This setup is being used on a DOKS
# service, with Nginx Ingress Controller installed and a Load Balancer in place.
# Those pieces can be setup easily with a 1-click install in the DO Marketplace:
# https://marketplace.digitalocean.com/apps/nginx-ingress-controller. I then
# grabbed the IP adress of the LB and pointed an A record at it. With that in
# place, this YAML can be applied with:
# kubectl apply -f ingress-nginx-server-snippets-example.yaml
# Once this is applied, you can test it with:
°@°A°B°C°D°E°F°G°H°I°J°K°L°M°N°O
°P°Q°R°S°T°U°V°W°X°Y°Z°[°\°]°^°_
°`°a°b°c°d°e°f°g°h°i°j°k°l°m°n°o
°p°q°r°s°t°u°v°w°x°y°z°{°|°}°~°
°Ä°Å°Ç°É°Ñ°Ö°Ü°á°à°â°ä°ã°å°ç°é°è
°ê°ë°í°ì°î°ï°ñ°ó°ò°ô°ö°õ°ú°ù°û°ü
°†
¢@¢A¢B¢C¢D¢E¢F¢G¢H¢I¢J¢K¢L¢M¢N¢O
¢P¢Q¢R¢S¢T¢U¢V¢W¢X¢Y¢Z¢[¢\¢]¢^¢_
™@™A™B™C™D™E™F™G™H™I™J™K™L™M™N™O
™P™Q™R™S™T™U™V™W™X™Y™Z™[™\™]™^™_
™`™a™b™c™d™e™f™g™h™i™j™k™l™m™n™o
™p™q™r™s™t™u™v™w™x™y™z™{™|™}™~°°
™Ä™Å™Ç™É™Ñ™Ö™Ü™á™à™â™ä™ã™å™ç™é™è
™ê™ë™í™ì™î™ï™ñ™ó™ò™ô™ö™õ™ú™ù™û™ü
™†
´@´A´B´C´D´E´F´G´H´I´J´K´L´M´N´O
´P´Q´R´S´T´U´V´W´X´Y´Z´[´\´]´^´_

Keybase proof

I hereby claim:

  • I am tjl2 on github.
  • I am tjl2 (https://keybase.io/tjl2) on keybase.
  • I have a public key ASAWn1i-glXHeNmiNXuaf0C6wMjyTqllPzqfpww-sOk04Ao

To claim this, I am signing this object:

@tjl2
tjl2 / es-log.md
Created June 20, 2015 10:06
ES log showing 2 failures when using `_tun0_` and one success when using `_tun0:ipv4_`

First extract shows behaviour while bind_host and public_host are set to _tun0_, and shows that the behaviour doesn't change after a restart (note the server is called 'Doctor Droom' and then 'Dr. Otto Octavius' after the restart):

[2015-06-20 09:51:19,529][INFO ][node                     ] [Doctor Droom] version[1.5.2], pid[9223], build[62ff986/2015-04-27T09:21:06Z]
[2015-06-20 09:51:19,529][INFO ][node                     ] [Doctor Droom] initializing ...
[2015-06-20 09:51:19,531][INFO ][plugins                  ] [Doctor Droom] loaded [], sites []
[2015-06-20 09:51:21,132][INFO ][node                     ] [Doctor Droom] initialized
[2015-06-20 09:51:21,133][INFO ][node                     ] [Doctor Droom] starting ...
[2015-06-20 09:51:21,184][INFO ][transport                ] [Doctor Droom] bound_address {inet[0.0.0.0/0.0.0.0:9400]}, publish_address {inet[/192.168.1.90:9400]}
[2015-06-20 09:51:21,199][INFO ][discovery                ] [Doctor Droom] github-enterprise/bzQiRcHkRBOe08dra--gOw
[2015-06-19 14:24:46,172][INFO ][node ] [the Living Colossus It] version[1.5.2], pid[10762], build[62ff986/2015-04-27T09:21:06Z]
[2015-06-19 14:24:46,172][INFO ][node ] [the Living Colossus It] initializing ...
[2015-06-19 14:24:46,178][INFO ][plugins ] [the Living Colossus It] loaded [], sites []
[2015-06-19 14:24:49,146][INFO ][node ] [the Living Colossus It] initialized
[2015-06-19 14:24:49,147][INFO ][node ] [the Living Colossus It] starting ...
[2015-06-19 14:24:49,219][INFO ][transport ] [the Living Colossus It] bound_address {inet[/0.0.0.0:9300]}, publish_address {inet[/192.168.1.90:9300]}
[2015-06-19 14:24:49,233][INFO ][discovery ] [the Living Colossus It] github-enterprise/2e7NdPs4RhimeJf6DtkCrw
[2015-06-19 14:24:52,248][INFO ][cluster.service ] [the Living Colossus It] new_master [the Living Colossus It][2e7NdPs4RhimeJf6DtkCrw][localhost][inet[/192.168.1.90:9300]]{
# Run this from the command line like so:
# ruby pr_comments.rb [user]/[repo] [pr-id]
require 'rest-client'
require 'json'
require 'pp'
# I usually configure a setup file to set the USERNAME, PASSWORD & HOSTNAME constants for use in the @api_url string
# You can just hard-code them in here, for testing purposes.
@api_url = "http://#{USERNAME}:#{PASSWORD}@#{HOSTNAME}/api/v3/"
@tjl2
tjl2 / add-commit-comment.rb
Created September 13, 2013 20:48
Add a commit comment with the GitHub API
require 'rubygems'
require 'rest-client'
require 'json'
require 'pp'
@config = YAML.load(File.open('.github.yml'))
HOSTNAME = '' # add your GHE hostname here
USERNAME = '' # add your username here
PASSWORD = '' # add your password or OAuth token here
@tjl2
tjl2 / user_ids.rb
Last active December 22, 2015 22:18
Getting user IDs from the GitHub API
# You'll need the rest-client and json gems installed to use this
require 'rubygems'
require 'rest-client'
require 'json'
HOSTNAME = '' # Put your GHE hostname here
USERNAME = '' # Put your Admin user name here
PASSWORD = '' # Put your Admin user password here
# Please change this to https, if you are using SSL on your GHE installation