Skip to content

Instantly share code, notes, and snippets.

View romuloctba's full-sized avatar
:octocat:

RcDev romuloctba

:octocat:
View GitHub Profile
@cristopher-rodrigues
cristopher-rodrigues / mongo_bkp.markdown
Last active December 2, 2015 13:09
Mongo copy last data (SIMPLE BKP)

Create script on server

/root/mongo_bkp.sh

rm -rf /root/dump* && mongodump && tar -cvf dump.tar dump/

Exec script

ssh user@machine /root/mongo_bkp.sh
@cristopher-rodrigues
cristopher-rodrigues / randdata.js
Created December 2, 2015 16:30
mongo random find data
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
*/
@andregs
andregs / profile.ps1
Last active March 2, 2019 11:28
PowerShell script to set the user profile with quote of the day, custom prompt string, and CTRL+D shortcut to close the window
# 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 {