perl: warning: Please check that your locale settings in Debian

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_TIME = "uk_UA.UTF-8",
	LC_MONETARY = "uk_UA.UTF-8",
	LC_ADDRESS = "uk_UA.UTF-8",
	LC_TELEPHONE = "uk_UA.UTF-8",
	LC_NAME = "uk_UA.UTF-8",
	LC_MEASUREMENT = "uk_UA.UTF-8",
	LC_IDENTIFICATION = "uk_UA.UTF-8",
	LC_NUMERIC = "uk_UA.UTF-8",
	LC_PAPER = "uk_UA.UTF-8",
	LANG = "uk_UA.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
debconf: delaying package configuration, since apt-utils is not installed

Читать далее perl: warning: Please check that your locale settings in Debian

Миграция на Zimbra с постороннего почтовика

Для переноса почты с постороннего почтового провайдера к которому у вас нет доступа по ssh, можно использовать Perl утилиту imapsync
Сначала подготовим пакеты

apt-get install makepasswd rcs perl-doc libio-tee-perl git libmail-imapclient-perl libdigest-md5-file-perl libterm-readkey-perl libfile-copy-recursive-perl build-essential make automake libunicode-string-perl libio-socket-ip-perl ibio-tee-perl

Для пущей убедительности можно поставит необходимые пакеты через CPAN

  perl -MCPAN -e "install Mail::IMAPClient"
  perl -MCPAN -e "install Term::ReadKey"
  perl -MCPAN -e "install IO::Socket::SSL"
  perl -MCPAN -e "install Digest::HMAC_MD5"
  perl -MCPAN -e "install URI::Escape"
  perl -MCPAN -e "install File::Copy::Recursive"
  perl -MCPAN -e "install IO::Tee"
  perl -MCPAN -e "install Unicode::String"
  perl -MCPAN -e "install Data::Uniqid"
  perl -MCPAN -e "install Authen::NTLM"

Клонируем репозиторий imapsync

git clone git://github.com/imapsync/imapsync.git

Запускаем установщик

cd imapsync
mkdir dist
sudo make install

Смотрим, что получилось

# imapsync -v
1.607

Читать далее Миграция на Zimbra с постороннего почтовика

Asterisk: импорт из Master.csv в Postgresql

postgres=# CREATE USER ast_user with password 'xxxxxxx';
CREATE ROLE
postgres=# CREATE DATABASE ast_db with owner ast_user;
CREATE DATABASE
postgres=#exit
 
psql ast_db ast_user
ast_db=> CREATE TABLE cdr (
calldate TIMESTAMP WITH TIME zone DEFAULT now() NOT NULL,
clid CHARACTER VARYING(80) DEFAULT '' NOT NULL,
src CHARACTER VARYING(80) DEFAULT '' NOT NULL,
dst CHARACTER VARYING(80) DEFAULT '' NOT NULL,
dcontext CHARACTER VARYING(80) DEFAULT '' NOT NULL,
channel CHARACTER VARYING(80) DEFAULT '' NOT NULL,
dstchannel CHARACTER VARYING(80) DEFAULT '' NOT NULL,
lastapp CHARACTER VARYING(80) DEFAULT '' NOT NULL,
lastdata CHARACTER VARYING(80) DEFAULT '' NOT NULL,
duration BIGINT DEFAULT 0::BIGINT NOT NULL,
billsec BIGINT DEFAULT 0::BIGINT NOT NULL,
disposition CHARACTER VARYING(45) DEFAULT '' NOT NULL,
amaflags BIGINT DEFAULT 0::BIGINT NOT NULL,
accountcode CHARACTER VARYING(20) DEFAULT '' NOT NULL,
uniqueid CHARACTER VARYING(32) DEFAULT '' NOT NULL,
userfield CHARACTER VARYING(255) DEFAULT '' NOT NULL
);
CREATE TABLE

Устанавливаем поддержку постгреса в Perl:

perl -e shell -MCPAN
install DBI::DBD
install DBD::Pg

Создаем скрипт для переноса даных:
Читать далее Asterisk: импорт из Master.csv в Postgresql