Update to Java 8 on Debian 8

Solution to update java 8 on Debian 8:

echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee /etc/apt/sources.list.d/webupd8team-java.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
apt-get update
apt-get install oracle-java8-installer

To see the result type:
root@unifi:~# java -version
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

If you fail with this howto try this: https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-get-on-debian-8

Enjoy !

How to setup minicom on Linux for EdgeRoute from Ubnt (EdgeOS)

The edge router comes with a console port where you can see all the information from startup to any error message.


I have had some trouble finding linux on how to set the minicom to see what the router console looks like.
The correct settings go into the configuration file. /etc/minicom/minirc.dfl

pu port /dev/ttyUSB0
pu baudrate 115200
pu bits 8
pu parity N
pu stopbits 1
pu rtscts No
pu xonxoff No

source of information: here

On your linux may differ in serial port so i recommend you to look for it so:

root@debian:~# setserial -g /dev/ttyS[0123]
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
/dev/ttyS1, UART: unknown, Port: 0x02f8, IRQ: 3
/dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4
/dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3

I hope the information was helpful. An excellent day.

Yum update failed!

If you get next error:

–> Processing Dependency: libsemanage >= 2.5-13 for package: selinux-policy-3.13.1-229.el7_6.6.noarch
—> Package selinux-policy-targeted.noarch 0:3.13.1-192.el7_5.6 will be updated
—> Package selinux-policy-targeted.noarch 0:3.13.1-229.el7_6.6 will be an update
–> Processing Dependency: policycoreutils >= 2.5-24 for package: selinux-policy-targeted-3.13.1-229.el7_6.6.noarch
—> Package tzdata.noarch 0:2018f-2.el7 will be updated
—> Package tzdata.noarch 0:2018g-1.el7 will be an update
–> Finished Dependency Resolution
Error: Package: selinux-policy-3.13.1-229.el7_6.6.noarch (updates)
Requires: policycoreutils >= 2.5-24
Installed: policycoreutils-2.5-22.el7.x86_64 (@base)
policycoreutils = 2.5-22.el7
Error: Package: selinux-policy-targeted-3.13.1-229.el7_6.6.noarch (updates)
Requires: policycoreutils >= 2.5-24
Installed: policycoreutils-2.5-22.el7.x86_64 (@base)
policycoreutils = 2.5-22.el7
Error: Package: kernel-3.10.0-957.1.3.el7.x86_64 (updates)
Requires: linux-firmware >= 20180911-68
Installed: linux-firmware-20180220-62.2.git6d51311.el7_5.noarch (@updates)
linux-firmware = 20180220-62.2.git6d51311.el7_5
Available: linux-firmware-20180220-62.git6d51311.el7.noarch (base)
linux-firmware = 20180220-62.git6d51311.el7
Error: Package: selinux-policy-3.13.1-229.el7_6.6.noarch (updates)
Requires: libsemanage >= 2.5-13
Installed: libsemanage-2.5-11.el7.x86_64 (@base)
libsemanage = 2.5-11.el7
You could try using –skip-broken to work around the problem
You could try running: rpm -Va –nofiles –nodigest

Solutions for this in next pictures:

yum update

[root@cx21 ~]# yum clean all
[root@cx21 ~]# rm -rf /var/cache/yum

Unable to login to Roundcube: PHP Error: Failed to create a user record.

Error found in error logs:

[28-Nov-2018 14:14:25 +0200]: <4d284o3h> DB Error: [1364] Field 'alias' doesn't have a default value (SQL Query: INSERT INTO `users` (`created`, `last_login`, `username`, `mail_host`, `language`) VALUES (now(), now(), 'microsoft@orsharlogistic.ro', 'localhost', 'en_US')) in /var/www/html/roundcubemail-1.0.3/program/lib/Roundcube/rcube_db.php on line 543 (POST /?_task=login&_action=login)
[28-Nov-2018 14:14:25 +0200]: <4d284o3h> PHP Error: Failed to create new user in /var/www/html/roundcubemail-1.0.3/program/lib/Roundcube/rcube_user.php on line 686 (POST /?_task=login&_action=login)
[28-Nov-2018 14:14:25 +0200]: <4d284o3h> PHP Error: Failed to create a user record. Maybe aborted by a plugin? in /var/www/html/roundcubemail-1.0.3/program/include/rcmail.php on line 650 (POST /?_task=login&_action=login)

