Linux

Delete All base on filename extension in folder and subfolders

Using Terminal and Find command. find . -iname ‘*.jpg’ -type f -exec…

Using Terminal and Find command.

find . -iname '*.jpg' -type f -exec rm -f {} \;

This command starts in the current directory, recursing through the entire subtree, looking for files only that end with ‘.jpg’. It will delete any such files.

find – the find program
. – search the subtree starting in the current directory
-iname ‘*.jpg’ – find all elements that match the shell pattern ‘*.jpg’. This should be done case-INsensitively
-type f – only match files
-exec rm -f {} \; – execute the command “rm -f {}” for each matched file, where ‘{}’ is replaced with the name of the matched file.

Also adding an -delete it should do the same.

find /yourdirectory -iname '*.jpg' -delete

Linux Malware Detect

Installing Linux Malware Detect on CentOS 6

I’m going to show you in few step how to install the…

I’m going to show you in few step how to install the LMD on your linux server.

What is Malware? well, Malware is short for malicious software, such as a virus, which is specifically designed to disrupt or damage your computer system.

What is LMD? Linux Malware Detect (LMD) is an open-source malware scanner that runs under various flavours of Linux, distributed under the GPL2 license.

Downloading LMD:

You can either use your user home directory or tmp folder for installation files.

cd ~

wget http://www.rfxn.com/downloads/maldetect-current.tar.gz

Installing LMD

tar xfz maldetect-current.tar.gz

cd maldetect-*

./install.sh

The first command unpacks the archive.  The second changes the folder to the unpacked archive and the third command runs the install script. You may come across a “permission denied” message when running the install script. If this happens do the following

Postfix Mail

How to send mails in POSTFIX through external SMTP

This short guide shows how you can set up Postfix to relay…

Postfix Mail
Postfix Mail

This short guide shows how you can set up Postfix to relay emails through another mailserver. This can be useful if you run a Postfix mailserver in your local network and have a dynamic IP address because most dynamic IP addresses are blacklisted today. By relaying your emails through another mailserver that is hosted on a static IP address in a data center (e.g. your ISP’s mailserver) you can prevent your emails from being categorized as spam.

First step, you will need to make changes in your configuration file (in standard postfix configuration it would be /etc/postfix/main.cf). You need to add at the end of configuration file following lines:

I’m going to use Nano editor to edit my configuration file.

nano /etc/postfix/main.cf

Configuration

UFW - Uncomplicated Firewall

UFW – Uncomplicated Firewall

The default firewall configuration tool for Ubuntu is ufw. Developed to ease…

The default firewall configuration tool for Ubuntu is ufw. Developed to ease iptables firewall configuration, ufw provides a user friendly way to create an IPv4 or IPv6 host-based firewall. By default UFW is disabled.

Gufw is a GUI that is available as a frontend.

Basic Syntax and Examples

Default rules are fine for the average home user

When you turn UFW on, it uses a default set of rules (profile) that should be fine for the average home user. That’s at least the goal of the Ubuntu developers. In short, all ‘incoming’ is being denied, with some exceptions to make things easier for home users.

Enable and Disable

Enable UFW

To turn UFW on with the default set of rules:

sudo ufw enable

To check the status of UFW:

sudo ufw status verbose

The output should be like this:

How To: PPTP VPN on Ubuntu 12.04 (pptpd)

PPTP VPN on Ubuntu 12.04 (pptpd)

Install Software sudo apt-get install pptpd ufw Allow Ports 22 and 1723…

Install Software
sudo apt-get install pptpd ufw

Allow Ports 22 and 1723 on UFW and Enable UFW
Warning: if you are connected to SSH on a port other than 22, please adjust the first command accordingly so you don’t get kicked off.

sudo ufw allow 22
sudo ufw allow 1723
sudo ufw enable

Edit /etc/ppp/pptpd-options
use your favourite editor in this case I use “sudo nano /etc/ppp/pptpd-options” and make sure you have the following parameters for encryption.

refuse-pap
refuse-chap
refuse-mschap
require-mschap-v2
require-mppe-128

Server

How to Use the vi Editor

This help note explains the basics of vi: opening and closing a…

This help note explains the basics of vi:

  • opening and closing a file
  • moving around in a file
  • elementary editing

vi has many other commands and options not described here. The following resources can help you get started using the vi editor, and are available at the UW University Book Store:

  • “vi Tutorial.” Specialized Systems Consultants (SSC).
  • “vi Reference.” Specialized Systems Consultants (SSC).
  • “Learning the vi Editor.” Linda Lamb, 1990.

Starting vi

You may use vi to open an already existing file by typing

      vi filename

where “filename” is the name of the existing file. If the file is not in your current directory, you must use the full pathname.

Or you may create a new file by typing

      vi newname

where “newname” is the name you wish to give the new file.

How to Set Up vsftpd on Ubuntu 12.04

How to Set Up vsftpd on Ubuntu 12.04

About vsftpd The first two letters of vsftpd stand for “very secure”…

How to Set Up vsftpd on Ubuntu 12.04
How to Set Up vsftpd on Ubuntu 12.04

About vsftpd

The first two letters of vsftpd stand for “very secure” and the program was built to have strongest protection against possible FTP vulnerabilities.

Step One – Install vsftpd

You can quickly install vsftpd on your server in the command line:

sudo apt-get install vsftpd
Once the file finishes downloading, the VSFTP will be on your server. Generally speaking, it is already configured with a reasonable amount of security. However, it does provide access on your Server to anonymous users.

Step Two – Configure vsftpd

Once vsftpd is installed, you can adjust the configuration.

Open up the configuration file:

sudo nano /etc/vsftpd.conf
The biggest change you need to make is to switch the Anonymous_enable from YES to NO:

anonymous_enable=NO

How to Create a SSL Certificate on Apache for Ubuntu 12.04

How to Create a SSL Certificate on Apache for Ubuntu 12.04

About SSL Certificates A SSL certificate is a way to encrypt a…

How to Create a SSL Certificate on Apache for Ubuntu 12.04
How to Create a SSL Certificate on Apache for Ubuntu 12.04

About SSL Certificates

A SSL certificate is a way to encrypt a site’s information and create a more secure connection. Additionally, the certificate can show the server’s identification information to site visitors. Certificate Authorities can issue SSL certificates that verify the server’s details while a self-signed certificate has no 3rd party corroboration.

What the Red Means

The lines that the user needs to enter or customize will be in red in this tutorial!

The rest should mostly be copy-and-pastable.

Set Up

The steps in this tutorial require the user to have root privileges on the server.

Additionally, you need to have apache already installed and running on your server.
If this is not the case, you can download it with this command:

sudo apt-get install apache2