Server Administration & Management

Just run command promptStart -> Run -> CMD for XP, or
for Vista, Se7en & 10 Start -> type CMD in search box, right click and run as Admin,
type the following command:

attrib -H -S C:\path\to\your\file.doc /S /D

You can also use the asterisk character to define multiple extensions. For example:

attrib -H -S C:\raymond\*.* /S /D

This would remove the Hidden and System attribute of all files in the raymond folder on the C drive.

The /S and /D arguments are optional.

Just to point out, it’s probably not the best idea to use something like “C:\*.*” as this will unhide the whole drive including files which Windows has set as hidden or system by design.

R – This command will assign the “Read-Only” attribute to your selected files or folders.
H – This command will assign the “Hidden” attribute to your selected files or folders.
A – This command will prepare your selected files or folders for “Archiving.”
S – This command will change your selected files or folders by assigning the “System” attribute.
/S – This command will recurse down into all sub folders
/D – This command will unhide the folders themselves if they have the System or Hidden attribute set.

You can use cpulimit program that attempts to limit the cpu usage of a process. Limits are expressed in percentage and not in cpu time. cpulimit does not act on the nice value or other scheduling priority stuff, but on the real cpu usage. Also, it is able to adapt itself to the overall system load, dynamically and quickly.

Root vs Normal User Account :–> cpulimit should run at least with the same user running the controlled process. But it is much better if you run cpulimit as root, in order to have a higher priority and a more precise control.

A Note About SMP (Multicore / MultiCpu) Systems :–> If your machine has one processor you can limit the percentage from 0% to 100%, which means that if you set for example 50%, your process cannot use more than 500 ms of cpu time for each second. But if your machine has four processors, percentage may vary from 0% to 400%, so setting the limit to 200% means to use no more than half of the available power. In any case, the percentage is the same of what you see when you run top.

In Linux operating systems everything is logged some where. Most of the system logs are logged in to /var/log folder. This folder contains logs related to different services and applications. In this folder we have some files such as utmp, wtmp and btmp. These files contains all the details about login’s and logout’s which are from local as well as from remote systems and system status such as uptime etc.

utmp will give you complete picture of users logins at which terminals, logouts, system events and current status of the system, system boot time (used by uptime) etc.

wtmpgives historical data of utmp.

btmp records only failed login attempts.

# last ( Provide how logged in, when they logged in and when they logged out etc info on the screen.)

# last -f /var/log/wtmp (To open wtmp file and view its content use blow command)

# last -f /var/run/utmp (To see still logged in users view utmp file use last command)

/dev/zero and /dev/null are two pseudo files which are useful for creating empty files. Many people consider there is no difference or puzzled with what could be the difference between two files. There is considerable difference when writing data using these hardware files.

/dev/zero: This file is used to create a file with no data but with required size(A file with all zero’s). In other words this will create a data file with all zeros in the file which will give the size to a file. If you see the strace command on /dev/zero, it’s continuous zeros which it will write to a file. So we conclude that /dev/zero is a file use full for creating a file with some required size without any meaning to the data.

/dev/null: This is one more Pseudo file which is useful in many places like redirecting unwanted output/error etc to this file. This file acts as a black hole(Which eat up everything and do not show any output). So whenever you feed some data to this file, you can not retrieve the data which is fed to it. This file even useful for creating files with zero size.

It has a meaning and for that we should know memory hierarchy. We have different levels of memory which is useful for processing your data. They are as follows.

Processor/CPU registers(Bits in size)

L1 Cache(kbs in size)

L2 Cache(MBs in size)

L3 cache(100s of MBs in size)

RAM(GB’s in size)

suppose take one application which is in running state. The application data is moved to RAM for faster accessing and some of its data is moved to L3 cache for processing frequently used data and we move more frequently used app data to L2 and then L1. And we move data which is right now processed by your processor/CPU to registers which is present in processor. If you observe the memory size will gradually decrease when you go up in the ladder more frequently used data is kept at higher levels and made it self available for processing. So if suppose you want to load a bigger program which can consume all the ram/L3/L2/L1 cache its better to move already running process to some location which we can access later to process it once again. But moving this data to HDD is not preferred as it is bit slow and other solution is to increase the RAM size which bit cost. So people came with a solution called SWAP partition which can solve both these limitations.

We create swap partition to cache all the data in registers, L1, L2, L3 caches and RAM.

Then why we create two times the RAM :–> The reason behind it is that if you club all the above memory locations, the total size will be between 1.5 times to 2 times the RAM. This is the reason behind the thumb rule to create swap size 2 times the RAM

