Setting up email routing to gmail / google apps via ISPConfig 3

The following guide describes the steps to add DNS records that route emails from a domain managed in ISPConfig 3 to google apps / gmail. The guide assumes that you have already setup the dns zone for your domain in ispconfig.

Login to ISPConfig, click on the DNS module icon in the upper navigation bar, then open the settings of the DNS zone that you want to redirect to google and click on the "records" tab. You should see a record list similar to this:

Now Delete the existing MX record and the "mail" A-Record. Then add the following new records:

CNAME Record:

Hostname: mail
Target: ghs.google.com.

MX Records:

example.com. ASPMX.L.GOOGLE.COM. 10
example.com. ALT1.ASPMX.L.GOOGLE.COM. 20
example.com. ALT2.ASPMX.L.GOOGLE.COM. 30
example.com. ASPMX2.GOOGLEMAIL.COM. 40
example.com. ASPMX3.GOOGLEMAIL.COM. 50

IMPORTANT: All full domain names like "ghs.google.com." have to end with a dot, if the dot is missing, the name is treated as subdomain of the zone.

The resulting record list should look like this:

Reorder accounts in Thunderbird (Windows)

There's one important feature missing in Thunderbird that you will need when working with many different accounts, that is, reordering them. You won't find any option for this in the settings, nor is there any obvious way. The only one I found involved editing the prefs.js file (close Thunderbird while doing so!), that is located in C:\Users\user-name\AppData\Roaming\Thunderbird\Profiles\[profile-name]:

Some people suggest changing the order of the user_pref("mail.accountmanager.accounts") parameter but this did nothing for me. What worked instead was setting the user_pref("mail.accountmanager.defaultaccount", "accountx") parameter.

Setting it will put one account at the top of the list - by repeating this process, you can order your accounts the way you want it! Just replace the number of the account (marked with x in the text above) with the one you want top.

Activate the title bar in Mozilla Thunderbird 17 again

Starting with the Mozilla Thunderbird 17, the classic title bar has been hidden in Thunderbird. To get the classic title bar back, follow these steps:

  1. Start Mozilla Thunderbird.
  2. Open the config editor by clicking on Tools -> Options -> Advanced -> General -> Config Editor (button)
  3. Navigate to the setting "mail.tabs.drawInTitlebar" in the config editor and set it to "false" by double clicking on the line.
  4. Close the config editor and restart Thunderbird

 

Click on

 

Rotating screen in Ubuntu and Linux Mint

Just as in Windows you have the option to rotate your screen into any direction in Linux, too. While in Windows you only need to press some keys, a key combination is not configured in Linux by default. But as you may have figured out, there are some terminal commands that let you do the exact same thing (you can configure shortcuts for these manually later on).

First, you need to find out how the screen that you want to rotate is labeled - to do that, use the following command:

xrandr -q

Screen 0: minimum 320 x 200, current 1366 x 768, maximum 8192 x 8192
LVDS1 connected 1366x768+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
1366x768 60.1*+
1360x768 59.8 60.0
1024x768 60.0
800x600 60.3 56.2
640x480 59.9
VGA2 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
DP1 disconnected (normal left inverted right x axis y axis)

You will get a list of connected monitors - I have only one here which is labeled LVDS1, it says connected next to the name. Determine the one that you want to rotate here. Next, we want to turn it around. For that, we use one of the following commands:

xrandr --output LVDS1 --rotate right
xrandr --output LVDS1 --rotate left
xrandr --output LVDS1 --rotate inverted
xrandr --output LVDS1 --rotate normal

Replace LVDS1 with your monitor label in the above commands and you'll be able to rotate the screen to your likings! This is especially helpful if you need to go through documents and can turn your physical monitor around.

Change screen orientation in Windows

In the age of widescreens, Windows offers a really helpful function for viewing documents, or just play pranks on your friends. With a simple key-combination, you can rotate your screen into any direction - flip it upside-down, or lay it on the side:

To rotate the screen, press Ctrl + Alt + Arrow key. The arrow you press determines what direction the screen will be turned. This feature is useful especially if you can set your screen resolution to fill the screen while it lies on the side - flip your monitor on the side afterwards and you've got the perfect size and resolution for viewing documents.

Copy files on Linux shell that have been modified or added within the last X minutes

