Please help me to understand these tun0 addresses

Hardware network links can be either point to point or point to multipoint. ppp links are point to point, ethernet is point to multipoint. tun can act as either, in your case it is acting as a point to point link. a point to multipoint interface has four addresses associated with it, specifically ip address (the address of the interface), network address, broadcast address, and netmask. A point to point link has two addresses associated with it, specifically ip address (the near address) and the point to point peer address (the far address). Since the point to point link will only work with the two addresses, the broadcast, and network addresses and the netmask do not have useful data or have flag values.

A final point tun interfaces can have mac addresses, they just don’t have default mac addresses.

Intel CPU, PROCESSOR_ARCHITECTURE = AMD64?

Yep, that’s right. The 64 bit extensions to the x86 architecture were invented and first implemented by AMD. Intel were laggards to the 64 bit party because they were hoping to transition away from x86 architecture and move us towards IA64. IA64 already existed in the form of the Itanium and Intel was hoping to transition towards that. Despite being a far better and more efficient architecture, lacking the inherent design flaws of x86, it suffered through lack of compatibility and it never took off except in the commercial space. AMD effectively forced Intel’s hand by introducing the Sledgehammer, which was effectively a 64bit chip based on the x86 architecture. Hence the name AMD64.

Synchronize and Mirror difference

With Synchronize files mode, the newer files in source directory are transferred to the opposite directory.

With Mirror files mode, the different (both newer and older) files in source directory are transferred to the opposite directory.

How to Enable FTP Passive Mode

https://documentation.cpanel.net/display/CKB/How+to+Enable+FTP+Passive+Mode

Overview

Use either the active or passive mode to connect to a File Transfer Protocol (FTP) server.

Active mode vs. passive mode

FTP utilizes two ports, a data port and a command port, to transfer information from a client to a server. Typically, the command port uses port 21 and the data port uses port 20. When you use a different mode, however, the data port does not always use port 20. 

Active

In active mode, the FTP server responds to the connection attempt and returns a connection request from a different port to the FTP client. Network Address Translation (NAT) configurations block this connection request.
 

Passive

In passive mode, the FTP client initiates both connection attempts. NAT configurations do not block this connection request.

Note:

If FTP users exist on the private network side of a NAT configuration, you must enable FTP’s passive mode and open the passive port range in your FTP server’s configuration file. You may also need to open the passive port range on your firewall.

ErrorLevel

IF ERRORLEVEL is a special syntax supported since the DOS days, the %ERRORLEVEL% variable support was added in WinNT.

The original syntax is used like this:

call someapp.exe
if errorlevel 1 goto handleerror1orhigher
if errorlevel 0 echo succuess...

To use the variable, use the normal IF syntax: if %errorlevel%==0 echo success...

Note that %errorlevel% stops working if someone does set errorlevel=foo and it might not get updated for internal cmd.exe commands.

An alternative solution is to use &&:

call someapp.exe && (echo success) || (echo error!)

File “Date modified” property are not updating while modifying a file without closing it.

These days, we are monitoring this issue:
when one was developing a utility that monitors log files as they are updated.

On 2003, opening the log file folder in explorer, you can see the timestamp and files size change before your eyes each time the log is updated.

On 2008, “Last Modified” field on log files is not updated unless another program attempts to open the file or the utility is stopped, even if F5 is pressed to refresh the view.

Explorer gets is information from NTFS, by using a cmd prompt and “dir” we found that the NTFS metadata for the files is not updated until the handle to a file is closed.

Refreshing the information of a FOLDER is just going to go to the (memory resident) metadata cached by NTFS, but querying the file explicitly will force disk I/O to get the properties – this was a design change introduced in Vista to reduce unnecessary disk I/O to improve performance

There are some exceptions to this rule:
– in some, but not all, cases a simple “dir filename” is enough to refresh the metadata
– “special” folders may be treated differently, such as user profiles where we do not expect a large number of files and want to be able to rely on the file data presented
– kernel filter drivers may change the behaviour as by design they “add, remove or
change functionality of other drivers”

As the workaround is for any process to open and close a handle to the log files, a tool was written to do exactly that, plus get the file information, using the following APIs:
CreateFile
GetFileInformationByHandle
CloseHandle

Reference:
http://social.technet.microsoft.com/Forums/en-US/winservergen/Thread/2B8BACA2-9C1B-4D80-80ED-87A3D6B1336F

Environment Variables

https://msdn.microsoft.com/en-us/library/windows/desktop/ms682653%28v=vs.85%29.aspx

Every process has an environment block that contains a set of environment variables and their values. There are two types of environment variables: user environment variables (set for each user) and system environment variables (set for everyone).

By default, a child process inherits the environment variables of its parent process. Programs started by the command processor inherit the command processor’s environment variables. To specify a different environment for a child process, create a new environment block and pass a pointer to it as a parameter to the CreateProcess function.

Continue reading “Environment Variables”

The ‘Sysnative’ folder in 64-bit Windows explained

In this article we explained that in a 64-bit Windows the System32 folder is intended for 64-bit binary files (DLL files etc.) and the SysWOW64 folder is intended for 32-bit binary files. In the article we also explained that if a 32-bit application includes the “\System32” folder name in a folder path, the system automatically makes a redirection to the SysWOW64 folder. This is to prevent compatibility problems when applications are compiled to 64-bit executables.

Continue reading “The ‘Sysnative’ folder in 64-bit Windows explained”