MISC: How to grep several strings at once

It is needed to use the Extended Regular Expressions (ERE), which can be done by add the -g argument to the grep command. Here's an example:

grep -E 'foo|bar' /var/log/messages

ADMIN: How to make a Debian live image

To create a customized Debian image, we'll use live-build. Reading the Live Systems Manual is also a good idea.

We're going to do this from a running Debian Stretch system, it'll be simpler.

To "prepare" the environment (here a Stretch system w/ contrib & non-free repos enabled:

lb config -d stretch --archive-areas "main contrib non-free" --debian-installer live

If you need some special packages installed in your Live environment, the lists are in config/package-lists/ (1 package name per line)

Finally, to build the image:

lb build

If you did this on a x86_64 system, the image will by default be named live-image-amd64.hybrid.iso. To put it on a USB stick, you can use dd the normal way.

ADMIN: repairing efi boot on Debian

If you swapped hard drives, installed an UEFI OS on the new one and put the old one back, changes are you won't be able to boot. To repair that (on Debian at least), boot on a liveusb (or CD if you live in the past), mount your boot partition and do:

grub-install --efi-directory /boot/efi

Reboot and you should be on your old OS.

ADMIN: Updating unrealircd

Here's a list:

  • Download the archive from here
  • Unpack the archive (tar xf $foo)
  • Move third party modules into src/modules/third/ of the new archive's folder
  • Move the config into the new archive's folder
  • Run ./Config into the new archive folder
  • make && make install
  • ./unrealircd restart

And voilà!

MISC: good uid for /bin/su

So I don't know why but I tried to remaster the Archlinux install iso to get some custom stuff on it, and I couldn't use `su` while logged in as my user. An error about creating groups. It's just that I did not have the right uid set for this file, I corrected it by doing this:

chmod u+s /bin/su

And it's now fine.

FROM PHP5 TO PHP7 (mainly for roundcube)

So here are the packages I had from php5:

  • php5-cli
  • php5-common
  • php5-fpm
  • php5-json
  • php5-readline
  • php5-sqlite

And here are the packages I needed to get Roundcube to work with php7:

  • php7.0-cli
  • php7.0-common
  • php7.0-fpm
  • php7.0-json
  • php7.0-mbstring
  • php7.0-opcache
  • php7.0-readline
  • php7.0-sqlite3
  • php7.0-xml

GENTOO/MISC: use 'su -', kids

Because if you don't, root's gonna have your use env variables, and if you compile kernels and such, you're potentially gonna have a bad time. Especially if you changed your umask.

POSTFIX: smtp/smtpd_tls_security_level

While on a security level it may be tempting to put both value at 'encrypt', it may prevents some mails from being delivered to you. Best use it to put 'may' as a value.