[Linux] 重灌事項記錄

OS:Lubuntu
簡介:重灌需注意的部分

嘸蝦米
  • fcitx
          sudo apt install fcitx fcitx-m17n
          sudo apt install fcitx-table-boshiamy
          # 切換輸入法為 fcitx
          imconfig
          # 登出
          logout
  • gcin
    需有字根檔 noseeing.gtab,請自行準備
          sudo apt install gcin
          # move noseeing.gtab to ~/.gcin
          # 切換輸入法為 gcin
          imconfig
          # 登出
          logout
  • hime
    需有字根檔 noseeing.gtab,請自行準備
          sudo apt install hime
          # move noseeing.gtab to ~/.config/hime
          # 切換輸入法為 hime
          imconfig
          # 登出
          logout
  • ibus
    再新的ibus或菜鳥也能簡單成功安裝嘸蝦米
telegram
  • 官方下載檔案
  • PPA
          sudo add-apt-repository ppa:atareao/telegram
          sudo apt update
          sudo apt install telegram
  • 無法輸入中文解法
    因 QT 編寫的程式在 Gnome3 下常會遇到的問題
    需安裝對應輸入法的 qt5,例:fcitx-frontend-qt5, gcin-qt5-immodule, hime-qt5-immodule
    曾遇過 fcitx 仍無效,此時換為 hime 即可
          # xxx 可替換成目前的輸入法,例:fcitx, gcin, hime
          env QT_IM_MODULE=xxx ~/opt/Telegram/Telegram -- %u
開機掛載硬碟
  sudo mkdir /media/使用者名稱/資料夾名稱
  # 確認硬碟位置
  sudo fdisk -l
  # 依確認的硬碟位置
  sudo mount /dev/硬碟位置 /media/使用者名稱/資料夾名稱
  # 查詢 UUID
  blkid -s UUID
  # 編輯 /etc/fstab,格式如下
  # UUID=查詢到的UUID /media/使用者名稱/資料夾名稱    ext4    errors=remount-ro 0       1
  sudo vim /etc/fstab
window 遠端
  sudo apt install xrdp
  # 需依不同的桌面環境設定,LXDE 如下
  echo "lxsession -s Lubuntu -e LXDE" > ~/.xsession
  # echo xfce4-session > ~/.xsession
  sudo service xrdp restart
ssh
  sudo apt install ssh
  sudo vim /etc/ssh/sshd_config
  # Port 2202
備份
防火牆
  sudo ufw enable
  sudo ufw default deny incoming
  # for ssh
  sudo ufw allow 2202/tcp
  # for remote
  sudo ufw allow from 192.168.1.0/24 to any port 3389
  # for web
  udo ufw allow 5000/tcp
  # 確認 ufw 設定
  sudo ufw status verbose
~/.bashrc
  alias python='python3'
  alias pythonDev='source ~/模板/venv/dev_venv/bin/activate'
  alias gnucash='~/.local/bin/gnucash'
  alias dropbox='python ~/dropbox.py'

  # golang 設定
  export PATH=$PATH:/usr/local/go/bin
  export GOPATH=$HOME/go
~/.vimrc
fzf
gnucash
Quote.pm
/usr/share/perl5/Finance
backup
  # https://wiki.gnucash.org/wiki/Backup
  ~/.local/share/gnucash
  ~/.config/gnucash
  
  dconf dump /org/gnucash/ > "GSettings.txt"
  # dconf load /org/gnucash/ < "GSettings.txt"
