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 🙁

 

 

Back to KDE

What happened?

Some things were just too annoying with awesome:

  • cvlc -f not opening full screen, just sometimes, completely at random. When  it didn’t, it froze.  When it did, it slowed down everything. First I thought that it had  something to do with VDPAU  and tried to turn it off, but I didn’t even get that far.
  • Maximizing a youtube-video in Chromium seemed to freeze the screen. Eventually I figured out that awesome decided to open it in the background or something. Surprisingly, maximizing the window in that state raised it. Learned that by accident.
  • ffplay and mplayer windows centered right where they shouldn’t: between both screens.

Overall, a tiling window manager is nice when  you use X just as a console multiplexer, but if you want more, the disadvantages outweigh the advantages.

So I decided to give KDE another shot. I used it before, but eventually got annoyed by all the useless crap I don’t want nor need, like Akonadi or Nepomuk.

The Experience

So I replaced

exec awesome

with

exec startkde

in my .xinitrc. First thing I noticed was my CPU fan spinning up. Baloo_file decided to have my 6 CPUs work overtime. I found out that it is the new file indexer of the KDE framework. Don’t want it, don’t need it, but easily fixed. Just turn  off the Desktop Search in System Settings. For good measure I also added

chmod -x /usr/bin/baloo_file

Other than that I’m quite happy with it. cvlc -f  always starts full screen again, and a tabbed Konsole is so much nicer than a tiled urxvt 🙂 Chromium and youtube also work as  expected again.

What I miss

What I really miss is separate desktops per screen, but from what I read that won’t be implemented soon, if ever. Well, you can’t have everything. Fortunately I found workarounds for most cases.

 

RAID

RAID-Devices

  • /dev/md0
    am@hadante ~ $ sudo mdadm -Q --detail /dev/md0 
    /dev/md0: 
            Version : 1.2 
      Creation Time : Wed May 27 13:52:56 2015 
         Raid Level : raid5 
         Array Size : 1463976960 (1396.16 GiB 1499.11 GB) 
      Used Dev Size : 487992320 (465.39 GiB 499.70 GB) 
       Raid Devices : 4 
      Total Devices : 4 
        Persistence : Superblock is persistent 
     
      Intent Bitmap : Internal 
     
        Update Time : Sat Jun 10 15:26:28 2017 
              State : clean  
     Active Devices : 4 
    Working Devices : 4 
     Failed Devices : 0 
      Spare Devices : 0 
     
             Layout : left-symmetric 
         Chunk Size : 512K 
     
               Name : archiso:0 
               UUID : 6d795529:03e05967:c4d50bcf:5dd604b7 
             Events : 3136 
     
        Number   Major   Minor   RaidDevice State 
           0       8      130        0      active sync   /dev/sdi2 
           1       8       18        1      active sync   /dev/sdb2 
           2       8        2        2      active sync   /dev/sda2 
           4       8      146        3      active sync   /dev/sdj2
  • /dev/md1
am@hadante ~ $ sudo mdadm -Q --detail /dev/md1 
/dev/md1: 
        Version : 1.2 
  Creation Time : Thu May  2 18:08:00 2013 
     Raid Level : raid5 
     Array Size : 8790405120 (8383.18 GiB 9001.37 GB) 
  Used Dev Size : 2930135040 (2794.39 GiB 3000.46 GB) 
   Raid Devices : 4 
  Total Devices : 4 
    Persistence : Superblock is persistent 
 
    Update Time : Sat Jun 10 15:26:58 2017 
          State : clean  
 Active Devices : 4 
Working Devices : 4 
 Failed Devices : 0 
  Spare Devices : 0 
 
         Layout : left-symmetric 
     Chunk Size : 512K 
 
           Name : hadante:1  (local to host hadante) 
           UUID : 0227c805:00c429e6:231a9f6f:168e5a4a 
         Events : 587869 
 
    Number   Major   Minor   RaidDevice State 
       7       8       64        0      active sync   /dev/sde 
       5       8       80        1      active sync   /dev/sdf 
       6       8       96        2      active sync   /dev/sdg 
       4       8      112        3      active sync   /dev/sdh

Order in external casing

From top to bottom:

  1. ST3000DM001-1ER166, Serial W501VAJY
  2. ST3000DM001-1CH166, Serial Z1F58T6T
  3. HGST HDN724040ALE640, Serial P4HU954B
  4. ST3000DM001-1CH166, Serial Z1F1JTDT