Here is a short script that helped me to copy files that have ben modified within the last 60 minutes to a new directory. The script uses a combination of the find and cp commands, it has to be run inside the directory that contains the new files.  In this example, I will copy all files that have been modified within the last 60 minutes from /var/www to the directory /var/newfiles, you can replace the timespan or target directory in the script to match your reqzúirements.

First, enter the /var/www directory which contains the files:

cd /var/www

Then execute this command to find the latest files and copy them to /var/newfiles:

find ./ -type f -mmin -60  -exec cp -pf {} /var/newfiles/ \;

 

 

Remember screen brightness settings in Ubuntu and Linux Mint

Screen brightness is an attribute that is reset automatically upon rebooting your machine on Ubuntu and all its fellow distributions. Lucky you if you find the settings okay, but on notebooks and similar machines, you might want to lower the brightness, you it doesn't suck your batteries dry.

To do that, open the following file as root via terminal:

sudo gedit /etc/rc.local

In there, enter the following line somewhere before the very last one that says "exit 0":

echo 0 > /sys/class/backlight/acpi_video0/brightness

0 is the lowest brightness setting. You can adjust it to your likings!

Read ext4 partitions from Windows 7

Linux partitions are usually not visible under Windows operating systems. While it's not recommended to write on a Linux partition from Windows, you can read files from there without too much of a great danger. However, a tool is needed for that - an example for that is DiskInternals Linux Reader.

You can download the reader at DiskInternals' homepage: http://www.diskinternals.com/linux-reader/

To browse the files on the Linux filesystems, you need to install the application and browse them through it - they're not shown in the Windows explorer as the other hard disks and partitions are. Download the application and follow the installer to correctly install it. You'll find an overview of all the available file systems listed:

To read or save files to a Windows system, just double- or right-click the item and select the appropriate action!

Add places icons to the desktop in Linux Mint 13 (Cinnamon)

After installing Linux Mint 13 on your machine for the first time, you will only have few to no icons on the desktop by default. This makes accessing important files fast a chore. However, you can change this just like in the present versions of MS Windows.

To do so, go to Menu > Preferences > Cinnamon Settings > Desktop.

Here, tick all the boxes whose items you want to have on the desktop and close the preferences window again. If you want to remove them again, just repeat the process and untick the boxes again.

Install BIND nameserver in a chroot on Debian 6

This tutorial is about chrooting a BIND (named) installation on Debian 6. Chrooting is used for security reasons, in case that BIND gets hacked on the server, the hacker is jailed into the chroot and can not get access to other services.

 

Installation

 

apt-get install bind9

to install BIND9.

For security reasons we want to run BIND chrooted so we have to do the following steps:

/etc/init.d/bind9 stop

Edit the file /etc/default/bind9 so that the daemon will run as the unprivileged user bind, chrooted to /var/lib/named. Modify the line: OPTIONS="-u bind" so that it reads OPTIONS="-u bind -t /var/lib/named":

vi /etc/default/bind9

# run resolvconf?
RESOLVCONF=yes

# startup options for the server
OPTIONS="-u bind -t /var/lib/named"
Create the necessary directories under /var/lib:

mkdir -p /var/lib/named/etc
mkdir /var/lib/named/dev
mkdir -p /var/lib/named/var/cache/bind
mkdir -p /var/lib/named/var/run/bind/run

Then move the config directory from /etc to /var/lib/named/etc:

mv /etc/bind /var/lib/named/etc

Create a symlink to the new config directory from the old location (to avoid problems when BIND gets updated in the future):

ln -s /var/lib/named/etc/bind /etc/bind

Make null and random devices, and fix permissions of the directories:

mknod /var/lib/named/dev/null c 1 3
mknod /var/lib/named/dev/random c 1 8
chmod 666 /var/lib/named/dev/null /var/lib/named/dev/random
chown -R bind:bind /var/lib/named/var/*
chown -R bind:bind /var/lib/named/etc/bind

We need to create the file /etc/rsyslog.d/bind-chroot.conf...

vi /etc/rsyslog.d/bind-chroot.conf

... with the following line so that we can still get important messages logged to the system logs:

$AddUnixListenSocket /var/lib/named/dev/log

Restart the logging daemon:

/etc/init.d/rsyslog restart

Start up BIND, and check /var/log/syslog for errors:

/etc/init.d/bind9 start

Thanks to Falko Timme from Howtoforge.com for this tutorial.