build
  1. #!/bin/bash
  2. # https://wiki.gnucash.org/wiki/Building_On_Linux
  3.  
  4. # -----------------------------------------------------------------------------------------------------
  5. # Installing the Build Tools;
  6. # -----------------------------------------------------------------------------------------------------
  7. sudo apt install build-essential
  8. sudo apt install autoconf # loads autoscan, autoconf and associated macros
  9. sudo apt install automake
  10. sudo apt install libtool
  11. sudo apt install m4
  12. sudo apt install make
  13. sudo apt install cmake
  14.  
  15.  
  16. # -----------------------------------------------------------------------------------------------------
  17. # Getting the GnuCash sources;
  18. # -----------------------------------------------------------------------------------------------------
  19. export VERSION=3.4 # One place to adjust the version;
  20. export TARBALL=gnucash-$VERSION.tar.bz2 # if you still have no bzip2 use ".gz" instead of ".bz2";
  21. export URL=https://sourceforge.net/projects/gnucash/files/gnucash%20%28stable%29/$VERSION # ;
  22. cd ~/Downloads # "~" short for "$HOME" = "/home/<user>";
  23. wget $URL/$TARBALL # Download the tarball;
  24. sha256sum $TARBALL # Integrity check: Compare the output with the sha256sum from the URL;
  25. mkdir ~/Applications -p
  26. tar -xjvf $TARBALL -C ~/Applications # extract the tarball below your personal Applications directory;
  27.  
  28.  
  29. # -----------------------------------------------------------------------------------------------------
  30. # Installing Google Test;
  31. # -----------------------------------------------------------------------------------------------------
  32. #cd $HOME/.local/src
  33. #git clone https://github.com/google/googletest.git
  34. #cd googletest
  35. #mkdir mybuild
  36. #cd mybuild
  37. #cmake -DBUILD_GMOCK=ON ../ # building gmock builds gtest by default
  38. #make # build the static libraries
  39. ## the following commands will create environment variables which if set and installed shared or static libraries are not detected will allow CMake to locate the sources and compile them into the prject build.
  40. ## These environment variables can be made permanent by copying these commands into $HOME/.profile
  41. #export GTEST_ROOT=$HOME/.local/src/googletest/googletest
  42. #export GMOCK_ROOT=$HOME/.local/src/googletest/googlemock
  43.  
  44.  
  45. # -----------------------------------------------------------------------------------------------------
  46. # Installing Dependencies.
  47. # -----------------------------------------------------------------------------------------------------
  48. sudo apt install libtool libltdl-dev
  49. sudo apt install libglib2.0 libglib2.0-dev # glib2 > v2.40.0
  50. sudo apt install icu-devtools libicu-dev
  51. sudo apt install libboost-all-dev # boost > 1.50.0 - requires locale and regex built with ICU support
  52. sudo apt install guile-2.0 guile-2.0-dev # guile >=2.0.0
  53. #sudo apt install swig2.0 # swig >2.0.10 - swig3.0 on some systems
  54. # not required if building from tarball,
  55. # but required if building from a git clone
  56. sudo apt install libxml2 libxml++2.6-dev libxml2-utils
  57. sudo apt install libxslt1.1 libxslt1-dev
  58. sudo apt install xsltproc
  59. sudo apt install texinfo # required for makeinfo
  60. sudo apt install libsecret-1-0
  61.  
  62. # Only use the next 2 lines if you have not installed [[Google_Test | Google Test]] already.
  63. sudo apt install libgtest-dev # >=1.7.0
  64. sudo apt install google-mock # 1.8.0 installs googlemock in a subdirectory of gtest
  65.  
  66. sudo apt install gtk+3.0
  67. sudo apt install libgtk-3-dev
  68. sudo apt install libwebkit2gtk-4.0-37 libwebkit2gtk-4.0-dev # > webkit2gtk-3.0
  69.  
  70. # Database Backend
  71. sudo apt-get install libdbi1 libdbi-dev # > v0.8.3
  72. sudo apt-get install libdbd-pgsql # PostgreSQL database
  73. sudo apt-get install libdbd-mysql # MySQL database
  74. sudo apt-get install libdbd-sqlite3 # Sqlite database
  75.  
  76. # OFX File importing
  77. sudo apt-get install libofx-dev # This will automatically install the corresponding libofx<n> package as well.
  78.  
  79. # AqBanking
  80. sudo apt-get install aqbanking-tools libaqbanking-dev # > v4.0.0
  81. sudo apt-get install gwenhywfar-tools libgwenhywfar60 libgwenhywfar60-dev
  82.  
  83.  
  84. # -----------------------------------------------------------------------------------------------------
  85. # Build and Install.
  86. # -----------------------------------------------------------------------------------------------------
  87. cd ~/Applications
  88. mkdir build-gnucash-$VERSION # create the build directory - Note: Named to identify the source since it is not within the source directory.
  89. cd build-gnucash-$VERSION # change into the build directory
  90. cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local -DCMAKE_PREFIX_PATH=$HOME/.local ../gnucash-$VERSION # As shown this will install in the .local directory in /home/<user>.
  91. make # builds the program and associated libraries
  92. make install # prefix with sudo if you do install to /usr/local or /opt as admin privileges are required.
  93.  
  94.  
  95. # -----------------------------------------------------------------------------------------------------
  96. # Finance:Quote
  97. # -----------------------------------------------------------------------------------------------------
  98. sudo perl $HOME/.local/bin/gnc-fq-update
  99. sudo perl $HOME/.local/bin/gnc-fq-check
  100. perldoc -lm Finance::Quote
  101.  
  102. # -----------------------------------------------------------------------------------------------------
  103. # Uninstall
  104. # https://wiki.gnucash.org/wiki/Uninstall_Gnucash_Linux.
  105. # -----------------------------------------------------------------------------------------------------
  106. #cd ~/Applications/build-gnucash-$VERSION # either the original build directory or the rebuilt version as above.
  107. #make uninstall # prefix with sudo if installed in /usr/local or /opt or another location requiring admin privileges.
terminal
  • tab 忽略大小寫
          echo "set completion-ignore-case on" > ~/.inputrc
f.lux

留言