Skip to content

Instantly share code, notes, and snippets.

View wesyoung's full-sized avatar
🎯
Focusing

wes wesyoung

🎯
Focusing
View GitHub Profile
import os
import autogen
import memgpt.autogen.memgpt_agent as memgpt_autogen
import memgpt.autogen.interface as autogen_interface
import memgpt.agent as agent
import memgpt.system as system
import memgpt.utils as utils
import memgpt.presets as presets
import memgpt.constants as constants
import memgpt.personas.personas as personas

Keybase proof

I hereby claim:

  • I am wesyoung on github.
  • I am barely3am (https://keybase.io/barely3am) on keybase.
  • I have a public key ASBjkkySlQIsT8Oz5xEt6aNz_543h6wSr_dgAI__EZKLngo

To claim this, I am signing this object:

@wesyoung
wesyoung / ja3.py
Last active December 15, 2019 00:46
import requests
import json
import logging
import os
import re
ENABLE_JA3 = os.environ.get('CIF_GATHERERS_JA3_ENABLED')
class Ja3(object):
def __init__(self, *args, **kwargs):
self.logger = logging.getLogger(__name__)
self.enabled = kwargs.get('enabled', os.environ.get('CIF_GATHERERS_JA3_ENABLED'))
@wesyoung
wesyoung / spam_es.py
Last active March 16, 2019 15:05
elastic spam
#!/usr/bin/env python3
"""
# docker containers are your friend!
$ pip install arrow chardet elasticsearch-dsl
$ cat test.eml | python3 spam_es.py
"""
"""
@wesyoung
wesyoung / keras_models.md
Created January 10, 2019 17:27 — forked from candlewill/keras_models.md
A collection of Various Keras Models Examples

Keras Models Examples

一系列常用模型的Keras实现

DNN

Multilayer Perceptron (MLP) for multi-class softmax classification

from keras.models import Sequential
@wesyoung
wesyoung / loadModel.py
Created June 22, 2018 20:05 — forked from vgpena/loadModel.py
Basic text classification with Keras and TensorFlow
import json
import numpy as np
import keras
import keras.preprocessing.text as kpt
from keras.preprocessing.text import Tokenizer
from keras.models import model_from_json
# we're still going to use a Tokenizer here, but we don't need to fit it
tokenizer = Tokenizer(num_words=3000)
# for human-friendly printing
@wesyoung
wesyoung / securitai-lstm-model.py
Created June 2, 2018 23:10 — forked from adamkusey/securitai-lstm-model.py
SecuritAI LSTM RNN Model
model = Sequential()
model.add(Embedding(num_words, 32, input_length=max_log_length))
# Prevent overfitting using dropout method of regularization
model.add(Dropout(0.5))
model.add(LSTM(64, recurrent_dropout=0.5))
model.add(Dropout(0.5))
# Condense to single binary output value
model.add(Dense(1, activation='sigmoid'))
model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
# Training set automatically split 75/25 to check validation loss/accuracy at each epoch
@wesyoung
wesyoung / yarm.config
Created May 7, 2018 15:43 — forked from gssbzn/yarm.config
Elastic Beanstalk Rails+Webpacker extension
# Copyright 2018 SwiftComply.com
commands:
01_node_install:
test: "[ `node --version` != 'v8.10.0' ]"
command: "curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -"
02_yarn_repo:
test: "[ ! -f /etc/yum.repos.d/yarn.repo ]"
command: "curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo"
03_yarn_install:
test: "[ ! -x /usr/bin/yarn ]"
property theAddress : "phish@ren-isac.net"
property theReportSubject : "PHISHING report (message attached)"
--
using terms from application "Mail"
on perform mail action with messages theMsgs for rule theRule
repeat with eachMsg in theMsgs
tell application "Mail"
try
set theSubject to subject of eachMsg
on error
@wesyoung
wesyoung / circleci-2.0-eb-deployment.md
Created April 13, 2018 17:54 — forked from ryansimms/circleci-2.0-eb-deployment.md
Deploying to Elastic Beanstalk via CircleCi 2.0

Deploying to Elastic Beanstalk via CircleCi 2.0

I got to here after spending hours trying to deploy to an Elastic Beanstalk instance via CircleCi 2.0 so I thought I'd write up what worked for me to hopefully help others. Shout out to RobertoSchneiders who's steps for getting it to work with CircleCi 1.0 were my starting point.

For the record, I'm not the most server-savvy of developers so there may be a better way of doing this.

Setup a user on AWS IAM to use for deployments