ClamAV Anti-Virus and ClamTK on Ubuntu

In general, you don’t need an anti-virus software for Linux operating system such as Ubuntu. But for some reasons you might want a virus scanner on your Linux PC. One of the most popular ones is the ClamAV anti-virus. ClamAV Anti-virus is an open source antivirus software engine for detecting trojans, viruses, malware & other malicious threats.

Official project website: https://www.clamav.net/

Installing ClamAV Anti-Virus

Here is how you can install it on your Ubuntu PC:

  1. Open Terminal
  2. Enter command:
    sudo apt-get install clamav
  3. Enter your administrator password to continue installation

Using ClamAV from Terminal

By default, updating the virus definition is handled by daemon at a regular interval. But if you need to update the virus definition manually, we need to stop the daemon first and run the update command:
sudo /etc/init.d/clamav-freshclam stop
sudo freshclam
sudo /etc/init.d/clamav-freshclam start

To scan for viruses, the command syntax: clamscan OPTIONS File/Folder

If necessary, start the scan with root permissions: sudo clamscan OPTIONS File/Folder

Below is the examples you can use with ClamAV antivirus in Terminal:

  • The scan all files on your Ubuntu PC
    clamscan -r /
  • To scan all files, but only display infected files and ring a bell when found:
    clamscan -r --bell -i /
  • To scan files in the all users home directories:
    clamscan -r /home
  • To scan files in the USER home directory and move infected files to another folder:
    clamscan -r --move=/home/USER/VIRUS /home/USER
  • To scan files in the USER home directory and immediately remove infected files (WARNINGS: files are deleted permanently)
    clamscan -r --remove /home/USER
  • To see more clamscan options:
    clamscan --help

Installing ClamTK

clamtk

ClamTK is a graphical front-end for ClamAV. It is designed to be an easy-to-use, lightweight and on-demand antivirus scanner for Linux systems.

Official project website: https://dave-theunsub.github.io/clamtk/

How to install it:

  1. Open Terminal
  2. Enter command:
    sudo apt-get install clamtk
  3. Enter your administrator password to continue installation

Apache 2 Installation & Setup

How to Install Apache 2 on Ubuntu Linux

Here is the commands to run in Terminal to install Apache2 on Ubuntu Linux:

To see available service commands:

 

Fix TTF and WOFF @font-face 404 Not Found Errors

If you are experiencing TTF and/or WOFF web fonts or @font-face throwing 404 Not Found errors when running a web application on Windows Server with IIS 6 or 7. You can see the warnings in Chrome or using Firefox Firebug add-on. You can fix it by adding TTF and WOFF MIME types in IIS. To do that follow this easy step:

Option 1: Add MIME Types using IIS Manager

  1. Start IIS Manager in your Windows Server (or Windows 7/8/10)
  2. Go to root node (browse to your website if you want this change only to apply to specific website)
  3. In the middle pane, under IIS section, open MIME Types feature/module
    Fix TFF and WOFF @font-face 404 Not Found Errors - Open MIME Types in IIS 1
  4. On the right sidebar, click Add… action and enter:
    Fix TFF and WOFF @font-face 404 Not Found Errors - Add MIME Type

    • For TTF, File name extension: ttf, MIME type: application/x-font-ttf
    • For WOFF, File name extension: woff, MIME type: application/x-font-woff
    • For WOFF2, File name extension: woff2, MIME type: application/x-font-woff2
  5. Click OK button and this issue should have been solved
  6. Refresh your website and you should no longer see 404 Not Found errors
  7. In case the errors still there, check if the actual font files are available

Note: Chrome may continue showing warnings if you enter application/x-woff instead of application/x-font-woff MIME type.

Option 2: Add the MIME Types in Web.config

  1. Open Web.config file usually resides in your website root folder
  2. Under system.webServer/staticContent nodes, change or add the following codes:
  3. Save and refresh your website and see the issues have been resolved
  4. But if the problem is not resolved, you may need to add the following security section as well under system.webServer node:

Disable Strong Password Enforcement & Password Aging in Windows Server

Microsoft Windows Server 2008 (R2) by default enforces Administrator users to use strong passwords. Normal home users usually do not need this password complexity policy when creating a password and using Windows. For whatever reasons, here are the steps to disable this password complexity requirements:

  1. From Start menu, click Run, enter gpedit.msc and press Enter or click OK button. In the Local Group Policy Editor window, expand Computer Configuration, then Windows Settings, then Security Settings, then Account Policies, and then finally click Password Policy.
    Windows Server 2008 Open Local Group Policy Editor
  2. In the right pane, open by double clicking Password must meet complexity requirements and choose Disable. Click OK button to save the change. The system will no longer force you to use strong passwords and you can even use blank password.
    Windows Server 2008 Disable Strong Password Policy 1
    Windows Server 2008 Disable Strong Password Policy 2
  3. Optionally, you can choose to have a never expired passwords. To do this, with the Local Group Policy Editor window still open, in the right pane, open Maximum password age policy and set the value to 0 days. Click OK button to save the policy change.
    Windows Server 2008 Disable Password Aging

Install & Configure OpenSSH on Ubuntu

Install and Enable OpenSSH Server on Ubuntu Linux

Open Terminal and enter the following commands:

Stop, Start and Restart OpenSSH service, Status and Reload

Open Config File and Change SSH Server Port Number

Change port 22 to different port number.

Optionally, For improved security:

  1. Find and change PermitRootLogin from yes to no
  2. At the end of the config file, add the following lines:
    UseDNS no
    AllowUsers [username]

    After reload, only above users can connect to the SSH server
  3. Save, close and reload SSH service

How to use SSH to connect to a remote server

And enter password. To quit from the connected session:

Reset Column Identity in SQL Server

There are 2 ways to reset column identity in SQL Server:

  1. Using DBCC CHECKIDENT. Executing below statement in Management Studio will reset the identity column value for the Customer table to 0 so that next new record start at 1.
  2. Using TRUNCATE TABLE statement.
    TRUNCATE TABLE removes all rows from a table or specified partitions of a table, without logging the individual row deletions. TRUNCATE TABLE is similar to the DELETE statement with no WHERE clause; however, TRUNCATE TABLE is faster and uses fewer system and transaction log resources.

Stop and Start (Restart) IIS Application Pool from Command Prompt

Below is the command that you can use to stop and start IIS Application Pool from Command Prompt console.

To stop:

C:\Windows\System32\inetsrv\appcmd.exe stop apppool /apppool.name:"ASP.NET v4.0"

To start:

C:\Windows\System32\inetsrv\appcmd.exe start apppool /apppool.name:"ASP.NET v4.0"

T-SQL Quick Tutorial

This is a very quick T-SQL tutorial to get you up and running quickly as a beginner.

Creating Database and Working with Tables

Contraints

Stored Procedures