bc-bd.org

Not a blog

Installing FreeBSD via PXE From Debian Wheezy

While trying to install FreeBSD via the bootonly image resulted in

mount failed with error 19

But using

  • dhcp/tftp servers on Wheezy
  • packages syslinux, syslinux-common and pxeboot from Jessie
  • mfsBSD SE USB memstick Image

I was able to install FreeBSD via netboot with ZFS on /.

Copy syslinux files to the tftp root:

cp -r /usr/lib/syslinux/modules/bios /var/lib/tftpboot/syslinux

Download mfsBSD image, gzip and copy to /var/lib/tftpboot/syslinux/freebsd

Configure pxelinux:

label freebsd
menu label freebsd
kernel memdisk
initrd freebsd/mfsbsd-se-10.0-RELEASE-i386.img.gz

After booting, look for disk and install:

geom disk list

Geom name: ada0
Providers:
1. Name: ada0

zfsinstall -d /dev/ada0 -s 256M -u http://www1.de.freebsd.org/freebsd/releases/i386/10.3-RELEASE/

Plesk, Mails and Aliases

Exporting configured mail accounts and their aliases from the PSA database to csv:

SELECT
    concat(mail.mail_name,"@",domains.name) AS address,
    group_concat(mail_aliases.alias) AS aliases,
    mail.account_id
INTO OUTFILE
    '/tmp/result.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
ESCAPED BY '\\'
LINES TERMINATED BY '\n'
FROM
    mail,domains,accounts,mail_aliases
WHERE
    mail.dom_id=domains.id
    AND mail.account_id=accounts.id
    AND mail_aliases.mn_id = mail.id
GROUP BY
    address
ORDER BY
    address;

Icinga2: Zones and Endpoints

If you have multiple hosts in one zone …

  • … upstream of you, it’s HA
  • … downstream of you, it’s Loadbalancing

Pandoc, PDF and ‘Inputenc Error: Unicode Char’

Using the xelatex engine fixed the following error for me, when generating a PDF from markdown via pandoc:

pandoc: Error producing PDF from TeX source.
! Package inputenc Error: Unicode char \u8:° not set up for use with LaTeX.

Perl, Curses and Mouse

While working with Curses and Mouse I found, that my Mouse error message will not be displayed. I worked around it by capturing the message via eval, calling endwin; directly and displaying the error after that.

#!/usr/bin/perl

package Foo;
use Mouse;

use Curses::UI;

has _cui => (
    isa => 'Curses::UI',
    is => 'ro',
    default => sub { return new Curses::UI ( -clear_on_exit => 0 ) },
);

has _screen => (
    # _screen should be a 'Curses::UI::Window'
    isa => 'Curses::UI',
    is => 'ro',
    default => sub { return shift->_cui->add( 'screen', 'Window' ) },
);

package main;

use Curses;

eval { my $f = Foo->new(); };

if ($@) {
    endwin;
    print $@;
}

Dh-make-perl and Sudo

dh-make-perl fails when run through sudo:

sudo dh-make-perl --cpan IO::Socket::SSL
...
Use of uninitialized value $orig_pwd in chdir at
/usr/share/perl5/DhMakePerl/Command/make.pm line 281.

Running as root works though.

KB3097877 Can’t Login

Black screen on Windows 7 after Ctrl+Alt+Del? Maybe it’s the broken update KB3097877.

A possible fix for 64 Bit Machines according to Heise Forum:

dism /image:X:\ /remove-package
/packagename:Package_for_KB3097877~31bf3856ad364e35~amd64~~6.1.1.1
/scratchdir:X:\temp