Skip to content

Instantly share code, notes, and snippets.

View smellslikeml's full-sized avatar
📈

smellslikeml smellslikeml

📈
View GitHub Profile
@smellslikeml
smellslikeml / w2v_tSNE_plot.py
Last active October 25, 2018 01:17
ntlk, gensim word2vec, sklean t-SNE embedding, matplotlib
#!/usr/bin/python
import sys
import re
import string
from gensim.models import Word2Vec, Phrases
from sklearn.manifold import TSNE
import matplotlib.pyplot as plt
from nltk.corpus import stopwords
from itertools import islice
@smellslikeml
smellslikeml / bte_rssi.py
Created October 22, 2018 18:07
query for RSSI signal strength with btmgmt
#!/usr/bin/env python
import subprocess
def rssi_vals(addr):
try:
p = subprocess.Popen('sudo btmgmt find | grep {}'.format(addr), stdout=subprocess.PIPE, shell=True)
a, b = p.communicate()
read_lst = []
for reading in str(a).split('\\n')[:-1]:
@smellslikeml
smellslikeml / tweepy_streamer.py
Created October 22, 2018 17:30
tweepy_stream
#!/usr/bin/env python
import os
import sys
from tweepy import OAuthHandler
from tweepy import Stream
from tweepy.streaming import StreamListener
import json
import socket
consumer_key = os.environ['CONSUMER_KEY']
@smellslikeml
smellslikeml / tweet_logger.py
Created October 22, 2018 17:28
tweepy_scraper
#!/usr/bin/env python
import sys
from datetime import datetime
import os
import json
from tweepy import OAuthHandler
from tweepy import Stream
from tweepy.streaming import StreamListener
consumer_key = os.environ['CONSUMER_KEY']
@smellslikeml
smellslikeml / zipcode_lookup.sh
Created October 21, 2018 18:06
zipcode lookup
#!/bin/bash
# zipcode--Given a ZIP code, identifies the city and state. Use city-data.com,
# which has every ZIP code configured as its own web page.
baseURL="http://www.city-data.com/zips"
/bin/echo -n "ZIP code $1 is in "
curl -s -dump "$baseURL/$1.html" | \
grep -i '<title>' | \
cut -d\( -f2 | cut -d\) -f1
exit 0
@smellslikeml
smellslikeml / screenshot.py
Last active September 25, 2023 09:31
hidden screenshot with xlib and PIL
#!/usr/bin/env python
import os
from Xlib import display, X
from PIL import Image
dsp = display.Display()
screen = dsp.screen()
W = screen.width_in_pixels
H = screen.height_in_pixels
@smellslikeml
smellslikeml / screenshot.py
Created October 21, 2018 17:52
screenshot with Qt5
#!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2013 Riverbank Computing Limited.
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
##
## This file is part of the examples of PyQt.
@smellslikeml
smellslikeml / cursor_logger.py
Created October 21, 2018 17:48
cursor logger - record cursor position
#!/usr/bin/env python
import os
import time
from Xlib import display
old_x = 0
old_y = 0
old_dur = 0
end_time = 0
logfile = os.environ['HOME'] + '/.cursor.log'
@smellslikeml
smellslikeml / nmap_list_scan.sh
Created October 21, 2018 16:59
nmap summary
# Nmap to scan the top 1000 most
# common ports, give us the service
# version information for any open
# ports, write it to an output
# file and use our csv file as a
# list of IPs to scan.
sudo nmap -sSV -oA OUTPUTFILE -T4 -iL IPS.csv
@smellslikeml
smellslikeml / linuxprivchecker.py
Created October 21, 2018 16:56
Mike Czumak's Linux Privilege Escalation Check Script
#!/usr/env python2
###############################################################################################################
## [Title]: linuxprivchecker.py -- a Linux Privilege Escalation Check Script
## [Author]: Mike Czumak (T_v3rn1x) -- @SecuritySift
##-------------------------------------------------------------------------------------------------------------
## [Details]:
## This script is intended to be executed locally on a Linux box to enumerate basic system info and
## search for common privilege escalation vectors such as world writable files, misconfigurations, clear-text
## passwords and applicable exploits.