Installation SSD

On May 27, 2015, I replaced the system raid of hadante (4 spinning 500 GB disks, RAID5) with 4 Samsung SSD drives (also 500 GB, RAID5). It was well worth it. The speed is amazing!

Along with the disks I ordered 4 3.5″ -> 2.5″ installation frames. As it turned out I only needed two, because you can easily stack two SSD drives on one frame with the right frame. There even is a gap in between, so I don’t expect heat problems.

The RAID5-rebuild was blazing fast. Overall, everything seems to be much snappier.

The serial numbers – SSD drives from top to bottom:

  1. S21JNXAG415926
  2. S21JNXAG415880
  3. S21JNXAG433264
  4. S21JNXAG433168

The old serial numbers – spinning drives from top to bottom:

  1. S13TJ1EQ401080 (Samsung)
  2. 5VMJ32Q9 (Seagate)
  3. 3PM23C12 (Seagate)
  4. S13TJ1EQ401081 (Samsung)

 

flac + cue to mp3

To convert a single flac file with a cue sheet to mp3, first split it up:

$ shnsplit -f <sheet.cue> <source.flac>

Then convert the wav-files to mp3 with ffmpeg:

for i in *.wav ; do ffmpeg -i ${i} -codec:a libmp3lame -qscale:a 2 ${i%%wav}mp3 ; done

Or, if you have individual flac files:

for i in *.flac; do ffmpeg -i ${i} -codec:a libmp3lame -qscale:a 2 ${i%%flac}mp3 ; done

qscale:a 2 produces mp3s with an average bitrate around 170-210 kbit/s. It should be close to lossless.

Upgrade Mailscanner

The easy part:

  • Download the tarball from the official website
  • Unpack to somewhere
  • execute <unpack-dir>/install.sh

The hard part:

Do not agree to install the missing perl modules from CPAN! Install them via the package manager. If almost every module is missing, perldoc is not installed. Debian is especially nasty here. They have a perldoc executable, even if it isn’t installed, and it only prints “the package perl-doc is not installed” or something and instructions how to install it.

Unfortunately the installer uses perldoc to figure out which modules are missing, so when it calls the stub everything is missing…

If there is a version mismatch, check if you have a CPAN-Version installed in /usr/local/<something>.

# perl -V

shows @INC at the bottom. Remove the offending package and install it via your favorite package manager.

The config part:

Generate a new config in the new etc-Directory as described in the docs. If you’re using MailWatch, don’t forget to copy

lib/MailScanner/CustomFunctions/MailWatch.pm

to the new directory. Stop mailscanner, link the new version to /opt/MailScanner or something and start it. You applaud 🙂

 

Upgrade wheezy to jessie

All in all, it was easy. Just one big caveat regarding apache2. Can’t say if it was PEBKAC any more. But read below.

1. Check for obsolete packages

As stated in the official Upgrade Guide: Do an audit!

# dpkg --audit

Really, do it! And fix the non-compliant packages.

2. Install the Distribution Kernel

Again, really do it. Otherwise the dist-upgrade will fail on udev, if your custom kernel doesn’t have CONFIG_SIGNALFD, CONFIG_FHANDLE and whatnot built in. You can override it, but then it won’t boot. So better be safe.

3. Update and dist-upgrade

Change /etc/apt/sources.list to use jessie. Then

# apt-get update
# apt-get dist-upgrade

Carefully watch for configfile-conflicts. Esp. Apache and cyrus! Keep the config for:

  • /etc/cyrus.conf
  • /etc/imapd.conf

Don’t overwrite them! We’ll fix them later!

4. Reboot

Reboot into the new system, get systemd running. Again, don’t even think to go on without a reboot

5. Fix cyrus and postfix

The command for cyr_* has changed. Now it’s so cyrus <*>, so move the old config out of the way and replace it with .dpkg-dist. Then diff it and change the relevant line(s). That would be especially:

lmtpunix cmd="lmtpd" \
   listen="/var/spool/postfix/cyrus-socket/lmtp" \
   prefork=0 maxchild=20

with

lmtp cmd="lmtpd -a" listen="localhost:lmtp" prefork=0 maxchild=20

So don’t listen on an AF_UNIX socket any more but on a network socket. For this to work you need to add this line to /etc/services:

lmtp        24/tcp

LMTP doesn’t seem to be a well known port, whatever…

Now for postfix: Change /etc/postfix/main.cf accordingly:

mailbox_transport = lmtp:inet:localhost

I.e. listen on a network socket instead of AF_UNIX. This way you don’t have to bother with permissions on the socket file, and it’s IPv6-enabled as a bonus 🙂

6. Fix apache2

Make sure all your files in sites-available end in *.conf! Otherwise they won’t be loaded! I learned the hard way, wondering why SSL-Connections failed because there was no SSL. Check what VHosts are loaded with:

# apache2ctl -t -D DUMP_VHOSTS

If that shows no Vhosts, you don’t have any! Fix it. BTW, NameVirtualHost is obsolete. Remove it. So seems to be gnutls…

Create an IPv6-enabled-VHost like this:

<VirtualHost _default_:443>
...
</VirtualHost>

 

Archlinux and Networkmanager

NetworkManager is a nice piece of software, congrats to the developers! But there are several catches on Arch Linux:

  1. Disable systemd-networkd
  2. Disable systemd-resolvd
  3. The most important one: Remove the package openresolv! If you don’t, you may end up  with an empty /etc/resolv.conf! It will be there for one or two seconds, but then the openresolv-scripts will remove it and in the best case link it to some non-existing file in /run

Create a Ringtone for Android 5

Conversion

This should be easy, wouldn’t you think? Of course it isn’t! Here’s a step-by-step instruction:

1. Extract the sound from the video or sound file. Write down the start and and position. For notifications don’t make it more than 3 seconds or it’ll get annoying. Do this with ffmpeg:

$ ffmpeg -i <input-file> -ss <hh:mm:ss.ms> -to <hh:mm:ss.ms> -f wav out.wav

Check with eg. ffplay if you got it right or adjust:

$ ffplay out.wav

2. Most likely you want to increase the volume:

$ ffmpeg -i out.wav -af 'volume=4|5|...> out2.wav

3. Convert to mp3

$ ffmpeg -i out2.wav -codec:a libmp3lame -qscale:a 8 out.mp3

qscale:a 8 is 70-105 kbit/s (default is 16 kbit/s, crappy)

Make a SAMSUNG S5 Galaxy acutally play it

Turned out this is the hard part.

1. Download it to the phone with “Eigene Dateien” (“My Files”?, dunno).

2. Select “Benachrichtigungston” (Notification in english?) and open with ES File explorer or something

3. Browse to the downloaded file and select it

4. OK everything

When selecting the dialog again, use “Medienspeicher”. Now the file name should show up there. Test it!

Results

Stargate alert:

Now What? (O’Neill)

Sorry for Denglish 🙁