How to change ip address manual
Dlltool is a usefull tool but need money 10$ only for 7 days. you can use it fix the netsh problem for free.

Changing TCP/IP settings using the GUI property is very easy and simple. But what about if you want to have more fun doing it, and change the IP and DNS properties using the windows command prompt? If you are a Linux guru or a batch scripting wizard this should not be complicated, if you are new to the command prompt, well, today is a good day to start.

We will change the IP address and DNS servers using the built-in utility in Windows called “Netsh” is a nifty utility to change system networking settings, locally or remotely. To run Netsh click on start then RUN and type CMD press ENTER.

When the command prompt comes up type Netsh, now you should be ready to execute commands. Simple huh. Just to warm up type “interface ip show config” that will show up the TCP/IP network settings.

Now, how you change the IP address and Default Gateway settings? To change the Local Area Connection TCP/IP settings type the following command:

interface ip set address name=”Local Area Connection” static

As you can see, when you use Netsh you need to specify what network properties you need to change, in the example above, we changed the network properties for “Local Area Connection” then we setup a static IP address, Subnet Mask and at the end the default gateway.

Changing the DNS IP address is almost identical as the procedure above, type the following command on the Netsh prompt:

interface ip set dns “Local Area Connection” static

To Setup WINS, type the following command:

interface ip set wins “Local Area Connection” static

To set the network properties to obtain the IP address from a DHCP server, type the following command:

interface ip set address “Local Area Connection” dhcp

To set DNS to obtain IP address automatically type the following:

netsh interface ip set dns “Local Area Connection” dhcp

There you have it, a useful tool to help you on your network configuration.

Https Cipher Suite in “nscurl –ats-diagnostics –verbose”


The Cipher Suite
Forward Secrecy ensures the integrity of a session key in the event that a long-term key is compromised. PFS accomplishes this by enforcing the derivation of a new key for each and every session.

This means that when the private key gets compromised it cannot be used to decrypt recorded SSL traffic.

The cipher suites that provide Perfect Forward Secrecy are those that use an ephemeral form of the Diffie-Hellman key exchange. Their disadvantage is their overhead, which can be improved by using the elliptic curve variants.

The following two ciphersuites are recommended by me, and the latter by the Mozilla Foundation.

The recommended cipher suite:

The recommended cipher suite for backwards compatibility (IE6/WinXP):

If your version of OpenSSL is old, unavailable ciphers will be discarded automatically. Always use the full ciphersuite above and let OpenSSL pick the ones it supports.

The ordering of a ciphersuite is very important because it decides which algorithms are going to be selected in priority. The recommendation above prioritizes algorithms that provide perfect forward secrecy.

Older versions of OpenSSL may not return the full list of algorithms. AES-GCM and some ECDHE are fairly recent, and not present on most versions of OpenSSL shipped with Ubuntu or RHEL.


Learn how to set the correct timezone and synchronize time with NTP servers on your CentOS box.

Setting the timezone
Setting the timezone on CentOS or Redhat Enterprise Linux (RHEL) is easy.

Login as root either locally or remotely via SSH.

See what the current timezone is:

You should see output like this:

Wed Jun 1 10:33:29 PDT 2017
To change the timezone first look at what timezones are available by running the following command on the command line interface:

ls /usr/share/zoneinfo/
You should see a listing like this:

[ ~]# ls /usr/share/zoneinfo
Africa Australia Cuba Etc GMT0 Iceland Japan MST Poland right Universal Zulu
America Brazil EET Europe GMT-0 Indian Kwajalein MST7MDT Portugal ROC US
Antarctica Canada Egypt Factory GMT+0 Iran Libya Navajo posix ROK UTC
Arctic CET Eire GB Greenwich MET NZ posixrules Singapore WET
Asia Chile EST GB-Eire Hongkong Israel Mexico NZ-CHAT PRC Turkey W-SU
Atlantic CST6CDT EST5EDT GMT HST Jamaica Mideast Pacific PST8PDT UCT
Then simply delete the current timezone:

rm /etc/localtime
And replace it with a symbolic link to the new timezone from /usr/share/zoneinfo. For example if your chosen zone is Pacific time:

ln –s /usr/share/zoneinfo/PST8PDT /etc/localtime
Synchronizing time with NTP server
Network Time Protocol (NTP) is a standard way of synchronizing computer clocks across a network. Using NTP you can keep your server’s clock synchronized with super accurate atomic clocks located around the world. Computer clocks tend to “drift” so regularly synchronizing them with NTP servers helps keep them accurate.

The first step is to make sure you have the ntp program installed. Do a:

which ntpdate
If its not available type:

yum install ntp
Once ntp is installed synchronize your computer clock with:

To use this pool zone, add the following to your ntp.conf file:


You are not limited to the above server. There are numerous NTP servers around the world. You can find a complete list at

Also keep in mind that ntp only affects the system time. The hardware clock on your server will not reflect that. So you want to set it as well so that the correct time is maintained after reboot:

hwclock –systohc
To keep your server clock automatically synchronized you can run the ntpd daemon which is installed as part of the ntp package.

Edit the /etc/ntp.conf file to comment out the following lines:

#server # local clock
#fudge stratum 10
The above two lines can sometimes prevent ntpd from properly synchronizing your clock. They are already commented out by default on CentOS/RHEL 6. But on 5.x you have to comment them out manually.

Finally type the following two commands to start the daemon and make it run automatically at boot up:

service ntpd start
chkconfig ntpd on


Install GNOME on CentOS and setup vnc server

# yum -y groupinstall “Desktop” “Desktop Platform” “X Window System” “Fonts”

You can also install the following optional GUI packages.

# yum -y groupinstall “Graphical Administration Tools”
# yum -y groupinstall “Internet Browser”
# yum -y groupinstall “General Purpose Desktop”
# yum -y groupinstall “Office Suite and Productivity”
# yum -y groupinstall “Graphics Creation Tools”
Finally, if you wanted to add the K Desktop Environment (KDE).
# yum -y groupinstall kde-desktop

When using yum groupinstall, the groupinstall option only installs default and mandatory packages from the group. There are times when you also want to include optional packages within a group. I have not figured out (yet) how to control which package types to install (group package “policy”) from the command-line using yum. The only method I know of to also include optional packages is to edit the /etc/yum.conf file and add the following to the [main] section:
group_package_types=default mandatory optional
The reason I mention this is because I wanted to install “Terminal emulator for the X Window System” (xterm) which is under the group “Legacy X Window System compatibility”. xterm happens to be an optional package and did not get installed until I added group_package_types=default mandatory optional to /etc/yum.conf.

# yum -y groupinstall “Legacy X Window System compatibility”

I did find a plug-in for yum that allows users to specify which package types within a package group should be installed when using yum groupinstall.

Enable GNOME

Since the server was previously running on CLI mode, we need to change the initialization process for the machine to boot up in GUI mode.

Open /etc/inittab using a text editor and change following line:

After making the change, reboot the machine.

# init 6
Note that you can switch from GUI to CLI mode manually by using following method:

GUI to CLI: Ctrl + Alt + F6
CLI to GUI: Ctrl + Alt + F1

Installing Additional Applications
After logging in to the GNOME Desktop, you can now go to System > Administration > Add/Remove Software to manage application in CentOS.

After installing gnome packages .Issue the below command to install VNC package along with dependencies

yum -y install tigervnc-server pixman pixman-devel libXfont
Create user name and password.
[ ~]# adduser user1
[ ~]# adduser user2
[ ~]# passwd user1
[ ~]# passwd user2

Create VNC passwords for the Users created.
[ ~]# su – user1
[ ~]$ vncpasswd
[ ~]$ logout
[ ~]# su – user2
[ ~]$ vncpasswd
[ ~]$ logout

Now open /etc/sysconfig/vncservers file and add the following lines at the end of the file( Edit as per your usernames ).
VNCSERVERS=”1:user1 2:user2″
VNCSERVERARGS[1]=”-geometry 1024×768″
VNCSERVERARGS[2]=”-geometry 800×600″

Here we have configured session 1 with 640×480 resolution for the user “user1” and session 2 with 800×600 resolution for the user “user2”.
Start vnc service
[ ~]# service vncserver start

and issue this command to start vnc service automatically during startup.
[ ~]# chkconfig –levels 235 vncsever on

Now in remote machine, start vncviewer type the IP and session as below to view their respective sessions. for user1 for user2

[ ~]# netstat -anlp|grep vnc
tcp 0 0* LISTEN 1374/Xvnc

vnc server
vnc server

» Check the iptables in the server, if you are not able to connect the sessions.
Issue the below command to stop iptables service.
[ ~]# service iptables stop

