Skip to content

Instantly share code, notes, and snippets.

View b1nary0mega's full-sized avatar
💭
life...

b1nary0mega b1nary0mega

💭
life...
View GitHub Profile
@b1nary0mega
b1nary0mega / download_flickr_albums.md
Created October 24, 2022 17:36
Download all Flickr Album(s) Images

WGET All Flickr Album Images

Use wget to pull index files 1 to 5 and, while probably not necessary, we ignore robots.txt:

wget -e robots=off www.flickr.com/photos/123@AB3/albums/82183820302522906/page{1..5}

REGEX

ip -o addr show | grep inet\ | grep eth0 | cut -d ' ' -f 7
@b1nary0mega
b1nary0mega / Last2Words.regex
Created May 18, 2017 21:03
Get the Last 2 Words of search string using RegEx
\b([A-Za-z])+\s([A-Za-z]+)\b$
@b1nary0mega
b1nary0mega / MyBackupScript.py
Created May 10, 2017 13:44
Backup data from a provided location to a zipped file in another location. Solution adapted from Automate the Boring Stuff with Python.
#! python2
# MyBackupScript.py - backup the My Documents folder and all contents into
# a zip file whole filename increments
import zipfile, shutil, os, sys
#function to create the backup zip file
def backupToZip(folder, location):
# Backup the entire contents of "folder" into a zip file
@b1nary0mega
b1nary0mega / mcb.bat
Created May 10, 2017 13:44
A batch file to be able to utilize WIN+R and then simply type 'mcb <args>'. This file needs to be stored in the root windows directory (typically C:\Windows\mcb.bat
@python.exe c:\Location\Of\mcb.pyw %*
REM removing below will allow program to run without poping up the continue
REM window, since the python file is a .pyw
@pause
@b1nary0mega
b1nary0mega / mcb.py
Created May 10, 2017 13:43
A multiclipboard tool from the "Automating the Boring Stuff with Python" book. Utilized to store and retrieve commonly used text, via the clipboard.
#! python2
# mcb.pyw - create a multiclipboard tool
# Usage: py.exe mcb.pyw save <keyword> - Saves clipboard to keyword.
# py.exe mcb.pyw <keyword> - Loads keyword to clipboard.
# py.exe mcb.pyw list - loads all keywords to clipboard.
import shelve, pyperclip, sys
#open the shelve
@b1nary0mega
b1nary0mega / randomQuizGenerator-Jeopardy.py
Created May 10, 2017 13:43
Randomly generate a Jeopardy!® style quiz
#! python2
# -*- coding: cp1252 -*-
# randomQuizGenerator-Jeopardy.py - Creates quizzes with questions and answer in
# random order, along with the answer key
import random
#The number of quizes to generate
quizzQty = 1
@b1nary0mega
b1nary0mega / randomQuizGenerator.py
Created May 10, 2017 13:43
Create several quizzes (randomly ordered) based on a dictionaries questions and answers.
#! python2
# randomQuizGenerator.py - Creates quizzes with questions and answer in
# random order, along with the answer key
import random
#The number of quizes to generate (aka how many students)
quizzQty = 15
#The quiz data; keys are questions and values are answers
@b1nary0mega
b1nary0mega / PrettyPrint.py
Created May 10, 2017 13:43
Pretty print out a dictionary. This is a modified version from "Automate the Boring Stuff with Python" book by Al Sweigart.
#Pretty print out a given dictionary
def prettyPrint(tableName, itemsDict, leftWidth, rightWidth):
print(tableName.center(leftWidth + rightWidth, '-'))
for k, v in itemsDict.items():
print(k.ljust(leftWidth, '.') + str(v).rjust(rightWidth,))
#Create a dictionary to test with
picnicItems = {'sandwiches': 4, 'apples': 12, 'cups': 4, 'cookies': 8000, 'juice boxes': 6}
#The below will figure out what to use for spacing
@b1nary0mega
b1nary0mega / getEmails.py
Created May 8, 2017 17:52
Program to collect unique emails in given file then output to same directory
#!/usr/bin/env python
""" Program to collect unique emails in given file then output to same directory """
import sys, os, re
__author__ = "James R. Aylesworth"
__copyright__ = "Copyright 2017"
__license__ = "GPL"
__version__ = "1.0.0"
__maintainer__ = "James R. Aylesworth"
__email__ = "jarhed323@gmail.com"
__status__ = "Production"