Memo by Michikazu Kobayashi
Ubuntu

Ubuntu General

  • When ssh connection is slow

    /etc/nsswitch.conf
                    #hosts:          files mdns4_minimal [NOTFOUND=return] dns nis mdns4
                    hosts:          files mdns4_minimal [NOTFOUND=return] dns nis
    /etc/ssh/ssh_config
                    #    GSSAPIAuthentication yes
                    #    GSSAPIDelegateCredentials no
  • When putting the NIS client on Ubuntu, it sometimes fails to start up the NIS client before the network is up at boot time

    • Workaround 1

      In /etc/init/ypbind.conf, add
                          pre-start script
                          …
                          sleep 10
                          end script
      to the last line of the pre-start script to delay startup by 10 seconds. If this still fails occasionally, simply Ctrl+Alt+F2 to get to the console screen and log in, then
                          sudo service ypbind restart
      to restart the NIS client and Ctrl+Alt+F7.
    • Workaround 2

      For personal use, you can give up the NIS client and create an account with the same user name and user ID.
  • Combine pdf files

    Normally, you can user pdftk to combine pdf files, but windows pdfpdfpdf (pdfc.exe) will bookmark the file name.
  • Writing software for pdf files

    In Linux, the only software that can write to pdf files is okular. If you want to write more things, it would be better to use pdf xchange viewer via wine. However, installing directly from wine seems to cause various problems (in my case, it always crashed when saving files). Therefore, I used PlayOnLinux and installed it for 32bit. Japanese inline input is not possible, but you can use a separate editor and copy-paste the input itself.
  • png viewer with easy redisplay

    Okular and qpdfview can be done with F5.The former is very sophisticated, the latter is light. eog (Eye of GNOME : an image viewer) is a bug or something, so it doesn't work well.
  • Install vncviewer

                    sudo apt-get install vncviewer
    The point is that if you install from Ubuntu Software Center, you get something weird.
  • Black screen in vlc media player

    Tools→Settings→Video→Output→X11 video output
    The same method can be userd to solve this problem with SMPPlayer and others.
  • Create boot USB stick

    Gparted is useful for formatting USB sticks. UNetbootin is useful to create a boot USB stick from an iso file. Incidentally, iso files for network installation of Ubuntu can be obtained from here.
  • Fast Fourier Transform on Ubuntu

    For a little Fourier transform.Install
                    apt install libfftw3-3 libfftw3-dev libfftw3-doc
    Compile
                    gcc hoge.c -lm -lfftw3
  • Clearing the Cache

                    sudo sysctl -w vm.drop_caches=3

Lubuntu in general

  • Abiword, Gnumeric

    If you see these two software names, you should delete them immediately. If you open and save doc, xls, etc. sent from office, etc. with these software, the characters will be garbled and you will never be able to recover them.
  • Accessing Windows network (samba) with lubuntu

                    smb://domain;user@server/folder
  • Users with UID less than 1000 are not displayed on the login screen, even though /etc/lightdm/users.conf has minimum-uid=500.

    There is a UID_MIN in /etc/login.defs, so set this from 1000 to 500
    This method did not work in Linux Mint. I don't know what the solution is. At this point, using Linux Mint is no longer an option for me personally.
  • Dual monitors in lubuntu

    menu→settings→monitor settings→turn on both monitors→ check monitor names in xrandr and
                    xrandr --output Monitor2 --right-of Monitor1
    If presenting in office, it is safe to use the same resolution
    If the desired resolution is no available, do
                    xrandr --addmode VGA1 1280x1024
                    xrandr --output VGA1 --mode 1280x1024
    Also, when presenting with libreoffice impress, it often happens that the projector is not recognized by libreoffice impress slideshow→slideshow settings→multiple displays, even though the main and sub displays are switched rather frequently.
                    xrandr --output Monitor2 --right-of Monitor1
                    xrandr --output Monitor2 --left-of Monitor1
                    xrandr --output Monitor2 --above Monitor1
                    xrandr --output Monitor2 --below Monitor1
                    xrandr --output Monitor2 --same-as Monitor1
    and fight (I couldn't do my best at the previous conference...) The fundamental solution, it is to install both ubuntu and lubuntuThe fundamental solution is to install both ubuntu and lubuntu, and start up ubuntu only when you give a presentation.
  • Dual monitors by default

    Even if you set dual monitors by xrandr, it will be restored if you log off, so always set dual monitors.Create a file named $HOME/.config/autostart/multidisplay.desktop, and put
                    [Desktop Entry]
                    Name=multidisplay
                    Exec=xrandr (configuration)
                    Type=Application
  • Dual monitor and touchscreen

    xinput to find out the id of the touchscreen. xrandr to find out the name of the monitor. Then
                    xinput --map-to-output id monitor
  • Install both Ubuntu and Lubuntu

    If only using Lubuntu, specifying Lubuntu desktop during installation. However, if you use both, the installation will fail, or even if it succeeds, various problems will occur and you will be in trouble later. Therefore, it is better to install Lubuntu on Ubuntu later.
                    apt-get install lubuntu-desktop
    The right side of the login screen will ask whether you want to use Ubuntu or Lubuntu.
  • Specify the program to start first in lubuntu

    If there is a corresponding .desktop file in /usr/share/applications, just copy it to $HOME/.config/autostat. If it is a command, write the command to $HOME/.config/lxsession/Lubuntu/autostart.
  • Digital clock settings

                    %x %a %T
    Display is extravagant

Ubuntu20.04LTS

  • Window tiling shortcut using Super keys in lxqt is gone

    Setting it in .config/openbox/lxqt-rc.xml does not work. It seems to be due to a conflict with the lqxt keyboard shotcut called lxqt-globalkeys.Moreover, lxqt-globalkeys does not allow window tiling. What are you thinking?
    The solution is to use the window tiling shortcut using the Super key, Ctrl+Super seems to be recognized as Super, so I'll live with that. Incidentally, I added the following description between and in lxqt-rc.xml.
                    <!-- Keybindings for window tiling -->
                    <keybind key="C-W-Up">
                      <action name="Maximize"/>
                    </keybind>
                    <keybind key="W-Left">        # HalfLeftScreen
                      <action name="UnmaximizeFull"/>
                      <action name="MoveResizeTo"><x>0</x><y>0</y><height>97%</height><width>50%</width></action>
                    </keybind>
                    <keybind key="W-Right">        # HalfRightScreen
                      <action name="UnmaximizeFull"/>
                      <action name="MoveResizeTo"><x>-0</x><y>0</y><height>97%</height><width>50%</width></action>
                    </keybind>
                    <keybind key="W-Up">        # HalfUpperScreen
                      <action name="UnmaximizeFull"/>
                      <action name="MoveResizeTo"><x>0</x><y>0</y><width>100%</width><height>50%</height></action>
                    </keybind>
                    <keybind key="W-Down">        # HalfLowerScreen
                      <action name="UnmaximizeFull"/>
                      <action name="MoveResizeTo"><x>0</x><y>-0</y><width>100%</width><height>50%</height></action>
                    </keybind>
                  
    After this
                    openbox --reconfigure
    Cinnamon has a shortcut similar to this by default, but Cinnamon is heavy and has many problems...
  • Japanese input conversion with half/full size keys

    This is the same as before.It is safe to do.
                    sudo apt install fcitx-mozc
  • Make Jupyter-notebook's default browser Chrome

    It launches in Chrome on Ubuntu and Cinnamon, but Firefox on Lubuntu.
                    $HOME/anaconda3/bin/jupyter-notebook --generate-config
    Then edit $HOME/.jupyter/jupyter_notebook_config.py
                    # c.NotebookApp.browser = ''
    to
                    c.NotebookApp.brower = '/usr/bin/google-chrome'
  • Make Coogle chrome the default web browser in LXQT (also solves the above problem)

    FireFox starts up even though I set it up with Chrome.
    Settings→LXQt settings→LXQt Configuration Center→LXQt session settings→Prescribed applications→Web browser→/usr/bin/google-chrome
    Why can't I set it from the chrome side?
  • Install zoom

    Download and install from a miserable software manager like Discover or something like that, because you'll get something miserable
                    sudo apt install zoom_amd64.deb
  • Install Hengshan font

    Install from CUI, as you can't find it in Discover or other miserable software manager. I feel like it gets more and more?
                    sudo apt install fonts-aoyagi-kouzan-t
                    sudo apt install fonts-kouzan-mouhitsu
  • Making WPS Office Japanese

    It is not enough to move the ja_JP folder to the mui folder.
    First, download ja_JP.7z from here and extract it.Move it to $HOME/.local/share/Kingsoft/office6/mui/. If there is no mui folder, create one. Then edit $HOME/.config/Kingsoft/Office.conf
                    [General]
                    PersistentStatus=0
                    languages=ja_JP
    Add the red part and restart WPS Office.
  • SpaceFM icon is crappy (small)

    Settings→LXQt settings→Appearance→Change icon theme
  • Alsa volume control not found in lxqt.

                    alsamixer
  • Wired LAN not recognized during OS installation

    I219-V controller is not recognized until Ubuntu20.04.2. Therefore, you need to install Ubuntu 20.04.3 (or later). That means Japanese Remix (20.04.1) is no good.
  • Application indicator icons are wrong

    I have confirmed that fcitx-mozc, Skype, Slack, discord, and to a lesser extent sylpheed are also wrong. I have looked around, but it doesn't work, and some people seem to have stopped using lxqt because of this. So I would like to stop using lxqt and lubuntu here too. Thank you very much. → I will use lxde. Since then lxde related.
  • The behavior of slack in lxde is strange

    Specifically, when I try to open xdg from chrome, it doesn't return to the slack app, but opens a new chrome instead. So I'm going to register it.
                    echo "x-scheme-handler/slack=slack.desktop;" >> ~/.local/share/applications/mimeinfo.cache
                    cp $HOME/.config/autostart/slack.desktop $HOME/.local/share/applications/
  • I want to do detailed power management

    lxde does not have an app for power management, so I'll borrow xfce4 power management
                    sudo apt install xfce4-power-manager
    Then, in /etc/xdg/lxsession/LXDE/autostart, add
                    @xfce4-power-manager
    lxqt-powermanagement might be ok, but let's not touch lxqt anymore for a while.
  • Ctl + Alt + T does not bring up terminal

    In $HOME/.config/openbox/lxde-rc.xml, between <keyboard> and </keyboard>
                    <!-- Keybindings for window tiling -->
                    <keybind key="C-W-Up">
                      <action name="Maximize"/>
                    </keybind>
                    <keybind key="W-Left">        # HalfLeftScreen
                      <action name="UnmaximizeFull"/>
                      <action name="MoveResizeTo"><x>0</x><y>0</y><height>100%</height><width>50%</width></action>
                    </keybind>
                    <keybind key="W-Right">        # HalfRightScreen
                      <action name="UnmaximizeFull"/>
                      <action name="MoveResizeTo"><x>-0</x><y>0</y><height>100%</height><width>50%</width></action>
                    </keybind>
                    <keybind key="W-Up">        # HalfUpperScreen
                      <action name="UnmaximizeFull"/>
                      <action name="MoveResizeTo"><x>0</x><y>0</y><width>100%</width><height>50%</height></action>
                    </keybind>
                    <keybind key="W-Down">        # HalfLowerScreen
                      <action name="UnmaximizeFull"/>
                      <action name="MoveResizeTo"><x>0</x><y>-0</y><width>100%</width><height>50%</height></action>
                    </keybind>
                  
                    <!-- Launch a terminal on Ctrl + Alt + T-->
                    <keybind key="C-A-T">
                      <action name="Execute">
                        <command>qterminal</command>
                      </action>
                    </keybind>
    In addition, I included the above keyboard tiling. After this
                    openbox --reconfigure
    I tried qterminal this time, but I think anything is fine.
  • Install obs-studio and the plugin backgroundremoval.

    backgroundremoval is distributed on git, but the installation instructions there do not allow you to install it (you will be asked for a file that may not exist in the world, such as obs-frontend-apiConfig.cmake). Instead, use pacstall to install.
    First of all, preparation. pacstall is installed.
                    git clone https://github.com/pacstall/pacstall.git
                    cd pacstall
                    sudo ./install.sh
    Uninstall obs-studio once and install the latest version again (in some cases you may need to re-install more).
                    sudo apt remove obs-studio --auto-remove
                    sudo add-apt-repository ppa:obsproject/obs-studio -r
                    sudo apt update
                    sudo apt install obs-studio
    install what you need
                    sudo apt install -y libobs-dev libopencv-dev language-pack-en build-essential cmake
    Install backgroundremoval
                    pacstall -I obs-backgroundremoval-git
    Sometimes it fails to install because it failed to install onnxruntime. The probable cause is listed in the backgroundremoval installation instructions.
                    wget https://github.com/microsoft/onnxruntime/releases/download/v1.7.0/onnxruntime-linux-x64-1.7.0.tgz
                    sudo tar xzvf onnxruntime-linux-x64-1.7.0.tgz --strip-components=1 -C /usr/local/ --wildcards "*/include/*" "*/lib*/"
    This is probably due to running. In this case, the files
                    /usr/local/include/cpu_provider_factory.h
                    /usr/local/include/cuda_provider_factory.h
                    /usr/local/include/onnxruntime_c_api.h
                    /usr/local/include/onnxruntime_cxx_api.h
                    /usr/local/include/onnxruntime_cxx_inline.h
                    /usr/local/include/onnxruntime_session_options_config_keys.h
                    /usr/local/lib/libonnxruntime.so.1.7.0
                    /usr/local/lib/libonnxruntime.so
    should be removed. If that doesn't work, extract onnxruntime directly under the download folder.
                    wget https://github.com/microsoft/onnxruntime/releases/download/v1.7.0/onnxruntime-linux-x64-1.7.0.tgz
                    tar zxvf onnxruntime-linux-x64-1.7.0.tgz
    According to the author of obs-backgroundremovel-git, this should complete the installation, launch obs-studio and backgroundremoval should be added to the video filter. If this does not work, exit obs-studio, install v4l2loopback, etc. first, and then launch obs-studio again. If this does not work, re-install obs-studio.
                    sudo apt remove obs-studio --auto-remove
                    sudo apt install obs-studio
  • Building a virtual camera with obs-studio

    Here (Jpn) was helpful. To be frank, you should look here.
    Installing v4l2loopback
                    sudo apt install v4l2loopback-dkms v4l2loopback-utils
    Installing obs-v4l2sink
    From here, download installer and
                    sudo apt install ./obs-v4l2sink.deb
                    cd /usr/lib/x86_64-linux-gnu/obs-plugins
                    sudo ln -s /usr/lib/obs-plugins/v4l2sink.so
    Load V4l2loopback (This needs to be done every reboot)
                    sudo modprobe v4l2loopback devices=1 video_nr=10 card_label="OBS Cam" exclusive_caps=1
    Now OBS Cam appears as a camera option for zoom and skype.Start obs-studio, select Tools → v4l2sink → Device Path as /dev/video10 → click Start to activate the virtual camera, and you will be able to view the screen created in obs-studio on zoom and skype during this time. This works fine for zoom and discord, but for skype, it seems that the basic resolution and the camera resolution need to be matched in order to work properly. Go to "Settings", specify the resolution, and restart obs-studio.