Thứ Ba, 14 tháng 8, 2018

Microsoft Visual C++ Redistributable All Versions Direct Download Links

Microsoft Visual C++ Redistributable is the library that is having components which are required by many Applications to run, and the Apps which you develop on Visual C++ require components of the Microsoft Visual C++ Redistributable. These packages are used to run the contents that are developed or written in the C++ programming language.
There are many Microsoft Redistributable packages installed on your System. You can view them by going to Control Panel/Programs/Apps and Features. And in the list of installed programs, you will see that there is more than one package of Microsoft Visual C++ Redistributable.

Visual C++ Direct Download Links

Choose your version for Redistributable according to your Windows version. If you are having 32 bit Windows, then download only 32-bit Microsoft Visual C++ Redistributable. And if you have installed 64-bit Windows, then you need to download both 32-bit and 64-bit versions of the Microsoft Visual C++ Redistributable.

Microsoft Visual C++ Redistributable 2017

Microsoft Visual C++ Redistributable 2015

Microsoft Visual C++ Redistributable 2013

Microsoft Visual C++ Redistributable 2012

Microsoft Visual C++ Redistributable 2010

Microsoft Visual C++ Redistributable 2008

Microsoft Visual C++ Redistributable 2005

The Uninstallation of the Microsoft Visual C++ Redistributor is same as you do with any other program. Go to Control Panel/Programs/Apps and Features. And double-click the program you want to uninstall and the program will uninstall.
Read More

Thứ Tư, 8 tháng 8, 2018

How To Install Java on CentOS and Fedora


Introduction
This tutorial will show you how to install Java on CentOS 7 (also 6 and 6.5), modern Fedora releases, and RHEL. Java is a popular software platform that allows you to run Java applications and applets.

The installation of the following versions of Java are covered:

OpenJDK 8
OpenJDK 7
OpenJDK 6
Oracle Java 9
Oracle Java 8
Feel free to skip to your desired section using the Contents button on the sidebar!

Prerequisites
Before you begin this guide, you should have a regular, non-root user with sudo privileges configured on both of your servers--this is the user that you should log in to your servers as. You can learn how to configure a regular user account by following the steps in our initial server setup guide for Centos 7.

Variations of Java
There are three different editions of the Java Platform: Standard Edition (SE), Enterprise Edition (EE), and Micro Edition (ME). This tutorial is focused on Java SE (Java Platform, Standard Edition).

There are two different Java SE packages that can be installed: the Java Runtime Environment (JRE) and the Java Development Kit (JDK). JRE is an implementation of the Java Virtual Machine (JVM), which allows you to run compiled Java applications and applets. JDK includes JRE and other software that is required for writing, developing, and compiling Java applications and applets.

There are also two different implementations of Java: OpenJDK and Oracle Java. Both implementations are based largely on the same code but OpenJDK, the reference implementation of Java, is fully open source while Oracle Java contains some proprietary code. Most Java applications will work fine with either but you should use whichever implementation your software calls for.

You may install various versions and releases of Java on a single system, but most people only need one installation. With that in mind, try to only install the version of Java that you need to run or develop your application(s).

Install OpenJDK 8
This section will show you how to install the prebuilt OpenJDK 8 JRE and JDK packages using the yum package manager, which is similar to apt-get for Ubuntu/Debian. OpenJDK 8 is the latest version of OpenJDK.

Install OpenJDK 8 JRE
To install OpenJDK 8 JRE using yum, run this command:

sudo yum install java-1.8.0-openjdk
At the confirmation prompt, enter y then RETURN to continue with the installation.

Congratulations! You have installed OpenJDK 8 JRE.

Install OpenJDK 8 JDK
To install OpenJDK 8 JDK using yum, run this command:

sudo yum install java-1.8.0-openjdk-devel
At the confirmation prompt, enter y then RETURN to continue with the installation.

Congratulations! You have installed OpenJDK 8 JDK.

Install OpenJDK 7
This section will show you how to install the prebuilt OpenJDK 7 JRE and JDK packages using the yum package manager.

Install OpenJDK 7 JRE
To install OpenJDK 7 JRE using yum, run this command:

sudo yum install java-1.7.0-openjdk
At the confirmation prompt, enter y then RETURN to continue with the installation.

Congratulations! You have installed OpenJDK 7 JRE.

Install OpenJDK 7 JDK
To install OpenJDK 7 JDK using yum, run this command:

sudo yum install java-1.7.0-openjdk-devel
At the confirmation prompt, enter y then RETURN to continue with the installation.

