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
// FROM: http://www.mongodb.org/display/DOCS/Updating#Updating-update%28%29 | |
// | |
// db.collection.update( criteria, objNew, upsert, multi ) | |
// criteria - query which selects the record to update; | |
// objNew - updated object or $ operators (e.g., $inc) which manipulate the object | |
// upsert - if this should be an "upsert"; that is, if the record does not exist, insert it | |
// multi - if all documents matching criteria should be updated | |
// | |
// SQL VERSION: | |
// UPDATE myTable SET dateField = '2011-01-01' WHERE condField = 'condValue' |
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
# Unpack | |
gzip -cd /boot/initramfs.example | cpio -i | |
# Repack | |
find . | cpio --dereference -o -H newc | gzip > /boot/initramfs.example |
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 IS OLD AND OUTDATED | |
#### LIKE, ANSIBLE 1.0 OLD. | |
#### | |
#### PROBABLY HIT UP https://docs.ansible.com MY DUDES | |
#### | |
#### IF IT BREAKS I'M JUST SOME GUY WITH | |
#### A DOG, OK, SORRY | |
#### |
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
from Crypto.Hash import HMAC | |
from Crypto.Hash import SHA | |
import hashlib | |
import datetime | |
class Auth: | |
@classmethod | |
def sign(cls, method, c_type, body, uri, key=None): |
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
var collectionNames = db.getCollectionNames(), stats = []; | |
collectionNames.forEach(function (n) { stats.push(db[n].stats()); }); | |
stats = stats.sort(function(a, b) { return b['size'] - a['size']; }); | |
for (var c in stats) { print(stats[c]['ns'] + ": " + stats[c]['size'] + " (" + stats[c]['storageSize'] + ")"); } |
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
$ juju ssh 0 | |
machine-0# sudo apt-get install mongodb-clients | |
machine-0# mongo --ssl -u admin -p $(grep oldpassword /var/lib/juju/agents/machine-0/agent.conf | awk -e '{print $2}') localhost:37017/admin | |
MongoDB shell version: 2.4.9 | |
connecting to: localhost:37017/admin | |
juju:PRIMARY> db = db.getSiblingDB("juju") | |
juju | |
juju:PRIMARY> show collections | |
constraints | |
containerRefs |
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
$ juju ssh 0 | |
machine-0# sudo apt-get install mongodb-clients | |
machine-0# mongo --ssl -u admin -p $(grep oldpassword /var/lib/juju/agents/machine-0/agent.conf | awk -e '{print $2}') localhost:37017/admin | |
MongoDB shell version: 2.4.9 | |
connecting to: localhost:37017/admin | |
juju:PRIMARY> db = db.getSiblingDB("juju") | |
juju |
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
#!/usr/bin/env python | |
from __future__ import print_function | |
import yaml | |
import subprocess | |
import argparse | |
__author__ = "Jorge Niedbalski <[email protected]>" |
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
# coding=utf8 | |
""" | |
salesforce.py - Willie Salesforce Module for displaying | |
support case information | |
Copyright 2015, Billy Olsen | |
Licensed under the Eiffel Forum License 2. | |
""" | |
from __future__ import unicode_literals |
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
$ source netns-lxc.sh && sudo veth_interface_for_lxc container_name | |
veth132 |
OlderNewer