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
from itertools import product | |
modified_strings = [] | |
for base_string, bit in product(A, B): | |
modified_strings.append(base_string.replace(bit, '')) |
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
Oct 14 20:47:51 remora kernel: sd 2:0:0:0: [sdb] Unhandled sense code | |
Oct 14 20:47:51 remora kernel: sd 2:0:0:0: [sdb] | |
Oct 14 20:47:51 remora kernel: Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE | |
Oct 14 20:47:51 remora kernel: sd 2:0:0:0: [sdb] | |
Oct 14 20:47:51 remora kernel: Sense Key : Medium Error [current] | |
Oct 14 20:47:51 remora kernel: sd 2:0:0:0: [sdb] | |
Oct 14 20:47:51 remora kernel: Add. Sense: Unrecovered read error | |
Oct 14 20:47:51 remora kernel: sd 2:0:0:0: [sdb] CDB: | |
Oct 14 20:47:51 remora kernel: Read(10): 28 00 00 11 2b 48 00 00 08 00 | |
Oct 14 20:47:51 remora kernel: end_request: critical medium error, dev sdb, sector 1125192 |
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 json | |
import sys | |
if __name__ == '__main__': | |
with open(sys.argv[1]) as jdata: | |
data = json.load(jdata) | |
# fetch identification data | |
identifiers = {d['description'][12:]:d['value'] | |
for d in data['identifiers'] |
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
me@bibook ~ bibook $ source activate djangoenv | |
xonsh: For full traceback set: $XONSH_SHOW_TRACEBACK = True | |
File "<string>", line None | |
SyntaxError: /opt/conda/lib/python3.5/site-packages/xontrib/xonda.xsh:4:9: ('code: $BASH_VERSION',) | |
if [[ -n $BASH_VERSION ]]; then | |
me@bibook ~ bibook $ |
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 string | |
sentence = input("Please enter a sentence \n") | |
translator = str.maketrans({key: None for key in string.punctuation}) | |
words = sentence.translate(translator).lower().split() | |
def indices(source_list, item): | |
return [index for index, value in enumerate(source_list) if value == item] |
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
me@bibook ~> env | grep "LANG\|LC" | |
LANG=C.UTF-8 | |
LC_TIME=en_GB.UTF-8 | |
me@bibook ~> locale | |
LANG="C.UTF-8" | |
LC_COLLATE="C" | |
LC_CTYPE="C" | |
LC_MESSAGES="C" | |
LC_MONETARY="C" | |
LC_NUMERIC="C" |
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
~ $ locale | |
LANG= | |
LC_COLLATE="C" | |
LC_CTYPE="UTF-8" | |
LC_MESSAGES="C" | |
LC_MONETARY="C" | |
LC_NUMERIC="C" | |
LC_TIME="C" | |
LC_ALL= | |
~ $ sudo ag LC_TYPE /etc ~/.bash* ~/.profile |
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
from formtest.forms import MyForm | |
a_dict = {'name': 'Foo', 'value': 12} | |
another_dict = {'name': 'Bar', 'value': 34 } | |
# Forms | |
## Missing both required fields | |
form = MyForm() |
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
Port 22 | |
Protocol 2 | |
HostKey /etc/ssh/ssh_host_rsa_key | |
HostKey /etc/ssh/ssh_host_dsa_key | |
HostKey /etc/ssh/ssh_host_ecdsa_key | |
HostKey /etc/ssh/ssh_host_ed25519_key | |
UsePrivilegeSeparation yes | |
KeyRegenerationInterval 3600 | |
ServerKeyBits 1024 | |
SyslogFacility AUTH |