The solution to the error “IP overlaps with VlanXXX. VlanXXX: incorrect IP address assignment”

It was necessary to replace the L3 switch of HP with Cisco once and after a similar switch configuration Cisco noticed an error:

172.16.63.0 overlaps with Vlan111
Vlan121: incorrect IP address assignment

As it turned out the network Vlan111 172.16.0.0/18 was ending at 172.16.63.254, it crossed with Vlan121 172.16.63.0/24.

The HP 5800 switch was configured before that and he did not say anything about it, and Cisco refused to accept the command.

Therefore, since IP addresses were used little in the Vlan111 172.16.0.0/18 network, the problem was solved by reducing the mask to 172.16.0.0/19.

After that, the IP address was successfully registered to the Vlan121 interface.

Done.

Hard reset on Samsung GT-I9505 Galaxy S4

Describe the points for the process of a full reset on the Samsung GT-I9505 Galaxy S4:

1) Turn off the phone

2) Simultaneously press and hold three buttons: “Volume +”, “Home” and “Turn on”

3) After the vibration, release the “Power on” button, when the menu appears, release the rest

4) From the menu, you can move up/down with the volume buttons, so select “wipe data/factory reset”

5) Confirm with the “Power” button

6) Then, in the same way, select “Yes — delete all user data”

7) Wait until the user data is cleared and the settings are reset, when the menu appears, select “reboot system now” to reboot the phone.

Done.

How to fix error “Table ‘name’ is marked as crashed and last (automatic?) repair failed”

Once in the FreeRADIUS logs I noticed a MySQL error:

Table ‘./radius/radacct’ is marked as crashed and last (automatic?) repair failed

As it turned out, the radacct table was damaged, since the data there were not particularly important, then the entire table was cleaned.
You can clean up via phpMyAdmin or SQL query:

truncate table TableName

A bit later for the experiment I decided to break the whole database, took another large table in general from another application, about 8 gigabytes in size and 80 million lines.
I applied to it SQL query to clean up old rows before the date specified in the query and rebooted at that moment MySQL, the request was interrupted, the database was left intact, executed the request to optimize the database and again rebooted MySQL, eventually got a corrupted database and a similar error:

#144 – Table ‘name’ is marked as crashed and last (automatic?) repair failed

To restore the database, you must stop the MySQL server (if the table is not used, then you can not stop it):

sudo service mysql stop

Let’s move to the directory with the database:

cd /var/lib/mysql/$DATABASE_NAME

Execute the command to restore the specified table:

myisamchk -r -o -f -v $TABLE_NAME

Upon completion, if you stopped the MySQL server, then run it:

sudo service mysql start

Similarly, on the test, also to speed up the process, the table was restored by copying it to another more powerful server, namely three files /var/lib/mysql/$DATABASE_NAME/ ($TABLE_NAME.MYD, $TABLE_NAME.MYI, $TABLE_NAME.frm).

Solving the start error “unable to execute ./database_installer.sh: No such file or directory”

Once upon a time, the following installer error occurred:

sudo ./database_installer.sh
sudo: unable to execute ./database_installer.sh: No such file or directory

I solved it this way:

sudo apt-get install dos2unix
sudo dos2unix database_installer.sh

How to change MySQL database encoding and its tables

Here is an example of changing the MySQL encoding of a database and tables.
Before any actions on important data it is necessary to make a backup copy, for example:

mysqldump -u USER -h localhost -p BASE | gzip -c > backup_base_`date +%Y-%m-%d`.sql.gz

For the test, we will connect to MySQL and create a couple of new databases without specifying the encoding and specifying:

mysql -u root -p
CREATE DATABASE test_db1;
CREATE DATABASE test_db2 CHARACTER SET utf8 COLLATE utf8_general_ci;

Create a test table in the first database and see its encoding:

USE test_db1;

CREATE TABLE users (
id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
firstname VARCHAR(30) NOT NULL,
lastname VARCHAR(30) NOT NULL,
email VARCHAR(50),
reg_date TIMESTAMP
);

show table status like 'users';

Create a test table in the second database and see its encoding:

USE test_db2;

CREATE TABLE users (
id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
firstname VARCHAR(30) NOT NULL,
lastname VARCHAR(30) NOT NULL,
email VARCHAR(50),
reg_date TIMESTAMP
);

show table status;

Let’s also look at the encoding of both databases:

SELECT default_character_set_name FROM information_schema.SCHEMATA WHERE schema_name = "test_db1";
SELECT default_character_set_name FROM information_schema.SCHEMATA WHERE schema_name = "test_db2";

To see the encoding of a column in a specific table, you can do this:

SELECT character_set_name FROM information_schema.`COLUMNS`
WHERE table_schema = "test_db1"
AND table_name = "users"
AND column_name = "firstname";

In my case, the table in the first database was encoded with latin1_swedish_ci, since it is standard, and in the second one utf8_general_ci, since I specified it beforehand.

You can see the table of possible encodings by such requests:

show collation;
show collation like 'utf8%';
show collation like 'latin1%';

View existing databases as follows:

show databases;

View existing tables in the database:

USE test_db1;
show tables;

Now we change the encoding of the first database and its tables to utf8 and immediately check:

ALTER DATABASE `test_db1` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE test_db1;
ALTER TABLE `test_db1`.`users` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
show table status;

If you need to change the encoding in a sql file, open it in the Notepad ++ editor, for example, convert it to UTF-8/without BOM, and if the encoding in SET NAMES is specified at the beginning of the file, change it there, then you can import the file into the database.

Installation and configuration of the IRC server – ircd-irc2

On the test I will launch IRC (Internet Relay Chat) server ircd-irc2 in Ubuntu Server 14.04.

The first command is to install the IRC server in Ubuntu:

sudo apt-get install ircd-irc2

There are several configuration files in the /etc/ircd/ directory: /etc/ircd/ircd.conf (main), /etc/ircd/ircd.motd (message to users when connecting), /etc/ircd/iauth.conf (connection parameters ).
In the /usr/share/doc/ircd-irc2/ directory, you can see examples of configuration files.

After the changes in the configuration files, you must reboot the IRC server:

sudo /etc/init.d/ircd-irc2 restart

Users can create and connect to channels with this command:

/join #channel_name

Installing Tarantool in Ubuntu

To install Tarantool in Ubuntu, execute the following commands:

sudo apt-get update
sudo apt-get install tarantool

I installed version 1.5 on the test, and the newest at that time was 1.7rc (the version can be viewed on the official site by the link below), so update the sources:

curl http://download.tarantool.org/tarantool/1.7/gpgkey | sudo apt-key add -
release=`lsb_release -c -s`
sudo apt-get -y install apt-transport-https
sudo rm -f /etc/apt/sources.list.d/*tarantool*.list
sudo tee /etc/apt/sources.list.d/tarantool_1_7.list <<- EOF
deb http://download.tarantool.org/tarantool/1.7/ubuntu/ $release main
deb-src http://download.tarantool.org/tarantool/1.7/ubuntu/ $release main
EOF

And we will perform the installation of the newest version, if the installation of Tarantool has already been performed, the update will be:

sudo apt-get update
sudo apt-get -y install tarantool