Skip to content

Instantly share code, notes, and snippets.

View anthonymobile's full-sized avatar

Anthony Townsend anthonymobile

View GitHub Profile
@anthonymobile
anthonymobile / extract_mbox_attachments.py
Created June 14, 2021 02:52 — forked from georgy7/extract_mbox_attachments.py
Extract attachments from mbox file.
# Modified.
# Original script source:
# http://blog.marcbelmont.com/2012/10/script-to-extract-email-attachments.html
# Usage:
# Run the script from a folder with file "all.mbox"
# Attachments will be extracted into subfolder "attachments"
# with prefix "n " where "n" is an order of attachment in mbox file.
# ---------------
@anthonymobile
anthonymobile / mysqldump-backup-and-zip-script.sh
Created November 5, 2018 01:55
mysqldump backup databases as individual tables
#!/bin/bash
### change the values below where needed.....
DBNAMES="buses"
HOST="--host=localhost"
USER="--user=buswatcher"
PASSWORD="--password=njtransit"
BACKUP_DIR="/home/anthony/outgoing_data"
#### you can change these values but they are optional....
OPTIONS="--default-character-set=latin1 --complete-insert --no-create-info --compact -q"
@anthonymobile
anthonymobile / 2-macOS-10.13-high-sierra-setup-brewfile
Created October 7, 2018 02:28 — forked from kevinelliott/1-macOS-10.13-high-sierra-setup.md
macOS 10.13 High Sierra Mostly-Automated Setup
tap "caskroom/cask"
tap "caskroom/drivers"
tap "caskroom/fonts"
tap "heroku/brew"
tap "homebrew/bundle"
tap "homebrew/core"
tap "homebrew/fuse"
tap "homebrew/science"
tap "homebrew/services"
tap "luckyframework/lucky"
@anthonymobile
anthonymobile / whack.sh
Created September 18, 2018 10:59
whack: a bash function to grab an entire website for offline viewing
whack() { wget --mirror --convert-links --adjust-extension --page-requisites --no-parent $1;}
# List unique values in a DataFrame column
# h/t @makmanalp for the updated syntax!
df['Column Name'].unique()
# Convert Series datatype to numeric (will error if column has non-numeric values)
# h/t @makmanalp
pd.to_numeric(df['Column Name'])
# Convert Series datatype to numeric, changing non-numeric values to NaN
# h/t @makmanalp for the updated syntax!