Skip to content

Instantly share code, notes, and snippets.

@voyeg3r
Created November 14, 2011 14:13
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save voyeg3r/1364022 to your computer and use it in GitHub Desktop.
Save voyeg3r/1364022 to your computer and use it in GitHub Desktop.
Script to put firefox cache in ram
#!/bin/bash
# HOW TO: Firefox cache in ramdisk (tmpfs)
# http://ubuntuforums.org/showthread.php?t=991205
# https://wiki.archlinux.org/index.php/Firefox_Ramdisk
# download: wget -c https://raw.github.com/gist/1364022/ -O firefox-cache-to-ram.sh && chmod +x $_
clear
echo 'Seu usuário tem que ser sudo user !'
read -p "Feceh o fiefox ou terá surpresa desagradável " read
pkill firefox
FILE=`find ~/.mozilla/ -iname "*.default"`/user.js
[ -f $FILE ] || > $FILE
echo 'user_pref("browser.cache.disk.parent_directory", "/dev/shm/firefox-cache");' >> $FILE
# As your firefox profile is now placed placed in a RAM Disk,
# we need to limit the disk cache size.
# This limitation will save some memory and will also limit
# the time taken by backup & restore that will take place at every boot & shutdown.
echo 'user_pref("browser.cache.disk.enable", true);' >> $FILE
echo 'user_pref("browser.cache.disk.capacity", 16384);' >> $FILE
echo 'user_pref("browser.cache.offline.enable", false);' >> $FILE
mount -a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment