Month: March 2016

  • Deleting Thumbs.db & Desktop.ini files and How to prevent them

    Removing thumbs.db file from explorer might take time. So you may also try the command interface.

    • Press Windows Key + R for Run window, type cmd for opening command prompt
    • del /s /ah thumbs.db

    This command will quickly remove thumbs.db files from your computer.

    How to prevent thumbs.db file from getting recreated?

    The above method only can help you in removing the created thumbs.db file, but it can’t prevent creation of newer thumbs.db files. If you have plenty of photos in your PC, these files will get regenerated easily and start consuming hard disk space.

    To prevent this file from getting generated, try this tweak.

    • Press Windows key + R for opening Run window. Type gpedit.msc and hit Enter
      Note: Group Policy Editor is a feature included with premium versions of Windows mainly the professional and enterprise edition. So if you don’t get any window opened after typing gpedit.msc, the version of windows in your PC may not support that feature.
    • On the left side of Group Policy Editor window, open User Configuration -> Administrative Templates -> Windows Components -> File Explorer (Windows Explorer in 7, File explorer in Windows 8). On the right side double click on “Turn off the caching of thumbnails in hidden thumbs.db files”. Click Enabled. Click OK

    thumb.db-gpedit-1

    thumb.db-gpedit-2

    Once the step is done, no more thumbs.db files will be generated in your computer.

  • How to Start and Enable Firewalld on CentOS 7

    It is highly recommended that you have a firewall protecting your server.

    Pre-Flight Check

    • These instructions are intended specifically for enabling and starting firewalld CentOS 7.
    • I’ll be working from a Liquid Web Self Managed CentOS 7 server, and I’ll be logged in as root.

    Check the Status of Firewalld

    To check the status of firewalld, run the following command as root:

    systemctl status firewalld

    Enable Firewalld

    To enable firewalld, run the following command as root:

    systemctl enable firewalld

    Start Firewalld

    To start firewalld, run the following command as root:

    systemctl start firewalld

  • How to check status, stop, and disable firewall on CentOS 7

    Firewalld is a complete firewall solution that has been made available by default on all CentOS 7 servers, including Liquid Web Core Managed CentOS 7, and Liquid Web Self Managed CentOS 7. On occasion, perhaps for testing, disabling or stopping firewalld may be necessary. Follow the instructions below to disable firewalld and stop firewalld.

    It is highly recommended that you have another firewall protecting your network or server before, or immediately after, disabling firewalld.

    Pre-Flight Check

    • These instructions are intended specifically for stopping and disabling firewalld CentOS 7.
    • I’ll be working from a Liquid Web Self Managed CentOS 7 server, and I’ll be logged in as root.

    Check the Status of Firewalld

    And finally, to check the status of firewalld, run the following command as root:

    systemctl status firewalld

    Stop Firewalld

    To stop firewalld, run the following command as root:

    systemctl stop firewalld

    Disable Firewalld

    To disable firewalld, run the following command as root:

    systemctl disable firewalld
  • Find files hiding in a lot of sub directories

    So I was moving a lot of my music to Amazon Cloud Drive, and ended with a lot of files still showing under a lot of sub directories. Problem was – how do I know which files are in what sub directory with out going into each of them.

    Here is the answer:

    K:\Music\dir /b /s /A-D /o:gn>list.txt

    This captured all the files in the sub directories and saved them to list.txt

    Hope this helps.

  • How to Install VMware Tools on RHEL 7/CentOS 7

    VMware Tools is one of important components for virtual machine (VM) in order get excellent performance. It is a group of utilities that help to enhances the overall performance of the virtual machine’s guest operating system (OS) and improves management of the VM. Without the VMware Tools, guest OS performance will lacks some of the important functionality. Below steps shows how to install the VMware Tools on RHEL 7, CentOS 7 and Oracle Linux 7.

    How to Install VMware Tools ?

    Option 1 (Recommended by VMware) – VMware support of open-vm-tools

    open-vm-tools is an open source implementation of VMware Tools from third parties and contains utilities that enhances virtualization management, administration and functions of the virtual machine in VMware environments. The ultimate goal is to enable the operating system vendors and/or communities and virtual appliance vendors to bundle VMware Tools into their product releases.

    # yum install open-vm-tools
    

    Option 2 :

    1. Install prerequisites :

    # yum install perl gcc make kernel-headers kernel-devel -y
    

    2. Attach the vmware tools sofware from vSphere client.

    3. Mount the vmware tools package into /mnt :

    # <strong>mount /dev/cdrom /mnt</strong>
    mount: /dev/sr0 is write-protected, mounting read-only
    

    4. Copy vmware tool packagae into /tmp :

    # cd /mnt
    
    # ls
    manifest.txt     VMwareTools-9.4.0-1280544.tar.gz  vmware-tools-upgrader-64
    run_upgrader.sh  vmware-tools-upgrader-32
    # <strong>cp -p VMwareTools-9.4.0-1280544.tar.gz /tmp
    </strong>

    5. Go to /tmp directory and extract the vmware tools package :

    # cd /tmp
    # <strong>tar xzvf VMwareTools-9.4.0-1280544.tar.gz
    </strong>

    6. Go to extracted folder, vmware-tools-distrib :

    # <strong>cd vmware-tools-distrib</strong>
    # ls
    bin  doc  etc  FILES  INSTALL  installer  lib  vmware-install.pl
    

    7. Run vmware-install.pl to start installation :

    # <strong>./vmware-install.pl</strong>
    

    Example:

    # ./vmware-install.pl
    Creating a new VMware Tools installer database using the tar4 format.
    
    Installing VMware Tools.
    
    In which directory do you want to install the binary files?
    [/usr/bin]
    
    What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
    [/etc/rc.d]
    
    What is the directory that contains the init scripts?
    [/etc/rc.d/init.d]
    
    In which directory do you want to install the daemon files?
    [/usr/sbin]
    
    In which directory do you want to install the library files?
    [/usr/lib/vmware-tools]
    
    The path "/usr/lib/vmware-tools" does not exist currently. This program is
    going to create it, including needed parent directories. Is this what you want?
    [yes]
    
    In which directory do you want to install the documentation files?
    [/usr/share/doc/vmware-tools]
    
    The path "/usr/share/doc/vmware-tools" does not exist currently. This program
    is going to create it, including needed parent directories. Is this what you
    want? [yes]
    
    The installation of VMware Tools 9.4.0 build-1280544 for Linux completed
    successfully. You can decide to remove this software from your system at any
    time by invoking the following command: "/usr/bin/vmware-uninstall-tools.pl".
    
    Before running VMware Tools for the first time, you need to configure it by
    invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want
    this program to invoke the command for you now? [yes]
    
    Initializing...
    
    
    Making sure services for VMware Tools are stopped.
    
    Stopping vmware-tools (via systemctl):                     [  OK  ]
    
    
    The module vmci has already been installed on this system by another installer
    or package and will not be modified by this installer.
    
    The module vsock has already been installed on this system by another installer
    or package and will not be modified by this installer.
    
    The module vmxnet3 has already been installed on this system by another
    installer or package and will not be modified by this installer.
    
    The module pvscsi has already been installed on this system by another
    installer or package and will not be modified by this installer.
    
    The module vmmemctl has already been installed on this system by another
    installer or package and will not be modified by this installer.
    
    The VMware Host-Guest Filesystem allows for shared folders between the host OS
    and the guest OS in a Fusion or Workstation virtual environment.  Do you wish
    to enable this feature? [no]
    
    The vmxnet driver is no longer supported on kernels 3.3 and greater. Please
    upgrade to a newer virtual NIC. (e.g., vmxnet3 or e1000e)
    
    The vmblock enables dragging or copying files between host and guest in a
    Fusion or Workstation virtual environment.  Do you wish to enable this feature?
    [no]
    
    VMware automatic kernel modules enables automatic building and installation of
    VMware kernel modules at boot that are not already present. This feature can be
    
    enabled/disabled by re-running vmware-config-tools.pl.
    
    Would you like to enable VMware automatic kernel modules?
    [no]
    
    No X install found.
    
    Creating a new initrd boot image for the kernel.
    Starting vmware-tools (via systemctl):                     [  OK  ]
    The configuration of VMware Tools 9.4.0 build-1280544 for Linux for this
    running kernel completed successfully.
    
    You must restart your X session before any mouse or graphics changes take
    effect.
    
    You can now run VMware Tools by invoking "/usr/bin/vmware-toolbox-cmd" from the
    command line.
    
    To enable advanced X features (e.g., guest resolution fit, drag and drop, and
    file and text copy/paste), you will need to do one (or more) of the following:
    1. Manually start /usr/bin/vmware-user
    2. Log out and log back into your desktop session; and,
    3. Restart your X session.
    
    Enjoy,
    
    --the VMware team
    

    8. Once successfully installed, make sure you umount (not unmount- missing the n) back the /mnt :

    # umount /mnt
  • Get a list of shared mailboxes that are accidentally licensed

    We know that in a hybrid scenario or during migration all shared mailboxes are migrated as a user account and then converted in a shared mailbox.

    Sometimes admin forget to remove the license for the shared box after conversion and there is no GUI alternative to see if the shared mailbox is licensed. Shared mailbox in Office365 do not require a license.

    To find out what shared mailboxes are “accidentally” licensed:

    #Connect to Office365
    Import-Module MSOnline
    $O365Cred = Get-Credential
    $O365Session = New-PSSession –ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $O365Cred -Authentication Basic -AllowRedirection
    Import-PSSession $O365Session
    
    #To view summary information about your current licensing plans and the available licenses for each plan
    Get-MsolAccountSku
    
    #Find out shared mailboxes that are licensed
    Get-Mailbox -ResultSize Unlimited -RecipientTypeDetails SharedMailbox | Get-MsolUser | Where-Object { $_.isLicensed -eq "TRUE" }
    
    #Find out shared mailboxes that are licensed and remove them
    #You need to supply your licensing plan name to remove licenses
    Get-Mailbox -ResultSize Unlimited -RecipientTypeDetails SharedMailbox | Get-MsolUser | Where-Object { $_.isLicensed -eq "TRUE" } | foreach {Set-MsolUserLicense -UserPrincipalName $_.UserPrincipalName -RemoveLicenses "yourlicenseplan:ENTERPRISEPACK"}
    
    
    
    

     

     

  • How to configure static ip address on CentOS 7

    In this small tutorial i will explain how to configure static ip address on CentOS 7 minimal.
    First, need to edit the set up for the ethernet. Let’s start with editing “/etc/sysconfig/network-scripts/ifcfg-enp0s3″ file:

    vi /etc/sysconfig/network-scripts/ifcfg-enp0s3
    HWADDR=08:00:27:6C:FF:91
    TYPE=Ethernet
    BOOTPROTO=static
    DEFROUTE=yes
    PEERDNS=yes
    PEERROUTES=yes
    IPV4_FAILURE_FATAL=no
    IPADDR=192.168.0.88
    IPV6INIT=yes
    IPV6_AUTOCONF=yes
    IPV6_DEFROUTE=yes
    IPV6_PEERDNS=yes
    IPV6_PEERROUTES=yes
    IPV6_FAILURE_FATAL=no
    NAME=enp0s3
    UUID=ea68db6e-461e-427d-b9a8-bfcf6e1a4fc6
    ONBOOT=yes
    

    Save and exit.

    Now, configure default getaway:

    vi /etc/sysconfig/network

    And add following line:

    NETWORKING=yes
    HOSTNAME=centos7
    GATEWAY=10.1.1.253

    Configure DNS Server

    vi /etc/resolv.conf

    add following line:

    nameserver 8.8.8.8
    nameserver 8.8.4.4

    Now restart your network or rebooting system

    /etc/init.d/network restart

    Check your network:

    ip addr
    1: lo: <loopback,up,lower_up> mtu 65536 qdisc noqueue state UNKNOWN 
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
           valid_lft forever preferred_lft forever
        inet6 ::1/128 scope host 
           valid_lft forever preferred_lft forever
    2: enp0s3: <broadcast,multicast,up,lower_up> mtu 1500 qdisc pfifo_fast state UP qlen 1000
        link/ether 08:00:27:6c:ff:91 brd ff:ff:ff:ff:ff:ff
        inet 192.168.0.88/24 brd 192.168.0.255 scope global enp0s3
           valid_lft forever preferred_lft forever
        inet6 fe80::a00:27ff:fe6c:ff91/64 scope link 
           valid_lft forever preferred_lft forever
    
  • How to setup network after RHEL/CentOS 7 minimal installation

    After installing RHEL/CentOS 7 minimal, You may not able to connect network in that machine. This will happen because Ethernet interfaces are not enabled by default.
    This guide explain you to setup network on RHEL/CentOS 7.

    Setup network on CentOS 7 minimal

    First, type “nmcli d” command in your terminal for quick list ethernet card installed on your machine:

    CentOS_7-network-setup

    “nmcli d” command output

    Type “nmtui” command in your terminal to open Network manager. After opening Network manager chose “Edit connection” and press Enter (Use TAB button for choosing options).

    CentOS_7-Network-manager-screen

    CentOS_7 Network manager screen

    Now choose you network interfaces and click “Edit”

    Edit-your-network-interfaces

     

    Edit your network interfaces

    DHCP configuration

    Choose “Automatic” in IPv4 CONFIGURATION and check Automatically connect check box and press OK and quit from Network manager.

    Set-ip-adress-using-DHCP

    Set ip adress using DHCP

    Reset network services:

    service network restart

    Now your server will get IP Address from DHCP .

    CentOS-7-check-ip-address

    CentOS 7 check ip address.