$ sudo apt-key adv --keyserver pool.sks-keyservers.net --recv-key 0xDBA36B5181D0C816F630E889D980A17457F6FB06
This file contains hidden or 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
# Put *unversioned* requirements in `requirements-to-freeze.txt` as described below. | |
# `requirements.txt` will be automatically generated from `pip freeze` | |
# https://www.kennethreitz.org/essays/a-better-pip-workflow | |
venv/bin/activate: requirements-to-freeze.txt | |
rm -rf venv/ | |
test -f venv/bin/activate || virtualenv -p $(shell which python3) venv | |
. venv/bin/activate ;\ | |
pip install -Ur requirements-to-freeze.txt ;\ | |
pip freeze | sort > requirements.txt |
This file contains hidden or 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
<script> | |
var dnt = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack; | |
if (dnt != "1" && dnt != "yes") { | |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |
})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); | |
ga('create', 'UA-XXXXXXXX-X', 'auto'); | |
ga('set', 'anonymizeIp', true); |
This file contains hidden or 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 os | |
def mkdir_p(directory): | |
if not os.path.isdir(directory): | |
os.makedirs(directory) | |
return directory |
This file contains hidden or 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/sh -eu | |
PATH=/bin:/usr/bin | |
DIR=/media/seagate_250gb/cameras/front | |
USER="camera-front" | |
cd_to_directory() { | |
cd "$DIR" | |
} |
This file contains hidden or 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/sh -u | |
LOG_FILE="${HOME}/log/$(date --iso-8601=seconds).log" | |
touch "${LOG_FILE}" | |
$1 "$@" >> ${LOG_FILE} 2>&1 | |
EXIT_CODE=$? |
/etc/nginx/sites-enabled/www.paulfurley.com_HTTP
:
server {
listen 80;
listen [::]:80;
server_name www.paulfurley.com;
location /.well-known/acme-challenge/ {
# For the letsencrypt "webroot" plugin
This file contains hidden or 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/sh | |
# /etc/NetworkManager/dispatcher.d/pre-up.d/randomize-mac-addresses.sh | |
# INSTALL | |
# | |
# > curl -L 'https://gist.github.com/paulfurley/46e0547ce5c5ea7eabeaef50dbacef3f/raw/56ee5dd5f40dec93b8f7438cbdeda5475ea3b5d2/randomize-mac-addresses.sh' |sudo tee /etc/NetworkManager/dispatcher.d/pre-up.d/randomize-mac-addresses.sh | |
# > sudo chmod +x /etc/NetworkManager/dispatcher.d/pre-up.d/randomize-mac-addresses.sh | |
# Configure every saved WiFi connection in NetworkManager with a spoofed MAC |
This file contains hidden or 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
# /etc/NetworkManager/conf.d/30-randomize-mac-address.conf | |
# REQUIRES NETWORK MANAGER >= 1.4.1 (Ubuntu Zesty and above) | |
# Thanks to https://blogs.gnome.org/thaller/2016/08/26/mac-address-spoofing-in-networkmanager-1-4-0/ | |
# This randomize your MAC address for *new* connections | |
# Be sure to change your existing (saved) connections in | |
# /etc/NetworkManager/system-connections/* |
Add this to the end of /etc/samba/smb.conf
:
[camera-front]
comment= Camera: Front
path=/media/seagate_250gb/cameras/front
browseable = yes
writeable = yes
write list = camera-front
guest ok = yes