Debian 8 - Install & Monitor EATON UPS

dropcap debian eaton

Because of this sumer heat wave, I finally decided to install an Uninterrupted Power Supply for my debian server.

So I decided to buy a Eaton 3S550 UPS. This small UPS is designed like a big strip, it handles 550 VA and it provides a USB connection.

Thanks to Network UPS Tools, this UPS is very easy to manage when connected to a Debian server.

Installation procedure in a non GUI environment is quite simple, but it involves a certain number of steps that should be carefully followed.

So, this article explains a step-by-step installation procedure of a Eaton UPS connected to a Debian Jessie headless server. If followed carefully, you should get your UPS fully integrated to your server, with an automatic shutdown when your UPS battery is becoming too low during a power cut.

This procedure should be applicable to any Ubuntu or Debian-based server.

Read more: Debian 8 - Install & Monitor EATON UPS

Debian - Self-hosted Web File Transfer with FileZ

Debian

debian-filez-logoFileZ is a Web file transfer project started by French university of Avignon.

It provides a simple and efficient way to upload and manage very big files that you want to share over internet. Everything is stored on your web server and handled through a web interface and some unique URLs.

University of Avignon has stopped to maintain the project, but it is still maintained by a small core team under Github repository https://github.com/FileZ/FileZ.

FileZ main features are :

  • handling of files up to 2 Gb
  • generation of short URL to retrieve these files
  • multiple users management with quotas
  • time limit and/or password management for files

Even if it is very simple to use, it is quite difficult to install. In fact, the project environment has evolved quite a lot but the provided installation procedure has not followed. As a result, whatever installation guide you find on the web is very much outdated.

So, this guide explains step by step procedure to fully install latest FileZ version 3.0 alpha from https://github.com/FileZ/FileZ on a Debian 9.0 Stretch server. It uses a MySQL database to manage users.

Read more: Debian - Self-hosted Web File Transfer with FileZ

Debian - Send your Server Notifications thru Telegram

dropcap debian telegram

As a system administrator, you must be receiving your important server notifications by emails. Email has been used since decades, but it is slowly replaced in everydays life by social networks. With social network clients, messages are usually displayed as thread and get instant notification on your smartphone.

So, why not receiving your main server notifications on one of your favorite social network client ?

Telegram is becoming a very popular social network as it is free and multi-platforms. It has also a unique feature : it's allowing the use of bots. Bots are very interesting as they can be seen as an application account associated to a real person's account. They are able to send or receive messages to/from either an individual account or a group.

So, instead of sending a mail, it could be very interesting for your Debian/Ubuntu server to be able to send you Telegram notification. You can for example create an administrator group and send all your server notifications to this group. Any administrator belonging to this Telegram group will get instant notification from the server.

This article explains how to setup a server environment to very easily send Telegram notifications from any of your server script or service. It also provides a script that allows you to send Telegram messages including text, photos, documents, logs, …

It has been tested on a Debian 8.5 server but it should work on any modern Linux distribution.

Read more: Debian - Send your Server Notifications thru Telegram

Debian - Configure Sendmail to use your Gmail account

Debian

If you are running a Debian server, you must be running some automated processes like database dump, log cleaning, data backup, …

When processing these batch treatments, it can be very convenient to get some completion reports sent by email.

Under debian, you can send mails thru command line with the help of sendmail and exim4 as a mail transfert agent. But you previously need to configure them to use an official smtp server.

This article will explain how to configure your Debian Wheezy server to be able to send emails from command line by using the smtp server provided with your Gmail account.

Configuration is given for a Gmail account, but it can obviously be adapted to any other smtp provider.

This article has been tested on a freshly installed Amd64 Debian Wheezy.

Read more: Debian - Configure Sendmail to use your Gmail account

Debian - Downscale Webcam in realtime for Internet Access

dropcap webcam internet

As part of a complete domotic project, I had to setup some security cams. These cams are connected thru ethernet or wifi to a domoticz server. They are HD cams, able to serve 1280×720 high quality JPG pictures.

