Skip to content

Instantly share code, notes, and snippets.

View bradymholt's full-sized avatar

Brady Holt bradymholt

View GitHub Profile
@bradymholt
bradymholt / smb.conf
Created January 12, 2012 19:37
Example Samba config file
# Global Parameters
[global]
workgroup = WORKGROUP
netbios name = POGO-SERVER
follow symlinks = yes
wide links = yes
security = user
map to guest = bad user
unix extensions = no
socket options = TCP_NODELAY IPTOS_LOWDELAY
@bradymholt
bradymholt / backup_mount_notifier.sh
Created January 16, 2012 16:25
Backup Mount Notifier
#!/bin/bash
[email protected]
BACKUP_LOCATION=/mount/backup
mountpoint -q $BACKUP_LOCATION
if [ $? == 0 ]; then
echo "$BACKUP_LOCATION is mounted!"
else
echo "$BACKUP_LOCATION is NOT mounted!" | mail -s "Backup Mount Status" $NOTIFY_EMAIL
@bradymholt
bradymholt / ec2-create-rolling-snapshot.sh
Created October 25, 2012 15:54
ec2-create-rolling-snapshot
#!/bin/sh
# Rolling snapshots for ec2
# Original version: 2010-05-28 by cwilper
# Updated: 2012-10-25 by [email protected]
# (Invoke with -h for more info)
showHelp() {
echo "SYNOPSIS"
@bradymholt
bradymholt / backup.sh
Created October 26, 2012 03:10
ec2-create-rolling-snapshot wrapper
#!/bin/sh
#Stop mysql to ensure snapshot consistancy
echo "Stopping mysql..."
/sbin/service mysqld stop
echo "Creating snapshot..."
export AWS_ACCESS_KEY="AKIDDDDDDDDDDDD"
export AWS_SECRET_KEY="GQYL9/JKCFNbZ/2/DDDDDDDDDDDDDDDD"
export EC2_HOME=/opt/aws/apitools/ec2
export JAVA_HOME=/usr/lib/jvm/jre
#!/bin/sh
# Unattended podcast record process
# Author: [email protected]
# Notes: Invoke with seconds parameter specifying how many seconds to record, ex. 'podcast-record.sh 10'
FILENAME=$(date +"%Y%m%d_%H%M")
#record with sudo since arecord seems to want root privledges
sudo arecord -f dat -d $1 ./record/${FILENAME}.wav
@bradymholt
bradymholt / ef-complextypes.cs
Last active August 29, 2015 14:03
Entity Framework with Complex Types
public class Person {
public string FirstName {get;set;}
public string LastName {get;set;}
public Address = new Address(); // << It's important to instantiate Address.
}
[ComplexType] // << This attribute is important.
public class Address {
public string Address1 {get;set;}
public string Address2 {get;set;}
@bradymholt
bradymholt / process.sh
Last active May 19, 2020 19:41
HFBC Podcast Upload
#!/bin/bash
FILENAME=$1
cd ~/veritas-podcast
#change ownership to bholt
sudo chown bholt ./record/${FILENAME}.wav
[ $? -eq 0 ] || exit $?
@bradymholt
bradymholt / Data.cs
Last active August 29, 2015 14:07
Entity Framework One-to-One Relationship
public class DataContext : DbContext
{
public DbSet<Order> Orders { get; set; }
public DbSet<OrderDetail> OrderDetails { get; set; }
}
public class Order
{
public int Id { get; set; }
public string Name { get; set; }
@bradymholt
bradymholt / organize.sh
Created November 10, 2014 02:05
TV downloads
#!/usr/bin/bash
DOWNLOAD_DIR=/home/bholt/downloads
TARGET_DIR=/home/bholt/tv
cd ${DOWNLOAD_DIR}
mv So.You.Think* ${TARGET_DIR}/So\ You\ Think\ You\ Can\ Dance
mv MythBusters* ${TARGET_DIR}/MythBusters
@bradymholt
bradymholt / arhive.sh
Created November 10, 2014 02:07
Motion Archive
#!/usr/bin/bash
# Format: YEAR MONTH DAY
DATE=$(date +%Y%m%d)
PATH="/home/bholt/surveillance/driveway"
TARGET_FILE="$PATH/$DATE"
/usr/bin/sudo /usr/bin/systemctl stop motion
/usr/bin/sudo /sbin/swapon /dev/sdb2
cd $PATH
#create timelapse video