Skip to content

Instantly share code, notes, and snippets.

View jasonwbarnett's full-sized avatar

Jason Barnett jasonwbarnett

View GitHub Profile
@jasonwbarnett
jasonwbarnett / mutt_and_gmail_smtp.sh
Last active August 29, 2015 13:57
This is how you can use mutt with a gmail account to send email at the command line.
## Install homebrew:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
## Run brew doctor to make sure everything is ok
brew doctor
## Install mutt
brew install mutt
## Setup your .muttrc file with the gmail smtp info:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC4gPkAp6XL8nIKs8LH5jouh69sIDCmlOh8hKDEEIepk49+HcTKdD7ZSCPvKKZIfdDREqVRFY9/EAQRVoe/LpeNqm5YsqEiyuzXmJF98LF2u00cWz6dOQsGjvdFllOBm0SbzP+Ylz4432bCMJnSXddwTzZ4rXuhtfM/DGJlx0nZ3DeceTNV22GdqFJbxv1/HqemWp8u6pFLUyHJsLqz2Zeuelyn5PHPKEj/oAtQxiAoAYrG5kP38lYngUeT4mtRQWPa3ug74KOzwK/bzmSLgFTPDWqXJRaR5b6M7hM5y9JoMZoLVskSSmOuhSsQeC7Q3tHiwgoauYIQeSqsmv8hP6PVWtSN07Dh/vF5nqTkTY/noQKm8UvRQ1dQCCCXxRwWwHWed/MAQgnTwjijnHfBNP1X6BXcqFRkDzjlx8vpt4T4p29CiSwTfpAOihMSRbAy1WMsSa7l9KhYJ1qDqajGCI2/cutkQS8WFxdBG+bfHTz6VJ2Nl4XwC0veLJ/z8ItC25ADWchDhd4dGqXnjmigcFvj+eX6adyXsSCgDtSdbRgA7NMA/vQWGu2qsQAbY966cfC7YT77csZNekrY46sRa89UCOpP+vPSwhZfX5WAlkEIbGYtQEhZkStuP/I/pJHrdo0VwMXkaULYZ951W8qwK3KkZiW2R4pBgmP/WRnhpGTw2Q== jbarnett@Jasons-MacBook-Pro.local
## First we remove all of the old crap:
curl "https://gist.githubusercontent.com/mxcl/1173223/raw/a833ba44e7be8428d877e58640720ff43c59dbad/uninstall_homebrew.sh" > ~/uninstall_homebrew.sh
bash ~/uninstall_homebrew.sh
rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup
rm -Rf ~/.rvm
## Re-install homebrew
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
## Install required libs
@jasonwbarnett
jasonwbarnett / mindjet_certificate_authority_root.cer
Last active August 29, 2015 14:02
Our new Mindjet CA root certificate
-----BEGIN CERTIFICATE-----
MIIGUTCCBDmgAwIBAgIJALYj155MmW7gMA0GCSqGSIb3DQEBBQUAMHgxCzAJBgNV
BAYTAlVTMRQwEgYDVQQKEwtNaW5kamV0IExMQzErMCkGA1UECxMiU2VjdXJlIERp
Z2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEmMCQGA1UEAxMdTWluZGpldCBDZXJ0
aWZpY2F0ZSBBdXRob3JpdHkwHhcNMTQwNjAxMTUyMjQ4WhcNMjkwNTI4MTUyMjQ4
WjB4MQswCQYDVQQGEwJVUzEUMBIGA1UEChMLTWluZGpldCBMTEMxKzApBgNVBAsT
IlNlY3VyZSBEaWdpdGFsIENlcnRpZmljYXRlIFNpZ25pbmcxJjAkBgNVBAMTHU1p
bmRqZXQgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MIICIjANBgkqhkiG9w0BAQEFAAOC
Ag8AMIICCgKCAgEAvq9FkWRJqF8452BdoC5Dn4b43pl4wofnMiBwaMSTOr+PoGIT
ujGrWa0D/4jkrzvxtrlRo18E+sC5Go0TArs6aYOT6M2pbf9LKJqCs7AV6cs1r4Cp
@jasonwbarnett
jasonwbarnett / cygwin_vim_fixes.sh
Created June 7, 2014 14:31
This fixes normal vim behavior in Windows when using cygwin
cat >> ~/.vimrc <<EOF
set nocompatible
set backspace=indent,eol,start
EOF
@jasonwbarnett
jasonwbarnett / convert_bugzilla_components.sh
Created June 20, 2014 17:36
This was used to convert component default assignee values if the user has example.com in their address
#!/bin/bash
components=$(mysql -BNe 'select * from bugs.components;' | tr '\t' '|')
AMY_ID=277
IFS=$'\n'
for x in $components;do
component_id=$(echo ${x} | awk -F\| '{print $1}')
default_assignee_id=$(echo ${x} | awk -F\| '{print $4}')
default_assignee_email=$(mysql -BNe "select login_name from bugs.profiles where userid = '${default_assignee_id}';")
example_email=$(echo ${default_assignee_email} | egrep -o 'example\.com')
@jasonwbarnett
jasonwbarnett / install_go.sh
Last active August 29, 2015 14:04
How to install Go in a few seconds
#!/bin/bash
wget "http://golang.org/dl/go1.3.linux-amd64.tar.gz" -O ~/go1.3.linux-amd64.tar.gz
tar -C /usr/local -xzf ~/go1.3.linux-amd64.tar.gz
cat << 'EOF' | sudo tee -a /etc/profile
export GOROOT=/usr/local/go
export PATH=$PATH:/usr/local/go/bin
EOF
@jasonwbarnett
jasonwbarnett / ssh_proxy.sh
Created August 7, 2014 16:47
How to SSH proxy through another host
jbarnett@Hackintosh-10 ~ $ cat ~/.ssh/config
Host r176.spigit.com r178.spigit.com
ProxyCommand ssh -T operations002.c.mindjet-gce-stack.internal 'nc %h %p'
jbarnett@Hackintosh-10 ~ $
@jasonwbarnett
jasonwbarnett / install_mysql-server_bin.sh
Last active August 29, 2015 14:05
This can be used to install MySQL Server from the bin distribution.
#!/bin/bash
# Author: Jason Barnett <J@sonBarnett.com>
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Jason Barnett
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
#!/bin/bash
# Note: Works with bash 4.x and above only #
# STOLEN FROM: http://www.cyberciti.biz/tips/unix-linux-bash-shell-script-wrapper-examples.html
# curl -I http://cyberciti.biz/
# ping -v -c 2 !!:2
# host -t aaaa !!:4
# host -t mx !!:3
# host -t a ftp://nixcraft.com/
# host -a ftp://nixcraft.com/
# ping 8.8.8.8