Mount windows share in Linux (fstab)

ubuntu10

This works on any modern distribution of Linux, but we are using Ubuntu 14.04 for the process. First, install CIFS/Samba tools, required to mount the share point:

In Ubuntu:

apt-get install cifs-utils

Now let's create the credentials file:

Add a software raid to Linux

linux-icon-19This tutorial is for adding extra disks to an already existing system, not conerting current ones to RAID. We are adding a RAID1 software RAID to most common Linux distributions (this should work on any one of them).

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

Unmount a drive when it is busy

There are some circumstances where you have to unmount a drive, but it is not letting you. Giving an error, similar to this:

umount: /mnt/backup: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))

Reserve IP in OpenVPN

openvpn-logo-300x300The IPs in the VPN are assigned randomly. If you have your router configured using something like Tomato, you can setup the reservation by MAC address. For the linux-based install, follow these steps:

1) To begin, first identify the directory, where the files will be stored:

403 Forbidden after changing DocumentRoot directory

apache server

Q. I am getting a Forbidden 403 error after I've changed the DocumentRoot in Apache for my domain. What do I do?

A. This is a security feature on the Apache running on Ubuntu (and Debian). The solution is quite simple:

Bash: determine if the week is odd or even

bash

Here's a quick way to determine if the week is odd or even in bash. You can replace the "even" and "odd" with whatever functions you are looking to perform (eg. backup)

Copy and paste this into a file:

Setup VNC in Ubuntu

vnc iconYou have a server, but want to setup VNC to access the GUI? This tutorial will help with that. 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

CentOS 7 Linux - missing ifconfig

centosThe widely used ifconfig is missing from Centos 7.X version of Linux with minimal install. To get it back, run the following command:

yum installnet-tools

The command will then be available as usual.

If you don't want to use ifconfig and are wondering how else you can find the IP address, you can run this command:

ip link

Generate CSR (Certificate Signing Request for SSL)

sslThese are instructions for generating the CSR (Certificate Signing Request) for Apache 2.

Steps:

1) Log in to your server's terminal (SSH).

2) Type:

openssl req -new -newkey rsa:2048 -nodes -keyout domainname.key -out domainname.csr