try again.
» you might receive the below error while starting the vnc service.
/usr/bin/Xvnc: symbol lookup error: /usr/bin/Xvnc: undefined symbol: pixman_composite_trapezoids
/usr/bin/Xvnc: symbol lookup error: /usr/bin/Xvnc: undefined symbol: pixman_composite_trapezoids


Issue the below command to install pixman,pixman-devel and libXfont packages.
[ ~]# yum -y pixman pixman-devel libXfont

This command will update everything .
[ ~]# yum update

and restart the VNC service and try again.

Too many ways to get my external IP address in linux

wget -qO-
lynx -source
wget -O – -q
curl -s
curl -s
nc 23 | grep IPv4 | cut -d’ ‘ -f4
telnet 2>&1 | grep IPv4 | cut -d’ ‘ -f4
echo close | ftp | awk ‘{print $4; exit}’
chmod a+x externalip-benchmark

How to change AdSense ad code support for SSL


If your site can be accessed over HTTPS, then you may need to update older versions of AdSense ad code to avoid the AdSense script being blocked as mixed content. If your AdSense ad code has a script starting with “http://”, then you should update it to “https://” instead:

The HTTPS version of the ad code is also safe for HTTP pages; you don’t need to serve two different versions.

The SSL-compatible ad code also works on HTTP sites and doesn’t change how ads are served on these sites.

How to Compiling and Installing PHP Imagick extension on centos 7

yum install php-pear php-devel
yum install ImageMagick ImageMagick-devel
yum install pcre-devel
tar -xvf imagick-3.2.0RC1.tgz
cd imagick-3.2.0RC1/
make test
make install
Remember to turn on the extension in the php configuration file.

vim /etc/php.ini
extension =


How to Setup vsftp and sftp server on centos 7

FTP server is used to exchange files between computers over network . This guide helps you to setup ftp server on centos 7 . This guide contains configuration steps for both FTP and SFTP as well as user creation . Here i’ve used VSFTP package which is secure and less vulnerable .
1. FTP Server
2. SFTP Server
3. User creation

Step 1 » Update your repository and install VSFTPD package .
[root@krizna ~]# yum check-update
[root@krizna ~]# yum -y install vsftpd

Step 2 » After installation you can find /etc/vsftpd/vsftpd.conf file which is the main configuration file for VSFTP.
Take a backup copy before making changes .
[root@krizna ~]# mv /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.orgNow open the file and make changes as below
[root@krizna ~]# nano /etc/vsftpd/vsftpd.confFind this line anonymous_enable=YES ( Line no : 12 ) and change value to NO to disable anonymous FTP access.
anonymous_enable=NOUncomment the below line ( Line no : 100 ) to restrict users to their home directory.
chroot_local_user=YESand add the below lines at the end of the file to enable passive mode and allow chroot writable.

Step 3 » Now restart vsftpd service and make it start automatically after reboot.
[root@krizna ~]# systemctl restart vsftpd.service
[root@krizna ~]# systemctl enable vsftpd.service

Step 4 » Add FTP service in firewall to allow ftp ports .
[root@krizna ~]# firewall-cmd –permanent –add-service=ftp
[root@krizna ~]# firewall-cmd –reload

Step 5 » Setup SEinux to allow ftp access to the users home directories .
[root@krizna ~]# setsebool -P ftp_home_dir on
Step 6 » Now create an User for ftp access. Here /sbin/nologin shell is used to prevent shell access to the server .
[root@krizna ~]# useradd -m dave -s /sbin/nologin
[root@krizna ~]# passwd dave
Now user dave can able to login ftp on port 21 .
You can filezilla or winscp client for accessing files.

SFTP server

SFTP ( Secure File Transfer Protocol ) is used to encrypt connections between clients and the FTP server. It is highly recommended to use SFTP because data is transferred over encrypted connection using SSH-tunnel on port 22 .
Basically we need openssh-server package to enable SFTP .
Install openssh-server package, if its not already installed.
[root@krizna ~]# yum -y install openssh-server
Step 7 » Create a separate group for FTP access.
[root@krizna ~]# groupadd ftpaccess
Step 8 » Now open /etc/ssh/sshd_config file and make changes as below.
Find and comment the below line ( Line no : 147 ).
#Subsystem sftp /usr/libexec/openssh/sftp-serverand add these lines below.
Subsystem sftp internal-sftp
Match group ftpaccess
ChrootDirectory %h
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp

Step 9 » Now restart sshd service.
[root@krizna ~]# systemctl restart sshdNow your SFTP server is configured and ready .

User creation

Step 10 » Create user jack with /sbin/nologin shell and ftpaccess group
[root@krizna ~]# useradd -m jack -s /sbin/nologin -g ftpaccess
[root@krizna ~]# passwd jack
Now assign root ownership for the home directory for chroot access and modify permission.
[root@krizna ~]# chown root /home/jack
[root@krizna ~]# chmod 750 /home/jack
Create a directory www inside home directory for writing and modify ownership .
[root@krizna ~]# mkdir /home/jack/www
[root@krizna ~]# chown jack:ftpaccess /home/jack/www

Now jack can use both ftp and sftp services . He can upload files in www directory .

If you are going to use FTP and SFTP together in the same server, you should follow above steps while creating users . For existing users add them to ftpaccess and make below changes.
[root@krizna ~]# usermod dave -g ftpaccess
[root@krizna ~]# chown root /home/dave
[root@krizna ~]# chmod 750 /home/dave
[root@krizna ~]# mkdir /home/dave/www
[root@krizna ~]# chown dave:ftpaccess /home/dave/www

Most commonly used Systemctl command to Manage Systemd Services and Units on centos 7

In this guide, we will be discussing the systemctl command, which is the central management tool for controlling the init system. We will cover how to manage services, check statuses, change system states, and work with the configuration files.Due to its heavy adoption, familiarizing yourself with systemd is well worth the trouble, as it will make administrating these servers considerably easier. Learning about and utilizing the tools and daemons that comprise systemd will help you better appreciate the power, flexibility, and capabilities it provides, or at least help you to do your job with minimal hassle.Systemd is an init system and system manager that is widely becoming the new standard for Linux machines. While there are considerable opinions about whether systemd is an improvement over the traditional SysV init systems it is replacing, the majority of distributions plan to adopt it or have already done so.


Service Management
The fundamental purpose of an init system is to initialize the components that must be started after the Linux kernel is booted (traditionally known as “userland” components). The init system is also used to manage services and daemons for the server at any point while the system is running. With that in mind, we will start with some simple service management operations.

In systemd, the target of most actions are “units”, which are resources that systemd knows how to manage. Units are categorized by the type of resource they represent and they are defined with files known as unit files. The type of each unit can be inferred from the suffix on the end of the file.

For service management tasks, the target unit will be service units, which have unit files with a suffix of .service. However, for most service management commands, you can actually leave off the .service suffix, as systemd is smart enough to know that you probably want to operate on a service when using service management commands.

Starting and Stopping Services

To start a systemd service, executing instructions in the service’s unit file, use the start command. If you are running as a non-root user, you will have to use since this will affect the state of the operating system:

systemctl start application.service

As we mentioned above, systemd knows to look for *.service files for service management commands, so the command could just as easily be typed like this:

systemctl start application

Although you may use the above format for general administration, for clarity, we will use the .service suffix for the remainder of the commands to be explicit about the target we are operating on.

To stop a currently running service, you can use the stop command instead:

systemctl stop application.service

Restarting and Reloading

To restart a running service, you can use the restart command:

systemctl restart application.service

If the application in question is able to reload its configuration files (without restarting), you can issue the reload command to initiate that process:

systemctl reload application.service

If you are unsure whether the service has the functionality to reload its configuration, you can issue the reload-or-restart command. This will reload the configuration in-place if available. Otherwise, it will restart the service so the new configuration is picked up:

systemctl reload-or-restart application.service

Enabling and Disabling Services

The above commands are useful for starting or stopping commands during the current session. To tell systemd to start services automatically at boot, you must enable them.

To start a service at boot, use the enable command:

systemctl enable application.service

This will create a symbolic link from the system’s copy of the service file (usually in /lib/systemd/system or /etc/systemd/system) into the location on disk where systemd looks for autostart files (usually /etc/systemd/system/ We will go over what a target is later in this guide).

To disable the service from starting automatically, you can type:

systemctl disable application.service

This will remove the symbolic link that indicated that the service should be started automatically.

Keep in mind that enabling a service does not start it in the current session. If you wish to start the service and enable it at boot, you will have to issue both the start and enable commands.