Skip to content

Instantly share code, notes, and snippets.

View sholloway's full-sized avatar
🐧
Coding, coding, coding

Samuel Holloway sholloway

🐧
Coding, coding, coding
View GitHub Profile
@sholloway
sholloway / Cleaning up SSH after EC2 reboot
Created January 13, 2013 20:03
After rebooting an ec2 instance, the domain name will change if not using Route 53 in front of it. Therefore, to connect with SSH you've got to remove the RSA token from your local known hosts file. Here's an easy way to do it. Change the number to the line that the SSH error message refers to.
sed -i".bak" '6d' ~/.ssh/known_hosts
@sholloway
sholloway / EBS Mount
Last active December 11, 2015 00:59
Basic directions to attach an EBS volume to an EC2 instance.
Attached the EBS volume to the EC2 Instance
http://www.webmastersessions.com/how-to-attach-ebs-volume-to-amazon-ec2-instance
Logged in to the EC2 instance,
The volume should show up as /dev/sdf or something.
#Format the volume
sudo mkfs.ext3 /dev/sdf
#create the directory to link the volume to.
mkdir /spatial-db
@sholloway
sholloway / Windows Commands
Created January 6, 2013 20:37
Windows Terminal Commands
ADDUSERS Add or list users to/from a CSV file
ARP Address Resolution Protocol
ASSOC Change file extension associations•
ASSOCIAT One step file association
ATTRIB Change file attributes
BOOTCFG Edit Windows boot settings
BROWSTAT Get domain, browser and PDC info
CACLS Change file permissions
CALL Call one batch program from another•
CD Change Directory - move to a specific Folder•
@sholloway
sholloway / OS X Terminal Commands
Created January 6, 2013 20:35
A listing of OS X Terminal commands
alias Create an alias
alloc List used and free memory
awk Find and Replace text within file(s)
basename Convert a full pathname to just a folder path
bash Bourne-Again SHell (Linux)
bless Set volume bootability and startup disk options.
break Exit from a loop
cal Display a calendar
@sholloway
sholloway / github release
Last active April 28, 2023 14:51
procedure for releasing to github
#first checkout master
git checkout master
#merge the dev branch
git merge dev
#get the log of commits and add them to the readme
git log --pretty=format:'%C(yellow)%h %Cred%ad %Cblue%an%Cgreen%d %Creset%s' --date=short
#tag the commit
@sholloway
sholloway / AWS Setup
Created November 7, 2012 01:29
Setting up AWS command line tool for EC2, S3, SQS, ELB, SDB
#http://timkay.com/aws/
mkdir aws_install
cd aws_install
curl https://raw.github.com/timkay/aws/master/aws -o aws
chmod +x aws
perl aws --install #this doesn't seem to work on OS X yet...
#Put your AWS credentials in ~/.awssecret: the Access Key ID on the first line and the Secret Access Key on the second line.
@sholloway
sholloway / SCP Cheats
Created October 5, 2012 13:57
dowloading and uploading files with scp
Usage:
scp [options] [[user@]host1:]filename1 ... [[user@]host2:]filename2
Where:
[[user@]host1:]filename1 is the source file and path, and [[user@]host2:]filename2 is the destination.
Upload Example:
scp ./myfile username@ipaddress:/Users/dest_user/remote_path/new_file_name
Download Example:
Upload Example:
@sholloway
sholloway / .bash_profile
Created July 15, 2012 21:21
Part of my bash profile
#call .bashrc if I'm logging in remotely.
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
#Enable RVM to work as a system function
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
#get ls the way I like it
alias ls='ls -aGF'
@sholloway
sholloway / gist:3071583
Created July 8, 2012 16:18
Basic Core Image filtering and Image I/O
framework "Quartz"
input_a = "path/to/a/file"
input_b = "path/to/a/file"
output = "path/to/a/file"
#load images using Core Image (could have also used Image I/O
h_path = NSURL.fileURLWithPath(input_a,false)
forground_image = CIImage.alloc.initWithContentsOfURL(h_path)
@sholloway
sholloway / list_image_io.rb
Created July 8, 2012 16:12
List avaible Image I/O inputs and outputs with macruby
framework "Quartz"
puts "Image I/O Input Formats:"
can_read_from = CGImageSourceCopyTypeIdentifiers()
CFShow(can_read_from)
puts " "
puts "Image I/O Output Formats:"
can_write_to = CGImageDestinationCopyTypeIdentifiers()
CFShow(can_write_to)