Congratulations! You have installed OpenJDK 7 JDK.

Install OpenJDK 6
This section will show you how to install the prebuilt OpenJDK 6 JRE and JDK packages using the yum package manager.

Install OpenJDK 6
To install OpenJDK 6 JRE using yum, run this command:

sudo yum install java-1.6.0-openjdk
At the confirmation prompt, enter y then RETURN to continue with the installation.

Congratulations! You have installed OpenJDK 6 JRE.

Install OpenJDK 6 JDK
To install OpenJDK 6 JDK using yum, run this command:

sudo yum install java-1.6.0-openjdk-devel
At the confirmation prompt, enter y then RETURN to continue with the installation.

Congratulations! You have installed OpenJDK 6 JDK.

Install Oracle Java 9
This section of the guide will show you how to install Oracle Java 9 JRE and JDK (64-bit), the latest release of these packages at the time of this writing.

Throughout this section we will be using the wget command to download the Oracle Java software packages. wget may not be included by default on your Linux distribution, so in order to follow along you will need to install it by running:

sudo yum install wget
Note: You must accept the Oracle Binary Code License Agreement for Java SE, which is one of the included steps, before installing Oracle Java.

Install Oracle Java 9 JRE
Note: In order to install Oracle Java 9 JRE, you wil need to go to the Oracle Java 9 JRE Downloads Page, accept the license agreement, and copy the download link of the appropriate Linux .rpm package. Substitute the copied download link in place of the highlighted part of the wget command.

Change to your home directory and download the Oracle Java 9 JRE RPM with these commands:

cd ~
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://link_copied_from_site"
Then install the RPM with this yum command (if you downloaded a different release, substitute the filename here):

sudo yum localinstall jre-9.0.4_linux_x64_bin.rpm
At the confirmation prompt, enter y then RETURN to continue with the installation.

Now Java should be installed at /usr/java/jre-9.0.4/bin/java, and linked from /usr/bin/java.

You may delete the archive file that you downloaded earlier:

rm ~/jre-9.0.4_linux_x64_bin.rpm
Congratulations! You have installed Oracle Java 9 JRE.

Install Oracle Java 9 JDK
Note: In order to install Oracle Java 9 JDK, you will need to go to the Oracle Java 9 JDK Downloads Page, accept the license agreement, and copy the download link of the appropriate Linux .rpm package. Substitute the copied download link in place of the highlighted part of the wget command.

Change to your home directory and download the Oracle Java 9 JDK RPM with these commands:

cd ~
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://link_copied_from_site"
Then install the RPM with this yum command (if you downloaded a different release, substitute the filename here):

sudo yum localinstall jdk-9.0.4_linux-x64_bin.rpm
At the confirmation prompt, enter y then RETURN to continue with the installation.

Now Java should be installed at /usr/java/jdk-9.0.4/bin/java, and linked from /usr/bin/java.

You may delete the archive file that you downloaded earlier:

rm ~/jdk-9.0.4_linux-x64_bin.rpm
Congratulations! You have installed Oracle Java 9 JDK.

Install Oracle Java 8
This section of the guide will show you how to install Oracle Java 8 JRE and JDK (64-bit).

Note: You must accept the Oracle Binary Code License Agreement for Java SE, which is one of the included steps, before installing Oracle Java.

Install Oracle Java 8 JRE
Note: In order to install Oracle Java 8 JRE, you will need to go to the Oracle Java 8 JRE Downloads Page, accept the license agreement, and copy the download link of the appropriate Linux .rpm package. Substitute the copied download link in place of the highlighted part of the wget command.

Change to your home directory and download the Oracle Java 8 JRE RPM with these commands:

cd ~
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://link_copied_from_site"
Then install the RPM with this yum command (if you downloaded a different release, substitute the filename here):

sudo yum localinstall jre-8u161-linux-x64.rpm
At the confirmation prompt, enter y then RETURN to continue with the installation.

Now Java should be installed at /usr/java/jre1.8.0_161/bin/java, and linked from /usr/bin/java.

You may delete the archive file that you downloaded earlier:

rm ~/jre-8u161-linux-x64.rpm
Congratulations! You have installed Oracle Java 8 JRE.

Install Oracle Java 8 JDK
Note: In order to install Oracle Java 8 JDK, you will need to go to the Oracle Java 8 JDK Downloads Page, accept the license agreement, and copy the download link of the appropriate Linux .rpm package. Substitute the copied download link in place of the highlighted part of the wget command.

Change to your home directory and download the Oracle Java 8 JDK RPM with these commands:

cd ~
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://link_copied_from_site"
Then install the RPM with this yum command (if you downloaded a different release, substitute the filename here):

sudo yum localinstall jdk-8u161-linux-x64.rpm
At the confirmation prompt, enter y then RETURN to continue with the installation.

Now Java should be installed at /usr/java/jdk1.8.0_161/jre/bin/java, and linked from /usr/bin/java.

You may delete the archive file that you downloaded earlier:

rm ~/jdk-8u161-linux-x64.rpm
Congratulations! You have installed Oracle Java 8 JDK.

Set Default Java
If you installed multiple versions of Java, you may want to set one as your default (i.e. the one that will run when a user runs the java command). Additionally, some applications require certain environment variables to be set to locate which installation of Java to use. This section will show you how to do this.

By the way, to check the version of your default Java, run this command:

java -version
Using Alternatives
The alternatives command, which manages default commands through symbolic links, can be used to select the default Java command.

To print the programs that provide the java command that are managed by alternatives, use this command:

sudo alternatives --config java
Here is an example of the output:

output
There are 5 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
   1           java-1.7.0-openjdk.x86_64 (/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.161-2.6.12.0.el7_4.x86_64/jre/bin/java)
   2           java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-5.b12.el7_4.x86_64/jre/bin/java)
   3           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
*+ 4           /usr/java/jre-9.0.4/bin/java
   5           /usr/java/jdk-9.0.4/bin/java




Enter to keep the current selection[+], or type selection number:
Simply enter the a selection number to choose which java executable should be used by default.

Using Environment Variables
Many Java applications use the JAVA_HOME or JRE_HOME environment variables to determine which java executable to use.

For example, if you installed Java to /usr/java/jdk1.8.0_161/jre/bin (i.e. java executable is located at /usr/java/jdk1.8.0_161/jre/bin/java), you could set your JAVA_HOME environment variable in a bash shell or script like so:

export JAVA_HOME=/usr/java/jdk1.8.0_161/jre
If you want JAVA_HOME to be set for every user on the system by default, add the previous line to the /etc/environment file. An easy way to append it to the file is to run this command:

sudo sh -c "echo export JAVA_HOME=/usr/java/jdk1.8.0_161/jre >> /etc/environment"
Conclusion
Congratulations, you are now set to run and/or develop your Java applications!

Read More

Thứ Ba, 7 tháng 8, 2018

How To Install and Configure SNMP on CentOS

Introduction

SNMP, or Simple Network Management Protocol, is widely used to communicate with and monitor network devices, servers, and more, all via IP. In this case, we’ll be installing an SNMP agent on a CentOS 6.5 server, which will allow for collection of data from our server, and make the information available to a remote SNMP manager.
Pre-Flight Check

    These instructions are intended for installing SNMP and doing a very basic configuration.
    I’ll be working from a Liquid Web Core Managed CentOS 6.5 server, and I’ll be logged in as root.

Install SNMP and SNMP Utilities

Installing SNMP and some optional SNMP utilities is as simple as running one command:

yum -y install net-snmp net-snmp-utils
Add a Basic Configuration for SNMP

Now, let’s take the default SNMP configuration file, /etc/snmp/snmpd.conf and move it to an alternate location, /etc/snmp/snmpd.conf.orig.

mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.orig

And now we’ll create a new /etc/snmp/snmpd.conf:

vim /etc/snmp/snmpd.conf
For a refresher on editing files with vim see: New User Tutorial: Overview of the Vim Text Editor

Insert the following text into the new /etc/snmp/snmpd.conf

# Map 'idv90we3rnov90wer' community to the 'ConfigUser'
# Map '209ijvfwer0df92jd' community to the 'AllUser'
#       sec.name        source          community
com2sec ConfigUser      default         idv90we3rnov90wer
com2sec AllUser         default         209ijvfwer0df92jd
# Map 'ConfigUser' to 'ConfigGroup' for SNMP Version 2c
# Map 'AllUser' to 'AllGroup' for SNMP Version 2c
#                       sec.model       sec.name
group   ConfigGroup     v2c             ConfigUser
group   AllGroup        v2c             AllUser
# Define 'SystemView', which includes everything under .1.3.6.1.2.1.1 (or .1.3.6.1.2.1.25.1)
# Define 'AllView', which includes everything under .1
#                       incl/excl       subtree
view    SystemView      included        .1.3.6.1.2.1.1
view    SystemView      included        .1.3.6.1.2.1.25.1.1
view    AllView         included        .1
# Give 'ConfigGroup' read access to objects in the view 'SystemView'
# Give 'AllGroup' read access to objects in the view 'AllView'
#                       context model   level   prefix  read            write   notify
access  ConfigGroup     ""      any     noauth  exact   SystemView      none    none
access  AllGroup        ""      any     noauth  exact   AllView         none    none

