Skip to content

Instantly share code, notes, and snippets.

@boxnos
Created March 28, 2014 16:47
Show Gist options
  • Save boxnos/9837401 to your computer and use it in GitHub Desktop.
Save boxnos/9837401 to your computer and use it in GitHub Desktop.
require 'find'
require 'fileutils'
require 'shellwords'
require 'kconv'
Find.find '.' do |path|
unless path.isutf8
next
end
if /^((goog|test)-(phish|malware))|classifier.hashkey/ =~ File.basename(path)
path = Shellwords.shellescape(path)
unless File.exist? path
next
end
if FileTest.directory? path
p = Dir.glob(path + '/../')[0]
else
p = File.dirname(path) + '/'
end
a = []
a += Dir.glob("#{p}classifier.hashkey")
a += Dir.glob("#{p}goog-*")
a += Dir.glob("#{p}test-*")
puts a.length.to_s + " : " + p
FileUtils.rm_rf a
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment