Skip to content

Instantly share code, notes, and snippets.

View firxworx's full-sized avatar

Kevin Firko firxworx

View GitHub Profile
@firxworx
firxworx / scrape-images.py
Created February 20, 2018 23:53
Web scraping with python: download all files linked to from a given web page with BeautifulSoup, urllib, and shutil
import urllib
import shutil
import re
from pathlib import Path
from bs4 import BeautifulSoup
# target page containing links to the image files
target_page = 'http://example.ca/image_links.php'
# local path
@firxworx
firxworx / vagrant-provision.sh
Created January 5, 2018 18:23
Vagrant shell provisioner (bash) - spin up tomcat7 + mysql, and deploy a java webapp (war file) on a fresh Ubuntu/Debian box
#!/bin/bash -e
# Author: Kevin Firko @firxworx (https://firxworx.com) from Bitcurve Systems (https://bitcurve.com) - 2017
# overview:
# installs and configures tomcat+mysql and then deploys a java webapp (war file) to a bare
# ubuntu 16.04+ (and similar Ubuntu/Debian distros) vagrant box when specified as a shell provisioner
# in a Vagrantfile. loading mysql timezone tables and basic postfix smtp config included.
# this script should also work on other ubuntu versions and debian boxes with minimal modification