Skip to content

Instantly share code, notes, and snippets.

View dustindorroh's full-sized avatar

Dustin Dorroh dustindorroh

View GitHub Profile
@dustindorroh
dustindorroh / mail.py
Created September 16, 2012 01:00
Command line python program that sends an email with an attachment from your account to someone else.
#!/usr/bin/python
# -*-coding:utf-8-*-
#
# mail.py
#
# Copyright 2012 Dustin Dorroh <[email protected]>
#
# 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
#!/bin/sh
# https://wiki.archlinux.org/index.php/Color_Bash_Prompt
# Reset
Color_Off='\e[0m' # Text Reset
Off='\e[0m'
OFF='\e[0m'
# Regular Colors
Black='\e[0;30m' # Black
source ~/colors.sh
function log () {
echo "$(date --rfc-3339=seconds) [$0] : $@" |& \
tee -a ${LOGFILE:-utils.log}
}
function warn () {
printf "$BIYellow""%s""$OFF""\n" "$(log $@)"
}
function error () {
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
# do not bell on tab-completion
#set bell-style none
set bind-tty-special-chars off
set meta-flag on
set input-meta on
set convert-meta on
set output-meta on
set history filename ~/.gdb_history
set history save
# -*- mode: Conf -*-
[user]
name = Dustin Dorroh
email = [email protected]
[core]
editor = emacs -nw
excludesfile = /home/ddorroh/.gitignore_global
[alias]
diff = diff --color
@dustindorroh
dustindorroh / concat_df.py
Created December 27, 2015 10:35
Concatenate csv files using pandas DataFrames into one file
#!/usr/bin/env python2
'''
Concatenate csv files using pandas DataFrames into one file
:author: Dustin Dorroh <[email protected]>
'''
import argparse
import pandas as pd
import os
@dustindorroh
dustindorroh / oswrap.py
Created December 27, 2015 10:37
Wraps various os methods to be more forgiving.
'''
Wraps various os methods to be more forgiving.
:since: Dec 22, 2015
:author: Dustin Dorroh <[email protected]>
'''
import os
import stat