This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import json | |
from urllib import unquote_plus | |
from xml.dom import minidom | |
from xml.parsers.expat import ExpatError | |
def remove_blanks_xml(node): | |
"""Remove blank texts from xml""" | |
for child_node in node.childNodes: | |
if child_node.nodeType == minidom.Node.TEXT_NODE: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
((count = 100)) # Maximum number to try. | |
((internet = 0)) | |
while [[ $count -ne 0 ]] ; do | |
ping -c 1 8.8.8.8 # Try once. | |
rc=$? | |
if [[ $internet -eq 0 ]] ; then | |
if [[ $rc -eq 0 ]] ; then | |
echo `say internet is up` | |
((internet = 1)) # If okay, flag to exit loop. | |
fi |