Skip to content

Instantly share code, notes, and snippets.

View conorsch's full-sized avatar

Conor Schaefer conorsch

View GitHub Profile
@conorsch
conorsch / allow-usb
Created January 24, 2017 19:22
Script to temporarily whitelist new USB devices under grsecurity
#!/bin/bash
# Temporarily permit new USB devices by disabling the grsecurity sysctl option
# `kernel.grsecurity.deny_new_usb` for several seconds. Will automatically
# restore the ban on exit (even on error).
set -e
set -u
set -o pipefail
@conorsch
conorsch / Sunder install failure under Tails
Created May 8, 2017 23:20
Cannot install Sunder deb package under Tails, even with the apt dependencies in place
amnesia@amnesia:~/Tor Browser$ sudo dpkg -i sunder_0.0.1_amd64.deb
[sudo] password for amnesia:
Selecting previously unselected package sunder.
(Reading database ... 144703 files and directories currently installed.)
Preparing to unpack sunder_0.0.1_amd64.deb ...
Unpacking sunder (0.0.1) ...
dpkg: dependency problems prevent configuration of sunder:
sunder depends on libnotify4.
sunder depends on libappindicator1.
sunder depends on libxtst6.
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQENBFhPGZsBCACzn00s3+i5HdGIldDGYXxY2HKL9Qhk0DhiRrNPaQemhNijuFlC
geCeKN/smDAUyM5mfEoxmWy3V7n8SEQUpqI4dIS2AohReLkyKEKiIpTuXW7F9kO3
vcXHgrTka+8B4ZQxDuTHNFJLmBwJnP24LrL6BzkDIUNeQFwM0EFTDOJlW1QV6qkm
9WGizo2sR0VBJJabfRWrTWd8llYOVcc+LptErVNADPaX6iqb+QnZVJ/nYmCTgABj
lD3aZ4EPZ+ioVOcOxbgBkAX76COObUUw/XahBGwj4fJ5kyzvDSBCHHlRzN39LKpM
Y+HfSc1scAOWN+Dd0N/joIa0j0U4SGHo1NdzABEBAAG0MVNlY3VyZURyb3AgVEVT
VElORyBrZXkgPHNlY3VyZWRyb3BAZnJlZWRvbS5wcmVzcz6JAU4EEwEIADgWIQRO
15zDNi19EoNwRgJKO+SpIhGwPAUCWE8ZmwIbAwULCQgHAgYVCAkKCwIEFgIDAQIe
@conorsch
conorsch / securedrop-qa.yml
Last active October 5, 2021 03:51
QA playbook for testing SD RC debs
---
# Playbook to update SecureDrop VMs configured with the latest stable release
# to use the release candiate packages from apt-test.freedom.press (rather
# than apt.freedom.press). Updates the apt repo pubkey with a testing pubkey,
# and alters the apt source lists to point to the test server.
#
# Steps to use this playbook:
#
# 1. `git checkout 0.7.0`
# 2. Provision prod VMs.
@conorsch
conorsch / securedrop-journalist-workstation-provisioning-workflow.txt
Created August 11, 2017 21:05
Documentation of workflow for provisioning Journalist Workstations
# Plug in Journalist USB stick.
# Mount Journalist USB stick (type in passphrase).
# Open "Terminal" application.
cp -r ~/Persistent/securedrop /media/amnesia/TailsData/Persistent/
cp ~/Persistent/securedrop/tails_files/securedrop-keepassx.kdbx /media/amensia/TailsData/Persistent/
# Now we'll need to remove the Admin-specific credentials:
cd /media/amnesia/TailsData/Persistent/securedrop/install_files/ansible-base
@conorsch
conorsch / circle-ci-checkout-special-step
Created August 16, 2017 21:27
Full script of the special "checkout" step in CircleCI
#!/bin/sh
set -e
# Workaround old docker images with incorrect $HOME
# check https://github.com/docker/docker/issues/2968 for details
if [ "${HOME}" = "/" ]
then
export HOME=$(getent passwd $(id -un) | cut -d: -f6)
fi
@conorsch
conorsch / gist:8a98839b4f8f312d70d9ca7aafac4e1e
Created October 6, 2017 23:13
Terminal session for QA of securedrop-keyring 0.1.1
(.venv) amnesia@amnesia:~/Persistent/securedrop/install_files/ansible-base$ ansible-playbook -vv --diff securedrop-qa.yml
Using /home/amnesia/Persistent/securedrop/install_files/ansible-base/ansible.cfg as config file
[DEPRECATION WARNING]: Instead of sudo/sudo_user, use become/become_user and
make sure become_method is 'sudo' (default).
This feature will be removed in a
future release. Deprecation warnings can be disabled by setting
deprecation_warnings=False in ansible.cfg.
PLAYBOOK: securedrop-qa.yml ****************************************************
1 plays in securedrop-qa.yml
@conorsch
conorsch / cell-data-parsing-attempt
Created January 8, 2018 02:05
First pass at using pandas for cell data munging
#!/usr/bin/env python
import pandas
import numpy
ethnicity_mapping = {
1: "White",
2: "Black",
3: "Asian",
@conorsch
conorsch / stn-data.py
Created January 12, 2018 17:57
First pass at retrieving historical data from Secure The News API
#!/usr/bin/env python3
import pandas
import requests
import matplotlib.pyplot as plt
# URL for SecureTheNews API
url = 'https://securethe.news/api/v1/sites/?format=json'
# URL template for retrieving historical scan data for a specific domain.
[conor@October:~/freedomofpress/securedrop] [sd] 9aa70048d+* ±
$ git fetch
remote: Counting objects: 85, done.
remote: Compressing objects: 100% (27/27), done.
remote: Total 85 (delta 46), reused 74 (delta 46), pack-reused 9
Unpacking objects: 100% (85/85), done.
From github.com:freedomofpress/securedrop
+ 50f2d2c9c...cd608b87c byebye-travis-ci -> origin/byebye-travis-ci (forced update)
+ 895649bd4...b7d991e7f experimental_signal_cli_notifications -> origin/experimental_signal_cli_notifications (forced update)
* [new branch] use-xenial-gettext -> origin/use-xenial-gettext