Slot History

  1. Original -> replaced by a recertified drive (Z1F2X130 – 2015/04/25) -> replaced by  a defective HGST 4TB that didn’t even start up on 2017/06/09 -> replaced by another SEAGATE 3TB drive in stock the same day (W501VAJY – delivered 2016/10/18)
  2. Original? (no history available)
  3. Original -> replaced by recertified drive (W1F2L184) -> replaced by Z1F142XH on 2016/08/26 (in stock, delivered 2016/06/26), which turned out to be defective and out of warranty (returned to sender, the replacement is in slot 1 now) -> replaced by HGST 4 TB (Serial: P4HU954B) on 2016/09/03. Read the whole story here
  4. Original? (no history available)

Remarks

  • [2017/06/10] I’m not really sure about the history of slot 3. A previous version said that it was slot 4, but the Amazon history says otherwise.
  • [2017/06/10] Despite still having a SEAGATE 3TB drive in stock I ordered a new HGST 4TB on Whitsunday 2016/06/04, delivered as promised on 2016/06/07. Unfortunately I couldn’t get my hands on it until Friday 2016/06/09, because the neighbor accepting the parcel wasn’t around when I was. Not at 3pm, 6pm nor 9pm (Wednesday and Thursday), so I took an early lunch break on Friday at about 11:15am and rode home to pick it up, yay! Much to my dismay the drive was defective. Instead of spinning up it made clicking, scratching sounds and didn’t show up in /dev, so I eventually replaced it with the 3TB SEAGATE drive, because I didn’t trust the still working, but failing drive any more. After a hard crash on Wednesday hadante kicked the (healthy) HGST drive out of the array, so I had to rebuild with the failing drive. About 24 hours later the rebuild finished, lucky me! I’m gonna return the HGST drive to the sender next week instead of voiding my warranty.
# journalctl -k | grep md1 
Jun 09 15:25:31 hadante kernel: md: md1 stopped. 
Jun 09 15:25:31 hadante kernel: md/raid:md1: device sdf operational as raid disk 1 
Jun 09 15:25:31 hadante kernel: md/raid:md1: device sdh operational as raid disk 3 
Jun 09 15:25:31 hadante kernel: md/raid:md1: device sdg operational as raid disk 2 
Jun 09 15:25:31 hadante kernel: md/raid:md1: raid level 5 active with 3 out of 4 devices, algorithm 2 
Jun 09 15:25:31 hadante kernel: md1: detected capacity change from 0 to 9001374842880 
Jun 09 15:27:46 hadante kernel: md: recovery of RAID array md1 
Jun 10 13:44:01 hadante kernel: md: md1: recovery done.

 

Disable comments on Post

Well, well, well… Not very user-friendly. To turn off comments for posts, navigate to the Posts overview and select “Quick Edit” and uncheck “Discussion”. This should be “Post Properties” or something…

 

OpenVPN and IPv6-Bridging

Nothing is as easy as it seems. Sigh… 🙁

I was getting strange timeouts when accessing sites via tunneled IPv6 (OpenVPN). Turned out that the sender never got the ICMPv6-Redirect from the tunnel endpoint, i.e. OpenVPN-Server. The ICMPv6-Packet is sent from the link-local address of the gateway (fe80::some:thin:g/64), because it gets dropped in the FORWARD-Chain of the gateway if the policy is DROP.

Setting it to ACCEPT magically makes things work, but that’s equal to turning off the firewall. Allowing traffic from and to fe80::/8 doesn’t help, either. Never figured out why.

What now? The physdev-module comes to rescue! Despite its name it can match the (virtual) tap-interface of the OpenVPN-Server. Just add the following rules to the beginning of the FORWARD-Chain:

ip6tables -I FORWARD -m physdev --physdev-out tap0 -j ACCEPT
ip6tables -I FORWARD -m physdev --physdev-in tap0 -j ACCEPT

and things run smoothly again 🙂

Change DirColors (literally)

1. Export the database to a file, say .config/dircolors:

$ dircolors -p > .config/dircolors

2. Customize it, eg. change directories to cyan:

...
DIR 01;36 # directory
...

3. Include it into .bashrc. Add this somewhere at the top:

eval $(dircolors .config/dircolors)

4. ANSI color codes

Ansi Color codes can be found here