Sunday, November 17, 2019

Adding SRV record


Online Tool for Looking up DNS records

The online utility in the reference section is able to resolve multiple SRV records. An example site where there are some SRV records is _sip._udp.sip.voice.google.com

Now this can also be found our using

dig _sip._udp.sip.voice.google.com SRV


dig _sip._udp.sip.voice.google.com SRV

; <<>> DiG 9.10.6 <<>> _sip._udp.sip.voice.google.com SRV
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- 41350="" id:="" noerror="" opcode:="" p="" query="" status:="">;; flags: qr rd; QUERY: 1, ANSWER: 2, AUTHORITY: 4, ADDITIONAL: 9
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1280
;; QUESTION SECTION:
;_sip._udp.sip.voice.google.com. IN SRV

;; ANSWER SECTION:
_sip._udp.sip.voice.google.com. 300 IN SRV 10 1 5060 sip-anycast-1.voice.google.com.
_sip._udp.sip.voice.google.com. 300 IN SRV 20 1 5060 sip-anycast-2.voice.google.com.

;; AUTHORITY SECTION:
google.com. 17393 IN NS ns3.google.com.
google.com. 17393 IN NS ns4.google.com.
google.com. 17393 IN NS ns2.google.com.
google.com. 17393 IN NS ns1.google.com.

;; ADDITIONAL SECTION:
ns1.google.com. 296707 IN A 216.239.32.10
ns2.google.com. 292461 IN A 216.239.34.10
ns3.google.com. 292653 IN A 216.239.36.10
ns4.google.com. 292689 IN A 216.239.38.10
ns1.google.com. 68329 IN AAAA 2001:4860:4802:32::a
ns2.google.com. 292461 IN AAAA 2001:4860:4802:34::a
ns3.google.com. 292653 IN AAAA 2001:4860:4802:36::a
ns4.google.com. 292689 IN AAAA 2001:4860:4802:38::a

;; Query time: 110 msec
;; SERVER: 64.104.128.236#53(64.104.128.236)
;; WHEN: Mon Nov 04 11:56:20 IST 2019
;; MSG SIZE  rcvd: 407




References:
https://www.a2hosting.in/kb/getting-started-guide/configuring-domain-settings/adding-an-srv-record-to-a-domain
https://centralops.net/co/NsLookup.aspx
https://www.onsip.com/voip-resources/voip-fundamentals/dns-srv-records-sip

What is SDWAN


SD-WAN is a software-defined approach to managing the wide-area network, or WAN.

Key advantages include:

Reducing costs with transport independence across MPLS, 3G/4G LTE, etc.
Improving business application performance and increasing agility.
Optimizing the user experience and efficiency for SaaS and public cloud applications.
Simplifying operations with automation and cloud-based management.

With SD-WAN, IT can:
Simplify management. As a centralized, cloud-delivered WAN architecture, SD-WAN makes it easy to scale across thousands of endpoints, whether they are in the branch, campus, or cloud. IT has the ability to automate zero-touch deployment globally, using a single management interface.

Improve the user experience. WAN optimization delivers optimal cloud application performance from multiple clouds to users anywhere. In the event of link failure or link degradation, application-aware routing can dynamically route traffic between dedicated circuits and secure Internet connections to drive constant delivery of business-critical applications. Additionally, businesses realize OpEx improvements by offloading expensive MPLS services with more economical and flexible broadband (including secure VPN connections).

Increase security. Threat prevention is enforced at the right place. SD-WAN architecture features distributed security at the branch level. Data does not have to travel back to the headquarters or data center for advanced security protection (such as a firewall, DNS enforcement, or intrusion prevention).


References:

Python - Date Operations



Pretty simple. Like below

