Installing and Configuring OpenFire

OpenFire – A cross-platform XMPP server written in Java.

For the test, I will install OpenFire in Ubuntu Server 16.04 and describe the process.

Since OpenFire requires Java, let’s see the installed version on the system:

java -version

If necessary, install Java:

sudo apt-get install default-jre

Then go to the download page www.igniterealtime.org/downloads/, click download and copy the link.

Download, adding at the end the copied link instead of LINK:

wget -O openfire.deb LINK

For example:

wget -O openfire.deb http://www.igniterealtime.org/downloadServlet?filename=openfire/openfire_4.2.1_all.deb

Install:

sudo dpkg --install openfire.deb

Now it remains to open in the browser http://YourServer:9090/ and follow the prompts.

After that, the installation of OpenFire will be completed.

If necessary, you can stop, start, or restart OpenFire like this:

/etc/init.d/openfire {start|stop|restart|force-reload}

Installing and Configuring SSMTP

SSMTP – an alternative to sendmail for sending mail, allows you to configure sending via third-party mail servers.

To install in Ubuntu, use the command:

sudo apt-get install ssmtp mailutils

Next, open the /etc/ssmtp/ssmtp.conf file in any text editor (in the nano, press Ctrl+X to exit, y/n to save or discard changes):

sudo nano /etc/ssmtp/ssmtp.conf

Comment out all and set up as shown below for an example:

root=test@gmail.com
mailhub=smtp.gmail.com:587
hostname=smtp.gmail.com:587
UseSTARTTLS=YES
AuthUser=test@gmail.com
AuthPass=password
FromLineOverride=YES

If you use Google mail, you will probably need to allow “Untrusted applications” in the settings at https://myaccount.google.com/security.

Also open the /etc/ssmtp/revaliases file in the text editor:

sudo nano /etc/ssmtp/revaliases

And add:

root:test@gmail.com:smtp.gmail.com:587

Let’s try to send the letter to the specified address (after the command we will type the desired text and put a point for completion):

sendmail -v admin@example.com

Letters must be sent from the address specified in the file /etc/ssmtp/ssmtp.conf.

How to delete a Foursquare account

For the test, I delete the Foursquare account.

First go to the account using your login and password, then click on the user’s icon in the upper right, select “My profile” – “Privacy settings”, in the text we find the link “delete your account” and click on it.

Direct link to delete:
https://foursquare.com/delete_me

In the opened page, you must specify the reason for the deletion and click “Delete Account”, then enter the password for confirmation.

That’s all.

Using Linux ISG

View all sessions:

/opt/ISG/bin/ISG.pl
/opt/ISG/bin/ISG.pl | less

View information about a specific session:

/opt/ISG/bin/ISG.pl | grep 192.168.4.168

Viewing the number of sessions:

/opt/ISG/bin/ISG.pl show_count

Deleting a specific session:

/opt/ISG/bin/ISG.pl clear 192.168.4.168
/opt/ISG/bin/ISG.pl clear <IP-address | Virtual# | Session-ID>

Change the speed for a specific session (incoming/outgoing, for example 100 MB/s):

/opt/ISG/bin/ISG.pl change_rate 192.168.4.168 102400 102400

I note that the speed is specified in kilobytes, and when viewed in the table of sessions is displayed in bytes.

I’ll describe the possible keys to the flags:
A (Session approved)
X (Session not approved)
S (This is a service (or sub-session))
O (Service administrative status is enabled)
U (Online service (RADIUS account is active, traffic flow))
T (Type of service – “tagger”)
Z (Disconnected)

Restoring MySQL tables

I’ll give an example of a simple check of tables of all databases using mysqlcheck:

mysqlcheck -u root -p -A

Where the -u option specifies the user name under which to connect to MySQL, -p to request a password, -A to check the tables of all databases.

Example of restoring a specific database:

mysqlcheck -u root -p -r db_name

Example of restoring a specific table in the specified database:

mysqlcheck -u root -p -r db_name table_name

I’ll describe the possible startup options.

Checking all databases and their tables, except INFORMATION_SCHEMA and performace_schema:

--all-databases, -A

You can specify the list of databases using the option:

--databases, -B

Run all with one query instead of the individual for each database:

--all-in-1, -1

Analyze tables:

--analyze, -a

After checking, repair the damaged tables:

--auto-repair

Specify the address of the connection to the MySQL server (for example, if there are several):

--bind-address=ip_address

Connecting to the MySQL server on the specified node:

--host=host_name, -h host_name

Directory with character settings:

--character-sets-dir=dir_name

Checking the tables for errors (default):

--check, -c

Check the tables that have changed since the last check or that were not closed properly:

--check-only-changed, -C

Checking the tables for compatibility with the current version of the server:

