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
In [90]: str(r0.answer[0]) | |
Out[90]: 'pinterest.com. 60 IN A 54.243.129.204\npinterest.com. 60 IN A 50.16.219.149\npinterest.com. 60 IN A 54.225.186.27\npinterest.com. 60 IN A 54.235.105.67\npinterest.com. 60 IN A 50.16.231.144\npinterest.com. 60 IN A 23.21.210.110\npinterest.com. 60 IN A 50.17.251.14\npinterest.com. 60 IN A 54.243.162.10' | |
In [91]: str(r1.answer[0]) | |
Out[91]: 'pinterest.com. 60 IN A 54.197.238.4\npinterest.com. 60 IN A 174.129.10.138\npinterest.com. 60 IN A 50.16.211.7\npinterest.com. 60 IN A 54.225.188.149\npinterest.com. 60 IN A 174.129.209.56\npinterest.com. 60 IN A 54.225.139.43\npinterest.com. 60 IN A 54.225.169.36\npinterest.com. 60 IN A 50.17.208.61' | |
In [92]: if str(r0.answer[0]) == str(r1.answer[0]): | |
print('No problem') | |
....: |
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
(dnsdiff)jenders@collaris/pts/0: dnsdiff $ ./dnsdiff.py --help | |
usage: dnsdiff.py [-h] -f FILENAME --from-ns NAMESERVER1 --to-ns NAMESERVER2 | |
optional arguments: | |
-h, --help Show this help message and exit | |
-f FILENAME, --filename FILENAME | |
File containing resource records to verify. File is | |
expected to be a valid zone master file as described | |
here: https://tools.ietf.org/html/rfc1035#section-5 | |
--from-ns NAMESERVER1 |
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
__zsh_like_cd() | |
{ | |
# Called as: | |
# cd() { __zsh_like_cd cd "$@" ; } | |
# popd() { __zsh_like_cd popd "$@" ; } | |
# pushd() { __zsh_like_cd pushd "$@" ; } | |
# So, "$@" in __zsh_like_cd contains the __zsh_like_cd "personality" as well as passed arguments | |
\typeset __zsh_like_cd_hook # define local variable in __zsh_like_cd scope, may be POSIXly correct but lol- #! is /bin/bash, use "local __zsh_like_cd_hook". Also, hilarious that they prepend \ to typeset because who knows if you can trust that it's not hooked! | |
if | |
builtin "$@" # builtin returns true if command is a built-in |
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
jenders@jenders-mba tmp :) $ cat ./foo.sh | |
#!/bin/bash | |
echo "\$@: $@" | |
flags=() | |
for flag in "$@"; do | |
if [[ "${flag}" =~ ^- ]]; then | |
flags=("${flags[@]}" "${flag}") | |
fi |
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
#!/usr/bin/python3.4 | |
import math | |
import statistics as stats | |
import signal | |
import sys | |
from os.path import basename | |
# Hide stack trace from KeyboardInterrupt |
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
[root@dev-aje:~]# apt-cache --help | grep -- depends | |
depends - Show raw dependency information for a package | |
rdepends - Show reverse dependency information for a package | |
[root@dev-aje:~]# apt-cache depends libpng12-0 | |
libpng12-0 | |
Depends: libc6 | |
Depends: zlib1g | |
PreDepends: multiarch-support | |
Conflicts: libpng12-dev | |
Conflicts: <mzscheme> |
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
#!/bin/bash | |
# for each list of nodes in ISP metadata list | |
for country in metadata/by-isp/*; do | |
ccode="$(basename ${country})" | |
echo "${ccode}" | |
mkdir "by-isp/${ccode}" | |
# from node list for each country, create file with only tests from said country | |
pattern=$(awk '{ print $2 }' "${country}" \ |
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
>>> a = "1.0" | |
>>> int(a) | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
ValueError: invalid literal for int() with base 10: '1.0' | |
>>> int(float(a)) | |
1 | |
>>> foo = "1.0" | |
>>> int(foo) | |
Traceback (most recent call last): |
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
if read proto cookie && [ -n "$DISPLAY" ]; then | |
if [ `echo $DISPLAY | cut -c1-10` = 'localhost:' ]; then | |
# X11UseLocalhost=yes | |
echo add unix:`echo $DISPLAY | | |
cut -c11-` $proto $cookie | |
else | |
# X11UseLocalhost=no | |
echo add $DISPLAY $proto $cookie | |
fi | xauth -q - | |
fi |
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
def params_to_dict(param_str): | |
splits = param_str.split(" ") | |
data = {} | |
prev_key = None | |
prev_val = None | |
for s in splits: | |
if "=" in s: | |
key, val = s.split("=") | |
if prev_key: |