Home Download Ubuntu

Install Verlihub from source on Ubuntu 16.04 LTS

In this tutorial, we are going to install Verlihub version from source on Ubuntu 16.04 LTS.
The first thing we need to do is to install Verlihub's dependencies.

1. We will update the repositories database to the latest version:

sudo apt update

2. Install Verlihub's dependencies:

sudo apt install cmake libssl-dev mysql-server libmysqlclient-dev libpcre3-dev gettext

for MySQL you will be asked for a password for root user. Please remember this password as it is required by Verlihub.

3. Download the latest version of Verlihub from Github:

wget https://github.com/Verlihub/verlihub/archive/master.zip

4. Unzip Verlihub:

unzip master.zip

this will inflate (extract) the master.zip file in a folder called verlihub-master

5. Navigate to Verlihub source directory

cd verlihub-master

6. Create a local directory where the build will be created and navigate to it:

mkdir build && cd build

7. Compile Verlihub from source for our OS:

cmake ..


8. Install Verlihub:

sudo make install

sudo ldconfig

9.  First-time setup of Verlihub (host, ip, database, administrator, etc):

To view all the available options of Verlihub utility script:


will output similar to this:

This is a utility script for Verlihub, usage:

  -i, --install                         Configure Verlihub for a new hub
  -r, --run     [path_to_dbconfig]      Run the hub from the given dbconfig path
  -q, --restart [path_to_dbconfig]      Restart the hub from the given dbconfig path
  -R, --reload  [path_to_dbconfig]      Force hub to reload it's configuration and caches
  -s, --stop    [path_to_dbconfig]      Stop the hub from the given dbconfig path
  -t, --status  [path_to_dbconfig]      Check if hub is running or not
  -g, --geoip                           Update GeoIP
  -a, --autoload                        Load plugin automatically when start the hub
        -l, --list                              Show list of available plugins
        -n, --on                                Run plugin automatically with hub
        -f, --off                               Disable auto load of plugin
        -d, --configdir  [path_to_dbconfig]     Specify the hub with location of dbconfig file. Optional
  -u, --adduser    [path_to_dbconfig]    Register a new user in the database
  -c, --clean   [path_to_dbconfig]                      Clean kicklist, banlist, unbanlist, iplog, stats and messages tables
  -w, --backup   [path_to_dbconfig]   Make backup of database from the given dbconfig path
  -t, --restore       [path_to_dbconfig]   Import the given SQL file in the database for given dbconfig path
  -v, --version                         Print version information
  -h, --help                            Show this help

Configure Verlihub (for the first time) a new hub:

sudo vh -i

you will be asked for the following:

Choose database name (verlihub): 
MySQL user to access to 'verlihub' (verlihub):
MySQL password for user 'verlihub':
MySQL hostname (localhost):
MySQL charset (experts only, leave empty for default):
Hub locale (experts only, leave empty for default):
Hub encoding (experts only, leave empty for default):
Do you want to continue with this information? (y/N)

here we press y

If the script could not find the MySQL user with the given password, you will be prompted for MySQL admin user and password:

-- Please insert MySQL administrator information to create DB or account or grant permissions.
Username (root):

If the script has the correct MySQL admin credentials, it will create the new MySQL user and database.
Next, you will be prompted for a location to save the configuration files:

-- You need to choose a place for the configuration files
        [1] /etc/verlihub
        [2] /usr/local/etc/verlihub
        [9] Other, choose path where put config file
Select number:

I choose the first option. This is where the MySQL database will be populated and it will take a while to complete.
After this step is completed you will be prompted:

-- Installation has been completed. Now you can add master account
Master name ([SU]root):
Master password (1468760540):
Hub port (411):
Hub host (test1):
Hub name (hub of root):

-- The hub is configured successfully. Now you can start the hub using vh --run command.

10. Let's start our new verlihub hub:

sudo vh --run

References: Verlihub Github repositories install tutorial, Verlihub official webpage installation tutorial

Using apt terminal command in Ubuntu

Yes, you read that right, it is apt instead of apt-get. I was used with apt-get command to install, update and remove repositories packages.
apt command compared to apt-get has a few advantages:  coloring and progress bar when you install or update a package.
One downside of using apt command is the partial support of tab completion, which apt-get has mastered it. And I know that tab completion is very usefull.
In terms of functionality, it's almost the same as apt-get command. Even the commands are very similar.

1. Update repositories with apt:

sudo apt update

2. List upgradable packages:

sudo apt list --upgradable

3. Install/update a package:

sudo apt install wget

4. Remove a package:

sudo apt remove vim

For more informations read the apt command manual:

man apt

"start: Unknown job: ssh" error while running Xubuntu Live CD

I tried running Xubuntu Live CD on an older laptop, but ssh server didn't wanted to start.
Running the start init.d script

sudo /etc/init.d/ssh start

showed me this error "start: Unknown job: ssh"
Searching for an answer lead me to this ubuntuforums.org post and this stackoverflow post. None of those solutions worked, however they helped me in a way to solve this problem.
Xubuntu Live CD doesn't have ssh server installed by default. I installed the ssh client and server:

sudo apt-get install ssh openssh-server -y

and I tried to start it when it gave me the error.
By running the ssh server manually
/usr/sbin/sshd -D

showed me this error "Missing priviledge separation directory: /var/run/sshd"
By creating this directory, the problem was solved:
sudo mkdir /var/run/sshd

Now, I can simply run
/usr/sbin/sshd -D

and the ssh server works

Bad "End Of Line" (EOL) for bash script under windows

The other day I was writing a script in Notepad++ under Windows. This file was saved on a linux machine but I had a surprise when I tried to run it. Ubuntu's bash complained about "bash: ./script.sh: /bin/sh^M: bad interpreter: No such file or directory". This  lead me to a stackoverflow post about this problem and how to solve it.

For an already opened document, goto Edit menu, EOL Conversion and select Unix/OSX Format. The file has been converted, you only need to save it and run it.

If you want all your new files to have the Linux EOL, goto Settings, Preferences, click the New Document/Default Directory tab, and under the New Document, Format legend choose Windows/Mac/Linux. All your future text document will have the Linux new line (EOL).

Dump all MySQL databases into separate files

Sometimes we need to to dump all databases form a MySQL server. This can be done using the mysqldump utility with the --all-databases switch enabled. In this case mysqldump will dump all databases to the standard output or to a file if explicitly specified. Let’s assume a situation where we want to backup all of the databases from the server, with the possibility to restore only one database at a time. To achieve this, you need to dump all the databases one by one or to use a pre-made script to do the heavylifting for you.  I’ve found a simple solution here: http://soniahamilton.wordpress.com/2005/11/16/backup-multiple-databases-into-separate-files/. I used this script as a starting point, and made some enhancements to it: 1. MySQL username can be specified from the command line (it’s not hardcoded in the file)
2. The script asks for the corresponding MySQL password for security reasons (the password is not echoed or saved anywhere – as you would expect on a Unix systems)
3. The output dir can also be specified from the command line
4. Support for gzipped output files (optional)


Download the dump-all-databases.sh. Make it executable using chmod +x dump-all-databases.sh.
Run it:
./dump-all-databases.sh -u user -o my_backup_dir -z

The command line options are the following:
  • -u – the MySQL user
  • -o – output dir (optional, if not specified the dump files will be placed in current directory)
  • -z – enables the gzipped output (optional)



System requirements

Unix/Linux system with mysql and mysqldump installed, for gzipped output gzip is also required.

Resources: http://carrotplant.com