Limit Firefox Cache

Just an FYI post.

In all previous slacko versions I did not bother limiting the browser cache. The only way I knew how to do it was to install a default profile in /root/.mozilla. If you decide to run the browser as spot then this totally defeats the purpose.

Mozilla in their infinite wisdom has decided to remove that option from it’s gui preferences program. Rolling Eyes . The only way to do it now is manually through about:config.

With a bit of research I devised a way to limit the browser cache without installing a default profile.

A file; /usr/lib/firefox*/defaults/preferences/local-settings.js needs to be created (you can check it out at /usr/lib/firefox-17.0.11/defaults/preferences). It contains the following:

Code:
//
//default home page and cache
pref(“browser.startup.homepage”, “data:text/plain,browser.startup.homepage=file:///usr/share/doc/home.htm”);
pref(“browser.cache.disk.capacity”, 60000);

You’ll notice that this also sets the home page.

The trick about this though was how to implement it without hard coding?

Well I did this at the woof level with a pinstall.sh. The relevant part of the pinstall.sh contains this:

Code:
# work around for firefox bug to set cache
if [ `pwd` != ‘/’ ];then
FF=$(find usr/lib -type d -name firefox*)
PKGSTATDIR=`find ../../ -type d -name status -maxdepth 3`
PKGSTATFILE=`find $PKGSTATDIR -type f -name ‘findpkgs_FINAL_PKGS*’`
FFVER=`grep ‘firefox’ $PKGSTATFILE | awk -F’|’ ‘{print $6}’`
FFVER=${FFVER%%.*}
if [ “$FFVER” -ge 21 ];then
mkdir -p ${FF}/browser/defaults/preferences
PREFDIR=”${FF}/browser/defaults/preferences”
else
mkdir -p ${FF}/defaults/preferences
PREFDIR=”${FF}/defaults/preferences”
fi
cat > ${PREFDIR}/local-settings.js <<_EOF
//
//default home page and cache
pref(“browser.startup.homepage”, “data:text/plain,browser.startup.homepage=file:///usr/share/doc/home.htm”);
pref(“browser.cache.disk.capacity”, 60000);
_EOF

fi

That will seem like jumble to some, but all it does is create the above file. One important note though; mozilla, again in their infinite wisdom, moved the location of where these type of files are read in firefox-21. From /usr/lib/firefox*/defaults/preferences to /usr/lib/firefox*/browser/defaults/preferences.

This should work for seamonkey as well but the version change over would have to be noted.

Many thanks to Mike’s Musings.

Advertisements

Slacko 5.7 Released!

After ~original 500 commits and ~45.000 lines of code changes in woof-CE since forking from Barry’s Fossil, the first official woof-CE-based puppy, Slacko-5.7, is out 😀

-mavrothal, Puppy Linux forum, 9th March, 2014

LOL. I agree completely about abiword, plus my interaction with some of the devs was not very pleasant. But, concerning Puppy and productivity, Slacko is so good that I am totally comfortable using it for production in teaching online university courses (I do use Libre Office).

-playdayz (a.k.a Larry Short, Lucid Puppy Developer, from 2010-2012), Puppy Linux forum, 9th March, 2014

What more can I say? Slacko Puppy Linux 5.7 is released! 

Get it from the Slacko Web Site. Everything you need to know is either there or only a click or two from there.

Many thanks to the woof-CE development team (you know who you are  :monkey:). Without you this would not be possible.

Go get it and enjoy!

Android plus Puppy

Recently on the Murga Puppy Forum Media Transfer Protocol (MTP), actually a Microsoft protocol, has been in the news. Since Android 4.0, USB Mass Storage, which is how Androids used to connect with computers in Ginger Bread and below, has been deprecated. The new way to access files on Android devices via USB interface is now with MTP.

can8v (Puppy forum member) has written an application with a daemon to detect and mount MTP devices. I wrote an alternative app that uses the kernel’s udev rules to detect MTP devices and mount them. The term “mount” is used loosely as MTP devices are not block devices like USB sticks, hard drives and other devices but are mounted as fuse filesystems.

I got to thinking though, you may not want to access your Android’s files but use it as a modem instead. Why would you want to do that when you can easily set it up as a wireless access point and connect wirelessly? One word; Battery. Wireless as another service and puts a strain on the already limited battery life of Android smart phones.

To set up USB tethering:

  • plug the device via USB cable into your computer
  • go into “Settings” on your Android
  • under “Wireless & Networks” choose “More..” (may vary for versions, I’m using Ice Cream Sandwich)
  • select “Tethering and portable hotspots”
  • check the “USB Tethering” checkbox
  • Your device should try to get an IP address automatically

That’s it. You should now be able to browse using you’re devices external connection. And, as a neat side benefit, if you’re computer doesn’t have wireless networking and you’re Android is connected to your wireless network, your computer will use that connection!

:yes:

 

PuppyLinuxWorld – Puppy Linux YouTube demos

PuppyLinuxWorld, what awesome screen casts!

I just watched a few of his screen casts and boy does he give me a good rap! Thanks mate! I do put plenty of time and effort into Slacko and am glad that is appreciated.

For anyone interested in Slacko, or Puppy for that matter, these series of videos are a great introduction to the features incorporated into each version and very well done.

Hit your plus +1’s on his channel (linked above).