Skip to content

Instantly share code, notes, and snippets.

Avatar
🥁
Ba Dum Tss..!!

Karthik blended-ideas

🥁
Ba Dum Tss..!!
View GitHub Profile
@blended-ideas
blended-ideas / django_secret.txt
Created May 5, 2020
Django Secret Key Generator
View django_secret.txt
# 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
View cassidyChallenge.js
# 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);
}
@blended-ideas
blended-ideas / port_scan.py
Created Oct 24, 2016
Simple port scanner in python
View port_scan.py
#!/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
View django_shell_to_csv.py
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
You can’t perform that action at this time.