from datetime import date
from datetime import time
from datetime import datetime
def main():
    ##DATETIME OBJECTS
    #Get today's date from datetime class
    today=datetime.now()
    #print (today)
    # Get the current time
    #t = datetime.time(datetime.now())
    #print "The current time is", t
    #weekday returns 0 (monday) through 6 (sunday)
    wd=date.weekday(today)
    #Days start at 0 for monday
    days= ["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]
    print("Today is day number %d" % wd)
    print("which is a " + days[wd])

if __name__== "__main__":
    main()





Python - Calendar Tutorial



Calendar module in Python has the calendar class that allows the calculations for various task based on date, month, and year. On top of it, the TextCalendar and HTMLCalendar class in Python allows you to edit the calendar and use as per your requirement.


References:
https://www.guru99.com/calendar-in-python.html

How to perform trace route to specific port



The command is below

traceroute -U -p 16387 network-analyzer-tool-dev.mpsvcs.com


References:

MongoDB, NodeJS getting into below error. useUnifiedTopology




(node:85632) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.
(node:85632) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
The file was saved!


References:
https://stackoverflow.com/questions/57895175/server-discovery-and-monitoring-engine-is-deprecated

Tracert & Traceroute




On Windows, tracert sends ICMP Echo Request packets, rather than the UDP packets traceroute sends by default. The time-to-live (TTL) value, also known as hop limit, is used in determining the intermediate routers being traversed towards the destination.



References:
https://en.wikipedia.org/wiki/Traceroute

What is Middleware in Sails JS



In an MVC framework, the term “middleware” typically refers more specifically to code that runs before or after your route-handling code (i.e. your controller actions), making it possible to apply the same piece of code to multiple routes or actions.

Below are the various middleware actions available in sails

HTTP middleware—to apply code before every HTTP request (see below for more details)
Policies—to apply code before one or more controller actions
Hooks with the routes feature implemented—to apply code before one or more route handlers
Custom responses—to apply code after one or more controller actions

HTTP middleware

Sails is fully compatible with Express / Connect middleware, which are functions that accept req, res and next as arguments. Every app utilizes a configurable middleware stack for handling HTTP requests. Each time the app receives an HTTP request, its configured HTTP middleware stack runs in order.



References:
https://sailsjs.com/documentation/concepts/middleware

How to reset Electron Cache



The Electron stores it's cache in these folders:



The Electron stores it's cache in these folders:

Windows:
C:\Users\<user>\AppData\Roaming\<yourAppName>\Cache

Linux:
/home/<user>/.config/<yourAppName>/Cache

OS X:
/Users/<user>/Library/Application Support/<yourAppName>/Cache



So deleting these folders can also help you. Of course this is one time solution ;-)

References:
https://medium.com/how-to-electron/how-to-reset-application-data-in-electron-48bba70b5a49
https://stackoverflow.com/questions/31446782/how-to-clear-the-cache-data-in-electronatom-shell/44675132

Upgrade Node Version on EC2 Instance



Below are few notes for upgrading the Node version on EC2.

1) Connect to your Linux instance as ec2-user using SSH
2) Install node version manager (nvm) by typing the following at the command line.

Warning

AWS does not control the following code. Before you run it, be sure to verify its authenticity and integrity. More information about this code can be found in the nvm GitHub repository.

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
We will use nvm to install Node.js because nvm can install multiple versions of Node.js and allow you to switch between them.

3) Activate nvm by typing the following at the command line.

. ~/.nvm/nvm.sh


4) Use nvm to install the latest version of Node.js by typing the following at the command line.

nvm install node

Installing Node.js also installs the Node Package Manager (npm) so you can install additional modules as needed.

5) Test that Node.js is installed and running correctly by typing the following at the command line.

node -e "console.log('Running Node.js ' + process.version)"
This displays the following message that shows the version of Node.js that is running.

Running Node.js VERSION

References:
https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-up-node-on-ec2-instance.html

Wednesday, November 13, 2019

DNS - Zone and Zone files

DNS - Zone and Zone files

A DNS zone is an administrative space within the Domain Name System (DNS). A DNS zone forms one part of the DNS namespace delegated to administrators or specific entities. Each zone contains the resource records for all of its domain names.

A DNS zone file is a text file stored on a DNS server that contains all the DNS records for every domain within that zone. It is mandatory for the zone file to have the TTL (Time to Live) listed before any other information. The TTL specifies how long a DNS record is in the DNS server’s cache memory. The zone file can only list one DNS record per line and will have the Start of Authority (SOA) record listed first. The SOA record contains essential domain name information including the primary authoritative name server for the DNS Zone.

A sample is below



references
https://www.liquidweb.com/kb/understanding-the-dns-process/