ForDoDone

Tales from the Command Line…

ForDoDone

Main menu

Skip to primary content
Skip to secondary content
  • Home
  • About

Monthly Archives: September 2015

use awk to find missing element of sequential list

Posted on September 18, 2015 by ForDoDone
Reply

Start with a list of a /24 of IP addresses:

# tail list.txt
        10.1.59.248
        10.1.59.249
        10.1.59.251
        10.1.59.252
        10.1.59.254

Find the missing elements from the sequence of last octets:

# awk -F [./] 'BEGIN{i=0}{i++;if(i!=$4){print i;i=$4}}' list.txt
250
253
share:
Posted in Miscellaneous | Tagged awk | Leave a reply

use dig to monitor DNS server for response

Posted on September 10, 2015 by ForDoDone
Reply
while true; do j=`dig < hostname > @W.X.Y.Z +short`; if [ "$j" != "1.2.3.4" ]; then echo nodig |mail 8185551212@vtext.com; break; fi ; sleep 1m; done;

This particular DNS server was only responding intermittently, so it needed some closer watching

share:
Posted in Miscellaneous, One Liners | Tagged dig, while | Leave a reply
Twitter
Visit Us
Follow
Instagram
RSS
Google+
https://fordodone.com/2015/09/">

Recent Posts

  • Connect to MongoDB Atlas Replica Set via SSH Tunnels
  • list contents of all docker volumes
  • connect to ssh tunnel on Mac host from inside docker container
  • using docker-compose to prototype against different databases
  • generate uuid bash

Tags

/dev/null apache awk Bash bc column curl cut dd docker docker-compose esxcli eval find forloop git grep mail mount mysql nagios NFS nmap openssl paste ping postfix route RPi rsync sed seq sort ssh ssh-keygen tail tar touch tr uniq unzip vim-cmd wget while zgrep

Categories

  • AWS
  • Bash
  • Continuous Delivery
  • Debian
  • Docker
  • General
  • Linux
  • Miscellaneous
  • MongoDB
  • MySQL
  • NetApp
  • Networking
  • One Liners
  • Puppet
  • Scripts
  • SSL
  • Troubleshooting
  • Ubuntu
  • VMWare
  • Vyatta
  • Windows
September 2015
S M T W T F S
« Aug   Oct »
 12345
6789101112
13141516171819
20212223242526
27282930  

Archives

  • March 2018
  • December 2017
  • November 2017
  • September 2017
  • August 2017
  • June 2017
  • April 2017
  • December 2016
  • September 2016
  • July 2016
  • June 2016
  • May 2016
  • April 2016
  • March 2016
  • February 2016
  • January 2016
  • December 2015
  • November 2015
  • October 2015
  • September 2015
  • August 2015
  • July 2015
  • May 2015
  • April 2015
  • March 2015
  • February 2015
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • June 2014
  • May 2014
  • April 2014
  • March 2014
  • January 2014
  • December 2013
  • November 2013
  • October 2013
  • September 2013
  • August 2013
  • July 2013
  • June 2013
  • May 2013
  • April 2013
Proudly powered by WordPress