Arch: find package for specific command

The problem is: How do you find the package for a given command? Two solutions are presented.

  1. Use the program pkgfile.
  2. Use pacman.
    1. Update database: $ sudo pacman -Fy
    2. Searching: $ pacman -Fs $cmd

Source: stackexchange.com

Advertisements

ssh config: include multiple files

it is useful to split up the ssh config file.

do as follows

  1. create config folder $ mkdir ~/.ssh/config.d
  2. create multiple config files in that folder (I group different hosts, and use a global options file)
    1. $ touch ~/.ssh/config.d/group1
    2. $ touch ~/.ssh/config.d/group2
    3. $ touch ~/.ssh/config.d/group3
    4. $ touch ~/.ssh/config.d/options
  3. include the whole directory by using the standard config file
    $ cat ~/.ssh/config
    Include config.d/*
    

 

arch: disable linux error beep

this beep comes up in terminals and for each error in matlab. just annoying…. fix this by disabling the right kernel module.

    1. append to /etc/modprobe.d/blacklist.conf:
      blacklist pcspkr
    2. include in /etc/mkinitcpio.conf:
      ...
      FILES="/etc/modprobe.d/blacklist.conf"
      ...
    3. Then rebuild the initramfs and reboot:
      $ mkinitcpio -p linux
      $ reboot

arch+matlab: setup opengl rendering

hardware accelerated rendering needs enabling.

  1. check out the arch-wiki page.
  2. i needed to install the intel graphics driver. explained here.
  3. to set the opengl paths (as explained in the wiki), i needed to modify the .desktop file
    1. for me, the path was: /usr/share/applications/matlab.desktop
    2. changed execution line
      1. before: Exec=matlab -desktop -nosplash
      2. after: Exec=/my/personal/binary/path/matlab_startWithEnvVars
    3. created seperate start script
      1. path: (same as given to Exec command above)
      2. content:
        #!/bin/sh
        
        export LD_PRELOAD=/usr/lib/libstdc++.so
        export LD_LIBRARY_PATH=/usr/lib/xorg/modules/dri/
        
        exec /usr/local/bin/matlab -desktop -nosplash "$@"
        
      3. make file executable

thunderbird: export message filters

one can export/import/backup the message filters but it’s more involved than it should be.

the message filters are in single files within your home directory. their path is

~/.thunderbird/<profileStr>/ImapMail/<mailAcc>/msgFilterRules.dat

For example

~/.thunderbird/asdbasbdas.default/ImapMail/mail.yahoo.ru/msgFilterRules.dat

Install Firefox Nightly binaries from Mozilla

Installation process is similar to the one for Thunderbird Daily (see this blog post).

differences:

  • binary download link:
    # wget "https://download.mozilla.org/?product=firefox-nightly-latest-ssl&os=linux64&lang=en-US" -O firefox-nightly.tar.bz2
  • icon link:
    # wget http://www.iconspedia.com/dload.php?up_id=146406 -O ~/.icons/Mozilla-Firefox-Nightly-256.png
  • # cat ~/.local/share/applications/firefox-nightly.desktop
    [Desktop Entry]
    Version=1.0
    Name=Firefox Nightly
    GenericName=Web Browser
    Comment=Browse the Web
    Exec=firefox-nightly %u
    Icon=Mozilla-Firefox-Nightly-256.png
    Terminal=false
    Type=Application
    MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;
    StartupNotify=true
    Categories=Network;WebBrowser;
    Keywords=web;browser;internet;
    Actions=new-window;new-private-window;
    
    [Desktop Action new-window]
    Name=New Window
    Exec=firefox-nightly --new-window %u
    
    [Desktop Action new-private-window]
    Name=New Private Window
    Exec=firefox-nightly --private-window %u
    

Install Thunderbird Daily binaries from mozilla

Thunderbird Daily can be installed in most distros directly from their repos but more often than not it is outdated (they usually disable automatic updates). this can be circumvented by installing the binary directly from mozilla. the automatic update will then be enabled.

download the latest binary from http://ftp.mozilla.org and verify the download (checksum and gpg – for gpg you need mozilla’s key)

as of the time of writing the following script downloaded the binary and verified it:

$ mkdir ~/{bin,software}
$ cd ~/software
$ wget http://ftp.mozilla.org/pub/thunderbird/nightly/latest-comm-central/thunderbird-57.0a1.en-US.linux-x86_64.{tar.bz2,checksums,checksums.asc}
$ tar xvf thunderbird-57.0a1.en-US.linux-x86_64.tar.bz2
$ mv thunderbird thunderbird-daily

the verification process is not as smooth as it could be. this will do a sha512 checksum test

$ grep thunderbird-57.0a1.en-US.linux-x86_64.tar.bz2 thunderbird-57.0a1.en-US.linux-x86_64.checksums | grep sha512 - | awk '{print $1, $4}' - | sha512sum -c -

import pgp key from mozilla. then do signature check

$ gpg2 --verify thunderbird-57.0a1.en-US.linux-x86_64.checksums{.asc,} 

Update script in total

#!/bin/zsh

RELEASE="57.0a1"

# download files
wget -q http://ftp.mozilla.org/pub/thunderbird/nightly/latest-comm-central/thunderbird-${RELEASE}.en-US.linux-x86_64.{tar.bz2,checksums,checksums.asc}

# check sha512 hash
grep thunderbird-${RELEASE}.en-US.linux-x86_64.{tar.bz2,checksums} | grep sha512 - | awk '{print $1, $4}' - | sha512sum -c -

# check gpg signature
gpg2 --verify thunderbird-${RELEASE}.en-US.linux-x86_64.checksums{.asc,} 

# extract, move, cleanup
tar jxf thunderbird-${RELEASE}.en-US.linux-x86_64.tar.bz2
mv thunderbird-daily{,OLD}
mv thunderbird{,-daily}
rm thunderbird-${RELEASE}.en-US.linux-x86_64.{tar.bz2,checksums.asc,checksums}

Now, create a file link:

$ ln -s $HOME/bin/thunderbird-daily $HOME/software/thunderbird-daily/thunderbird-bin

download the daily icon (no direct download link available): assets.mozilla.org

create a desktop entry (include your home folder path!):

$ cat $HOME/.local/share/applications/thunderbird-daily.desktop
[Desktop Entry]
Version=1.0
Name=Thunderbird Daily
Comment=Send and receive mails
GenericName=Mail Client
Exec=/home/paul/bin/thunderbird-daily %u
Icon=thunderbird-daily.png
Terminal=false
Type=Application
MimeType=message/rfc822;x-scheme-handler/mailto;application/x-xpinstall;
StartupNotify=true
Categories=Network;Email;
Keywords=web;browser;internet;
Actions=ComposeMessage;OpenAddressBook;

[Desktop Action ComposeMessage]
Name=Write new message
Exec=/home/paul/bin/thunderbird-daily -compose

[Desktop Action OpenAddressBook]
Name=Open address book
Exec=/home/paul/bin/thunderbird-daily -addressbook