As they are used for motion detection purpose, it's important to keep the picture quality as high as possible for investigation purpose. But on the other side, as they should be available from anywhere on a supervision console, they should also be available thru internet with a resolution compatible with internet limited bandwidth.

Solution to this problem is to allow :

  • full resolution picture while served on the LAN
  • real time picture transcoding if served thru Internet

This article explains how to setup an Apache web server to handle realtime transcoding of some declared security cams images so that their dimension and quality level are adjusted to internet transmission. As a result, your security system will get high quality images on your LAN and optimized size and quality if served thru Internet.

Read more: Debian - Downscale Webcam in realtime for Internet Access

Debian - Automate Monthly Connexion for Dyndns Free Accounts

dropcap-debian-dyndns

For so many years, http://www.dyndns.org/ has been providing free dynamic DNS accounts. For me, they have been the 'de facto' dynamic DNS provider. The proof : so many home routers, NAS, ... manufacturers are providing update clients for their DNS service.

But this wonderful time has come to an end. Dyn has simply removed any free offer from their catalog and thanks to their latest SLA, you are now supposed to connect to their web server at least once a month to keep your existing free dyndns account active. Even with an update client, your free account may be terminated if you do not connect periodically to their web site. This new policy is a deliberate free account killer.

If, like me, you've been relying for ages on their service for your personal web site, this new policy is a real pain in the neck. Who will think to connect once a month to a site to do ... nothing ? Hopefully (as usual in the computing world) there is a solution : instead of you in person, a small shell script can peridically to do the connection job for you. It will automatically connect to Dyn web site using your account.

So, this article explains how to create and setup a periodic script that will connect to Dyn login page. This connexion will be considered by Dyn as a user connexion. As a result, you'll be able to keep your free dyndns account active even without doing yourself the newly needed monthly connexion. This periodic script should allow you to save your free account from a killing SLA.

Read more: Debian - Automate Monthly Connexion for Dyndns Free Accounts

Debian - Setup your Server as a Permanent BTSync Peer

dropcap-debian-btsync

BitTorrent Sync is a new p2p tool which opens some fantastic possibilities. It may revolutionize the way you'll handle your private file sharing as it allows you to share & synchronize your files across multiple devices (PC, tablet, smartphone, ...) on the net in almost real time.

Some examples of the possibilities opened by BTSync are described in the article BTSync - How peer-to-peer may Simplify your Life .

Like with any p2p network, BTSync needs to get some accessible peers to start synchronisation.

So, to allow synchronisation to be done at any time, you can setup a permanent peer on a Debian server by installing BTSync on it. As your server is always connected, it will handle all your devices connexions whenever they need it.

This article explains how to install a BTSync client on a Debian server to make it a permanent BTSync network peer. Any device (PC, smartphone, tablet, ...) will then be able to synchronize any time. You've then created your self hosted Dropbox or Google Drive replacement.

It has been tested on a Debian 7 Amd64 server.

Read more: Debian - Setup your Server as a Permanent BTSync Peer

Debian 7 - ZFS pools lost after ZFSonLinux update

dropcap-debian-zfsonlinux

In a previous article, I explained how to Setup ZFS with RAIDZ pool on your Linux Server .

Even if I'm doing regular updates to my Debian Wheezy server, I hardly reboot it, once every blue moon.

With these regular updates, my ZFSonLinux packages have been updated from version 0.6.2 to 0.6.3, from 0.6.3 to 0.6.4, from 0.6.4 to 0.6.4.1 , ... but without a reboot after every update.

To my surprise, after next reboot following a ZFSonLinux update, both my ZFS pools had disappeared. All my important server data where lost !

While searching the web for an explanation, I read lots of articles giving some tips and tricks, but nothing was really convincing. And more than that, lots of stuff was looking quite dangerous, with a high risk of definitely breaking the ZFS pools. After lots of searches, I finally found the real explanation to this huge problem on zfsforlinux discussion group.

Even if the solution is very simple, it is to my point of view worth writing this article. In fact, I hope it will help you to go straight to the solution. This should avoid you lots of frightening time ...

