RPM files

extract example

cd ~/Downloads
mkdir mariadb
mkdir mariadb/10.2
cd mariadb/10.2
rpm2cpio ../../MariaDB-devel-10.2.8-1.fc26.x86_64.rpm | cpio -idmv

GNU parallel


display list of devices

clean dnf database

@@commandline packages can be removed using dnf autoremove command

list packages
sudo dnf list autoremove
remove listed packages
sudo dnf autoremove
if script is preventing package from removal
sudo dnf --setopt=tsflags=noscripts remove gnome-tweak-tool

Mendeley Desktop


  • qt5-qtwebengine


  • download latest version from releases
  • run sudo rpm -ivh mendeleydesktop-*.rpm

File manager


add shortcut to open terminal

  • search for “terminal” in ~/.gnome2/accels/nemo
  • insert e.g. F4 as shortcut


Font Manager

GUI to import and manage user fonts

dnf install -y font-manager


list installed runtimes and applications do
flatpak list
org.gnome.Games/x86_64/master           system,current
org.gnome.Games.Locale/x86_64/master    system,runtime
org.gnome.Platform.Locale/x86_64/3.20   system,runtime
org.gnome.Platform.Locale/x86_64/master system,runtime
org.gnome.Platform/x86_64/3.20          system,runtime
org.gnome.Platform/x86_64/master        system,runtime
uninstall a runtime or application named name
flatpak uninstall name
$ flatpak uninstall Games
$ flatpak uninstall org.gnome.Platform//3.20
$ flatpak uninstall org.gnome.Platform//master




$ mkdir ~/AppImage
$ cd ~/AppImage
$ chmod +x OpenShot-v2.2.0-x86_64.AppImage
$ ./OpenShot-v2.2.0-x86_64.AppImage


disable Bash history
$ set +o history and $ set -o history to enable again


check CNAME using dig
$ dig bowerth.github.io +nocmd +nostats +noquestion

System information

Fan speed

use sensors command of Lm_sensors to monitor
$ sensors

Battery status

display location of upower
$ upower -e
check status
$ upower -i /org/freedesktop/UPower/devices/battery_BAT0
energy: 46.5964 Wh  
energy-full: 52.2423 Wh  
energy-rate: 16.5406 W  
time to full: 20.5 minutes  
percentage: 89%  
using acpi
$ acpi -V
Battery 0: design capacity 6930 mAh, last full capacity 6838 mAh = 98%


set root password
log in as root $ sudo -s
set password $ passwd

Nix The Purely Functional Package Manager

download and run install script
$ curl https://nixos.org/nix/install | sh
reload ~/.bash_profile
$ source ~/.bash_profile


aMule CMD

modify parameters in ~/.aMule/amule.conf

create password
$ echo -n yourpasswordhere | md5sum | cut -d ' ' -f 1
start aMule and connect using amulecmd
$ amulecmd (type password)

C* (cmus)

install dependencies

  • libmad-devel
  • libcue | libcue-devel | OK
  • libpulse | pulseaudio-libs-devel | OK
  • pulseaudio | pulseaudio-devel | OK
  • samplerate | libsamplerate-devel | OK
  • libavformat, libavcodec | ffmpeg-devel | OK
  • opusfile | opusfile-devel | OK

additional output plugins:

  • alsa
  • jack
  • libroar
:quit <Enter>
list installed output plugins
$ cmus --plugins
set output device (“no output plugin detected”)
:set output_plugin=pulse

add files

open file browser
add file/folder
open library view

create desktop entry

create ~/.local/share/applications/cmus.desktop with contents:

[Desktop Entry]
Exec=cmus-remote -f %f
Comment=Music player cmus-remote control

in order to add to gnome favorites, the .desktop file must be named exactly the same as the started application


ask.fedoraproject.org: dropbox failed synchronize cache for repo

modify repo file
/etc/yum.repos.d/dropbox.repo from baseurl=http://linux.dropbox.com/fedora/$releasever/ to baseurl=http://linux.dropbox.com/fedora/22/

Docker Cloud Images



identify the encoding of a file
$ uchardet [textfile]


Feednix is s simple ncurses-based console client for Feedly

Fedora 23

install dependencies
$ sudo dnf install -y dh-autoreconf ncurses-devel jsoncpp-devel libcurl-devel
configure, make, install
$ ./configure && make && sudo make install
copy configuration file
$ cp config.json ~/.config/feednix/
create symbolic link in /etc/xdg folder
$ sudo ln -s ~/.config/feednix /etc/xdg/feednix
enter developer token
start program
$ /usr/bin/feednix or simply $ feednix


add new feed

Google Chrome

Mozilla Firefox



install thunderbird
sudo dnf install thunderbird


Composition: plain text and HTML

