Skip to content

Instantly share code, notes, and snippets.

View T31337's full-sized avatar

Trenton T31337

  • 1337 Software
  • In The Interwebz, For All To See And Access Equally
View GitHub Profile
@T31337
T31337 / SD_usb_auth.sh
Last active October 30, 2018 01:56
PAM_USB Set-Up & Configuration Helper Script With SD Card Support
#!/bin/bash
#Downlaod .bash_colors (Ensure File Exists And Has Expected Content)
wget http://raw.github.com/maxtsepkov/bash_colors/master/bash_colors.sh -O .bash_colors
#Import Colors Script
#See Here For More Info - https://github.com/mercuriev/bash_colors
source .bash_colors
#Set Authentication Device (SD-Card)
MyDevice="/dev/mmcblk0"
#!/bin/bash
URL="-i sites.txt"
ACCEPT='html,htm,css,js,php,jpg,png,jpeg,gif,bmp,img,ico,svg' #File Accept/Download List
DECLINE='tmp' #File Reject/Decline List
DIR="$HOME/Downloads/web/"
function downloadSite
{
wget --no-clobber --convert-links --random-wait -r -p -E -e robots=off -U mozilla -P $DIR $URL
}
@T31337
T31337 / PySpider
Created July 6, 2017 04:13
Scrapy & BeautifulSoup Based Python Spider
from bs4 import BeautifulSoup, SoupStrainer
from scrapy.selector import HtmlXPathSelector
from urllib import request
import requests
from scrapy.linkextractors import LinkExtractor
import requests.utils
import scrapy.link
import scrapy
import scrapy.spiders
from scrapy.spiders.crawl import CrawlSpider, Rule
@T31337
T31337 / spider.sh
Last active July 5, 2017 04:20
Spider Using xidel, xargs, and curl
#!/bin/bash
spiderFile="spider.txt"
spiderInfo="spiderInfo.txt"
errorFile="html_errors.txt"
ok="spiderList.txt"
prefix="http://"
curl=$(which curl)
spiderBin=$(which xidel)
xargsBin=$(which xargs)
if [[ -z $curl ]]; then
@T31337
T31337 / download.sh
Created July 4, 2017 12:35
Download From Websites With wget And curl
#!/bin/bash
# Allow more advanced pattern matching (for case..esac below)
shopt -s extglob
#Variables
dir="$HOME/Downloads/web/" #What Directory Do We Save Files To?
ok="ok.txt"
notok="bad_urls.txt" # We Won't Be Needing This... But It Might Be Handy...
sitelist="download.txt" #also can named urls.txt or url-list.txt
#!/bin/bash
#IP Information Gathering Script
ipList="ipList.txt" #IP ADDRESS LIST
ipData="IP_INFO.txt" #IP INFORMATION FILE
ip=""
function getIP_Data
{
if [[ -z $ip ]]; then
read -p "IP ADDRESS: " ip
fi
@T31337
T31337 / PyQt5 Number Guessing Game
Last active June 7, 2017 18:27
Graphical Number Guessing Game Written Python Using Qt5
#!/usr/bin/env python
import sys,random
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton,QLabel
from PyQt5.QtGui import QIcon
from PyQt5.QtCore import pyqtSlot
from PyQt5 import QtWidgets
from PyQt5.QtWidgets import *
class App(QWidget):
@T31337
T31337 / Qt4PortScanner.py
Last active March 26, 2017 05:29
Python Qt4 PortScanner
import sys
import PyQt4.QtGui as QtGui
import socket
'''
Qt4 Version Of Python PortScanner (https://gist.github.com/T31337/93cf239fff8314b182e2)
License:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@T31337
T31337 / Qt4Template.py
Last active March 26, 2017 05:31
Python Qt4 Template
import sys
import PyQt4.QtGui as QtGui
class Template:
def __init__(self):
app = QtGui.QApplication(sys.argv)
self.gui()
sys.exit(app.exec_())
def doStuff(self):
#FFPMEG Converter GUI
import tkinter,subprocess,os
from tkinter import filedialog,messagebox
from tkinter import *
class FFConvert:
def convert(self):
self.btnConvert['state'] = 'disabled'
self.btn['state']='disabled'