Please note that this solution is valid for servers where the / partition is not a ZFS one. Your ZFS pools should not host the root filesystem. They should be mounted during the boot process.

Read more: Debian 7 - ZFS pools lost after ZFSonLinux update

Debian 7 - Setup ZFS with RAIDZ pool on your Linux Server

dropcap-debian-zfsonlinux

Few days after the release of Debian Wheezy, I decided to install a brand new HP N54L micro server to use it as a small company NAS cum Server and to use ZFS filesystem for the data storage. As I wanted to fully manage my system, I decided not to go for a NAS distribution, but to use a plain Debian install and to setup a ZFS filesystem.

ZFS is a filesystem originally developed by Sun for Solaris OS. It has been ported to Linux by the zfs on linux project.

Its most interesting functionnalities are :

  • convergence of filesystem and volume manager
  • software raidz (software raid5 equivalent)
  • online data compression
  • snapshots

This filesystem is so simple, efficient and advanced, that I'm sure it will become a Linux standard very, very soon. Other FS may become part of the past sooner than expected ...

This guide explains how to install and configure a ZFS RAIDZ pool, how to setup snapshots and how to handle its day to day maintenance. A pre-requisite is to run Debian Wheezy server with a separate system disk (ZFS won't be on the boot device).

It doesn't explain in detail all ZFS options and possibilities, but it explains all the steps to get a fully running zfs raidz pool that will give you the flexibility of a professional grade NAS at the cost of a geek tool box :-)

Read more: Debian 7 - Setup ZFS with RAIDZ pool on your Linux Server

Debian 7 - Install Android Tools (ADB, Fastboot, ... & QtADB)

dropcap-debian-android

If you own an Android Smartphone and you want to manage it from your computer, you will need sooner or later to use some specific Android tools like adb or fastboot.

Under Debian, two options are available :

  • Install the whole Android SDK which bring these tools among many other things
  • Install some specific android-tools packages that bring only these tools

For some basic needs, to install the whole Android SDK is not needed, the android-tools packages are more than enough.

But these packages are only available for sid, they are not in the wheezy repository. So we'll need to backport them.

This article explains the simple steps needed to install the main Android tools (ADB, Fastboot, ... & QtADB) on a Debian 7 Wheezy workstation.

For example, after these steps, you should be able to Root a Google Nexus S or to Root a Google Nexus 7.

Read more: Debian 7 - Install Android Tools (ADB, Fastboot,... & QtADB)

Debian 7 - Installation on Sony VAIO VGN-TX2XP

dropcap-vaio-tx2xp

Sony Vaio VGN-TX2XP is a 7 years old, 1.25kg and 11.1'' screen notebook. When it has hit the market, it was a very high end laptop. It has been designed by Sony for durability as it is fully made of carbon, based on a multi-layered carbon fiber and carbon composite.

With an Intel Pentium M 1.2GHz CPU, 1 Gb RAM, an Intel 915GM chipset and a 16:9 1366×768 screen, it was originally delivered with Windows XP. Even if it was quite responsive in its childhood, it has become incredibly slugish years after years.

This laptop being very robust, very light weight and having a heavy duty battery, it was worth giving it a new life.

As it integrates some very standard components, I decided to install latest stable Debian 7.

This article explains the few steps needed to get a fully operational Vaio VGN-TX2XP running Debian Wheezy 7.0.

Thanks to Debian 7, you'll get a brand new Vaio VGN-TX2XP, giving back its full speed and reactivity under latest Gnome 3.4 environment.

Read more: Debian 7 - Installation on Sony VAIO VGN-TX2XP

Debian - Very fast backup server for your Windows PC

Debian

Till today, a lot of personal computers are still running Windows OS (XP, Visat, Seven, ...) and many people are still keeping a lot of valuable datas directly on their workstation or laptop hard disk. Most people do so because of ignorance of the risks  or because they are always on the move and they need their files available anytime, even not connected to any server.

The side effect of this behaviour is that everything can be lost in case of a hard disk crash, as all the datas are stored locally on the PC.

So, to avoid that type of loss, it is very important to save all your personal valuable files on a secure server.

RSync may be the clue to this problem. In fact, RSync is widely used to do data backup in the Unix/Linux world and it is having a lot of advantages :

  • it is multi-os (unix, linux, windows, ...)
  • it is using differential backup mecanism (only modifications are sent across the network)
  • it is command line base
  • some GUI are available, even on Windows (DeltaCopy)

This article will explain how to provide a very simple and very efficient way to backup your Windows PC local files on a Debian server with the help of RSync and DeltaCopy.

It has been succesfully tested on Windows XP and Windows Seven clients and on Debian Squeeze server.

By following these steps, you will be able to save all your local datas from your Windows PC to your Debian server in a very optimised and lightning fast way. Whatever happens to your PC, your personnal data will be safe !

Read more: Debian - Very fast backup server for your Windows PC

Debian - Tune Apache/PHP/MySQL for a Compact Flash disk

Debian

After having tuned your Debian server according to the article Install Debian on a server with a Compact Flash main disk, you plan to use it as a LAMP web server.

Once you have installed all the Apache, Php & MySQL packages with aptitude, you then need to do some specific tuning on these packages configuration as your server is running on Compact Flash.

This article describes all the ajustments I've done on my server to setup :

  • Apache to deal with /var/log on tmpfs
  • PHP to save sessions on tmpfs
  • MySQL to fully load the database in memory (small one)

This setup is specific to my needs and has been done to minimize the disk access to the CF.

Read more: Debian - Tune Apache/PHP/MySQL for a Compact Flash disk

Debian - Share same port for HTTPS, SSH and OpenVPN

Debian

If you need to administrate your home network while on the move, you will soon realize that you need different type of accesses.

The standard accesses you may need are :

  • Https to access your secured pages or webdav shares
  • SSH to administrate your main server
  • OpenVPN to get a full unrestricted access to your LAN

The only problem is that many Internet providers are blocking most of the ports used by these protocols. With some very restrictive providers (or with some corporate proxy) the only available ports may be 80 & 443.

So the solution to that problem is to allow Https, SSH & OpenVPN to share the same 443 port. With such setting, all your connexions needs can be handled from any type of network.

To help us to reach that goal, a fantastic little tool is available under Linux : sslh.

This tool listens on one specific port, analyse the stream & forward it to a specific local port according to thits type. To be able to handle any type of SSH client and OpenVPN connection, we need to install and configure the latest version of SSLH (1.9 minimum).

This guide will explain how to install the latest version of sslh, which is not available in the distribution repository, on a Debian Squeeze. It should also work on Debian Lenny and on some flavours of Ubuntu also.

Read more: Debian - Share same port for HTTPS, SSH and OpenVPN

Debian - Setup Scan-to-folder server for HP AIO scanner

Debian

HP Multi-Function Network Printers support is very good under Linux thanks to HP Linux Imaging and Printing (HPLIP).

But one important functionality is still missing : Scan-to-folder. You can not make your scanned documents easily available from a public network share.

This article explains how to setup a Debian server daemon to become a Scan-to-folder server for HP Multi-Function Network Printer/Scanner.

If this destination folder is shared ... you will have a direct access to your scanned documents from any PC.

debian-scan-to-folder-server

This Scan-to-folder service has been tested on a Debian Squeeze server and with a HP CM1312nfi All-In-One printer/scanner.

It should be compatible with many Linux flavours and with many modern HP multi-function network printers.

Read more: Debian - Setup Scan-to-folder server for HP AIO scanner

Debian - Setup HTTPS WebDav share and client configuration

Debian

For some reasons, I need to access some of my home server files from outside when I am on the move.

That access can be done from various places :

  • some friends or relatives ADSL boxes,
  • a public Wifi access
  • my 3G connection with unlimited data plan.

Some of these accesses can be very restrictive, allowing only web access (port 80 and 443 only) and some can also even check your user agent (my 3G data plan).

So to be sure to be able to access my files from anywhere & anytime, I decided to setup a secured WebDav share. This share will be accessed by using the HTTPS protocol on port 443. As a matter of fact, it should be allowed with no restriction by any access type.

This article will explain how to setup such WebDav share on an existing Apache2 server. It will also explain how to setup a Windows and a Ubuntu client to be able to use that access.

This setup has been done on Debian Squeeze, but it should be compatible with any following version.

Read more: Debian - Setup HTTPS WebDav share and client configuration

Debian - Realtek RTL8111/8168 on Intel D945GCLF2

Debian

Having upgraded a D945GCLF2 motherboard to Debian Squeeze, I started to have lot of troubles & serious problems with the integrated network interface Realtek RTL 8111/8168.

For example, the mt-daapd music server was totally unstable, having difficulty to serve more than one Roku music player. The multicast functionality was totally broken.

After some search, it appears that the driver used by the 2.6.26 kernel for that NIC was the wrong one. Instead of using a proper r8168.ko module, the 2.6.26 kernel was using the r8169.ko module.

If your kernel is 2.6.30+, you don't need to follow this guide anymore as the kernel includes a proper driver.

If you update your kernel to 2.6.30+ and you had followed this guide before, be careful to remove the blacklist of r8169 module in /etc/modprobe.d/blacklist.conf before reboot, or you won't get any network support ...

Read more: Debian - Realtek RTL8111/8168 on Intel D945GCLF2

Debian - Install a server on a Compact Flash memory

Debian

This article will explain how to install Debian on a server using a Compact Flash memory card as a primary drive. All the above procedures are based on the Lenny distribution, but they should work on other Debian flavours and even for Ubuntu.

The first question to ask is : Why to do that ?

When you install such a server, after sometimes you realize that it has become a backbone in your house as it hosts :

  • a family web site
  • a music server for appliances like Roku Soundbridge
  • a file server for other PCs
  • a web based torrent manager & amule manager
  • an access filter proxy for the kids surf
  • an asterisk telephony exchange
  • ...

Then, you start to have nightmares about the fact that your server's hard disk may fail and that you will need to reinstall everything.

One simple, efficient & cheap solution is to replace your hard disk by a Compact Flash memory in association with an IDE to CF adapter. As CF memory have no mecanical parts, they are known to be much more reliable.

But, on the other side, they are known to have limited write cycles (between 100 000 and 1 million times).

Read more: Debian - Install a server on a Compact Flash memory

Debian - Convert a EEE 701 as a server with embeded UPS

EEE 701 & Debian

Having a spare Asus EEE 701 netbook, I've converted it as a home server for music streaming, DVB-T streaming, web server, ...
This netbook is consuming very little power and is running under Debian in console mode without any graphical interface.

As every netbook, the EEE 701 is having an inbuilt battery, which can be used a very KISS (Keep It Simple and Stupid) Uninterrupted Power Supply system.


With proper scripts, it is possible to detect power failure and to follow the battery level &  to initiate a clean shutdown process when battery level is too low after a long power failure.

This article will explain how to :

  • detect power failure
  • check battery level
  • start a shutdown process when battery level is reaching predefined low level

With that, your server will shutdown properly whatever happens with its power supply.

Read more: Debian - Convert a EEE 701 as a server with embeded UPS

Debian - Automatic backup with USB disk

Debian

You are hosting a server (or a workstation) with some important files that sould be backed-up regularly on some external storage ?

This article will explain how to use the fantastic possibilities of UDEV & RSync to automatise some files backup on an external USB hard disk.

The concept is as follow :

  1. You insert an external USB disk on one of your server USB port
  2. Your server recognise the inserted disk & mount it
  3. According to some backup rules associated with that specific disk, your server starts a differential backup
  4. When backup is over the disk is unmounted & the server beeps you the indicate that the backup is over

And, with this approach, you can use as many backup disks as you want, as the backup is done according to rules associated with a specific disk.

We will use :

  • UDEV to recognize the disk and start the associated backup script
  • RSync to do a very fast differential backup

This setup has been done on Debian Squeeze, but it should be compatible with any following version.

Read more: Debian - Automatic backup with USB disk