List from useres table in roundcube database.
MariaDB [roundcube]> describe users;
| Field | Type | Null | Key | Default | Extra |
| user_id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| username | varchar(128) | NO | MUL | NULL | |
| mail_host | varchar(128) | NO | | NULL | |
| alias | varchar(128) | NO | MUL | NULL | |
| created | datetime | NO | | 1000-01-01 00:00:00 | |
| last_login | datetime | YES | | NULL | |
| language | varchar(5) | YES | | NULL | |
| preferences | text | YES | | NULL | |
| failed_login | datetime | YES | | NULL | |
| failed_login_counter | int(10) unsigned | YES | | NULL | |

Solutions: Remove alias column from users table.

Connect database:
mysql -u root -p

Use database you need to make change:
MariaDB [(none)]> use roundcube;

Alter table users;
ALTER TABLE roundcube.users DROP COLUMN roundcube.users.alias;

Now problem solved !


Source: https://support.plesk.com/hc/en-us/articles/360005898674-Unable-to-login-to-Roundcube-PHP-Error-Failed-to-create-a-user-record

Easy Install cbpolicyd On CentOS 7

I have encountered the situation when users have weak passwords and are guessed by spammers so valid accounts are used for SPAM. The solution they choose in case is the limitation of mails sent over a period of time.

1. Install dependencies on the application

yum install -y mariadb mariadb-server perl-Cache-FastMmap perl-Config-IniFiles

2. Download and install policyd rpm package and source files for setting up db.

wget https://download.policyd.org/v2.0.14/cluebringer-2.0.14-1.noarch.rpm
rpm -Uvh cluebringer-2.0.14-1.noarch.rpm
wget https://download.policyd.org/v2.0.14/cluebringer-v2.0.14.zip

3. Settings database.

unzip cluebringer-v2.0.14.zip
cd cluebringer-v2.0.14/database/

Prepare sql file

vim run.sh
for i in core.tsql access_control.tsql quotas.tsql amavis.tsql checkhelo.tsql checkspf.tsql greylisting.tsql;
./convert-tsql mysql $i
done > policyd.sql

Change in file
sed -i 's/TYPE=InnoDB CHARACTER SET latin1 COLLATE latin1_bin//' policyd.sql

4. Create database and populate.
mysql -u root -p
create database policyd;
GRANT all on policyd.* to ‘policyd’@’localhost’ identified by ‘Your-password’;
mysql -u root -p policyd < policyd.sql

5. Configure cbpolicyd database on webui.conf

vim /etc/policyd/cluebringer.conf
config line like this

vim /etc/policyd/webui.conf
config line like this

6. Setup in your page policyd and postfix.
Access for config file
cd /var/www/html/
ln -s /usr/share/cluebringer/webui/ policyd

Now you need to create your apache access with vhosts.

Modify postfix
Add the following Postfix config setting in BOTH smtpd_recipient_restrictions and

smtpd_end_of_data_restrictions: check_policy_service inet:

It’s recommended to add these parameters first, i.e.:

smtpd_recipient_restrictions = check_policy_service inet:, permit_mynetworks, ..

You can check logs on /var/log/cbpolicyd.log and /var/log/maillog
Start service /etc/init.d/cbpolicyd start
[root@mail html]# systemctl enable cbpolicyd
cbpolicyd.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig cbpolicyd on

How to install Shrew Cisco VPN client in Ubuntu 16.04

Source of inspiration  for this page: https://github.com/lmmx/devnotes/wiki/Installing-Shrew-Soft-VPN-on-Linux

First Step: prepare for instalation!

apt-get install g++
apt-get install build-essential linux-headers-$(uname -r)
apt-get install flex
apt-get install libedit2 libedit-dev
apt-get install bison
apt-get install cmake
apt-get install openssl
apt-get install qt-sdk

Second step: Download and install ike from Shrew.
Go to page https://www.shrew.net/download/ike and download last version !

Unpacking the package

tar -zxvf ike-2.2.1-release.tgz
cd ike
make install

