Created
September 22, 2008 04:11
-
-
Save beccasaurus/11940 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env ruby | |
puts "closing firefox ..." | |
`killall firefox` | |
require 'rubygems' | |
require 'activerecord' | |
ActiveRecord::Base.establish_connection :adapter => 'sqlite3', | |
:database => '/home/remi/.mozilla/firefox/efs72yik.default/places.sqlite' | |
ActiveRecord::Base.table_name_prefix = 'moz_' | |
class Favicon < ActiveRecord::Base; end | |
# mime_type => 'image/png' | |
# expiration => 0 | |
# id => [generated] | |
# url => full path to favicon | |
# | |
# Favicon.create :url => "http://localhost:3000/favicon.png", :mime_type => "image/png", | |
# :expiration => 0 | |
puts "deleting favicons for localhost ..." | |
favicons = Favicon.find :all, :conditions => "url like '%localhost%'" | |
favicons.each {|f| f.update_attribute :data, nil } | |
puts "deleted #{favicons.length} favicons" | |
puts "restoring firefox ..." | |
`firefox &` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment