Skip to content

Instantly share code, notes, and snippets.

View davidschlachter's full-sized avatar

David Schlachter davidschlachter

View GitHub Profile
if [ $# -eq 0 ]
echo "Usage: YEAR"
export YEAR=$1
cd /home/mongobackup
source mbackupconfig # Load environment variables with username and password
mongodump --username=$MUSER --password=$MPASSWORD --db=osdsvol --host= --out=osdsvol
mv osdsvol osdsvol.`date "+%Y-%m-%d-%H%M"`
tar -zcvf osdsvol.`date "+%Y-%m-%d-%H%M"`.tar.gz osdsvol.`date "+%Y-%m-%d-%H%M"`
rm -rf osdsvol.`date "+%Y-%m-%d-%H%M"`
davidschlachter /
Last active June 21, 2016 20:25
Shell script to update timetables for uOttawa schedule generator
# Script to update course time tables and restart the schedule generator with the new schedules
/bin/su --shell=/bin/bash schedgen <<'EOF'
cd "/etc/schedgen/uOttawa Schedule Generator/course-download"
mv db_activities.csv db_activities.csv.old ; mv db_courses.csv db_courses.csv.old ; mv db_sections.csv db_sections.csv.old
/usr/bin/xvfb-run ./ && \
./ -p 8
davidschlachter / Chromium_launcher.command
Created April 26, 2016 14:31
Chromium launcher for OS X with environment variables
# Set up environment variables
export GOOGLE_API_KEY=your_api_key
export GOOGLE_DEFAULT_CLIENT_ID=your_client_id
export GOOGLE_DEFAULT_CLIENT_SECRET=your_client_secret
# Launch Chromium