The above text is noted with basic information on the function of each configuration line. In short, we’re creating two scenarios for polling information from SNMP version 2c.
Note: SNMPv2c contains some security enhancements over SNMPv1 but uses the existing SNMPv1 administration structure, which is “community” based. Areas of improvement include: transport mappings, protocol packet types, and MIB structure elements.

In the first scenario: ConfigUser is assigned to ConfigGroup and may only use SNMP security model 2c, ConfigGroup can use the SystemView, SystemView is assigned to two OID sub-trees, and all of this is referenced in an SNMP poll by the secret, and unique community string idv90we3rnov90wer.

In the second scenario: AllUser is assigned to AllGroup and may only use SNMP security model 2c, AllGroup can use the AllView, AllView is assigned to the entire OID tree, and all of this is referenced in an SNMP poll by the secret, and unique community string 209ijvfwer0df92jd.
Important Tip: Be ABSOLUTELY SURE that you choose a unique community string and replace the community strings in the above examples. Keep each secret, and keep each safe.

Exit vim, and restart the SNMP service to reload the new configuration file:

service snmpd restart

Configure SNMP to start when the server boots:

chkconfig snmpd on
Test the SNMP Configuration

Now let’s test the SNMP configuration… try running the following two commands:

snmpwalk -v 2c -c idv90we3rnov90wer -O e 127.0.0.1

snmpwalk -v 2c -c 209ijvfwer0df92jd -O e 127.0.0.1
Note: The default port for SNMP is 161 and 162. If you’re going to connect to SNMP from a remote server, be sure your server’s firewall has the appropriate ports open.
Read More

PowerShell says “execution of scripts is disabled on this system.”

You can bypass this policy by adding -ExecutionPolicy ByPass when running PowerShell
powershell -ExecutionPolicy ByPass -File script.ps1
 
For Windows 7, Windows 8, Windows Server 2008 R2 or Windows Server 2012, run the following commands as Administrator:
x86 (32 bit)
Open C:\Windows\SysWOW64\cmd.exe
Run the command powershell Set-ExecutionPolicy RemoteSigned
x64 (64 bit)
Open C:\Windows\system32\cmd.exe
Run the command powershell Set-ExecutionPolicy RemoteSigned
You can check mode using
  • In CMD: echo %PROCESSOR_ARCHITECTURE%
  • In Powershell: [Environment]::Is64BitProcess
 
Read More

Thứ Hai, 6 tháng 8, 2018

Faster SQL queries with RAM Disk

Faster SQL queries with RAM Disk

We have been having performance issue with our SQL Server database. Specifically, certain kinds of frequently executed stored procedures were causing high IO throughput on SQL Server tempdb files. The server utilizes multiple 15K RPM drives in RAID 10 configuration. Even with this setup, we were seeing near constant 100% utilization of the disk IO system. In previous version of SQL Server it was possible to force tempdb into RAM. Microsoft has since disabled this functionality. By using RAMDisk Plus we were able to essentially move tempdb into RAM. This improved response time on the particular stored procedure at least ten fold. Additionally, this lowered overall IO utilization on the server from around 100% to under 5%, which further improved response times

Preliminary considerations:

    Examine the current size of the tempdb file and the amount of available free memory. If the tempdb file is 100 MB or less, a RAM disk is unlikely to improve performance. If the tempdb file is greater than available physical memory, add more RAM to the system.
    Consider the impact of reallocating system memory to the RAM disk. Sufficient memory resources must be available for SQL and other processes.
    On a production machine, determine a convenient time when SQL Server can be stopped. SQL must be stopped to change the tempdb path, and, possibly, to reduce its memory allocation limit.

Instructions:

    Stop SQL Server
    Add a RAM disk to the system.( You can download from URL: https://sourceforge.net/projects/imdisk-toolkit/ or this link: http://www.ltr-data.se/opencode.html/)
        Select a size large enough to contain the tempdb file.
        Select an appropriate drive letter.
        Select “NTFS” file system, without compression.
        Enable ‘\temp’ folder creation.
        Use the default image location.
        Do not enable “Save at system shutdown” or “Reserve space for full disk
    Configure SQL Server to place the tempdb file on the RAM disk. If necessary, reduce the SQL Server’s system memory allocation limit. (See How to Relocate Microsoft SQL Server’s tempdb files below.)
    Start SQL Server.
Read More

Chủ Nhật, 5 tháng 8, 2018

MySQL Won’t Start – InnoDB Corruption and Recovery

Databases get corrupted for many reasons. In my case, our SAN (or your hard drive) went down during writes to the database from a power failure. InnoDB corruption can cause all of the databases running on that server to become inaccessible.

I have to say what everyone else out there says, “Backup, Backup, and Backup”. Make sure that you maintain a good backup schedule by running a dump script to get your dbs back in order in case of serious corruption or data loss (which is inevitable). (Automysqlbackup)
MySQL Won’t Start: How do I restore an InnoDB database?

Prerequisites:
My server is Centos 5.x, MySQL 5.5 running cPanel 11.34. Ubuntu and Debian flavors will differ and good command-line knowledge is helpful here. You will not be able to do any of these steps without shell access to your server via SSH.  You also will not be able to repair or check your tables via phpmyadmin, WHM or cPanel.

InnoDB corruption can cause all of the databases running on that server to be inaccessible.  Without going into the technical reasons as to why that is, you will find that your databases are unavailable and your MySQL server just won’t start.  You may get a simple response from the MySQL server like:

Starting MySQL..The server quit without updating PID file (/var/lib/mysql/my.server.com.pid).
[FAILED] or MySQL server PID file could not be found!

These errors can only usually be found when trying to re-start the MySQL server. You must now dig deeper, this is where checking the MySQL error log for “my.server.com” will somewhat give you an idea as to what to do next.

First, we have to get to the server and this is where command-line experience comes into play. You should have sudo or root access to your server running MySQL. Let’s take a look at the MySQL error log for my.server.com:

ssh user@my.server.com
tail -500 /var/lib/mysql/my.server.com.err

130306 22:02:18 mysqld_safe Number of processes running now: 0
130306 22:02:18 mysqld_safe mysqld restarted
130306 22:02:18 [Note] Plugin 'FEDERATED' is disabled.
130306 22:02:18 InnoDB: The InnoDB memory heap is disabled
130306 22:02:18 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130306 22:02:18 InnoDB: Compressed tables use zlib 1.2.3
130306 22:02:18 InnoDB: Using Linux native AIO
130306 22:02:18 InnoDB: Initializing buffer pool, size = 128.0M
130306 22:02:18 InnoDB: Completed initialization of buffer pool
130306 22:02:18 InnoDB: highest supported file format is Barracuda.
130306 22:02:18 InnoDB: 5.5.30 started; log sequence number 1629186928
130306 22:02:18 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
130306 22:02:18 [Note] - '0.0.0.0' resolves to '0.0.0.0';
130306 22:02:18 [Note] Server socket created on IP: '0.0.0.0'.
130306 22:02:18 [Note] Event Scheduler: Loaded 0 events
130306 22:02:18 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.30-cll' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
130306 22:02:19 InnoDB: Assertion failure in thread 47204348393792 in file trx0purge.c line 840
InnoDB: Failing assertion: purge_sys->purge_trx_no <= purge_sys->rseg->last_trx_no
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
03:02:19 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.

We will try our best to scrape up some info that will hopefully help diagnose the problem, but since we have already crashed, something is definitely wrong and this may fail.

Steps to get it back up.

1. Stop mysqld.
2. Backup /var/lib/mysql/ib*
3. Add the following line into /etc/my.cnf:

innodb_force_recovery = 4

4. Restart mysqld.
5. Dump all tables:# mysqldump -A > dump.sql
6. Drop all databases which need recovery.
7. Stop mysqld.
8. Remove /var/lib/mysql/ib*
9. Comment out or remove innodb_force_recovery = 4 in /etc/my.cnf
10. Restart mysqld. Look at mysql error log. By default it should be /var/lib/mysql/server/hostname.com.err to see how it creates new ib* files.
11. Restore databases from the dump:mysql < dump.sql

**Hint : A simple query for finding all of your InnoDB tables in case you want to specifically target the corruption:

SELECT table_schema, table_name
FROM INFORMATION_SCHEMA.TABLES
WHERE engine = 'innodb';
Read More