Skip to content

Instantly share code, notes, and snippets.

@ehazlett
ehazlett / mongodb.conf
Created February 13, 2012 15:32
MongoDB supervisor config
[program:mongodb]
command=/opt/mongodb/bin/mongod --dbpath /storage/mongodb_data --rest
directory=/opt/mongodb
user=root
autostart=false
@ehazlett
ehazlett / pub_med.py
Created July 25, 2011 16:27
Search PubMed with BioPython
#!/usr/bin/env python
# numpy and biopython are required -- pip install numpy biopython
from Bio import Entrez
from Bio import Medline
MAX_COUNT = 10
TERM = 'Tuberculosis'
print('Getting {0} publications containing {1}...'.format(MAX_COUNT, TERM))
@ehazlett
ehazlett / gist:ea67a231285d444d6e42783fd3230d58
Created April 21, 2020 15:05
OS X Parallels synergy fix
defaults write 'com.parallels.Parallels Desktop' 'HID Host Hook.Allowed Sources' "synergy"
defaults write 'com.parallels.Parallels Desktop' 'HID Host Hook.Allowed Sources' "synergyc"
setup-xorg-base
apk add -U \
xf86-input-libinput \
plata-theme \
ttf-hack \
firefox \
ttf-cantarell \
gnome \
gnome-terminal \
func withCheckpointMounts(c *container.Container) containerd.CheckpointOpts {
return func(ctx context.Context, client *containerd.Client, _ *containers.Container, index *imagespec.Index, _ *options.CheckpointOptions) error {
for _, m := range c.MountPoints {
// tarstream of content
// a tmpdir is created to use as the blank comparison directory for the diff
tmpdir, err := ioutil.TempDir("", "container-data-")
if err != nil {
return err
}
defer os.RemoveAll(tmpdir)
package utils
import (
"bytes"
"os"
"testing"
)
var (
testCgroup = `11:rdma:/
http://www.realtek.com.tw/downloads/downloadsCheck.aspx?Langid=1&PNid=14&PFid=23&Level=4&Conn=3&DownTypeID=3&GetDown=false
@ehazlett
ehazlett / gist:38ba224ae8bba348da2e
Last active March 28, 2019 18:32
Using NFS with boot2docker

NFS Server

OS X Host

Note: you will need sudo access. Add the following to /etc/exports

/Users -alldirs -maproot=root:wheel -network 192.168.99.0 -mask 255.255.255.0

Restart NFS:

docker ps -a -q | % { docker rm $_ }
@ehazlett
ehazlett / gist:9241844
Last active February 13, 2018 15:47
OpenShift Origin AWS

OpenShift Origin in AWS

This describes deploying and running OpenShift Origin in Amazon Web Services.

This is based upon the code and installer on 2014-02-26 so YMMV.

We will be using a VPC for deployment in us-east-1 and Route53 for DNS. I will leave the VPC setup as an exercise for the reader.

Prerequisites

  • AWS Account
  • VPC