Once these requirements are met you can begin configuring the apt-mirror tool. The main items that you’ll need to define are:

storage location (base_path)

number of download threads (nthreads)

release(s) and architecture(s) you want

The configuration is in the /etc/apt/mirror.list file. A default config was put in place when you installed the package, but it is generic. You’ll need to update the values mentioned above.

Below I have included a complete configuration which will mirror Ubuntu 16.04 LTS for both 32 and 64 bit installations. It will require nearly 250GB of storage space, which I will be putting on a removable drive. The drive will be mounted at /media/STORAGE/.

Once your configuration is saved you can begin to populate your mirror by running the command:

apt-mirror

In order for this repository to be available to other clients on your local area network you’ll need to share the contents over http. This is why we listed Apache2 as a requirement above. In my example configuration above I mirrored the repository on a removable drive, and mounted it at /media/STORAGE. What I need to do now is make that address available over the web. This can be done by way of a symbolic link.

The commands above will tell the filesystem to follow any requests for “ubuntu” back up to the mounted external drive, where it will find your mirrored contents. If you have any problems with this linking double-check your paths (as compared to those suggested here) and make sure your link points to the ubuntu directory, which is a subdirectory of the mirror you pulled from. If you point anywhere below this point your clients will not properly be able to find the contents.

If you get the “403 Forbidden” error then make sure the user and group of apache2 process have at least read and execute permission for every folder in the full-path to your local repository, for this article, the full-path to your local repository is:

/media/STORAGE/mirror/vn.archive.ubuntu.com/ubuntu/

shell commands that helps you check user and group of apache2 process are:

ps -ef | grep apache2#orps -aux | grep apache2

The default user and group of apache2 process are: “www-data” and “www-data”. If the “403 Forbidden” error happens, you usually can solve this error by “chmod” command. For example:

sudo chmod -R o+rx /media

The other cause for “403 Forbidden” error is wrong configurations for apache2. In Ubuntu 16.04LTS the apache2 version is usually 2.4.18. Version of apache2 can be checked with command:

apache2 -v

make sure that /etc/apache2/apache2.conf or /etc/apache2/sites-available/000-default.conf has the following line:

The additional task of keeping this newly downloaded mirror updated with the latest updates can be automated by way of a cron job. By activating the cron job your machine will automatically run the apt-mirror command on a regular daily basis, keeping your mirror up to date without any additional effort on your part.

To activate the automated cron job, edit the file /etc/cron.d/apt-mirror. There will be a sample entry in the file. Simply uncomment the line and (optionally) change the “4” to an hour more convenient for you. If left with its defaults it will run the apt-mirror command, updating and synchronizing your mirror, every morning at 4:00am.

The final step needed, now that you have your repository created, shared over http and configured to automatically update, is to configure your clients to use it. Ubuntu clients define where they should grab errata and security updates in the /etc/apt/sources.list file. This will usually point to the default or regional mirror. To update your clients to use your local mirror instead you’ll need to edit the /etc/apt/sources.list and comment the existing entries (you may want to revert to them later!)

Once you’ve commented the entries you can create new entries, this time pointing to your mirror. A sample entry pointing to a local mirror might look something like this:

Basically what you are doing is recreating your existing entries but replacing the archive.ubuntu.com with the IP of your local mirror. As long as the mirrored contents are made available over http on the mirror-server itself you should have no problems. If you do run into problems check your apache logs for details.

The important factors here are the use of percent-encoding and the number of slashes following the ‘file:’ scheme name.

In order to avoid ambiguity, and for your Windows file paths to be interpreted correctly, characters that are important to URI parsing that are also allowed in Windows file paths must be percent-encoded. This includes ‘#’ and ‘%’. Characters that aren’t allowed in URIs but are allowed in Windows file paths should also be percent-encoded. This includes ‘ ‘, ‘{‘, ‘}’, ‘`’, ‘^’ and all control characters. Note, for instance, that the spaces in the example URIs above have been percent-encoded to ‘%20’. See the latest URI standardfor the full list of characters that aren’t allowed in URIs.

The number of slashes following the ‘file:’ is dictated by the same rules as other well-known schemes like http and ftp. The text following two slashes is the hostname. In the case of the UNC Windows file path, the hostname appears immediately following the ‘//’. In the case of a local Windows file path, there is no hostname, and thus another slash and the path immediately follow.

The username, password, and port components of a file URI in Windows are not used. The query and fragment components may be used. The query component will not be used when locating the resource, but the application that displays the content from the file URI may use the query component. For example, if an html document contains script, the script may read the query component of its URI when accessed via the file scheme. Similarly, the fragment will be used like a fragment in any other URI scheme.

Error LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt appear often on Visual C++ 2010 and this error don’t let you to compile and run your program coded on Visual C++. If you got this error you no need to reinstall Visual C++.

Causes:

this error appear because you have installed Visual C++ 2012 after you have actually installed Visual C++ 2010 in your system;

If you have wrong version you should go toC:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\cvtres.exe
and copy cvtres.exe then replace it withC:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cvtres.exe

I just make it shorter than msdn’s version and contains only what are important for me.

WINDOWS

In a graphical Windows-based application, a window is a rectangular area of the screen where the application displays output and receives input from the user. Therefore, one of the first tasks of a graphical Windows-based application is to create a window.

A window shares the screen with other windows, including those from other applications. Only one window at a time can receive input from the user. The user can use the mouse, keyboard, or other input device to interact with this window and the application that owns it.

WINDOW-CREATION MESSAGES

When creating any window, the system sends messages to the window procedure for the window. The system sends the WM_NCCREATE message after creating the window’s nonclient area and the WM_CREATEmessage after creating the client area. The window procedure receives both messages before the system displays the window. Both messages include a pointer to a CREATESTRUCT structure that contains all the information specified in the CreateWindowEx function. Typically, the window procedure performs initialization tasks upon receiving these messages.

When creating a child window, the system sends the WM_PARENTNOTIFY message to the parent window after sending the WM_NCCREATE and WM_CREATE messages. It also sends other messages while creating a window. The number and order of these messages depend on the window class and style and on the function used to create the window. These messages are described in other topics in this help file.

MULTITHREAD APPLICATIONS

A Windows-based application can have multiple threads of execution, and each thread can create windows. The thread that creates a window must contain the code for its window procedure.

An application can use the EnumThreadWindows function to enumerate the windows created by a particular thread. This function passes the handle to each thread window, in turn, to an application-defined callback function, EnumThreadWndProc.