Useful Tricks and Tips ( Know-How )

Disable IPv6 on Linux

Here’s how to disable the protocol on a Red Hat-based system:

Open a terminal window.
Change to the root user.
Issue the command sysctl -w net.ipv6.conf.all.disable_ipv6=1
Issue the command sysctl -w net.ipv6.conf.default.disable_ipv6=1

To re-enable IPv6, issue the following commands:

sysctl -w net.ipv6.conf.all.disable_ipv6=0
sysctl -w net.ipv6.conf.default.disable_ipv6=0

Here’s how to disable the protocol on a Debian-based machine.

  • Open a terminal window.
  • Issue the command sudo nano /etc/sysctl.conf
  • Add the following at the bottom of the file:

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

  • Save and close the file.

Hide Apache Version Number and Other Sensitive Info

To hide web server version number, server operating system details, installed Apache modules and more, open your Apache web server configuration file using your favorite editor:

$ sudo vi /etc/apache2/apache2.conf        #Debian/Ubuntu systems 
$ sudo vi /etc/httpd/conf/httpd.conf #RHEL/CentOS systems

And add/modify/append the lines below:

ServerTokens Prod 
ServerSignature Off

Disable Directory Browsing in Apache

Create a .htaccess file with the following:

Options -Indexes

Next Idea, If you are using Debian/Ubuntu, edit the file /etc/apache2/apache2.conf with

Remove Indexes Option
Remove Indexes Option

Install SSL certificates to the JRE Keystore

Copy the public key to any available location. Start cmd as administrator and goto JRE Home.

Point to bin folder and execute following command : ( change path according to your environment)

keytool -import -file "C:\MY-KEYS\KEYS\server.crt" -keystore "C:\XXXXXXXX\JAVA\jre1.8.0_191\lib\security\cacerts" -storepass "changeit"  
Importing SSL certificate to the JRE Keystore

http to https apache redirection

<VirtualHost *:80>
   ServerName mysite.example.com
   DocumentRoot /usr/local/apache2/htdocs 
   Redirect permanent / https://mysite.example.com/
</VirtualHost>

Run Powershell script using schedule job in Windows OS

Running Powershell Script

Add arguments: -ExecutionPolicy Bypass C:\Script.ps1 -RunType $true -Path %temp%


Activate IP-Forwarding on the physical server for a specific network interface

Launch Powershell as administrator and type

netsh
 
interface ipv4


show interfaces

This command will display the list of network cards, loopback cards and virtual switches configured on your server.

Display the details of the network interface of your choice :

show interface <Idx>
Windows-2012-ipforward-disabled.jpeg
Port Forwarding disabled

To activate the “IP Forwarding” option for the interface with the ID “Idx = 19”, run the command:

 set interface 19 forwarding="enabled"

After that create rules for port forwarding.

Nesh int ipv4 install
Port Forwarding

Where, 10.0.1.192 is the destination server.

Verify the configuration using:

netsh interface portproxy show all

Change Desktop Background Info

SQL SERVER – How to Change Server Name?

/* Execute below to drop the current server name */ 
exec sp_dropserver 'oldservername'
/* Execute below to add a new server name. Make sure local is specified. */
exec sp_addserver'newservername', 'local'

/* Restart SQL Services. */
/* Verify the new name using: */
select @@SERVERNAME

Download VM from ESXi using VMWare Workstation

If you are getting error using VMware Convertor to download the VM from ESxi server, it is better to use VMWare Workstation.

Login to the ESxi Server using VMWare workstation and choose the VM to download.

Connect to the Server
Download VM

Find which actual application uses port 80 via the Command line

netstat -anbo | findstr :80

Sourcetree Installation : validate credentials Error

Solution: https://community.atlassian.com/t5/Sourcetree-questions/Getting-this-error-quot-Something-went-wrong-while-attempting-to/qaq-p/805220

Solving Credential error in Sourcetree

Check what services are running by default on the Linux Server

netstat -tulpn
lsof -i 

Get a list of all started services ( Linux Server )

service --status-all
systemctl list-unit-files
mm

Anup Chhetri

IT system administrator

You may also like...

error: Content is protected !!