Skip to content

Instantly share code, notes, and snippets.

@adchooser
adchooser / analise.sh
Created May 3, 2019 13:14
analyse OpenWPM http requests (3rd parties)
#!/bin/bash
set -e -x
db_file=$(ls -a ~ | grep openwpm_results | head -n 1)/crawl-data.sqlite
python3 << EOF
import sqlite3
from six.moves.urllib.parse import urlparse
conn = sqlite3.connect('${db_file}')
@adchooser
adchooser / Run.ipynb
Last active April 23, 2019 14:51
OpenWPM Jupyter notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@adchooser
adchooser / Test.ipynb
Last active April 19, 2019 19:55
PyVirtualDisplay tmp files test
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@adchooser
adchooser / demo.py
Last active April 11, 2019 07:52
test globally installed OpenWPM
from OpenWPM.automation import CommandSequence, TaskManager
# The list of sites that we wish to crawl
NUM_BROWSERS = 3
sites = ['http://www.example.com',
'http://www.princeton.edu',
'http://citp.princeton.edu/']
# Loads the manager preference and 3 copies of the default browser dictionaries
@adchooser
adchooser / install.sh
Created April 10, 2019 13:21
modified OpenWPM install script: install pip and requirements globally
#!/bin/bash
# https://github.com/mozilla/OpenWPM/blob/master/install.sh
set -e
if [[ $# -gt 1 ]]; then
echo "Usage: install.sh [--flash | --no-flash]" >&2
exit 1
fi
if [[ $# -gt 0 ]]; then
@adchooser
adchooser / setup.sh
Created March 22, 2019 19:18
Selenium (with Firefox) setup on headless debian
# https://seleniumhq.github.io/selenium/docs/api/py/
# https://www.seleniumhq.org/docs/04_webdriver_advanced.jsp
# https://intoli.com/tags/selenium/
#
# mount the vm in the host
# mkdir -pv ~/selenium && sshfs -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3,port=2222,password_stdin user@localhost:/home/user/ ~/selenium <<<"password"
# but first install ssh-server (if not already)
# su -c 'apt-get install openssh-server'
@adchooser
adchooser / setup.sh
Created March 22, 2019 18:55
OpenWPM setup on a headless debian
# https://github.com/mozilla/OpenWPM/blob/master/install.sh
# https://github.com/mozilla/openwpm-crawler
# https://github.com/mozilla/openwpm-webext-instrumentation/
# https://github.com/mozilla/openwpm-firefox-webext
#
# flash needed?
#
su -c 'apt-get install openssh-server sudo mc git firefox-esr'
su -c "usermod -aG sudo user"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.