Install and configure Sphinx in Ubuntu

Sphinx – search engine with integration of API and MySQL databases, PostgreSQL.

Installation command:

sudo apt-get install sphinxsearch

After installation, tcp ports 9312 and 9306 are used.

Install the MySQL database server:

sudo apt-get install mysql-server mysql-client

Create a test database:

mysql -u root -p
CREATE DATABASE test;
SOURCE /etc/sphinxsearch/example.sql;
quit

Make a copy of the sample configuration file:

sudo cp /etc/sphinxsearch/sphinx.conf.sample /etc/sphinxsearch/sphinx.conf

Fill in the required parameters including data for connecting to the database.
An example of opening a configuration file in the nano editor (Ctrl+X to exit and y/n to save or discard changes):

sudo nano /etc/sphinxsearch/sphinx.conf

Activate sphinxsearch by specifying START=yes in the following file:

sudo nano /etc/default/sphinxsearch

Run sphinxsearch:

sudo service sphinxsearch start

Adding data to the index:

sudo indexer --all

An example of adding to cron:

sudo crontab -e
@hourly /usr/bin/indexer --rotate --config /etc/sphinxsearch/sphinx.conf --all

Command line search example:

search TEXT

Asterisk compile error solution “‘pjsip_tcp_transport_cfg’ has no member named ‘sockopt_params’”

Once I compiled Asterisk version 13.13.1 and when running make I noticed the following error:

‘pjsip_tcp_transport_cfg’ has no member named ‘sockopt_params’

pjproject-2.2.1 has already been compiled.

Solved the problem by compiling a newer version of pjproject-2.4.5

cd /usr/src
wget http://www.pjsip.org/release/2.4.5/pjproject-2.4.5.tar.bz2
tar -xjvf pjproject-2.4.5.tar.bz2
cd pjproject-2.4.5
CFLAGS='-DPJ_HAS_IPV6=1' ./configure --prefix=/usr --enable-shared --disable-sound --disable-resample --disable-video --disable-opencore-amr
make dep
make
make install

After that, the error disappeared.

Configure IP Unnumbered on Cisco

On the test I will configure IP Unnumbered on Cisco Catalyst 6509E with firmware 12.2(33)SXJ7, on other switches the setup is similar.
IP Unnumbered is useful, for example, when it is necessary to divide a large network into several VLANs and use the same IP addresses and also to issue white IPs in any VLAN using one gateway.

Connect to the terminal device through the console, telnet or SSH.

Continue reading “Configure IP Unnumbered on Cisco”

View and configure sharing of files and folders Windows from the command line

I will give an example of some commands for setting up sharing of resources.

View shared resources:

net share

Deleting a shared resource:

net share <sharename> /delete

Sharing a folder:

net share sharename=C:\dir

Example of disconnecting users from the share:

net session \\pc1 /delete

To close an open network file, use the command:

net file file_id /close

An example of granting user rights to a file (N – not set, W – write, C – change, F – full access):

cacls file.txt /G User:w

To cancel user access to a share:

cacls /R User

We allow up to 5 users to simultaneously connect to a shared resource:

net share sharename /users:5

Example of caching settings from a share (manual/BranchCache/documents/programs/none):

net share myshare /cache:manual

I want to note that when opening a share to a resource in the firewall, the following ports should be opened: TCP 139, TCP 445, UDP 137, UDP 138.

See also my articles:
Installing and using the nbtscan network scanner
Some information about the virus encryptor Trojan.Encoder.12544 attacked 06/27/2017

Hidden files and directories in Ubuntu

Method 1
Put a dot at the beginning of the file or directory name.

Method 2
Create a .hidden file, place in a directory in which you need to hide something and write in it a column of the names of files or folders that should be hidden. The case of letters has a meaning, that is, if the name of an element is from a capital letter, then write it in the .hidden file in the same way.

To see the hidden items through the Nautilus file manager, you must press the key combination Ctrl+H or in the “View” menu click “Show hidden files”.

D-Link DSR-150 router firmware upgrade

To flash the D-Link DSR-150 router, take the following necessary steps in steps:

1) Let’s look at the revision on the label under the router and download the new firmware from it from the official site http://www.dlink.ru/ru/products/9/1697_d.html

Firmware router not under the revision can lead to its failure.

2) Open the settings of the router by typing in the browser the address http://192.168.1.1 (maybe 192.168.0.1) and enter the standard login – admin, the password – admin.

3) In the opened interface at the top, open the “Tools” tab, on the left, select “Firmware“. On the page that opens, the current firmware version will be displayed, if it is older than the downloaded one, then click “Browse” and select the previously downloaded firmware file, then click “Upgrade” to start the process updates.

Wait until the update is complete, usually 2-5 minutes. At the end, the router will reboot.

Is done.

How to connect a wireless mouse to your macbook

Briefly describe the points on how to connect a wireless mouse to your MacBook:

1) First you need to turn on Bluetooth. The Bluetooth icon is usually located at the top of the screen, to the left of the volume and Wi-Fi icon, or in the System settings.
2) Set up a new device, for this you need to click in the “Install a new device” window.
3) Turn on the wireless mouse (the switch is usually under the mouse), after switching on the indicator should light up.
4) Select the device in the list and click “Continue” to complete the connection. After pairing in the system settings, you can configure some parameters of the mouse.

Installing UNMS (Ubiquiti Network Management System)

UNMS (Ubiquiti Network Management System) – EdgeMAX®, EdgeSwitch®, airMAX®, UFiber device management system, which includes software updates, configuration backup, real-time performance graphs, notifications, device location maps, etc.

For example, I will install UNMS on Ubuntu Server 18.04 64bit.

First, install the necessary components:

sudo apt-get update
sudo apt-get install curl sudo bash netcat

Download the installation script from the official site to the temporary directory:

curl -fsSL https://unms.com/install > /tmp/unms_inst.sh

Run the downloaded script:

sudo bash /tmp/unms_inst.sh

If it is necessary to change the web ports during the installation:

sudo bash /tmp/unms_inst.sh --http-port 8080 --https-port 8443

By default, UNMS uses Let’s Encrypt when creating SSL certificates for your domain and saves them in /home/unms/data/cert/live.
If you want to use your SSL certificates, then during installation, for example, we specify (UNMS should have read rights in ssl-cert-dir):

sudo bash /tmp/unms_inst.sh --http-port 8080 --https-port 8443 --ssl-cert-dir /etc/certificates --ssl-cert fullchain.pem --ssl-cert-key privkey.pem