25.11.10

Keep your life in mind.

"This is your life. Do what you love, and do it often..."
Source: http://shop.holstee.com/pages/about
Von Daniel in triviale Weisheiten25.11.10 German (DE) E-Mail

13.11.10

08.11.10

Get container ID from inside an OpenVZ container

The following snippet will get you the OpenVZ container, when you're in a container. I have added this to my zsh prompt, but this might be useful in other places, too.

Code:

# Get OpenVZ container ID (/proc/bc is only on the host):
if [[ -f /proc/user_beancounters && ! -d /proc/bc ]]; then
  CTID=$(sed -n 3p /proc/user_beancounters | cut -f1 -d: | tr -d '[:space:]')
fi
By Daniel in Snippets2010-11-08 English (EU) Email

02.09.10

18.08.10

Reinstall Debian init.d scripts into default runlevels

The following zsh snippet allows you to re-install any missing startup/init.d links.

This can be useful/required when e.g. installing an upstart based distribution (like Ubuntu Lucid) has removed some of those, and you want them back after downgrading to Hardy or switching to Debian testing (like I just did).
(apt-get install --reinstall won't bring back those links; you would have to purge (apt-get purge) and reinstall the package instead, removing any other configuration of the package though)

It basically looks for any init scripts that are not present in /etc/rc?.d/S* and then looks at the packages' postinstallation script for an update-rc.d command.

It will not install anything, but only output them (and allows you to pipe it into "sh" for execution).

Worked fine on my "messed up" system, but has rather odd results on my Maverick desktop.

Code:

for i in /etc/init.d/* ; do
    a=( /etc/rc?.d/S*$i:t(N) );
    ((${#a})) && continue;
    package=$(dpkg -S $i 2>/dev/null |cut -d: -f1);
    [[ -z $package ]] && continue;
    echo "# $i: $package";
    grep "update-rc\.d $i:t" /var/lib/dpkg/info/$package.postinst;
done

(in case you need to extract the init script altogether, the following might help for starters:
dpkg-deb --extract /var/cache/apt/archives/$PACKAGE.deb /tmp/foo.)

06.08.10

Eulenwaschen

Mal was lustiges, via Reddit.

Von Daniel in fun06.08.10 German (DE) E-Mail
Schlagworte: , ,

04.08.10

Ubuntu Stack Exchange opened for public beta

Link: http://ubuntu.stackexchange.com/

Ubuntu Stack Exchange has been opened for public beta.

It's similar to (and driven by the same software as) Stackoverflow or Superuser: a user driven site focused on questions and answers regarding a particular topic.

While being in closed beta (to get an initial set of questions, answers and users), the Ubuntu Stack Exchange got more support than the (more generic) Linux Stack Exchange (according to Joel).

By Daniel in Ubuntu2010-08-04 English (EU) Email
Seitenleiste