Skip to content

Instantly share code, notes, and snippets.

View beaudierman's full-sized avatar

Beau Dierman beaudierman

View GitHub Profile

Keybase proof

I hereby claim:

  • I am beaudierman on github.
  • I am beaudierman (https://keybase.io/beaudierman) on keybase.
  • I have a public key whose fingerprint is F501 39AA D307 41ED 6293 9F41 1503 B071 252D E1B2

To claim this, I am signing this object:

@beaudierman
beaudierman / Pull-and-Sync-Data-Between-Google-Doc-Spreadsheet-and-MySQL.gs
Created April 19, 2018 18:10
You can pull data from MySQL database to Google doc spreadsheet auto with just click of a button or scheduled time. This is great use for retrieving data in spreadsheet format.
// MySQL to Google Spreadsheet By Pradeep Bheron
// Support and contact at pradeepbheron.com
function myMySQLFetchData() {
var conn = Jdbc.getConnection('jdbc:mysql://127.0.0.1:3306/employee_db', 'username', 'pass'); // Change it as per your database credentials
var stmt = conn.createStatement();
var start = new Date(); // Get script starting time
@beaudierman
beaudierman / update-pip-packages.py
Created February 15, 2018 14:14
Update pip packages with a simple Python script, answer from https://stackoverflow.com/a/5839291
import pip
from subprocess import call
packages = [dist.project_name for dist in pip.get_installed_distributions()]
call("pip2 install --upgrade " + ' '.join(packages), shell=True)
@beaudierman
beaudierman / playlist_youtube.lua
Created January 14, 2015 16:08
Youtube Playlist Parser for VLC Media Player
--[[
Youtube playlist importer for VLC media player 1.1 and 2.0
Copyright 2012 Guillaume Le Maout
Authors: Guillaume Le Maout
Contact: http://addons.videolan.org/messages/?action=newmessage&username=exebetche
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
@beaudierman
beaudierman / nat_monitor.sh
Created May 19, 2014 14:18
When needing to route specific traffic while using a NAT inside of the AWS VPC I use this script. I find it works better than routing 0.0.0.0/0 to the NAT since I use specific IP addresses to pass through the NAT, all other traffic using 0.0.0.0/0 -> IGW
#!/bin/sh
# This script will monitor another NAT instance and take over its routes
# if communication with the other instance fails
# NAT instance variables
# Other instance's IP to ping and route to grab if other node goes down
NAT_ID=
NAT_RT_ID=
# My route to grab when I come back up
@beaudierman
beaudierman / gist:11219873
Created April 23, 2014 15:25
Ubuntu 14.04 Composer Mcrypt error while installing Laravel
## Run the following commands after making sure you have the php5-mcrypt extension installed
sudo php5enmod mcrypt
sudo service apache2 restart
@beaudierman
beaudierman / fix.sh
Created December 2, 2013 15:58
Fix OS X Mavericks(10.9) Lag Issues
sudo defaults write /System/Library/LaunchDaemons/com.apple.coreservices.appleevents ExitTimeOut -int 1
sudo defaults write /System/Library/LaunchDaemons/com.apple.securityd ExitTimeOut -int 1
sudo defaults write /System/Library/LaunchDaemons/com.apple.mDNSResponder ExitTimeOut -int 1
sudo defaults write /System/Library/LaunchDaemons/com.apple.diskarbitrationd ExitTimeOut -int 1
sudo defaults write /System/Library/LaunchAgents/com.apple.coreservices.appleid.authentication ExitTimeOut -int 1
@beaudierman
beaudierman / gist:7487737
Created November 15, 2013 16:58
After installing Ubuntu 13.10 with PHP 5.5.3 I kept getting the "Laravel Requires the mcrypt PHP extension" when trying to run artisan commands. Running the following commands on my server fixed the problem.
# Make sure you have php5-mcrypt installed first. If not, run
sudo apt-get install php5-mcrypt
# Add a symlink for mcrypt.ini in the PHP5 apache config directory
sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/apache2/conf.d/20-mcrypt.ini
# Restart apache
sudo service apache2 restart
When your cron jobs have output, or, when they fail, email is sent to the following addresses
MAILTO="foo@bar.com,baz@qux.com"
The path of the user whose crontab you're setting up.
Use echo $PATH and copy the contents into the PATH variable
PATH="/usr/bin:/sbin:/bin"
The home directory that your crontab should be working in.
This can replace needing to cd /path/to/app/root in each script and using absolute paths.
@beaudierman
beaudierman / ssis-ftp-hack.cs
Created October 20, 2013 02:50
Hack for using an FTP Connection Manager in an SSIS package
object ftpConnectionManager = (object)Dts.Connections["FTP Connection Manager"];
string user = "user";
string pass = "pass";
Dts.Connections["FTP Connection Manager"].Properties["ServerUserName"].SetValue(ftpConnectionManager, user);
Dts.Connections["FTP Connection Manager"].Properties["ServerPassword"].SetValue(ftpConnectionManager, pass);