Skip to content

Instantly share code, notes, and snippets.

View btobolaski's full-sized avatar

Brendan Tobolaski btobolaski

View GitHub Profile
@btobolaski
btobolaski / LaunchAgent.template.plist
Created September 18, 2012 18:27
A simple template for launching a script on user login. Fill in name.of.LaunchAgent with the name of the launch agent(ex. com.example.script) and the fill in the location of the script into location/of/scipt
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0/EN" "http://www.apple.com/DTDs/PropertList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>name.of.LaunchAgent</string>
<key>ProgramArguments</key>
<array>
<string>location/of/script</string>
</array>
@btobolaski
btobolaski / gist:3789194
Created September 26, 2012 17:01
wp-svbtle redirect if
if ($request_uri ~* "(/wp-admin/|/wp-svbtle/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php)") { set $cache_uri "no cache"; }
@btobolaski
btobolaski / gist:3789200
Created September 26, 2012 17:02
wp-svtle nginx send script to fastcgi
location /wp-svbtle { fastcgi_index wp-svbtle.php; fastcgi_pass 127.0.0.1:9000; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; }
@btobolaski
btobolaski / crossover.sh
Created September 28, 2012 19:37
Installs dependencies for running Microsoft office 2010 under crossover 11
#!/bin/bash
yum install isdn4k-utils.i686 mesa-libGLU.i686 libgphoto2.i686 gsm-devel.i686 hal-libs.i686 lcms-libs.i686 libtiff.i686 libv4l.i686 libpng.i686
libxslt.i686 cups-libs.i686 fontconfig.i686 openldap.i686 libXcomposite.i686 libXcursor.i686 libXinerama.i686 openssl-devel.i686 && \
yum --enablerepo=epel install openal-soft.i686 sane-backends-libs.i686
# Fix an issue with naming, on RHEL, libtiff.so.4 is libtiff.so.3
ln -s /usr/lib/libtiff.so.3 /usr/lib/libtiff.so.4
@btobolaski
btobolaski / gist:3815976
Created October 2, 2012 03:21
This script copies the files from my Drafts app folder to my notes folder
#!/bin/bash
find ~/Dropbox/Apps/Drafts -maxdepth 1 -mindepth 1 -not -name Journal.txt -print0 | xargs -0 mv -t ~/Dropbox/Notes
@btobolaski
btobolaski / dropbox.sh
Created October 9, 2012 14:49
Start dropbox on boot on a linux server as user. Useful for linux machines that don't have a gui.
#!/bin/bash
su user -c "/home/user/.dropbox-dist/dropboxd &"
@btobolaski
btobolaski / drafts.sh
Created October 9, 2012 18:04
A script to deal with Drafts' App folder in dropbox. I don't like how it uses a special folder in Dropbox. I wish that I could just set the folder to whatever I want. So what I do is check whether a file exists in my notes directory, if it does, it adds t
#!/bin/bash
DRAFTS_DIR=~/Dropbox/Apps/Drafts/*
NOTES_DIR=~/Dropbox/Notes
for file in $DRAFTS_DIR
do
FILENAME=$(basename "$file")
if [ "$FILENAME" != "Journal.txt" ]; then
if [ -f $NOTES_DIR/"$FILENAME" ]; then
echo "" >> $NOTES_DIR/"$FILENAME"
@btobolaski
btobolaski / python.vim
Created October 10, 2012 16:51
My python settings for vim. Feel free to use this if you want to create python code that looks like mine.
setlocal tabstop=2
setlocal softtabstop=2
setlocal shiftwidth=2
setlocal textwidth=90
setlocal smarttab
setlocal expandtab
@btobolaski
btobolaski / redhat5.sh
Created October 17, 2012 17:00
A script to install the EPEL repo if it isn't installed.
#!/bin/bash
if [ ! -f /etc/yum.repos.d/epel.repo ]
then
wget http://mirror.es.its.nyu.edu/epel/5/i386/epel-release-5-4.noarch.rpm
yum localinstall epel-release-5-4.noarch.rpm
rm -f epel-release-5-4.noarch.rpm
sed -i "s/enabled=1/enabled=0/g" /etc/yum.repos.d/epel.repo
fi
@btobolaski
btobolaski / rss-subscribers.sh
Created November 2, 2012 17:07 — forked from drdrang/rss-subscribers.sh
Bash script to parse Apache log for a count of RSS subscribers and email it to you
#!/bin/bash
# A modification of Marco Arment's script at
#
# https://gist.github.com/3783146
#
# It's intended to be run once a day as a cron job. The main
# differences between it and Marco's script are:
#
# 1. It checks two feeds instead of just one.