ls /etc/rsyslog.d/
20-ufw.conf 21-cloudinit.conf 50-default.conf 60-etl.conf postfix.conf
cat /etc/rsyslog.d/60-etl.conf
:syslogtag, isequal, "claims_etl:" /var/log/etl/claims.log
function findagent { | |
if ssh-add -l; then | |
echo "Your SSH Agent is already working." | |
return 0 | |
fi | |
for sock in `ls /tmp/ssh-*/agent.*`; do | |
export SSH_AUTH_SOCK=$sock | |
if ssh-add -l; then | |
echo "Your SSH Agent is fixed. New socket=$sock." | |
return 0 |
#!/usr/bin/env python | |
import sys, os, re, random | |
import time, datetime | |
from collections import defaultdict | |
import pandas as pd | |
import numpy as np | |
from argparse import ArgumentParser | |
def main(): | |
args = handle_args() |
%reload_ext rpy2.ipython | |
%R -n library(dplyr) | |
%%R | |
do_regression = function(mpr, features) { | |
df = read.csv("activity_quantity_df.csv", header=T) | |
df$mem_gender = as.factor(df$mem_gender) | |
df$mem_age = as.factor(df$mem_age) | |
feature_str = paste(features, collapse=" + ") | |
print(paste(mpr, "~", feature_str, " + mem_gender*mem_age")) |
from pyspark.sql import SQLContext | |
sqlContext = SQLContext(sc) | |
df = sqlContext.read.format("org.elasticsearch.spark.sql").load("index/type") | |
df.printSchema() |
df.to_hdf('/home/tom/data/behaviorXoutcomes/user_features.h5', 'data', complevel=1, complib='zlib') |
I hereby claim:
To claim this, I am signing this object:
def do_R_wilcoxon(before, after, paired=True, two_tailed=False): | |
b_mat = before.as_matrix() | |
a_mat = after.as_matrix() | |
alternative = 'g' | |
if two_tailed: | |
alternative = 'two.sided' | |
%R -i b_mat,a_mat,paired,alternative -o wilcox_res wilcox_res=wilcox.test(b_mat, a_mat, paired=paired, exact=TRUE, conf.int=TRUE, alternative=alternative) | |
#print list(enumerate(wilcox_res)) | |
# this returns just the p-value and the conf interval | |
return { |
class VotingClassifier(object): | |
"""Stripped-down version of VotingClassifier that uses prefit estimators""" | |
def __init__(self, estimators, voting='hard', weights=None): | |
self.estimators = [e[1] for e in estimators] | |
self.named_estimators = dict(estimators) | |
self.voting = voting | |
self.weights = weights | |
def fit(self, X, y, sample_weight=None): | |
raise NotImplementedError |
// adapted from: https://github.com/stellar/laboratory/blob/master/src/utilities/extrapolateFromXdr.js | |
import * as _ from "lodash"; | |
import { xdr, StrKey, Keypair, Operation } from "stellar-sdk"; | |
/** | |
* Convert XDR string to minimal JSON object | |
* @param input input xdr string | |
* @param type type of XDR (TransactionResult, TransactionMeta, etc...) | |
*/ | |
export function extrapolateFromXdr(input: string, type: string) { |