×


Search For:


mkvirtualenv command not found on Ubuntu - How to fix this error

This article covers solution to the #error 'mkvirtualenv: command not found' which happens while running mkvirtualenv #command.

You'll need to install virtualenvwrapper package into the same global site-packages area where virtualenv is installed. 

Administrative privileges are required for this installation. 

Ensure you're logged in as root user or standard user with sudo privileges.


Start by Updating the System package list:

$ sudo apt update

Then install #Python build tools.

# Python 2

$ sudo apt-get install python-pip python-dev build-essential

# Python 3

$ sudo apt-get install python3-pip python3-dev build-essential

Then install virtualenv and virtualenvwrapper packages.


With APT package manager:

$sudo apt install virtualenv virtualenvwrapper

With Pip:

# Python 2

$ sudo pip install virtualenv virtualenvwrapper

# Python 3

$ sudo pip3 install virtualenv virtualenvwrapper


Unable to connect to MongoDB in Docker container - How to fix this error

This article covers solution to the error "Unable to connect to MongoDB in docker container".

Basically, this Docker error happens when there is a port issue.

if a container listens on 127.0.0.1, then the host can't map ports to it.

You need to listen on 0.0.0.0 or similar, and then the -p can reach the container's interface.


How do Docker ports work?

The -P command opens every port the container exposes. 

Docker identifies every port the Dockerfile exposes and the ones that are exposed with the Docker container build --expose parameter. 

Every exposed port is bound directly on a “random” port of the host machine.

The docker build command builds Docker images from a Dockerfile and a “context”. A build's context is the set of files located in the specified PATH or URL . 

The build process can refer to any of the files in the context. 

For example, your build can use a COPY instruction to reference a file in the context.


tar dev st0 cannot write invalid argument - How to resolve this error

This article covers resolve errors relating to Linux commands. You need to specify the block factor size. If you try to write a large file on tape this error may occur.

The data in an archive is grouped into blocks, which are 512 bytes. Blocks are read and written in whole number multiples called records. The number of blocks in a record (i.e., the size of a record in units of 512 bytes) is called the blocking factor.

Archives with blocking factors larger than 20 cannot be read by very old versions of tar, or by some newer versions of tar running on old machines with small address spaces. 

With GNU tar, the blocking factor of an archive is limited only by the maximum record size of the device containing the archive, or by the amount of available virtual memory.


How to fix tar /dev/st0 cannot write invalid argument error?

Set blocking factor to 256 to avoid this error with the -b option. 

For example, use the following command to backup the /webroot directory and its content to /dev/st0 with 256 blocking factor:

# tar cvf -b 256 /dev/st0 /webroot


MySQL crash – Causes Recovery and Prevention methods

This article covers methods to fix and prevent MySQL downtime. Basically, many issues such as resource limits, #database table errors, file system errors, and so on, can lead to a MySQL crash.


To fix MySQL errors in cPanel?

You can also restart the MySQL service from WHM.

1. Login to WHM.

2. Navigate to Restart Services.

3. Now you can restart the MySQL service by clicking the icon “SQL Server(MySQL)”.


To use mysqlcheck, follow these steps:

1. As the root user, type the following command: cd /var/lib/mysql.

2. Replace the database with the name of the database that you want to check.

3. Mysqlcheck checks the specified database and tables.


How do I know if MySQL is running?

We check the status with the service mysql status command. We use the mysqladmin tool to check if MySQL server is running. 

The -u option specifies the user which pings the server. 

The -p option is a password for the user.


What does repair table do MySQL?

REPAIR TABLE repairs a possibly corrupted table, for certain storage engines only. 

This statement requires SELECT and INSERT privileges for the table. Although normally you should never have to run REPAIR TABLE , if disaster strikes, this statement is very likely to get back all your data from a MyISAM table.


What causes MySQL #tables to crash?

The major cause of the database corruption is the lack of free disk space on the server.

Other possible causes of MySQL table crashes include operating system problems, power failures, hardware issues, unexpected MySQL server termination, data corruption due to external programs, and so on.


To access your #MySQL database in Linux, please follow these steps:

1. Log into your Linux web server via Secure Shell.

2. Open the MySQL client program on the server in the /usr/bin directory.

3. Type in the following syntax to access your database: $ mysql -h {hostname} -u username -p {databasename} Password: {your password}


FastCGI Proxying in Nginx - How to implement it

This article covers FastCGI Proxying in Nginx. Basically, FastCGI Proxying in Nginx allows working with a great number of applications, in configurations that are performant and secure. 

FastCGI proxying within Nginx is generally used to translate client requests for an application server that does not or should not handle client requests directly.

Nginx has become one of the most flexible and powerful web server solutions available. 

However, in terms of design, it is first and foremost a proxy server. 

This focus means that Nginx is very performant when working to handle requests with other servers.

Nginx can proxy requests using http, FastCGI, uwsgi, SCGI, or memcached.


How do I know if #FastCGI is enabled?

If the variable is present and correctly set to /phpinfo. php/foobar? foo=bar, then either ISAPI or FastCGI is used. 

Look near the top of the output for Server API; it should be set to either ISAPI (which means ISAPI is being used) or CGI/FastCGI (which means FastCGI is being used, since we already ruled out CGI).


More about Fastcgi_read_timeout?

proxy_read_timeout is applied when nginx proxies via HTTP protocol (for example, if you used nginx to proxy the request to a server such as node.js ). fastcgi_read_timeout is used when nginx speaks to the other service using FastCGI protocol.


More about Keepalive_timeout in nginx?

The keepalive_timeout assigns the timeout for keep-alive connections with the client. 

Simply put, Nginx will close connections with the client after this period of time.


How does Nginx location work?

The location directive within NGINX server block allows to route request to correct location within the file system. 

The directive is used to tell NGINX where to look for a resource by including files and folders while matching a location block against an URL.


How do I start Nginx on Linux?

1. Nginx is a powerful server application that routes network traffic.

2. Nginx runs as a service on your server.

3. systemctl can be used to start and stop the Nginx service.

4. To force close and restart Nginx and related processes: sudo /etc/init.d/nginx restart.


What does #Nginx Rewrite do?

Nginx rewrite rules can be defined within your Nginx configuration file in order to change at least part or all of a URL. 

Usually, this is done for one of two purposes. 

First, if a URL has changed, using a rewrite rule will let the client know that the resource requested is in a different location.


How do I remove nginx welcome page?

If you removed default under /etc/nginx/sites-available and restarted nginx and the welcome page is still showing, then see if there is a default. conf under /etc/nginx/conf. d and delete it and then restart nginx.


Advantages of NoSQL Databases - Get to know them now

This article covers the advantages of NoSQL Databases. #SQL databases are vertically scalable, NoSQL databases are horizontally scalable. SQL databases are table based, while NoSQL databases are document, key-value, graph or wide-column stores. 

SQL #databases are better for multi-row transactions, #NoSQL are better for unstructured data like documents or JSON.

#MongoDB, CouchDB, CouchBase, Cassandra, HBase, Redis, Riak, Neo4J are the popular NoSQL databases examples.

The structure of many different forms of data is more easily handled and evolved with a NoSQL database. 

NoSQL databases are often better suited to storing and modeling structured, semi-structured, and unstructured data in one database.


Main purpose of NoSQL?

NoSQL Database is a non-relational Data Management System, that does not require a fixed schema. 

It avoids joins, and is easy to scale. 

The major purpose of using a NoSQL database is for distributed data stores with humongous data storage needs. 

NoSQL is used for Big data and real-time web apps.


Reasons to Use a NoSQL Database includes:

1. Storing large volumes of data without structure. A NoSQL database doesn't limit storable data types.

2. Using cloud computing and storage. Cloud-based storage is a great solution, but it requires data to be easily spread across multiple servers for scaling.

3. Rapid development.


Main types of NoSQL databases?

There are four big NoSQL types: 

1. Key-value store

2. Document store, 

3. Column-oriented database,

4. Graph database. 

Each type solves a problem that can't be solved with relational databases. 

Actual implementations are often combinations of these. 

OrientDB, for example, is a multi-model database, combining NoSQL types.