Config the i3wm / openbox / virtualbox / ubuntu / acme /w3m /ranger+vifm / zsh

Linux Mint工具學習html

https://www.bookstack.cn/read/learning-linux-mint/daily-tool-autojump.mdlinux

 

config autojumpgit

安裝命令:github

1
sudo  apt-get  install  autojump

安裝成功後,執行 autojump 命令,提示錯誤:shell

 

 

Please source the correct autojump file in your shell's數據庫

startup file. For more information, please reinstall autojumpubuntu

and read the post installation instructions.vim

 

~/.bashrc文件中加入以下內容,而後關閉再從新打開命令行:segmentfault

1
source  /usr/share/autojump/autojump . bash

配置完成後,執行 autojump 或者 j 沒有報錯就說明安裝成功。windows

 


config the universal-ctags

https://www.cnblogs.com/cascle/p/5133213.html

安裝universal-ctags

universal-ctags是exuberant-ctags的替代者,相比gtags能夠解析更多的語言,可是其餘方面好比操做,數據庫的組織方式等就不夠好。須要本身編譯安裝

先用 git clone https://github.com/universal-ctags/ctags.git 下載,而後參考ctags/docs/autotools.rst用如下命令編譯(Ubuntu要先用 sudo apt-get install autoconf 安裝autoconf)

$ ./autogen.sh
$ ./configure --prefix=/where/you/want # defaults to /usr/local
$ make
$ sudo make install # may require extra privileges depending on where to install

 

 

config the acme


install plan9 usrspace : https://9fans.github.io/plan9port/

我不用每次下源碼編譯,編好了事後,打個包,放到另個一機器上

comile issue: X11/Xlib.h: No such file or directory
A quick search using...
apt search Xlib.h
Turns up the package libx11-dev but you shouldn't need this for pure OpenGL programming. What tutorial are you using?
You can add Xlib.h to your system by running the following...
sudo apt install libx11-dev
https://stackoverflow.com/questions/5299989/x11-xlib-h-not-found-in-ubuntu
fontconfig/fontconfig.h No such file or directory
install libfontconfig-dev

extensions/shape.h : No such file
sudo apt-get install libxtst-dev
https://www.sitepoint.com/understanding-nix-login-scripts/

if you want to switch to different windows manager, you need create ~/.xsession and/or ~/.xsessionrc

 

config the i3

* If you choose the Virtualbox Hotkey (Mouse Integration), then the win key (as modi) can not work. So choose Alt as modi is safe. but Alt is also for open menu shortcut? 

* you can reconfigure i3 by using i3-config-wizard.

[ i3 user guide ]
https://i3wm.org/docs/userguide.html#_changing_the_container_layout
https://github.com/mudan/profile/blob/master/.i3/config

[start i3] 

https://faq.i3wm.org/question/6126/how-do-i-start-i3/index.html

https://www.sitepoint.com/understanding-nix-login-scripts/

 

fix issue 1: after using i3 in lubuntu and exit, can not enter other desktop.

                please type 'startx' (edit ~/.xinitrc first with 'exec xfdesktop' etc.)

fix issue 2: can not enter login screen. 

                please intall a windows manager and it will fix it?

config the w3m

sudo apt-get install w3m

https://github.com/janosgyerik/cheatsheets/wiki/W3m-cheat-sheet

http://wiki.ubuntu.com.cn/W3m

https://wenku.baidu.com/view/bb2e7f19fc4ffe473368ab49.html

config the openbox

intall openbox
https://wyldeplayground.net/install-openbox-on-ubuntu-server-16-04/

  (need install x11-xserver-utils)
  xrandr -s 1024x768

 

choose different windows manager

 https://complete-concrete-concise.com/ubuntu-2/ubuntu-12-04-server/ubuntu-12-04-server-how-to-install-a-gui/

config the virtualbox

ubuntu server 18.04.1
更新源 https://blog.csdn.net/zhangjiahao14/article/details/80554616
https://blog.csdn.net/howell2013/article/details/16991651 拉一個源的模板,不用手動敲

vbox安裝extension出錯,手動彈出光盤,再來一次
https://blog.csdn.net/JCRunner/article/details/44393787
https://askubuntu.com/questions/80341/unable-to-mount-virtualbox-guest-additions-as-a-guest-win7-host

sudo mkdir --p /media/cdrom
sudo mount -t auto /dev/cdrom /media/cdrom/ (mount cd rom, interesting!)
cd /media/cdrom/
sudo sh VBoxLinuxAdditions.run
裝了以後,mount -t纔有vboxsf的類型

 

