/root/mongo_bkp.sh
rm -rf /root/dump* && mongodump && tar -cvf dump.tar dump/
ssh user@machine /root/mongo_bkp.sh
db.collection.find().limit(1).skip(_rand()*db.collection.count()); |
<?php | |
/* | |
Plugin Name: Import demo | |
Plugin URI: http://royduineveld.nl | |
Description: A demo import for my blog | |
Version: 1.0 | |
Author: Roy Duineveld | |
Author URI: http://royduineveld.nl | |
*/ |
# prints quote of the day | |
$temp = [System.IO.Path]::GetTempPath() | |
$today = Get-Date -UFormat "%Y-%m-%d" | |
$file = "$temp\qod-$today.json" | |
try { | |
if (Test-Path $file) { | |
$qod = (Get-Content -Path $file | ConvertFrom-Json) | |
} else { |