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

Linux Mint工具学习

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

 

config autojump

安装命令:

1
sudo  apt-get  install  autojump

安装成功后,执行 autojump 命令,提示错误:

 

 

Please source the correct autojump file in your shell's

startup file. For more information, please reinstall autojump

and read the post installation instructions.

 

~/.bashrc文件中加入如下内容,然后关闭再重新打开命令行:

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

配置完成后,执行 autojump 或者 j 没有报错就说明安装成功。

 


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这个文件,为什么?

  还可以用

sudo service lightdm restart
https://askubuntu.com/questions/15795/how-can-you-log-out-via-the-terminal
还可以
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
sudo apt-get -f install
https://unix.stackexchange.com/questions/273968/apt-unmet-dependecies-libefl-bin
 ---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/Configuring
https://help.ubuntu.com/community/SSH/OpenSSH/Keys

转载于:https://www.cnblogs.com/sysmman/p/9803219.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值