Skip to content

Instantly share code, notes, and snippets.

View linjer's full-sized avatar

Jerry Lin linjer

View GitHub Profile
@linjer
linjer / seed_mongodb_from_production.js
Last active August 29, 2015 14:23
Script for seeding local development mongodb instance from data on a production server
// Copies data from every mongo collection in production to your local instance
// Usage:
// 1. Configure the desired parameters below
// 2. $ mongo local-mongo-seed-all-collections.js
/*=================================
* Configuration parameters
*===============================*/
var config = {
SOURCE_SERVER: '127.0.0.1',
@linjer
linjer / tmcleanup.md
Last active April 1, 2024 07:15
Script to automatically remote old Mac OSX Time Machine Backups older than a specified number of days

Prerequisites

  • gfind (via brew install findutils)
  • Time Machine drive mounted on your computer (or you can change path from standard /Volume/Time\ Machine\ Backups/Backups.backup.db/
  • Admin/sudo access in the OSX terminal

Script

  • Be sure to set the correct machine name. You can check the actual folder things are going into by looking in the backup location.
  • By default, it erases all backups older than 30 days. Adjust as desired.
@linjer
linjer / stash_slack.sh
Last active April 20, 2019 06:40
Atlassian Stash 3.2 Git integration with Slack through external web hooks
#!/bin/bash
# $1 => Slack hook URL
# $2 => Channel name
# $3 => URL to web repo browser for base project
slack_url="$1"
channel="$2"
browser_url="$3"
# Debugging output in /tmp/stash_slack.txt