Canada  united states of america usa  linkedinfacebook   Call Us Today: 866.646.6461

linux iconThis is a nice little command to search and replace one type of content with another. It recursively parses through directories and files.

Be very careful when running this command, because it can do a lot of damage

Below is an example of replacing all "http" with "https" inside a directory /var/www:

postfix-emailSometimes we have emails going to a particular address, which cannot be stopped. There are many reasons, but most common is an invalid address, which pollutes the mail queue with invalid entries. The simplest way to solve this is by adding a DISCARD directive for postfix. 

If you don't have it already, add this line in main.cf

header_checks = regexp:/etc/postfix/header_checks

Let's say you've gotten a bigger disk (or just resized a VM partition) and now would like to use the extra space. Since for this example we are using LVM, the resizing has to be done using the following steps:

Assuming you want to use all of the free space, let's see what we got: 50Gb before resize

FFmpegThere are many tools, including free ones that allow for video conversion, however, many of them use GUIs and don't allow for automation of tasks. FFmpeg is a command line based tools which allows to do very neat video manipulations.

We would like to share this small script, which our IT specialists have used for one of our video conversion projects. It parses a directory, finds all flv (Flash video) files and converts them to mp4. This script can be added to a cronjob to run on a scheduled basis. Converted videos can be moved elsewhere upon completion. 

As mentioned, we've used ffmpeg to accomplish this task, running under Ubuntu 14.04. FFmpeg doesn't come with Ubuntu 14.04 and a package repository needs to be added manually first. 

ubuntu10The network configuration has changed in Ubuntu 18 from all the previous versions. The new version uses Netplan and it is somewhat harder if you don't know yaml. The discussion for pros and cons of this move by Ubuntu can be infinite (why change what's working; this is a tool, I don't want to learn the new ways, etc.), but this is a quick tutorial for quickly changing the IP address. (There's more information available on Netplan)

The network configuration files are located in /etc/netplan. Configuration file can be opened as below:

vim /etc/netplan/50-cloud-init.yaml

With comments removed, this is the configuration data for a simple DHCP setup:

linux iconThis is an issue that we, as an IT services company, run into quite frequently. If you are unlucky enough to have a software raid running on your Linux server, you've probably noticed the occasional slowing down of the system. This is because of periodic redundancy checks of MD devices.

It is a cronjob that runs weekly and scans the MD devices for consistency. This can have a serious effect on the system, especially if you are running IO intensive applications, such as virtual machines. (Microsoft Exchange or SQL, for example). 

One way to solve this problem is to lower the dev.raid.speed_limit_max. By default, it is set to this:

One of our IT Support clients asked us why some emails are coming in with extra HTML content. After some searching, we've discovered that is was due to the MailScanner antispam system: it was parsing emails improperly and adding extra junk characters. We have decided to solve this by skipping the email from that domain from being scanned altogether.

One way to do so is to change the Scan Messages directive in MailScanner.conf from:

Scan Messages = yes

to

Scan Messages = %rules-dir%/scan.messages.rules

Then, in your rules directory, create a file called scan.messages.rules. In that file, be sure to add the line for scanning all by default:

vnc iconYou have a server, but want to setup VNC to access the GUI? We use this tutorial for our systems and wanted to share. (ALT is an IT consulting company, offering technical support for Mac, PC and Linux systems). We try to keep things updated, but tutorials have a tendency of exiring, so some steps may be different for newer versions. We've used Ubuntu 16.04 to install, but it should work with others as well.

Install the components

apt-get -y install ubuntu-desktop tightvncserver xfce4 xfce4-goodies autocutsel

Add the vnc user and give it a password:

adduser vnc
passwd vnc

You can add vnc as sudo, so you could run apps as root. Edit the sudoers file:

echo "vnc ALL=(ALL)       ALL" >> /etc/sudoers

linux-icon-19 We have added this tutorial, because we use it very often ourselves. (ALT is an IT consulting company, providing support for Apple, Windows and Linux based systems and servers.) It describes steps for adding extra disks to an already existing system, not converting current ones to RAID (the disks will be wiped, so don't do it on the OS partition!) We are adding a RAID1 software RAID to most common Linux distributions (the setps should work on any one of them).

We have used 2 disks for this:
/dev/sdb: 500.1
/dev/sdc 500.1

Last updated Apr 15, 2024