This file contains 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
# Python Way of generating | |
python -c 'import random; print("".join([random.choice("abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)") for i in range(50)]))' | |
# Using Linux | |
base64 /dev/urandom | head -c50 | |
# or (slower) | |
base64 /dev/urandom | head -c50 |
This file contains 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
# Cassidoo Newsletter Challenge - 2/21/19 | |
removeForOdd = (arr) => { | |
const sum = arr.reduce((a, b) => a + b); | |
if (sum % 2 !== 0) { | |
return -1; | |
} | |
return arr.findIndex(x => x % 2 !== 0); | |
} | |
This file contains 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/python | |
# Visit Codingsec.net | |
# Importing the modules | |
# socket :=> This is what we use to create a socket connection | |
# argparse is used to parse arguments. This is not important now | |
# and it is out of the scope of this post | |
import socket,sys,time,datetime,argparse,os | |
flag = 0 # we're gonna use this flag later. Just keep it in mind |
This file contains 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 csv | |
def get_field(instance, field): | |
field_path = field.split('.') | |
attr = instance | |
for elem in field_path: | |
try: | |
attr = getattr(attr, elem) | |
except AttributeError: | |
return None |