Skip to content

Instantly share code, notes, and snippets.

View davidschlachter's full-sized avatar

David Schlachter davidschlachter

View GitHub Profile
#!/bin/bash
if [ $# -eq 0 ]
then
echo "Usage: set-months.sh YEAR"
fi
export YEAR=$1
cd /home/mongobackup
source mbackupconfig # Load environment variables with username and password
mongodump --username=$MUSER --password=$MPASSWORD --db=osdsvol --host=127.0.0.1 --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
davidschlachter / timetables-updater.sh
Last active June 21, 2016 20:25
Shell script to update timetables for uOttawa schedule generator
#!/bin/bash
#
# 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 ./getCourses.py && \
./getTimetables.py -p 8
@davidschlachter
davidschlachter / Chromium_launcher.command
Created April 26, 2016 14:31
Chromium launcher for OS X with environment variables
#!/bin/bash
# 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
/Applications/Chromium.app/Contents/MacOS/Chromium