Setup NFS root, copy the Kernel to the tftproot and install u-boot:
cd /tmp
mkdir pi
mount /dev/sdb2 pi
mount /dev/sdb1 pi/boot
mkdir /var/lib/tftpboot/pi
cp pi/boot/kernel.img /var/lib/tftpboot/pi/zImage
cp pi/boot/*.dtb /var/lib/tftpboot/pi/
mv pi/boot/kernel.img{,.old}
cp /tmp/sid/tmp/u-boot/uboot.bin pi/kernel.img
cp -a pi /mnt
umount pi/boot
umount pi
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;
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 $@;
}