15.09.11

Disable disk cache in Chromium / Google Chrome

There is no user interface in Google's browser Chrome yet to disable the disk cache, or control its size (version 14 appears to have something in the developer tools section).

But it can be done using command line options when starting the browser, and you can configure this globally for Ubuntu.

The following command line flags will use /dev/null ("the sink") as cache dir, and additionally limits it to 1 byte:

--disk-cache-dir=/dev/null --disk-cache-size=1

(I have tried just --disk-cache-size=0 or 1, but it did not appear to work as expected)

On Ubuntu/Debian, you can just add these flags to the CHROMIUM_FLAGS variable in /etc/chromium-browser/default and it will be used every time when starting Chromium.

The motivation to do this comes from me using a local (intercepting) HTTP proxy with its cache on a RAM disk. Therefore I do not want Chromium to store quite the same retrieved files on disk again.
Additionally, this is a SSD, which is not that happy about being written to in general.
Therefore /tmp is a tmpfs mount already, and the same should be the case for temporary browser files.

By Daniel in Ubuntu, Debian, Snippets2011-09-15 English (EU) Email

25.08.11

Marian - Only Our Hearts To Lose

Offenbar auch ein sehr schönes Album, wo Marek Hemmann mit involviert ist..

Marian - Only Our Hearts To Lose by marekhemmann

Von Daniel in music25.08.11 German (DE) E-Mail
Schlagworte: ,

24.08.11

Marek Hemmann - In Between

Alleine wegen des Tracks `Gemini` lohnt sich der Kauf dieses Albums schon sowas von..

Nachdem ich es (aufgrund dieses Tracks) heruntergeladen habe, merkte ich auch, dass sich noch mehr meiner last.fm loved tracks darunter befinden.

Kurzum Geilomat!

Selbst wenn man dann beim MP3-Download feststellt, dass aktuelle Linux-Versionen von Amazon nicht mehr unterstützt werden (man kann dann die Tracks einzeln herunterladen).

Von Daniel in music24.08.11 German (DE) E-Mail
Schlagworte: , ,

15.03.11

Script to double/halve OpenVZ resources

The following script allows you to easily double or halve resources in an OpenVZ container.

You would install this script as "/usr/local/bin/vz-double-resources" and also create a symlink named "vz-half-resources" to it (probably also in /u/l/b).

This then allows you to just call "vz-double-resources 123 shmpages" in case you've been notified that there have been shmpages beancounter failures (resource limit has been hit).
This outputs the command to double the bean counter limit, and allows for easy execution by just forwarding the output to "sh", as in "vz-double-resources 123 shmpages | sh -".

Here's the script (available and maintained as/at Gist):

Code:

# cat =vz-double-resources
#!/bin/bash
 
VZ="$1"
RESOURCE="$2"
 
if [ -z $VZ ] || [ -z $RESOURCE ]; then
    echo "Usage: $0 VZ RESOURCE"
    exit 1
fi
 
case $0 in
  *-double-*) OPERATION="*2" ;;
  *-half-*)   OPERATION="/2" ;;
  *) echo "Invalid: $0" ; exit 1;;
esac
 
echo "# Operation: $OPERATION"
 
# get failures:
# awk '$NF ~ /[0-9]*[1-9]$/' /proc/bc/*/resources
 
if [ -f /proc/bc/$VZ/resources ] ; then
# uid  resource                     held              maxheld              barrier                limit              failcnt
 
  resource=$(echo $RESOURCE | tr '[:upper:]' '[:lower:]')
  awk /$resource/ /proc/bc/$VZ/resources | {
    read resource held maxheld barrier limit failcnt
    if [ -n "$resource" ]; then
      cmd="vzctl set $VZ --$resource $(($barrier $OPERATION)):$(($limit $OPERATION)) --save"
      echo $cmd
      exit
    fi
  }
fi
[[ -n "$cmd" ]] && exit
if [ -f /etc/vz/conf/$VZ.conf ] ; then
  value=$(grep -i "^$RESOURCE=" /etc/vz/conf/$VZ.conf)
  eval $value
  RESOURCE=$(echo $RESOURCE | tr '[:lower:]' '[:upper:]')
  resource=$(echo $RESOURCE | tr '[:upper:]' '[:lower:]')
  value=$(eval echo \$${RESOURCE})
  echo $value | {
    IFS=: read barrier limit
    cmd="vzctl set $VZ --$resource $(($barrier $OPERATION)):$(($limit $OPERATION)) --save"
    echo $cmd
  }
else
  echo "ERROR: container $VZ not found."
  exit 1
fi

This is a script I've been using since quite a while (otherwise it would use zsh instead of bash), and have not looked into after creating it.
I just noticed that it is quite useful in general and therefore wanted to make it public.

12.03.11

Sexy sax man serenade (prank feat. Sergio Flores)

Link: http://www.youtube.com/watch?v=mKSyPoxzT6w

Funny prank video from «sexy sax man Sergio»:

(via)

Von Daniel in enjoy Video, fun12.03.11 German (DE) E-Mail

03.03.11

Underworld - Scribble (radio edit)

Link: http://www.youtube.com/watch?v=dHs8LxPepKU

26.02.11

Puppet definition to add Launchpad PPA repository

Link: https://gist.github.com/844735

The provided puppet definition(s) will allow you to add a PPA repository on a host managed by Puppet, e.g. by means of a class like this:

Code:

class blueyedppa {
  pparepo { "blueyed/ppa": apt_key => "7CC17CD2" }
}

I have created this to easily add the Current BOINC releases PPA to one of my hosts, and refactored a previously snippet for this.

Since I could not find anything for this, but questions asked about it, I like to share this. The actual code is available at the Gist linked to by this post.

By Daniel in Ubuntu, Audio2011-02-26 English (EU) Email
Seitenleiste