This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var links = document.querySelectorAll('#content a'); | |
for(var i = 0; i < links.length; i++){ | |
console.table(links[i].href); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
""" | |
Copyright (C) 2016 Jeffrey S. McAnarney | |
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 the Free Software Foundation; either version 2 | |
of the License, or (at your option) any later version. | |
This program is distributed in the hope that it will be useful, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Spider Websites with Wget – 20 Practical Examples | |
Wget is extremely powerful, but like with most other command line programs, the plethora of options it supports can be intimidating to new users. Thus what we have here are a collection of wget commands that you can use to accomplish common tasks from downloading single files to mirroring entire websites. It will help if you can read through the wget manual but for the busy souls, these commands are ready to execute. | |
1. Download a single file from the Internet | |
wget http://example.com/file.iso | |
2. Download a file but save it locally under a different name | |
wget ‐‐output-document=filename.html example.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Run this script just before you put the laptop in the bin for security scanning. | |
# You can add the seconds the laptop will be waiting before speaking. The default | |
# is waiting for 180 seconds (3 minutes). | |
# Switch to the login screen, effectively locking the screen. | |
function lockscreen() { | |
/System/Library/CoreServices/"Menu Extras"/User.menu/Contents/Resources/CGSession -suspend | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get NEWRELIC_LICENSE_KEY from https://rpm.newrelic.com/accounts/ | |
# export NEWRELIC_LICENSE_KEY=___CHANGE___THIS___TO___NEWRELIC_LICENSE_KEY____ | |
[ -z "$NEWRELIC_LICENSE_KEY" ] && { echo "Please export NEWRELIC_LICENSE_KEY"; exit 1; } | |
#debian repo | |
echo 'deb http://apt.newrelic.com/debian/ newrelic non-free' | sudo tee /etc/apt/sources.list.d/newrelic.list | |
wget -O- https://download.newrelic.com/548C16BF.gpg | sudo apt-key add - | |
sudo apt-get update | |
sudo apt-get install newrelic-php5 newrelic-sysmond |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
# Windows dependencies | |
# - Python 2.7.6: http://www.python.org/download/ | |
# - OpenCV: http://opencv.org/ | |
# - Numpy -- get numpy from here because the official builds don't support x64: | |
# http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy | |
# Mac Dependencies | |
# - brew install python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ---------------------------------------------------------------------- | |
# Prelimenary checks | |
# ---------------------------------------------------------------------- | |
# Make sure there's a license key file. | |
KEYFILE="LICENSEKEY" | |
if [ ! -e $KEYFILE ]; then | |
echo "No LICENSEKEY found." |