--check-upgrade, -g

Data compression is transmitted between the client and the server if both support it:

--compress

Write and display debugging information (on the standard mysqlcheck test in Ubuntu 16.04 was compiled without debug support):

--debug=debug_options
--debug-check
--debug-info

Specifying the default character set:

--default-character-set=charset_name

Use only the specified parameter file:

--defaults-file=file_name

The following option makes the test longer and guarantees the integrity of the tables, it will also take a lot of time to recover and produce many unnecessary rows:

--extended, -e

Check only the tables that were not closed properly:

--fast, -F

Continue even in the case of SQL errors:

--force, -f

Faster than extended, there are 99.99% errors:

--medium-check, -m

Do not read the options files, however the .mylogin.cnf file will be read:

--no-defaults

See also my article – Connecting to MySQL from localhost without entering a password.

Optimize tables:

--optimize, -o

Specify the password when connecting:

--password[=password], -p[password]

TCP/IP port number for connection:

--port=port_num, -P port_num

Displaying the name of the program and all the parameters it receives from the parameter files:

--print-defaults

Specify the connection protocol:

--protocol={TCP|SOCKET|PIPE|MEMORY}

A quick method for checking tables, prevents scanning of lines for checking invalid links:

--quick, -q

Performing repairs:

--repair, -r

Quiet mode, only errors are displayed:

--silent, -s

Skip specified database:

--skip-database=db_name

Specifying the socket when connecting:

--socket=path, -S path

Connection using SSL:

--ssl*

Override -databases or -B, all the name arguments following the option are treated as table names:

--tables

Specifying a list of protocols separated by commas, which are allowed to be used for encrypted connections:

--tls-version=protocol_list

When recovering, get the table structure from the .frm file:

--use-frm

The MySQL user name that will be used when connecting:

--user=user_name, -u user_name

Detailed mode, more information is displayed:

--verbose, -v

Display version of mysqlcheck and exit:

--version, -V

See also:
Installing and configuring a MySQL server on Ubuntu

View information about MySQL databases

To view information about MySQL databases and their tables, we first connect to the MySQL console, for example, as root:

mysql -u root

Or so, if you need to enter a password:

mysql -u root -p

Let’s see a list of existing databases:

SHOW DATABASES;

You can select a database like this:

USE dbname;

See which database is currently selected:

SELECT DATABASE();

To see which tables the selected database contains:

SHOW TABLES;

Example of viewing the contents of the specified table:

SELECT * FROM tablename LIMIT 25;

To view the structure of a particular table, execute the command:

DESCRIBE tablename;

Where Field is the name of the column, Type is the data type, Null – determines whether the column can contain NULL values, Key – whether the column is indexed, Default – determines the default value for the column.

To see information about the indexes of the table, you can do this:

SHOW INDEX FROM tablename;

View information about the table, the encoding, its type (ENGINES), etc. you can use:

SHOW CREATE TABLE tablename;

To see what types the server supports, you can do this:

SHOW ENGINES;

Monitoring the web site in Zabbix

Here is an example of setting up monitoring of a web site in Zabbix:

1) Select or add a network node for which we will observe.

2) Add to the Web site “Web Scenario”, specifying in the first tab:
Name: any
Agent: for example, Internet Explorer 11.0
in the “Steps” tab, add a step:
Name: any
URL: for example http://example.com
Required string: any string that is present on the site
Required status codes: 200

3) Add a graph for the created “Web Scenario” to see the download speed by selecting Download speed for scenario “example.com check”.

4) We add a trigger that will work after 3 unsuccessful attempts to access the site:
Name: any, for example “Site example.com is not available”
Importance: any
Expression:

{example.com:web.test.fail[example.com check].last(#3)}<>0

Done.

Configuring HTTP on Cisco

Connect to the Cisco switch and go into elevated privilege mode:

enable

Now go into the configuration mode:

configure terminal

Enable HTTP:

ip http server
ip http authentication local

If necessary, you can disable HTTP and HTTPS as follows:

no ip http server
no ip http secure-server

Add a user if it does not exist:

username NAME privilege 15 secret PASSWORD

If you want to allow HTTP access to only certain IPs, then let’s see what rules there are on the switch:

exit
show access-list
show ip access-lists
configure terminal

If there is no necessary rule, then we will create:

access-list 10 permit 192.168.1.22
access-list 10 permit 192.168.3.10

See my article – Restricting access to the Cisco Catalyst 6500 management

Apply the rule to HTTP:

ip http access-class 10

To cancel it is possible so:

no ip http access-class 10

If you need to specify the maximum number of connection attempts:

ip admission max-login-attempts 5
show ip admission configuration

Leave their configuration mode and save the configuration:

exit
write

See also:
Configuring Cisco devices