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.getCollectionNames().forEach(function(collection) { | |
indexes = db[collection].getIndexes(); | |
indexes.forEach(function (c) { | |
opt = ''; | |
ixkey = JSON.stringify(c.key, null, 1).replace(/(\r\n|\n|\r)/gm,""); | |
ns = c.ns.substr(c.ns.indexOf(".") + 1, c.ns.length); | |
for (var key in c) { | |
if (key != 'key' && key != 'ns' && key != 'v') { | |
if (opt != '') { opt+= ','} | |
if (c.hasOwnProperty(key)) { |
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 | |
namespace App\Libraries\Queue; | |
use Illuminate\Events\Dispatcher; | |
use Illuminate\Queue\DatabaseQueue; | |
use Illuminate\Support\Str; | |
use Laravel\Horizon\Events\JobDeleted; | |
use Laravel\Horizon\Events\JobPushed; | |
use Laravel\Horizon\Events\JobReleased; |
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 | |
/** | |
* Classes source autoload | |
*/ | |
class Varien_Autoload | |
{ | |
/** @var \Composer\Autoload\ClassLoader */ | |
private static $autoloader; | |
/** @var self */ |
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
#!/bin/bash | |
cd /media/dumps | |
name=$(date +%b-%d) | |
year=$(date +%Y) | |
[ -d $year ] || mkdir $year || { echo "Could not create directory '$year'"; exit 1; } | |
mongodump --db t3_mage --out $name &> mongodump.log | |
if [ $? ]; then | |
tar -czf snapshots/$year/$name.tgz $name | |
if [ $(($(date +%d | sed 's/^0*//') % 10)) == 0 ]; then |
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
#!/bin/bash | |
DBNAME=mwe | |
SNAPSHOT_DAYS=7 | |
ARCHIVE_DAYS=60 | |
mysqldump=/usr/bin/mysqldump | |
gzip=/bin/gzip | |
function error() { | |
echo $1 >> $logfile.tmp |
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
#!/bin/bash | |
# | |
# Optimize all jpg and png files in the cwd | |
# Run it again to optimize new files since the last run | |
# | |
# Example: | |
# echo "optimize_media.sh > /tmp/optimize.log" | sudo -u www-data bash -s | |
# | |
# Colin Mollenhour 2016 |