If I create swap size more than two times the RAM, What will happen –> As we said earlier swap is used to move data from different memories and their total size is always 1.5 times to 2 times maximum so it’s of no use if you create swap size more than 2 times the RAM. In other words, all the space more than 2 times the RAM in swap is no use.

I have RAM size of 128GB and my RAM usage never fills up, do I have to create swap partition –>No, not at all required. As mention earlier swap is a temporary space to store all your memories data for future processing, if your RAM is free then there is no use of swap partition.

Actually in basic hard disk, we can create 4 partition(either primary or extended), we can create

4 primary maximum or

3 primary + 1 extended or

2 primary + 1 extended or

1 primary + 1 extended

not more then that? why and what is the reason?

The reason is because of a limitation of the MBR (Master Boot Record- the first sector of the hard disk.) The MBR is only 512bytes of size, it is needed to store the primary boot loader, and the partition table. Typically, the area reserved for partition table is only 64 bytes. And the partition table entry for one partition is 16 bytes. So, 16×4=64. The space is over. so we cant create more than this.

This trick is for those who deal with many removable devices, with every device changing its name after you restart your systm. The solution is to mount devices by using their UUIDs (Universally Unique Identifier)

Which will show the UUIDs of devices, Now you can make an entry in the “/etc/fstab” file to avoid any problems.
This tip can also be applied in case of SAN storage, where every Logical Unit Number (LUN) needs to be mounted.

dmidecode is a tool for dumping a computer DMI (some say SMBIOS) table contents in a human-readable format. This table contains a description of the system hardware components, as well as other useful pieces of information such as serial numbers and BIOS revision. You can retrieve this information without having to probe for the actual hardware. While this is a good point in terms of report speed and safeness, this also makes the presented information possibly unreliable.

The DMI table does not only describe what the system is currently made of, it also can report the possible evolutions (such as the fastest supported CPU or the maximal amount of memory supported).

SMBIOS stands for System Management BIOS, while DMI stands for Desktop Management Interface. Both standards are tightly related and developed by the DMTF (Desktop Management Task Force).

There are many cases where you want to kill multiple processes that match a certain pattern in their command line strings. For example, suppose you want to kill all processes that are running commands with keyword “javaxyz” in their arguments.

# ps aux | grep javaxyz

Here is a single command that will kill all processes at once that are matched with grep.

# kill -9 `ps aux | grep javaxyz | grep -v grep | awk ‘{print $2}’`

The command line inside a pair of backtick characters (i.e., ps aux …. ‘{print $2}’) will print out a list of process IDs that are matched with grep. The result is then used by the outer command kill. The “grep -v grep” is to exclude a self match (i.e., grep command itself) from a list of matched processes.

One caveat with this command is that when you are running it in a shell script, make sure to use bash, not sh.

If you are running the following script with sh: you will get “kill: Illegal number:” error. The command line inside a pair of backticks is returning a multi-line response, and it appears that sh is not able to handle it. But bash can. So the following script should be okay.

Recently, WhatsApp quietly introduced a new feature that lets users know that their messages have been read, with the double grey ticks appearing in front of the messages turning blue and now, just as quietly, the mobile messaging service is letting users of its Android app disable the feature with the rollout of WhatsApp version 2.11.444. This version is available for users on WhatsApp’s website for now, and will eventually be rolled out to all users.

Here’s how you can disable the blue coloured read receipts’ with the message timestamp on WhatsApp’s Android app:-

1. Make sure that your smartphone is running on Android 2.1 or a newer version.

2. Go to settings menu and enable ‘Download from Unknown Sources‘ in the Security tab

4. Once the APK file is downloaded to your device, tap the ‘Install‘ option.

5. Now that WhatsApp has been updated, select Settings –> Account –> Privacy.

6. Under the Privacy tab, uncheck the Read Receipts option.

This feature however doesn’t apply to group messages and will let other participants know when you’ve read a message. Also, once you disable this feature, you won’t be able to view blue double-check marks when you send a message as well.

The feature that enabled the users to see when their messages were read didn’t go down too well with the users and with this update, WhatsApp seems to be taking steps to please users who were not happy with the new feature.

Login via ssh to the first Proxmox VE node or cluster. Use a unique name for your Cluster, this name cannot be changed later.

node-1# pvecm create node-1

node-1# pvecm status (To check the state of cluster)

Step-2 :- Adding nodes to the Cluster

Login via ssh to the other Proxmox VE nodes. Please note, the node cannot hold any same VM´s. (If yes you will get conflicts with identical VMID´s – to workaround, use vzdump to backup and to restore to a different VMID after the cluster configuration).