Skip to content

Instantly share code, notes, and snippets.

/workbench
db.model_versions.getIndexes()
db.model_versions.createIndex(
{
"modelId.value": 1,
"metadata.created": -1
}
)
db.model_versions.getIndexes()
db.model_versions.getIndexes()
@chrismyang
chrismyang / log_consolidation.md
Created August 29, 2017 18:04
Log Consolidation

Log Consolidation

We have log files spread out over several directories and want to automate the process of consolidating them back to a single location. Your task is to create a script that will perform this consolidation. Note that this script must be designed to run on different systems, which means that your script must be able to run on a system that is different than the one you have access to for this test.

Instructions

Create a script in the file consolidate_logs.sh that does the following:

  • For each log file in the LOG_LOCATIONS environment variable, copy that file to the location specified in LOG_DESTINATION but do not overwrite any files that already exist in LOG_DESTINATION

Keybase proof

I hereby claim:

  • I am chrismyang on github.
  • I am chrismyang (https://keybase.io/chrismyang) on keybase.
  • I have a public key ASD89g6SsmAaRjn3tzNSdTvQ6NI2wzeIXfM8vn2FT--lcQo

To claim this, I am signing this object:

Hey Mac

This is a gist

@chrismyang
chrismyang / domino-create-instance.sh
Created April 28, 2015 17:19
domino-create-instance.sh
#!/bin/bash
#
# Creates a Domino server instance.
#
set -o nounset -o errexit
function die() { echo >&2 "$@"; exit 1; }
function require_sudo() {
if [ $UID != 0 ]
#!/bin/bash
cat <<EOF >> /etc/yum.repos.d/mongodb.repo
[mongodb]
name=MongoDB Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
gpgcheck=0
enabled=1
EOF