【解決】fatal error: X11/XXXX.h: No such file or directory
https://www.aliyun.com/jiaocheng/156978.html
安裝庫文件libx11-dev
sudo apt-get install libx11-dev
安裝依賴文件
sudo apt-get install apt-filesudo apt-file updateapt-file search XXXX.h
如:安裝Intrinsic.h
sudo apt-get install apt-filesudo apt-file updateapt-file search Intrinsic.h
搜索結果以下:
libxt-dev: usr/include/X11/Intrinsic.h
所以,只需安裝libxt-dev便可:
sudo apt-get install libxt-dev

 

adjust font in acme
https://wiki.ubuntu.com/Fonts (install font by copy font folder to /usr/share/fonts/truetypes and refresh font cache)
for acme, may also need restart fontsrv
acme-font=/fonts/misc/latin1.8x13.font
Font /fonts/lucidasans/unicode.10.font

 

- using grep
in linux, we can use
grep -r keyword/pattern foldername
in plan9, we can not use that, instead, use the following cmd
grep createDisplay *.cpp
then we got
SurfaceFlinger.cpp:303: sp<IBinder> SurfaceFlinger::createDisplay(const String8& displayName,
and we can then just select SurfaceFlinger.cpp:303 by m1, and click m3 on that, then
a new window was created and locate to that position, great!!
奇怪,這個功能在windows上能夠,可是在linux的plan9port不行, windows standalone版本能夠.
linux貌似也能夠,可是好像有時候會和m3的search string的功能混淆,不會當成文件名來處理
好像規則是若是沒有找到這string, 就會按文件名, 不然定位到改string去了

linux版本有bug, surfaceFlinger這個上面m3有時候進不去目錄(有時候須要所有選中)
因此用grep 搜索一個文件裏的關鍵字更好用些

linux上ls很差用,能夠用dir這個命令
執行win沒有bash shell的上一個命令嘛?\

-> to modify configuration in "C:\Users\XXX\AppData\Roaming\acme-home\lib\profile"

 

install ag
-----------------------
10 CLI Tools that You Will Love – ITNEXT
https://itnext.io/10-cli-tools-that-you-will-love-d214bc73d856

# Install ag $ sudo apt install silversearcher-ag.
On Ubuntu 16.04, ack was located in package ack-grep so you have to use sudo apt install ack-grep to install it
but command name was still ack. fzf: Fuzzy Finder. fzf is a powerful file finder that can find files, processes, environment variables fast.

 

 

config the Ubuntu 

- ubuntu顯示字體不清晰,是由於選擇了虛擬機的自動縮放模式
right ctl+c回到控制模式

- kills current ubuntu session
who -uH
kill xxxx

 

- install .deb

sudo dpkg -i DEB_PACKAGE
https://askubuntu.com/questions/40779/how-do-i-install-a-deb-file-via-the-command-line

 

- enable autojump

https://www.tecmint.com/autojump-a-quickest-way-to-navigate-linux-filesystem/

start some shell script on startup (能夠用來登陸編譯服務器的時候,自動設置編譯環境)

echo '. /usr/share/autojump/autojump.sh' >> ~/.bashrc

https://www.tecmint.com/autojump-a-quickest-way-to-navigate-linux-filesystem/

- install fonts

https://askubuntu.com/questions/3697/how-do-i-install-fonts

其實最簡單,就是直接把字體copy到/usr/share/font/truetype下面

而後fc-cache -f -v

而後fc-list就能夠看到了

 

- 看word

sudo apt install antiword

 

-看pdf

sudo apt install zathura

或者直接用xdg-open

 

--中文支持

https://www.linuxidc.com/Linux/2014-02/96939.htm

下面不必定ok

dpkg-reconfigure locales
保持en_US.UTF-8 UTF-8的選中狀態,而後按下回車,繼續保持en_US.UTF-8 UTF-8的選中狀態,,再回車,就會之心設置locales。此時ubuntu就支持中文顯示了
原文:https://blog.csdn.net/daguanjia11/article/details/81113487
https://blog.csdn.net/vrix/article/details/69389692

 實際上裝了一些window manager/desktop 以及中文字體後就自動ok了

-- samba

  1. sudo apt-get install samba samba-common-bin

  2. systemctrl status smbd nmbd

  3. sudo smbstatus or smbd --version

  ........

  Reference:

  https://www.linuxbabe.com/ubuntu/install-samba-server-ubuntu-16-04

      查看端口

  netstat -tlnp |grep smb

      * virtualbox下光用NAT沒法作到使用samba, 須要再創建一個個host only網卡, 使用192.168.56.x的ip

        https://www.zhihu.com/question/19900112 爲甚host-only沒法設置, 主要是去添加一個virtual box host-only 的網卡在全局設定裏面, 而後ipconfig就能夠看到host有一個192.168.56.1了

   http://www.cnblogs.com/leezhxing/p/4482659.html  virtualbox中centos系統配置nat+host only上網

       以上的文章比較適合ubuntu 使用ifupdown來配置網絡的狀況, 在ubuntu18以後使用了netplan來替代ifupdown,

      因此在虛擬器的全局設置添加host-only adpater後, 在具體設置裏host-only adpater網絡設置裏界面選擇這個adapter後, 就須要用net-plan去配置

  在虛擬機啓動後,首先查看ifconfig -a列出全部設備, 而後sudo vim /etc/netplan/50-cloud-init.yaml,添加以下

注意enp0s8裏面兩個填寫addresses的地方的格式和含義.而後sudo netplan apply就ok了

 Reference:   https://www.itzgeek.com/how-tos/linux/ubuntu-how-tos/netplan-how-to-configure-static-ip-address-in-ubuntu-18-04-using-netplan.html

       https://askubuntu.com/questions/293816/in-virtualbox-how-do-i-set-up-host-only-virtual-machines-that-can-access-the-in

                     https://blog.ubuntu.com/2017/12/01/ubuntu-bionic-netplan

                      https://www.linuxidc.com/Linux/2017-03/141585.htm    VirtualBox虛擬機NAT模式下不能鏈接外網  (解決配置兩張網卡, 虛擬機啓動後,卻不能訪問外網)

--- 使用複製的虛擬機文件

    注意,一臺電腦上的虛擬機磁盤是有UUID的, 直接copy後導入不行, 由於virtualbox會認爲導入了相同UUID的虛擬機. 

   要使用vitrualbox的虛擬介質管理裏面的複製功能來複制到指定位置. 而後在虛擬介質裏面釋放原來的vdi文件, 以後在具體虛擬的操做系統的設置中加載新的磁盤就能夠正常啓動了.

 http://derekmolloy.ie/resize-a-virtualbox-disk

 使用命令也能夠複製, 複製出來的是動態調整大小的虛擬磁盤, 能夠resize

C:\Program Files\Oracle\VirtualBox>VBoxManage.exe clonehd "C:\Users\RXXX\VirtualBox VMs\Ubutu180401\NewVirtualDisk1.vdi" "D:\VirtualBox VM\Ubuntu180401srv\Ubuntu180401srv_01.vid"
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone medium created in format 'VDI'. UUID: ca8abd92-d9de-4009-a1cf-4bb743a01227

 

resize的過程很快, 可是必須是動態分配存儲才能resieze, fixed size不能.用下面的命令.

C:\Program Files\Oracle\VirtualBox>VBoxManage.exe modifyhd --resize 30000 "D:\VirtualBox VM\Ubuntu180401srv\Ubuntu180401srv_01.vdi"
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

https://www.intowindows.com/fix-resize-hard-disk-operation-for-this-format-is-not-implemented-yet-error-while-resizing-virtualbox-disk/

 而後看http://derekmolloy.ie/resize-a-virtualbox-disk, 後面要調整得很複雜.

我沒有仔細研究, 直接簡單粗暴的下載gparted, 而後把剩餘空間都給/dev/sda2了.看起來也沒有問題.

 

 ranger   

http://www.mikewootc.com/wiki/linux/usage/ranger_file_manager.html

 

zsh

sudo apt-get install fonts-powerline

 https://segmentfault.com/a/1190000006248107

https://github.com/robbyrussell/oh-my-zsh

注意網上給的方法都是下載了install.sh,不執行的話是沒有安裝的.

 

--進不了desktop

  安裝太多的desktop, 又刪除一些, 很容易出問題

  能夠刪除~/.XAuthority這個文件,爲何?

  還能夠用


https://askubuntu.com/questions/15795/how-can-you-log-out-via-the-terminal
還能夠sudo service lightdm restart
sudo pkill -u username
sudo service lightdm restart

https://www.cyberciti.biz/faq/howto-kill-unix-linux-user-session/

--使用虛擬機的技巧
C^+P 暫停虛擬機

--fix error while installing Enlightenment
sudo dpkg --force-all -i /var/cache/apt/archives/libefl_201604022131-32022~ubuntu14.04.1_amd64.deb

https://unix.stackexchange.com/questions/273968/apt-unmet-dependecies-libefl-binsudo apt-get -f install
 ---SSH
sudo apt-get install openssh-server
sudo service ssh status
sudo nano /etc/ssh/sshd_config
sudo service ssh restart   or
sudo systemctl restart ssh

https://help.ubuntu.com/14.04/serverguide/openssh-server.html
https://help.ubuntu.com/community/SSH/OpenSSH/Configuringhttps://help.ubuntu.com/community/SSH/OpenSSH/Keys
相關文章
相關標籤/搜索