Skip to content

Instantly share code, notes, and snippets.

@deargle
deargle / _README.md
Last active November 12, 2021 14:10
List of Mturk premium qualification types
@deargle
deargle / install-nessus.sh
Last active May 3, 2024 06:37
Install nessus
#!/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

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 January 31, 2019 03:34
nginx-proxy docker compose config file
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 April 22, 2021 12:32
Example of TfidfVectorizer with custom tokenizer that does basic stemming
# -*- 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 March 7, 2018 20:14
A script to pull kaggle scores for the titanic competition and select only the top three
'''
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,
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 June 1, 2024 12:32
OpenVPN server.conf and 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 November 10, 2019 03:10
batch create hits using psiturk
#!/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 August 21, 2020 22:21
island.byu.edu configs and scripts

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.