Now finish
### Start IKE daemon
## /home/$user/Documents/Lucian/Linux/ike/script/linux/iked start

You need to start ike daemon.
Now start client:
qikea &

Enjoy !

How to remove domain from letsencrypt ?

Q:  Do you have a domain that you want to remove from the list of certificates with letencrypt?

Answer: Simple deletion from the list

certbot delete --cert-name domain.com

If you get error:
No certificate found with name blog.ceae.info (expected /etc/letsencrypt/renewal/blog.ceae.info.conf)

Use next command:

certbot delete --cert-name blog.ceae.info-0001

Setup Vacation on Postfixadmin 3.2 Centos 7.x

This year we set up a new server with Postfixadmin 3.2 and I recently also had to set the vacation module.
I want to outline how I’ve solved the problem that appears on setup.

1. Install perl library dependancies:

yum install perl-Email-Valid perl-Email-Sender perl-Email-Simple perl-Test-Email perl-Try-Tiny perl-MIME-Charset perl-MIME-EncWords perl-Log-Log4perl perl-Log-Dispatch perl-Test-mysqld

For Debian:

apt-get installlibmail-sender-perl
libdbd-mysql-perl libemail-valid-perl libmime-perl liblog-log4perl-perl
liblog-dispatch-perl libgetopt-argvfile-perl libmime-charset-perl

2.  Add user and group, crete folder.
groupadd -r -g 65501 vacation
useradd -r -u 65501 -g vacation -d /var/spool/vacation -s /sbin/nologin vacation

mkdir /var/spool/vacation
cp /var/www/html/postfixadmin/VIRTUAL_VACATION/vacation.pl /var/spool/vacation
chown -R vacation:vacation /var/spool/vacation

chmod -R 750 /var/spool/vacation/vacation.pl

3. Setup script.

vim /var/spool/vacation/vacation.pl

our $db_type = ‘mysql’;
our $db_username = ‘postfix’;
our $db_password = ‘yourdbpasswd’;
our $db_name = ‘postfix’;

our $vacation_domain = ‘autoreply.yourdomain.com’;

close file with :wq

Setup config.local.php
vim /var/www/html/postfixadmin/config.local.php

$CONF[‘vacation’] = ‘YES’;
$CONF[‘vacation_domain’] = ‘autoreply.yourdomain.com’;

4. Config vacation in postfix

vim /etc/postfix/master.cf


vacation unix – n n – – pipe
flags=Rq user=vacation argv=/var/spool/vacation/vacation.pl -f ${sender} — ${recipient}

( do not forget to add some space in front  “flags=….. ” )

Make sure you have this line in /etc/postfix/main.cf

transport_maps = hash:/etc/postfix/transport

vim /etc/postfix/transport

autoreply.domain.org    vacation:

Save file and close. After this:

postmap /etc/postfix/transport

Restart Postfix

systemctl restart postfix.service.

Follow these steps if you get an error in logs like this:

Aug 20 14:25:01 mail postfix/pipe[24086]: 43AF03E0B63: to=<lucian#domain.ro@autoreply.domain.ro>, orig_to=<lucian@domain.ro>, relay=vacation, delay=2, delays=1.4/0.01/0/0.56, dsn=5.3.0, status
=bounced (Command died with status 255: “/var/spool/vacation/vacation.pl”. Command output: Attribute (ssl) does not pass the type constraint because: Validation failed for ‘Bool’ with value “starttls” at
constructor Email::Sender::Transport::SMTP::new (defined at /usr/share/perl5/vendor_perl/Email/Sender/Transport/SMTP.pm line 200) line 98, <STDIN> line 38. Email::Sender::Transport::SMTP::new(‘Email::Sen
der::Transport::SMTP’, ‘HASH(0x433e128)’) called at /var/spool/vacation/vacation.pl line 474 main::send_vacation_email(‘lucian@domain.ro’, ‘lucian@domainsender.com’, ‘lucian@domain.ro’, ‘<b2f160c
a41b1e4773765ad634564ff1a@domainsender.com>’, 456, 0) called at /var/spool/vacation/vacation.pl line 657 )


vim /var/spool/vacation/vacation.pl

and change

our $smtp_ssl = ‘ssl’
our $smtp_ssl = ‘0’