Extract one database from mysql/mariadb full dump

Submitted by Fekete Zoltán on Thu, 07/26/2018 - 13:51

Save this script into an sh file:

#!/usr/bin/env bash


SED_FILTER="/^-- Current Database: \`$DBNAME\`/,/^-- Current Database: /p"

sed -n "$SED_FILTER" $INFILE > $DBNAME.sql

echo "Dump is ready: $DBNAME.sql"

exit 0

Run as :

$ sh script_name dbname full_dump_file

If you want to avoid problems during foreign key imports, then insert this line into the newly generated file after the USE <DBNAME>; statement:

Start LXDE on NetBSD
After installing LXDE either from binary or from pkgsrc, it wouldn't start. Here is how to solve:
Fekete Zoltán Wed, 04/18/2018 - 14:25


Setting up fancy prompt in Korn Shell (ksh)

Put this line into your ~/.shrc:

export PS1="$(echo -e "\033[31m$(whoami)\033[00m@$(hostname -s): \$PWD $") "

Change coloring as you wish by tuning  \e[31m and \e[00m parts.

For color codes and further information see the link attached.

Fekete Zoltán Thu, 01/25/2018 - 11:04
Sync master zone file with bind9 journal

This command synchronizes all current setting with zone file, and also removes the journal (jnl) file:

# rndc sync -clean


Fekete Zoltán Fri, 01/05/2018 - 15:21
NetBSD letsencrypt certificate installation with certbot for Apache
certbot client has a limited functionality on NetBSD. However you can use it fully functional following these steps:
Fekete Zoltán Sun, 12/17/2017 - 13:19
Don't use poweroff on NetBSD

poweroff command simply doesn't run shutdown scripts. It causes several dirty killing of running processes, etc.

Use always

# shutdown -p now


Fekete Zoltán Wed, 11/22/2017 - 08:17