This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This from the MongoDB University Class M102:MongoDB for DBAs | |
#This is not an original script by me the author. | |
#Author Bill Glennon | |
#Date: January 18, 2014 | |
# run processes for the cluster | |
# running on as single dev machine as a demo... | |
# make directories |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to connect | |
> sqlite3 ~/Library/Messages/chat.db | |
Helpful Commands | |
sqlite> .help | |
sqlite> .tables | |
sqlite> .headers off | |
sqlite> .headers on | |
sqlite> .mode line | |
sqlite> .mode list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
! function(e, t) { | |
"object" == typeof exports && "object" == typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? exports.video = t() : (e.Twitch = e.Twitch || {}, e.Twitch.video = t()) | |
}(this, function() { | |
return function(e) { | |
function t(r) { | |
if (n[r]) return n[r].exports; | |
var i = n[r] = { | |
exports: {}, | |
id: r, | |
loaded: !1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lass KeenHttpOutput < Fluent::Output | |
Fluent::Plugin.register_output('out-keen-http', self) | |
def initialize | |
super | |
require 'rubygems' | |
require 'eventmachine' | |
require 'em-http-request' | |
require 'cgi' | |
require 'json' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; | |
(function() { | |
function q(f, g) { | |
if (!(f instanceof g)) throw new TypeError("Cannot call a class as a function"); | |
} | |
function r(f, g) { | |
if (!f) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | |
return !g || "object" !== typeof g && "function" !== typeof g ? f : g | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MongoDB shell version: 2.4.8 | |
usage: mongo [options] [db address] [file names (ending in .js)] | |
db address can be: | |
foo foo database on local machine | |
192.169.0.5/foo foo database on 192.168.0.5 machine | |
192.169.0.5:9999/foo foo database on 192.168.0.5 machine on port 9999 | |
options: | |
--shell run the shell after executing files | |
--nodb don't connect to mongod on startup - no | |
'db address' arg expected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# dependencies | |
fs = require 'fs' | |
http = require 'http' | |
path = require 'path' | |
Crawler = require 'crawler' | |
# script | |
crawled = {} | |
c = new Crawler { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> db.getSisterDB('week5').help() | |
DB methods: | |
db.addUser(username, password[, readOnly=false]) | |
db.adminCommand(nameOrDocument) - switches to 'admin' db, and runs command [ just calls db.runCommand(...) ] | |
db.auth(username, password) | |
db.cloneDatabase(fromhost) | |
db.commandHelp(name) returns the help for the command | |
db.copyDatabase(fromdb, todb, fromhost) | |
db.createCollection(name, { size : ..., capped : ..., max : ... } ) | |
db.currentOp() displays currently executing operations in the db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.users.insert({"_id":"joe","joined":ISODate("2012-02-03T00:00:00Z"),"likes":["tennis","golf"]}) | |
db.users.insert({"_id":"jane","joined":ISODate("2012-02-09T00:00:00Z"),"likes":["tennis","golf"]}) | |
db.users.insert({"_id":"remesh","joined":ISODate("2012-05-05T00:00:00Z"),"likes":["basketball"]}) | |
db.users.insert({"_id":"john","joined":ISODate("2012-03-05T00:00:00Z"),"likes":[]}) | |
db.users.insert({"_id":"mary","joined":ISODate("2012-03-22T00:00:00Z"),"likes":["golf","sailing"]}) | |
db.users.insert({"_id":"ann","joined":ISODate("2012-01-22T00:00:00Z"),"likes":["golf","basketball"]}) | |
db.users.insert({"_id":"jim","joined":ISODate("2012-11-01T00:00:00Z"),"likes":["tennis","fishing","golf","snowboard","football"]}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prompt = function() { | |
var ndocs, obj, p, sec; | |
ndocs = function(n) { | |
return "" + n + " document" + (n > 1 ? 's' : ''); | |
}; | |
db.setProfilingLevel(2); | |
obj = db.getLastErrorObj(); | |
p = db.system.profile.find({ | |
$and: [ | |
{ns: {$not: /profile$/}}, |
NewerOlder