Skip to content

Instantly share code, notes, and snippets.

@keithrozario
keithrozario / parlimen.csv
Last active April 28, 2018 12:25
Latest Election Candidates - Parlimen (19:03 28-Apr)
Seat_ID Seat_Name Candidate_Name Candidate_Undi_Name Party
P.001 PADANG BESAR IZIZAM BIN IBRAHIM IZIZAM BIN IBRAHIM PKR
P.001 PADANG BESAR MOKHTAR BIN SENIK USTAZ MOKHTAR SENIK PAS
P.001 PADANG BESAR ZAHIDI BIN ZAINUL ABIDIN DATUK ZAHIDI BIN ZAINUL ABIDIN BN
P.002 KANGAR MOHAMAD ZAHID BIN IBRAHIM USTAZ ZAHID IBRAHIM PAS
P.002 KANGAR NOOR AMIN BIN AHMAD AMIN AHMAD PKR
P.002 KANGAR RAMLI BIN SHARIFF RAMLI SHARIFF BN
P.003 ARAU ABD RAHMAN BIN DAUD DATO' DR. HAJI ABD RAHMAN BIN DAUD PKR
P.003 ARAU HASHIM BIN HJ JASIN USTAZ HASHIM JASIN PAS
P.003 ARAU SHAHIDAN BIN KASSIM SHAHIDAN BIN KASSIM BN
@keithrozario
keithrozario / search_user.py
Created April 22, 2018 11:05
Search for a Users Tweet on twitter
import tweepy
from custom_config import get_attr_from_list
from custom_config import consumer_key, consumer_secret, access_key, access_secret
def write_tweets_to_file(screen_name):
ids = []
x = 1
with open(screen_name.strip() + '.csv', 'w') as file:
@keithrozario
keithrozario / delete_tweets.py
Last active April 22, 2018 10:53
Delete all tweets older than x days
import tweepy
from tweepy import TweepError
from datetime import datetime, timedelta
import logging
import json
from custom_config import consumer_key, consumer_secret, access_key, access_secret
tweets_delete = []
max_age = 90 # in days
@keithrozario
keithrozario / copy.py
Last active April 13, 2018 14:50
Copy files from S3 to another folder
import requests
import json
import boto3
import os
bucket_name = 'files.siteaudit.sayakenahack.com'
file_prefix = 'scan'
keys = []
client = boto3.client('s3')
s3 = boto3.resource('s3')
@keithrozario
keithrozario / load_jsonl_into_dynamo.py
Last active September 12, 2018 09:46
Load JSONL into DynamoDB
import json
import logging
import boto3
import customConfig
import os
import argparse
import datetime
""" Loading JSONL file into DynamoDB, customConfig.table_name has the DynamoDB Table Name"""
@keithrozario
keithrozario / divideFolders.py
Created March 14, 2018 15:50
Split files between folders
import argparse
import os
import logging
import shutil
from pathlib import Path
""" Assumes files end with _xx.jsonl
where xx is an integer (that is at least 1 digit
"""
import logging
# Logging setup
logging.basicConfig(filename='log.txt',
filemode='a',
level=logging.INFO,
format='%(asctime)s %(message)s',
datefmt='%m/%d/%Y %I:%M:%S %p')
if __name__ == "__main__":
@keithrozario
keithrozario / randomStrings.py
Created December 21, 2017 02:11
generate a random bunch of strings for captcha
import string
from random import choice
alphabet = string.ascii_letters + string.digits
captcha = "".join(choice(alphabet) for x in range(1, 4))
print(captcha)
<a href="www.google.com"> link here </a>
netdiscover -r 192.168.0.0/24
>> Machine Name, IP, MAC (csv file)
Enter name of machine:
Enter ip of the machine:
nMap Fast scan with version
nMap Full scan with version