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

Android 4.3 Jelly Bean

Android developers announced today that they have updated the Jelly Bean version of their phone and tablet OS with bugfixes and new features.

This development has been much anticipated and it coincides with hardware releases from Google of the newNexus 7 and Chromecast TV stick.

New develpoper features of Jelly Bean 4.3 include;

  • OpenGL ES 3.0 — Game developers can now take advantage of OpenGL ES 3.0 and EGL extensions as standard features of Android, with access from either framework or native APIs.
  • Bluetooth Smart — Now your apps can communicate with the many types of low-power Bluetooth Smart devices and sensors available today, to provide new features for fitness, medical, location, proximity, and more.
  • Restricted profiles — Tablet owners can create restricted profiles to limit access to apps, for family, friends, kiosks, and more. Your app can offer various types of restrictions to let tablet owners control its capabilities in each profile.
  • New media capabilities — A modular DRM framework enables media application developers to more easily integrate DRM into their own streaming protocols such as MPEG DASH. Apps can also access a built-in VP8 encoder from framework or native APIs for high-quality video capture.
  • Notification access — Your apps can now access and interact with the stream of status bar notifications as they are posted. You can display them in any way you want, including routing them to nearby Bluetooth devices, and you can update and dismiss notifications as needed.
  • Improved profiling tools — New tags in the Systrace tool and on-screen GPU profiling give you new ways to build great performance into your app.

 

As for the consumer, both business and private, this means that;

  • apps should get better notification support
  • the possibility of restricting profiles in the case of multiple users is vastly improved
  • games should get better with improved graphics performance
  • bluetooth support in apps should improve.

among other improvements.

If you have a Nexus 4, 7 or 10 the rollout of 4.3 should hit your device over the next few weeks. For those that are impatient and want to flash their device (warning: this does involve some risk so be sure to do your homework) you can download an image for your particular device from the Google Developers website.

All sources direct from Google.

Have fun!

Phone scam in Australia – AVG

According to AVG there is a mobile phone scam circulating in Australia.

Have you had any missed calls lately from a phone number that you do not recognise? The natural thing for many to satisfy curiosity is to call the number back. Don’t. 

It is possible that this is a scam call designed to suck your phone credit. The call is redirected to a prefix 190 number which are premium calls. This happens without your consent or knowledge. Immediately, your account is billed at premium rates. Even just dialling the number can attract a steep fee.

For more information read the full article from AVG.