activate default message composition in HTML (where defaults can be specified, e.g. using themes)
Edit > Preferences > Account Settings > Composition & Addressing > "Compose messages in HTML format"
force to send messages as plain text
Menu > Preferences > Preferences > Composition > Send Options > "Convert the messages to plain text"
display of plain text messages
`Edit > Preferences > Display > Fonts & Colors > Colors… > [select colors] > “override the colors…” [always]


edit userChrome.css in profile folder (create chrome folder if doesn’t exist)


create report with detailed information about sound hardware
$ alsa-info.sh --no-upload
use GUI
$ alsamixer -c 1
get parameter of binary controls
$ amixer -c 0 get 'Headphone Jack'




install keepassx on Fedora 22
sudo dnf install keepassx


list keys
gpg --list-keys
to export a public key into file public.key
gpg --export -a "User Name" > public.key
delete a public key (from your public key ring)
gpg --delete-key "User Name"
to import a public key
gpg --import [public key file]
to export a private key
gpg --export-secret-key -a "User Name" > private.key
to import a private key
gpg --allow-secret-key-import --import private.key
to encrypt a single file, use command gpg as follows
gpg -c filename


Flash player

  • download .deb file from ppa launchpad
  • remove existing flash installations (flashplayer-installer, flash-plugin)
  • close browser
  • install using sudo dpkg -i [package name]

Fedora Server

CentOS 7

adjust screen brightness
$ xrandr --output LVDS1 --brightness 0.7 e.g. for 70%


Differences to Redhat and CentOS

User management

add an existing user to existing group
$ sudo usermod -a -G hadoop xps13

Install Workstation Live Image

install or update Adobe Flash Player

Fedora 21

  • $ yum install flash-plugin

Fedora 22

  • download .rpm version (PPAPI) from https://get.adobe.com/flashplayer/
  • $ sudo dnf remove flash-plugin
  • $ sudo rpm -i ~/Downloads/flash-plugin-[version]-release.x86_64.rpm

screen brightness Toshiba

jamielinux: adjust screen brightness forums.fedoraforum.org: Fix for Toshiba laptops with no control of brightness after suspend

add acpi_backlight=vendor in the kernel command line

append to edit grub GRUB_CMDLINE_LINUX="rd.md=0 [...] rhgb quiet acpi_backlight=vendor"
sudo nano /etc/default/grub
backup grub.cfg
sudo cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg.backup
update grub.cfg
sudo grub2-mkconfig -o /boot/grub2/grub.cf
check contents of new grub.cfg in editor without root permission
sudo cat /boot/grub2/grub.cfg > ~/Downloads/grub.cfg

place the quoted 99toshiba script (below) in /etc/pm/sleep.d/ where the content of the script for /etc/pm/sleep.d/99toshiba is:

#!/usr/bin/env sh
# /etc/pm/sleep.d/99toshiba

if [ $1 == suspend ]
cat /sys/class/backlight/intel_backlight/brightness > /var/run/brightness
elif [ $1 == resume ]
echo 3 > /sys/class/backlight/toshiba/brightness
cat /var/run/brightness > /sys/class/backlight/intel_backlight/brightness
Also remember to make it runnable to root
chmod 744 /etc/pm/sleep.d/99toshiba

update Fedora 25 to 26 using DNF system upgrade

sudo dnf system-upgrade download -y --releasever=26 --allowerasing
dnf system-upgrade reboot
dnf clean packages

update Fedora 22 to 23 using DNF system upgrade

update your system using the standard updater for your desktop or pkcon or dnf
$ sudo dnf update --refresh
install Package-x-generic-16.pngdnf-plugin-system-upgrade package:
$ sudo dnf install dnf-plugin-system-upgrade
download the updated packages
$ sudo dnf system-upgrade download --releasever=23
trigger the upgrade process
$ sudo dnf system-upgrade reboot
install unsigned packages
add --nogpgcheck

update Fedora 21 to 22 using FedUp

Using a network source is the easiest method of upgrading and will pull in updates while upgrading - eliminating the potential issue if your current system has a newer kernel version than the Fedora release to which you are upgrading.

Start the upgrade prep by executing following command
sudo yum update fedup fedora-release
If you are upgrading from Fedora 20 to Fedora 21, run the following command
sudo fedup --network 21 --product=[workstation | server| cloud | nonproduct]
If you are upgrading from Fedora 21 to Fedora 22 or above, run the following command
sudo fedup --network 22

Once the preparations have completed, check the /var/log/fedup.log file if any errors show up in the output from fedup

Source: FedUp

Language Support

simplified chinese (non-Unicode)
sudo dnf groupinstall simplifided-chinese-support


Wayland is intended as a simpler replacement for X, easier to develop and maintain.

GNOME Shell Extensions

i3 A window tile manager

kill GNOME desktop
$ xkill and click GNOME desktop


log out via the terminal



Create ~/.config/gtk-3.0/gtk.css with the following content and restart the shell.

/* .header-bar.default-decoration { */
/*     padding-top: 3px; */
/*     padding-bottom: 3px; */
/*     border: none; */
/*     background-image: linear-gradient(to bottom, */
/*                                       shade(@theme_bg_color, 1.05), */
/*                                       shade(@theme_bg_color, 0.99)); */
/*     box-shadow: inset 0 1px shade(@theme_bg_color, 1.4); */
/* } */

/* .header-bar.default-decoration .button.titlebutton { */
/*     padding-top: 2px; */
/*     padding-bottom: 2px; */
/* } */

# small title bar

.header-bar.default-decoration {
    padding-top: 3px;
    padding-bottom: 3px;

.header-bar.default-decoration .button.titlebutton {
    padding-top: 2px;
    padding-bottom: 2px;



Screen is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells.

open help
$ C-a ?

Disk usage

with gui
$ sudo baobab
list directories by size
$ sudo du /|sort -gr|more for root folder
$ du .|sort -gr|more for current folder
list files by size
$ find . -type f -exec du --human {} + | sort --human --reverse | head
list files recursively by partial string
$ find -iname "*hsfclmap*"
check for incomplete files
$ find -iname "*.tmp"


start as root
sudo baobab
clean /var/cache (large PackageKit folder)
sudo dnf clean all
using PackageKit console client
sudo pkcon refresh force -c -1
large /var/cache/PackageKit: modify /etc/PackageKit/PackageKit.conf
# Keep the packages after they have been downloaded
run pkcon refresh force -c -1
delete PackageKit metadata manually
sudo rm -r /var/cache/PackageKit/25/*
old releases
yum clean all --releasever=19
log files
rm -r /var/log/journal/*

Environment variables

/etc directory
global settings (used for sudo), otherwise overwritten by files in home directory
define PATH variable, e.g. texlive path or http_proxy for curl
global environment
global functions and aliases

shell commands, bash files

terminate a process
killall -9 firefox


list all files recursively with specific extension
$ find . -type f -name "*.epub"


list all files and directories in path
ls $HOME


find files in path
find $HOME/. -maxdepth 1 -type f

executable script files

make bash file executable
sudo chmod +x file

string operations

global replace
sed -e 's:\\(:(:g' $path/${file}_temp.md > $path/${file}_temp2.md
complex expression to replace multiple blank lines with two blank lines, see stackexchange: How to remove multiple blank lines from a file?
sed -r ':a; /^\s*$/ {N;ba}; s/( *\n *){2,}/\n\n/'
combine with printf
printf "line one\\nline two\\n" | sed -e 's/.*/( & )/'
remove newline
tr '\n' ' ' < input_filename
remove newline
tr -d '\n' < file

startup files

~/ home directory
ls -a show all files in directory order of execution
  1. .bash_profile private equivalent of /etc/profile, source from .bashrc
  2. .bashrc sources from /etc/bashrc
  3. .bash_login
  4. .profile modify environment variables, e.g PATH
create simple http server
cd ~/Downloads/scipy-lectures.github.com-master/ \ && python -m SimpleHTTPServer

Example: proxy settings

  • in order to use yum, the global environment variable http_proxy needs to be defined
  • this can be achieved with sudo su, http_proxy=http://wsg-proxy.oecd.org:80, export http_proxy


Limit grep context to N characters on line
N=10; grep -roP ".{0,$N}time.{0,$N}" TariffLineSdmx.xml
return all files with a specific extension
ls -al | grep .git
return all occasions with “PATH”
grep -i "PATH" .*
search for term in subfolder
grep -i ".jParProperties" R/*
search files in path recursively, only print filename
grep -rl "gh-training-logo" [path]
remove all files with a specific pattern
rm sample*.log
change theme for specific window (firefox, thunderbird etc.)



Can be used to modify bookmarks (i.e. “Outline” in Evince). The format of a bookmark file in csv format is as follows:

1;O;1 Scala Language Basics;32 FitH 758
1;O;2 Basics of Object-Orientation and Software Development;82 FitH 758
1;O;3 Details of Object-Orientation in Scala;112 FitH 758


separate into pages
pdftk document.pdf burst


convert pdf to text
pdftotext [file]
search resulting file for RegExp
grep '^[0-9][ ][A-Z].*' scala-toc.txt
reduze PDF file size
convert -density 200x200 -quality 60 -compress jpeg input.pdf output.pdf


qpdf --password=[...] --decrypt [sourcefile] [destfile]
combine pages
qpdf --empty --pages "02_Main.pdf" 1-6 "03_Main.pdf" 1-8 -- "out.pdf"


install dependencies Fedora 23
$ sudo dnf install -y yad perl-Image-ExifTool qpdf
clone repository
$ git clone git@github.com:Glutanimate/PDFMtEd.git
edit file (reports error on save and does not recognize existing metadata)
$ ./pdfmted-editor "/home/xps13/Documents/Mendeley Desktop/Bergeron - 2003 - Essentials of XBRL, Financial Reporting in the 21st Century.pdf"


  • create ruby module to pick up page source md file, generate pdf and trigger file download with default location and file name


large /var/log/journal: modify /etc/systemd/journald.conf
set SystemMaxUse=1M
sudo systemctl restart systemd-journald
set SystemMaxUse=200M
sudo systemctl restart systemd-journald


27 February 2015