Skip to content

Instantly share code, notes, and snippets.

@llipe
Last active July 20, 2020 16:57
Show Gist options
  • Save llipe/c8f223d91820d4226a3dc2fb08d7f383 to your computer and use it in GitHub Desktop.
Save llipe/c8f223d91820d4226a3dc2fb08d7f383 to your computer and use it in GitHub Desktop.
MacOS command line utilities

MacOS Command Line Utilities

TOC

Speedtest

Ref: https://www.speedtest.net/apps/cli

Installation

brew tap teamookla/speedtest
brew update
brew install speedtest --force

Usage

speedtest

#Sample Result
   Speedtest by Ookla

     Server: EdgeUno - Santiago (id = 29671)
        ISP: Movistar Movil Chile
    Latency:    24.26 ms   (7.77 ms jitter)
   Download:     5.00 Mbps (data used: 5.9 MB)
     Upload:     3.11 Mbps (data used: 5.2 MB)
Packet Loss:     0.0%
 Result URL: https://www.speedtest.net/result/c/24770316-121f-482a-b7b4-d7f9cbfaa01e

Domain tools (whois, dig, ping, nslookup)

Dig allow to query nameserver agains a specific type of record. eg.:

dig -t MX llipe.com

; <<>> DiG 9.10.6 <<>> -t MX llipe.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 60778
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;llipe.com.			IN	MX

;; ANSWER SECTION:
llipe.com.		300	IN	MX	1 aspmx.l.google.com.
llipe.com.		300	IN	MX	5 alt2.aspmx.l.google.com.
llipe.com.		300	IN	MX	5 aspmx.l.google.com.
llipe.com.		300	IN	MX	10 aspmx2.googlemail.com.
llipe.com.		300	IN	MX	10 aspmx3.googlemail.com.

;; Query time: 36 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Mon Jul 20 12:48:38 -04 2020
;; MSG SIZE  rcvd: 172

Ping allows to test conectivity between services. For example:

ping -o llipe.com
PING llipe.com (104.31.68.58): 56 data bytes
64 bytes from 104.31.68.58: icmp_seq=0 ttl=54 time=39.590 ms

--- llipe.com ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 39.590/39.590/39.590/0.000 ms

The host command performs a NSlookup identifying IPs and DNS records associated to a domain

host securitytrails.com
securitytrails.com has address 151.139.243.5
securitytrails.com mail is handled by 1 aspmx.l.google.com.
securitytrails.com mail is handled by 5 alt1.aspmx.l.google.com.
securitytrails.com mail is handled by 5 alt2.aspmx.l.google.com.
securitytrails.com mail is handled by 10 aspmx2.googlemail.com.
securitytrails.com mail is handled by 10 aspmx3.googlemail.com.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment