To resolve another issue as shown below, try "sudo -H make install" as suggested (note that you may want to clean up first—see next section):

$ sudo make install
The directory '/home/<usrname>/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/<usrname>/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

Cleanup and Retry

In case you have run into any issues, you can cleanup your environment and retry with fixes. In your Python-3.5.1 folder, type the following:

A program is free to modify this list for its own purposes. Only strings and bytes should be added to sys.path; all other data types are ignored during import. See also Module site — This describes how to use .pth files to extend sys.path.

Python 2 vs 3

In this section, we will show you how to display sys.path value from the command line without entering interactive mode. To do that, we use a built-in module print. However, as noted below, there are syntax differences between Python 2 and Python 3 in the way of invoking it.

Where Is a Python Module Located?

When a module, say, encodings is imported, the interpreter first searches for a built-in module with that name. If not found, it then searches for a file named encodings.py in a list of directories given by the variable sys.path.

To find out where an imported module is located, you can use its attribute __file__.[11] For example, module encodings is located under /usr/lib/python3.5 in our system:

Under Unix-like operating systems, when a script with a shebang is run as a program, the program loader parses the rest of the script's initial line as an interpreter directive; the specified interpreter program is run instead, passing to it as an argument the path that was initially used when attempting to run the script.

A Perl module is the Perl equivalent of the class in OOP. It defines how its source codes are packaged (much like Java packages) using namespaces. Its file structure mirrors the namespace structure. For instance, IPTables::IPv4::IPQueue could locate in your file system somewhere like:

/usr/local/lib64/perl5/auto/IPTables/IPv4/IPQueue

To resolve the missing module issue, you need to install it by entering:

cpan[1]> force install IPTables::IPv4::IPQueue

But, before you do it, make sure you understand the following sections first.

CPAN is a software repository of over 150,929 modules written in the Perl programming language. The modules can be downloaded from metacpan.org and also from mirrored sites worldwide. The resources found on CPAN are easily accessible with the CPAN.pm module.

From metacpan.org home page, you can search for any Perl Module you need. For example, enter "IPTables::IPv4" in the search field. You will find the documentation for IPTables::IPv4here.

CPAN Module (CPAN.pm)

The resources found on CPAN are easily accessible with the CPAN.pm module. If you want to use CPAN module, you use CPAN shell, which provides an interactive mode, in two ways:

perl -MCPAN -e shell

--or--

cpan

Configuration Steps

If you want to use CPAN.pm, lots of things have to be configured. So, when you use it the first time, you will be prompted to configure them. After the configuration, don't forget to commit by entering:

cpan[19]> o conf commit

to make the configuration permanent, which configuration data will be logged into below file:

/usr/share/perl5/CPAN/Config.pm

Only one CPAN process can be run at a time and this is protected by a mechanism using below lock:

/root/.cpan/.lock

How to Connect to the Internet behind a Proxy

After the first-time configuration effort, you can still modify configured data by entering:

cpan[20]> o conf init

Then you will be asked if you like to configure as much as possible automatically or not. Without the trouble of going through all configuration steps again, you can also specify which data to be configured. For example, if your server is behind a proxy server, you may run into the following issue:

As you did not allow me to connect to the internet you need to supply a valid CPAN URL now.

To work around, you can configure a proxy for CPAN by entering:[4,5]

cpan[21]> o conf init /proxy/
If you're accessing the net via proxies, you can specify them in the CPAN configuration or via environment variables. The variable in
the $CPAN::Config takes precedence.
Your ftp_proxy? []

At the "Your http_proxy? " prompt, we have entered the following:

http://146.xx.xx.29:80

and it works fine afterwards. Besides proxy configuration, you may also want to configure a urllist to specify which mirror(s) to use for downloading:

cpan[22]> o conf init urllist

There are 235 registered sites around the world make up the N part of CPAN (the Network), you can find the full list here.

Saturday, March 19, 2016

To support Cloud Services, IaaS is the hardware and software that powers it all – servers, storage, networks, operating systems. These days Linux (or Windows) servers used in IaaS are more and more powerful. Hence they also generate more log files.

Very often we will run into large message files above 1 GB. These log files can be viewed by regular text editors. However, most text editors have a limitation of supporting files over a certain size.

In this article, we will cover how to read large message files (e.g., /var/log/messages) generated on Linux systems.

/var/log/messages

To debug issues in Cloud environments, it's essential for you to know where the log files are and what is contained in each log file. On Linux servers, over a dozen log files are located in /var/log directory. Here we only focus on one of them:

/var/log/messages[7]

This log aims at storing "general system activity" messages.

There are several things that are logged in /var/log/messages including mail, cron, daemon, kern, auth, etc.

in which you can specify rules (i.e., selector + action) of logging. For example, you can log anything of level informational or higher except mail, cron, or private authentication message:

*.info;mail.none;authpriv.none;cron.none /var/log/messages

and messages are logged into a file named /var/log/messages.

Limitations of Text Editors

Some editors have limitations of supporting certain sizes of text file. For example, the following popular editors on Windows have described limitation:

Notepad[3]

64 kilobytes (KB)

Wordpad[4]

It's said of no size limit. But, the real problem is performance.

Depends on the version of Wordpad, some people say it can support files of size up to 20 MB without performance issues.

Textpad[8]

It can handle file sizes up to the largest contiguous chunk of 32-bit virtual memory.

Solutions

Basically, there are two solutions of dealing with large text files:

Find a more capable text editor

Divide and conquer

If you google search "large text file", you may find many suggestions on Large Text File Reader. Some editors may be able to open and read large text files. However, the performance (e.g., searching a pattern) of it could be slow.

On Linux systems, a good approach is 'divide-and-conquer" by using split command like:

split -b1000m messages-20160315T2201 split-messages

After splitting, a good text editor such as Textpad will be able to read a file of 1000 MB easily.

where array can be an array, an array formula, or a reference to a range of cells for which you want the number of rows.

Our formula defines array as a range of cells. For example, in cell J2, the range is J1:J2 and, in cell J3, the range is J1:J3. In other words, we just count the number of rows from current cell to the first cell in column J. Then we use that count multiplied by three to retrieve every third row from the array.

Tuesday, March 1, 2016

ssh (SSH client) is a program for logging into a remote machine and for executing commands on a remote machine. ssh obtains configuration data from the following sources in the following order (for each parameter, the first obtained value will be used):

command-line options

If a configuration file is given on the command line (i.e., ssh -F ), the system-wide configuration file (/etc/ssh/ssh_config) will be ignored

user's configuration file

~/.ssh/config

system-wide configuration file

/etc/ssh/ssh_config

In this article, we will focus on the specifications of directives via ssh's configuration file (specifically user's configuration file).

Advantages of Using Configuration File

There are some advantages of using configuration file to specify ssh directives:

Can use shorthand to avoid long keystrokes

Avoid mistakes

Especially when you have lots of parameters to be specified and/or some of them using non-standard connection values.

Can provide options in different scopes (per-host vs per-user)

User's Configuration File

Here are the sample contents from a user's configuration file (i.e.,~/.ssh/config):

Arguments may optionally be enclosed in double quotes (") in order to represent arguments containing spaces.

/var/log/secure

Linux has an extensive set of log files under the /var/log directory.[5] This directory is the central place where all applications and programs put their log files. Most log files are text files that can be viewed using a standard text editor.

As shown above, old secure files are archived periodically with their name annotated with the date.

/var/log/messages – This file contains messages of various programs and services including the SSH server.[6,7] Old message files are also archived periodically with their name annotated with the date.

Disclaimer

The statements and opinions expressed here are my own and do not necessarily represent those of Oracle.For your computer health, follow me @xmlandmore. To improve your personal health, follow me @travel2health.

About Me

Healthy pursuits are like traveling. We know there is a wonderland called wellness. But, there are no fixed routes to reach there. The pursuits need effort and determination. We cannot act like tourists who don't know where they've been. We must take notes of warning signs sent by our bodies.

On the journey to wellness, there are many dangers to be avoided; there are many footsteps to be taken; unfortunately, there are no short-cuts.

Travelers walking in the night follow North Star. Healthy pursuits work similarly. We know our goal; we know the signposts; we know the dangers on the road; we can adjust pace if we are tired; we can change travel plans due to the weather. But, We walk steadily and persistently. With my companionship, hopefully, your journey will be made easier.