Skip to content

Instantly share code, notes, and snippets.

View set-months
#!/bin/bash
if [ $# -eq 0 ]
then
echo "Usage: set-months.sh YEAR"
fi
export YEAR=$1
View cron job for osdsvol database backup
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 Jun 21, 2016
Shell script to update timetables for uOttawa schedule generator
View timetables-updater.sh
#!/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 Apr 26, 2016
Chromium launcher for OS X with environment variables
View Chromium_launcher.command
#!/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