Switch from netctl to NetworkManager on Arch Linux

On my notebook I finally decided to try NetworkManager with its applet

After installing. I had to check status of some networking services and disable them.

systemctl status dhcpcd.service
sudo systemctl stop netctl.service
sudo systemctl stop netctl-ifplugd@eth0.service
sudo systemctl status netctl-ifplugd@eth0.service
sudo systemctl stop netctl-auto@wlan0.service

And then wait for the magic after starting NetworkManager
sudo systemctl start NetworkManager.service

network manager applet

I should have searched for a how to video on YouTube and could save some debugging time with journalctl -f 🙂 After setup I found https://www.youtube.com/watch?v=MAi9DurTRQc


Google Play Music desktop player MPRIS media keys for Linux

I finally nailed it 😀
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.google-play-music-desktop-player /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause

dbus-send --print-reply --dest=org.mpris.MediaPlayer2.google-play-music-desktop-player /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next

Also added to my Awesome window manager config

Monitor progress of cp, mv, gzip, mysql and CLI commands

To monitor progress of an ongoing copy or mysql dump import you might try progress CLI tool. Track progress of commands like cp, mv, dd, tar, cat, rsync, grep, fgrep, egrep, cut, sort, md5sum, sha1sum, sha224sum, sha256sum, sha384sum, sha512sum, adb, gzip, gunzip, bzip2, bunzip2, xz, unxz, lzma, unlzma, 7z, 7za, zcat, bzcat, lzcat, split, gpg, etc.

Dual monitor Awesome WM with xrandr

I struggled a couple of days until I figured it out that setting up dual monitor via xrandr is needed after X started and before aweome started, so in between.

The solution was adding xrandr exec line into my .xinitrc

# ~/.xinitrc
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

function VGAConnected {
   ! xrandr | grep "^VGA-1" | grep disconnected
if VGAConnected; then
    xrandr --output eDP-1-1 --mode 1920x1080 --primary \
           --output VGA-1-1 --mode 1920x1080 --rotate normal --right-of eDP-1-1

exec awesome -c .config/awesome/rc.lua

to get the screen names (eDP-1-1, VGA-1-1, etc.) just run xrandr without args.

Tinkering with GNU parallel and wget for broken link checking

Finally found a parallel spidering solution. Online solutions didn’t really fit, because I don’t want to overload the production site and they can’t reach http://localhost. Trying out parallel + wget snippet from https://www.gnu.org/software/parallel/man.html#EXAMPLE:-Breadth-first-parallel-web-crawler-mirrorer looks promising.


 # Stay inside the start dir
 BASEURL=$(echo $URL | perl -pe 's:#.*::; s:(//.*/)[^/]*:$1:')
 URLLIST=$(mktemp urllist.XXXX)
 URLLIST2=$(mktemp urllist.XXXX)
 SEEN=$(mktemp seen.XXXX)

# Spider to get the URLs
 echo $URL >$URLLIST

while [ -s $URLLIST ] ; do
 cat $URLLIST |
 parallel lynx -listonly -image_links -dump {} \; \
 wget -qm -l1 -Q1 {} \; echo Spidered: {} \>\&2 |
 perl -ne 's/#.*//; s/\s+\d+.\s(\S+)$/$1/ and
 do { $seen{$1}++ or print }' |
 grep -F $BASEURL |
 grep -v -x -F -f $SEEN | tee -a $SEEN > $URLLIST2


Great exercise for the CPUs
htop gnu parallel

When the command finishes then the next step is parsing access_log

grep -r ' 404 ' /var/log/httpd/access_log | cut -d ' ' -f 7 | sed -r 's/^\//http\:\/\/localhost\//g'