Skip to content

Instantly share code, notes, and snippets.

Bryan Nehl k0emt

Block or report user

Report or block k0emt

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
k0emt /
Last active Feb 28, 2020
Basic Hello world in Python with corresponding unittest
__author__ = 'k0emt'
class Greeter:
def __init__(self):
self.message = 'Hello world'
# print self.message
k0emt /
Last active Oct 10, 2019
Some helpful docker commands for working with mongoDB

Some helpful mongo container docker commands

Get latest image of mongoDB

docker pull mongo

Spin up a new container named my_mongo from image mongo Mapping and exposing ports 27017-27019 from the container to the host OS: docker run -d -p 27017-27019:27017-27019 --name my_mongo mongo

Get an interactive shell in the container: docker exec -it my_mongo bash

k0emt /
Last active Sep 7, 2019
Notes regarding setting up a Pop OS! development environment on a Sony Flip 15.

Sony Flip 15 Pop OS! build

Pop OS!

Had to turn off secure boot and switch from UEFI to legacy to install. Use ASSIST above keyboard for boot options and getting into CMOS.

keyboard shortcuts

ctrl-shift-c and ctrl-shift-v for copy and paste in the terminal

k0emt /
Last active Aug 14, 2019
This gist shows how to loop throw and alter/update an individual uniquely identified document.
from pymongo import MongoClient
import sys
# code example to show updating individual records in a loop
# initialize the database with:
# mongoimport -d school -c scores --type json grades.js
# verify no records with "added"
# db.scores.find({"added":{$exists:true}}) // returns nothing
k0emt /
Created Sep 15, 2011
Demo code for RabbitMQ Publish/Subscribe (fanout) exchange with Python
import sys
import pika
# prerequisites are that you have RabbitMQ installed
# create a "darkmatter" named VirtualHost (VHOST)
# rabbitmqctl.bat add_vhost darkmatter
# create a user APP_USER with associated APP_PASS word
# rabbitmqctl add_user darkmatteradmin <password>
# give the APP_USER the necessary permissions
# rabbitmqctl set_permissions -p darkmatter darkmatteradmin ".*" ".*" ".*"
k0emt /
Last active Apr 26, 2018
Convert the Enron email dataset files to a MongoDB. Blog post here: Brendan McAdams @rit created a version of the code which utilizes the Python email library to produce a database with more metadata. You can see the results of his work here: http://mongodb-enron-email.s3-w…
import os
import datetime
from pymongo import MongoClient
__author__ = 'k0emt'
MAIL_DIR_PATH = '/Users/k0emt/Projects/enron/enron_mail_20110402/maildir'
counter = 1
k0emt / cities.xml
Created Feb 15, 2013
Example of XSLT Transformation with for-each-grouping. command to create: saxon -xsl:for-each-group.xsl -s:cities.xml > grouped_cities.xml
View cities.xml
k0emt /
Last active Sep 7, 2017
Check list of software that goes onto surface tablet or PC -- data science / developer tools.

Chocolately Managed / Installed software

  • Chocolately
  • Git
  • NodeJS
  • yarn
  • Chrome x64
    • postman
  • MongoDB
  • InkScape
k0emt / create_replica_set.bat
Last active Nov 20, 2016
Helper batch file for starting up a replica set named m101. Drop the --logpath option if you want to enjoy the log text flying by in the console. The --oplogSize option is the magic sauce to avoid creation of numerous 512MB+ files up to 5% of disk space.
View create_replica_set.bat
mkdir \data\rs1 \data\rs2 \data\rs3
start mongod --replSet m101 --logpath "1.log" --dbpath \data\rs1 --port 27017 --smallfiles --oplogSize 64
start mongod --replSet m101 --logpath "2.log" --dbpath \data\rs2 --port 27018 --smallfiles --oplogSize 64
start mongod --replSet m101 --logpath "3.log" --dbpath \data\rs3 --port 27019 --smallfiles --oplogSize 64
View bubble-progress.markdown
You can’t perform that action at this time.