Register now and start sharing your code snippets.
-->

Deleting favicons in Firefox 3

Shell Script (Bash) posted 6 days ago by christian

To force Firefox to show your updated favicon (updating favicon.ico is not enough), first quit Firefox. Then issue the following commands in the terminal:

   1  $ cd /Volumes/Macintosh\ HD/Users/christian/Library/Application\ Support/Firefox/Profiles/46xov8kt.default
   2  $ sqlite3 places.sqlite 
   3  SQLite version 3.5.0
   4  Enter ".help" for instructions
   5  sqlite> 
   6  sqlite> delete from moz_favicons;
   7  sqlite> update moz_places set favicon_id = NULL;
   8  sqlite> .quit 

Tagged mac, osx, firefox, favicon

Mounting a remote network drive with SSHFS on OSX

Shell Script (Bash) posted 4 months ago by christian
  1. Install SSHFS

http://code.google.com/p/macfuse/

  1. Read documentation

http://code.google.com/p/macfuse/wiki/MACFUSE_FS_SSHFS

  1. Create symlink

   1  ln -s /Applications/sshfs.app/Contents/Resources/sshfs-static /usr/local/bin/sshfs

  1. Mount drive

   1  mkdir /Volumes/mount_name
   2  sshfs -p 666 server:/ /Volumes/mount_name -oreconnect,ping_diskarb,volname=mount_name

  1. References

http://lifehacker.com/software/ssh/geek-to-live—mount-a-file-system-on-your-mac-over-ssh-246129.php

Tagged sshfs, mount, remote, drive, osx

Rails+Mongrel+Apache 2 on Mac OSX Leopard

Apache posted 6 months ago by christian

I use this configuration on my development machine when I need mod_rewrite; it’s not meant for production:

   1  <VirtualHost *:80>
   2  ServerName dev.xxx.com
   3  
   4  # Enable URL rewriting
   5  RewriteEngine On
   6  
   7  # Rewrite index to check for static pages
   8  RewriteRule ^/$ /index.html [QSA]
   9  
  10  # Rewrite to check for Rails cached page
  11  RewriteRule ^([^.]+)$ $1.html [QSA]
  12  
  13  # Redirect all non-static requests to cluster
  14  RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
  15  RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L]
  16  
  17  DocumentRoot  "/Users/christian/Documents/Projects/xxx/public"
  18  <Directory "/Users/christian/Documents/Projects/xxx/public">
  19       Options Indexes FollowSymLinks
  20  
  21       AllowOverride None
  22       Order allow,deny
  23       Allow from all
  24   </Directory>
  25  
  26  </VirtualHost>
  27  
  28  <Proxy balancer://mongrel_cluster>
  29    BalancerMember http://127.0.0.1:3000
  30  </Proxy>

Tagged apache, mongrel, osx, rails

How to start Firefox with a different profile on OSX

Plain Text posted 6 months ago by christian

   1  # Start the development profile
   2  /Applications/Firefox.app/Contents/MacOS/firefox-bin -P 'development'
   3  # Choose the profile manually
   4  /Applications/Firefox.app/Contents/MacOS/firefox-bin -ProfileManager

Tagged osx, firefox, profile

Installing ImageMagick, mini-magick and rmagick on Mac OS X Leopard

Ruby posted 9 months ago by christian

I had no success installing ImageMagick and mini-magick with the instructions I found on this page but after some googling I found this blog post, which had the magic commands that worked for me:

   1  sudo port install tiff -macosx  #disables the linkage with Apple's open gl
   2  sudo port install ImageMagick
   3  
   4  sudo gem install rmagick
   5  sudo gem install mini_magick

To test mini-magick, open an irb console and paste in the following code:

   1  require 'rubygems'
   2  require 'mini_magick'
   3  
   4  path = "public/images/0000/0003/logo.jpg"
   5  image = MiniMagick::Image.new(path)
   6  
   7  #print width and height
   8  puts image[:width]
   9  puts image[:height]

Tagged imagemagick, attachment_fu, rails, ruby, mac, osx, leopard, mini-magick, rmagick