Skip to content

Instantly share code, notes, and snippets.

View plainprogrammer's full-sized avatar

James Thompson plainprogrammer

View GitHub Profile
#!/usr/bin/ruby
rev_10_file = File.open('rev_10.rev', 'a')
rev_172_file = File.new('rev_172.txt', 'w+')
rev_192_file = File.new("rev_192.txt", "w+")
Dir['/Users/andybaxter/bind/*.com'].each do |filename|
File.open(filename, 'r+').readlines.each do |line|
domain = line.split.first
ip = line.split.last
@plainprogrammer
plainprogrammer / S3 bulk rename script
Created July 3, 2012 18:13
This is a quick script for doing a mass copy or rename of all files in an Amazon S3 bucket.
# This is a quick script for doing a mass rename of all files in an Amazon S3 bucket.
# In this case, the rename operation was to unescape all filenames which had been
# previously escaped in error.
#############################
# Configuration:
bucketname = "YOUR_S3_BUCKET_NAME"
access_key = 'YOUR_ACCESS_KEY_ID'
secret_key = 'YOUR_SECRET_ACCESS_KEY'