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
/** | |
@author Jaimon Mathew | |
csc /target:library /out:DnsLib.dll /D:DEBUG=1 /debug+ DnsLite.cs | |
*/ | |
using System; | |
using System.Net; |
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
ipfs : [0;37m01:02:21.637 INFO [0;34m cmd/ipfs: [0mIPFS_PATH C:\Users\gates/.ipfs [0;37m<autogenerated>:28[0m | |
At line:1 char:1 | |
+ ipfs daemon --debug *> .\ipfs_fsync_error.log | |
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
+ CategoryInfo : NotSpecified: ([0;37m01:02:21...nerated>:28[0m:String) [], RemoteException | |
+ FullyQualifiedErrorId : NativeCommandError | |
[0;37m01:02:21.637 [36mDEBUG [0;34m cmd/ipfs: [0mlooking for running daemon... [0;37m<autogenerated>:22[0m | |
[0;37m01:02:21.637 [36mDEBUG [0;34m cmd/ipfs: [0mCalling pre-command hooks... [0;37m<autogenerated>:22[0m |
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
### Sample usage: Get-FolderSizes "C:\data" | sort size -Descending | FT -AutoSize | |
function Get-FolderSizes([string] $StartFolder) { | |
$results = @(); | |
$colItems = (Get-ChildItem $StartFolder | Measure-Object -property length -sum) | |
$res = New-Object PSObject | select Folder, Size; | |
$res.Folder = $startFolder; | |
$res.Size = [float]("{0:N2}" -f ($colItems.sum / 1MB)); |
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: 1.8.1 | |
connecting to: test | |
> db.test.insert({ _id:3, "items": [ 'appstore.com', 'engineapp.com', 'asp.ca' ] }) | |
> db.test.find() | |
{ "_id" : 3, "items" : [ "appstore.com", "engineapp.com", "asp.ca" ] } | |
> db.test.update({}, {$pull : { items: {$regex: 'app' } } }) | |
> db.test.find() | |
{ "_id" : 3, "items" : [ "asp.ca" ] } |
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
<?php | |
try { | |
$mongo = new Mongo(); // default host:port | |
$db = $mongo->example; | |
$collection = $db->test; | |
$document = array('x' => 1); | |
$collection->insert($document); | |
print_r($document); |
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
<?php | |
try{ | |
### Step 1 & 2 | |
$m = new Mongo('ec2-50-16-121-178.compute-1.amazonaws.com'); | |
$db = $m->admin; | |
### Step 3 | |
$res = $db->command(array('replSetGetStatus' => 1)); | |
print_r($res); |
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
<?php | |
try{ | |
$m = new Mongo('localhost'); | |
$db = $m->abc; | |
$collection = $db->def; | |
$collection->drop(); | |
// Insert test data | |
$collection->insert( array('A' => 1, 'B' => 4, 'C' => array("C1" => 'val', "C2" => 15) ) ); |
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
<?php | |
try{ | |
$m = new Mongo('localhost'); | |
$db = $m->abc; | |
$collection = $db->def; | |
$collection->drop(); | |
// Insert test data | |
$collection->insert( array('A' => 1, 'B' => 4, 'C' => array("C1" => 'val', "C2" => 15) ) ); |
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.foo.insert( { x : 1, y : 1 } ) | |
> db.foo.insert( { x : 2, y : "string" } ) | |
> db.foo.insert( { x : 3, y : null } ) | |
> db.foo.insert( { x : 4 } ) | |
> db.foo.find() | |
{ "_id" : ObjectId("4dc1974612c677fc83b5629d"), "x" : 1, "y" : 1 } | |
{ "_id" : ObjectId("4dc1974c12c677fc83b5629e"), "x" : 2, "y" : "string" } | |
{ "_id" : ObjectId("4dc1975312c677fc83b5629f"), "x" : 3, "y" : null } | |
{ "_id" : ObjectId("4dc1975a12c677fc83b562a0"), "x" : 4 } | |
> db.foo.find( { "y" : null } ) |
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 x = { | |
"_id" : ObjectId("4dbf16ecee3bbe4d22000003"), | |
"options" : { | |
"options" : [ { "price" : { "_type" : "decimal", "val" : 1000 }, "label" : "10" } | |
], | |
"categories" : [[ "WTF","11" ]] | |
} | |
} | |
db.deals_test.drop(); |
NewerOlder