Skip to content

Instantly share code, notes, and snippets.

Avatar

Dave Eargle deargle

View GitHub Profile
@deargle
deargle / _README.md
Last active May 18, 2021
List of Mturk premium qualification types
View _README.md
View install-nessus.sh
#!/bin/bash -ex
# run as root
wget -O nessus.deb https://www.tenable.com/downloads/api/v1/public/pages/nessus/downloads/12207/download?i_agree_to_tenable_license_agreement=true
dpkg -i nessus.deb
View demo-r-md-in-gist.md

Demo .Rmd to .md

library(readr)
library(lsmeans)

my.data <- read_csv("https://raw.githubusercontent.com/deargle/deargle.github.io/master/assets/data/LendingClub_2007_2014_Cleaned_Reduced_NoTargetLeak.csv")
@deargle
deargle / docker-compose.yml
Created Jan 31, 2019
nginx-proxy docker compose config file
View docker-compose.yml
version: '3'
services:
nginx:
image: nginx:1.14.2
container_name: nginx-proxy
ports:
- "80:80"
- "443:443"
volumes:
@deargle
deargle / tokenize.py
Last active Apr 22, 2021
Example of TfidfVectorizer with custom tokenizer that does basic stemming
View tokenize.py
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 24 16:30:42 2018
@author: deargle
"""
from sklearn.feature_extraction.text import TfidfVectorizer
from nltk.stem.porter import PorterStemmer
import nltk
@deargle
deargle / get-kaggle-scores.py
Created Mar 7, 2018
A script to pull kaggle scores for the titanic competition and select only the top three
View get-kaggle-scores.py
'''
This script downloads the public leaderboard data for a competition,
filters down to just the highest-scoring submissions for each
team with "Eargle" in the name, and saves the top-three scores
to a .csv in the current directory called `top-three <date-timestamp>.csv`
If you want to see the highest submission for _each_ team, just comment out
line 40 (put a `#` before it).
To run this, get python if you don't already have it, and also `pip` if you don't already have it,
View psiturk_scripting_example.py
from sqlalchemy import create_engine, MetaData, Table, text
import json
import pandas as pd
from boto.mturk.connection import MTurkConnection
import random
import sys
from psiturk.models import Participant
from psiturk.db import db_session, init_db
from psiturk.amt_services import MTurkServices
from psiturk.psiturk_config import PsiturkConfig
@deargle
deargle / client.conf
Last active Jun 14, 2021
OpenVPN server.conf and client.conf
View client.conf
##############################################
# Sample client-side OpenVPN 2.0 config file #
# for connecting to multi-client server. #
# #
# This configuration can be used by multiple #
# clients, however each client should have #
# its own cert and key files. #
# #
# On Windows, you might want to rename this #
# file so it has a .ovpn extension #
@deargle
deargle / psiturk_batcher.sh
Last active Nov 10, 2019
batch create hits using psiturk
View psiturk_batcher.sh
#!/bin/bash
set -e
#set -x
set -o nounset # aka set -u
# WHAT IS THIS
# -------------
# This will use the `psiturk -e` functionality to post batches of hits to mturk, with each hit
# having no more than 9 assignments so that requesters don't get hammered by the extra 20% commission (yeesh).
#
@deargle
deargle / _island.byu.edu-conf.md
Last active Aug 21, 2020
island.byu.edu configs and scripts
View _island.byu.edu-conf.md

how to start from scratch

Deprecated: see https://github.com/deargle/island-vNext instead


  • set up the nginx-proxy docker-compose. pull down nginx.tmpl.
    • This will give auto letsencrypt
  • git clone discourse into /home/deargle/island, drop in the two container config files below. Build them using the discourse launcher
  • git clone the discourse-cas repo, up that.