Skip to content

Instantly share code, notes, and snippets.

View mushinlogit's full-sized avatar

mushinlogit mushinlogit

View GitHub Profile
@mushinlogit
mushinlogit / gitLatest.sh
Last active August 9, 2017 16:02
gitLatest.sh
#!/bin/bash
# from root directory, traverse child directories and git up, then list their current branch
projs=$(find $PWD -maxdepth 1 -type d)
for proj in $projs
do
cd $proj
git fetch --all -p
git pull
@mushinlogit
mushinlogit / dockerKillEmAll.sh
Created August 9, 2017 15:48
dockerKillEmAll.sh
# kill all running docker containers
docker ps | cut -d ' ' -f 1 | xargs docker kill $1
@mushinlogit
mushinlogit / .bash_profile
Last active June 14, 2018 15:11
.bash_profile
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "
NODE_HOME=${HOME}/programs/node
#JAVA_HOME=$(/usr/libexec/java_home)
JAVA_HOME=${HOME}/programs/java/Contents/Home
MAVEN_HOME=${HOME}/programs/maven
@mushinlogit
mushinlogit / uniqueDownloadTypes.js
Last active September 18, 2017 15:12
uniqueDownloadTypes.js
const uniqueDownloadTypes = (resp) => {
const types = resp.objects.map(el => el.type);
return new Set(types);
}
@mushinlogit
mushinlogit / docker-compose.processor.yml
Last active September 18, 2017 14:39
processor compose
version: '2'
services:
unfetter-discover-processor:
build: ../unfetter-store/unfetter-discover-processor
container_name: unfetter-discover-processor
image: unfetter-discover-processor
volumes:
- ./config/examples:/tmp/examples
- ../unfetter-store/unfetter-discover-processor:/usr/src/app
environment:
@mushinlogit
mushinlogit / keybase.md
Created January 12, 2018 14:43
keybase.md

Keybase proof

I hereby claim:

  • I am mushinlogit on github.
  • I am mushinlogit (https://keybase.io/mushinlogit) on keybase.
  • I have a public key ASAFxGnOcbHm1Ai0e1P-ffYfL_LCxDG9VYikmbYaZvrRGQo

To claim this, I am signing this object:

@mushinlogit
mushinlogit / git-config.sh
Created January 22, 2018 16:56
git-config.sh
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
@mushinlogit
mushinlogit / git-up.sh
Created June 14, 2018 14:58
git-up.sh
#!/bin/bash
function gitClean() {
echo "prune local branches"
git branch -avv | grep gone | cut -d '\'' '\'' -f 3 | xargs git branch -D';
}
for PROJ in "unfetter-store" "unfetter" "unfetter-ui" "taxii-server" "stix" "stix2pattern"
do
pushd $PROJ
@mushinlogit
mushinlogit / test-data.json
Last active June 14, 2018 20:35
test-data.json
{
"data": {
"attributes": {
"created": "2018-06-14T18:50:16.132Z",
"valid_from": "2018-06-14T18:50:16.132Z",
"version": 2,
"type": "x-unfetter-object-assessment",
"object_ref": "x-unfetter-capability--2288d472-daeb-4be5-82f2-03b3d8eb3c51",
"assessed_objects": [
{
@mushinlogit
mushinlogit / x-unfetter-object-assessment.js
Created June 14, 2018 20:37
x-unfetter-object-assessment.js
const mongoose = require('mongoose');
const stixCommons = require('./stix-commons');
const xunfetterAssessObject = require('./x-unfetter-assessed-object').xunfetterAssessObject;
const StixSchema = {
created_by_ref: {
type: String,
required: [true, 'created_by_ref is required']
},
type: {