$ dig dns.service.consul @localhost -p 8600 ; <<>> DiG 9.10.6 <<>> dns.service.consul @localhost -p 8600 ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 47597 ;; flags: qr aa rd; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1 ;; WARNING: recursion requested but not available ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4096 ;; QUESTION SECTION: ;dns.service.consul. IN A ;; ANSWER SECTION: dns.service.consul. 0 IN A 192.168.0.15 dns.service.consul. 0 IN A 192.168.0.18 dns.service.consul. 0 IN A 192.168.0.28 ;; Query time: 8 msec ;; SERVER: 127.0.0.1#8600(127.0.0.1) ;; WHEN: Sat Sep 12 01:00:55 BST 2020 ;; MSG SIZE rcvd: 95
I set up a cluster of DNS servers at home, next step is to use dnsdist along with consul to load balance .
0 Comments
Redirect internet facing domain name to a local host ip when at home network using coredns server8/30/2020
So this is one of my amazing learning of the day. I have been using coredns dns server at home home network to which all devices connect, beside just caching and speeding up opening website faster on home network. I also host my website from home. which while navigating I wanted to domain name should resolve to my local host ip that is serving the website. So here is the solution I figured out and it works.
Use the below Corefile for coredns(global) { log errors cache 36400 { prefetch 5 10m 10% } dnssec loadbalance } .:53 { import global hosts { 192.168.0.15 self-hosted.drydns.com fallthrough } forward . tls://1.1.1.3 { tls_servername cloudflare-dns.com health_check 10s } loop reload }
In the above corefile , I am using hosts plugin of CoreDNS, that allows me to mimi the systems /etc/hosts file even within configuration. I have defined self-hosted.drydns.com pointing to local server IP address which is hosting my website. And for other websites it is forwared to cloudeflare dns server.
And here are the results:
When I am at home network. (domain name resolve directly in a single hop.)
$ nslookup self-hosted.drydns.com Server: 192.168.0.75 Address: 192.168.0.75#53 Name: self-hosted.drydns.com Address: 192.168.0.15
In the above output of nslookup 192.168.0.75 is my CoreDNS Server I have setup in my router.
And take a look below when I am outside , connected to a public wifi or via phone hotspot.
$ nslookup self-hosted.drydns.com Server: 1.1.1.3 Address: 1.1.1.3#53 Non-authoritative answer: Name: self-hosted.drydns.com Address: 92.8.179.214
Now nslookup the same domain name I got it resolved to a external ip of the server. 1.1.1.3 is cloudfare DNS server ip.
sudo netstat -ltnp | grep 53
Where 53 is the port number, so if I run this on my linux box I get the following.
I wanted to put together a list of tools I have written from the time I started in vfx industry.
Starting from the first ever tool I wrote was more than a decade back. And that was not even in python. In 2008-2009 I had a chance to learn and work on Apple Shake as a compositor while I was in Vancouver. that is more than a decade from now. The first tool for Apple Shake was a macro that adds camera shake to a composite It was done while I worked on my first project with Landon and Blake. Second macro I wrote was to handle multi-pass composite. I uploaded my tools to creativehead.net .the website still exists but the interface is changed and I can't login to the website anymore. Around the same time prior to ever working on Apple Shake, I also wrote tools for Maya using mel. I can recall the tool was called badApple as name given by Christopher Hartt. Since I come from technical background I wrote huge line of code . I don't remember what it does. But Chris was impressed. Later when I moved to India and worked with Prime Focus I wrote tools for Eyeon Fusion using Lua. this tool was simple enough . It provided a prompt to browse image sequences and add them and generate a multi pass composite. There were few other tools I wrote but I do not remember anything from 2011. Moving on from Prime Focus I taught myself python. and made my first Technical Artist showreel with tools written in python. That was Render Manager. using that showreel I landed for a job at MPC Bangalore. From that point on I wrote many tools for vfx . I basically became a 2d pipeline developer mostly writing tools for Foundry Nuke. I took over a application that worked as frontend integration of user with the backend asset management system . It was called hubNuke. In earlier days it integrated Nuke with hub and later it also added integration with MPC's new asset management system Tessa. I also wrote gizmos for nuke used by compositors at MPC. Beside just writing tools for Nuke I also did some tools for Maya and Silhouette. From there I moved to Basefx in Beijing where I worked in vfx company but my tasks were mostly devops writing tools for pipeline developers. I wrote a web application frontend for multisite Base-fx packages deployment. The frontend was done in Vue.Js framework and a rest api gateway done in flask-restplus. that was my first experience with web application development. And after that I moved to London to work with Dneg where I worked on an application for Editorial / Layout department. Few frontend tools for maya using python for Animators. And Dneg's Popcorn framework for integrating nuke with Katana render dispatcher to dispatch 2d renders post lighting renders are done. That was 2019 and here I am now at ILM in 2020 working on Shotgun and RV and lot of different things. I am happy I finally got to do some development related to shotgun I always wanted which I also asked for to do at basefx but I didn't got it, Here at ILM I wrote my first rvpackage for rv. Hope more good developments come my way.
I finally have a good working simple example for HttpClient that works with Particle Photon. I have tested it on my particle photon and would like to document and share with everyone. I did faced one of the problem is that even when I included the HttpClient library into my experimental project it was continuously erroring pointing to glowfish library when I reckoned if glowfish was ever the dependency of httpClient library being included. So I have copied the httpClient.cpp and httpClient.h files along with my project.
// Author : Sanjeev Kumar // Contact: sanjeev at outlook Dot in // This #include statement was automatically added by the Particle IDE. #include "HttpClient.h" unsigned int nextTime = 0; // Next time to contact the server HttpClient http; http_header_t headers[] = { { "Authorization", "Basic QWxhZGRpbjpPcGVuU2VzYW1l" }, { "Accept" , "*/*"}, { NULL, NULL } // NOTE: Always terminate headers will NULL }; http_request_t request; http_response_t response; void setup() { Serial.begin(9600); } void loop() { if (nextTime > millis()) { return; } request.hostname = "localhost"; request.port = 80; request.path = "/flaskapp"; http.get(request, response, headers); Particle.publish("Response Status: ", String::format("%3i",response.status)); Particle.publish("Request body: ", response.body); nextTime = millis() + 10000; }
take a look at the gitlab link of httpclient get example here:
https://gitlab.com/particle-photon/httpclientexample |
![]()
Custom Search
Other Blogs & PagesGit Commands Animation & VFX SitesA MUST READ for Ani/VFX Artistsawakened by thoughts,
|