ubuntu16.04 ide搭建
ubuntu常用命令
sudo ifconfig ens38 down #配置网络
sudo ifconfig ens38 up #配置网络
sudo ifconfig ens33 192.168.1.3 #配置网络
sudo ifconfig ens33 192.168.0.120 #配置网络
sudo ifconfig ens33 192.168.1.120 #配置网络
sudo /etc/init.d/networking restart #配置网络
printf "\e[?2004l" #Linux终端复制粘贴后前后会多出0~和~1
du -h -d1 #查看当前目录文件或文件夹大小
hostname #查看主机名
vim /etc/hostname #修改第一行
vim /etc/hosts #修改第二行
find . -type f -exec dos2unix {} \; #批量转换dos到unix
Rg -C 2 -F "require('uglifyjs-webpack-plugin')" #括号无须转义
sudo ifconfig ens33 192.168.0.120 #配置网络
sudo ifconfig ens33 netmask 255.255.255.0 #配置网络
sudo route add default gw 192.168.0.1 #配置网络
sudo /etc/init.d/networking restart #配置网络 sudo service network restart
ctags --languages=c -R linux-3.4.2/ #生成tags
sudo chgrp book Hi3516Ev200Kits/ -R #转换文件属性的用户组
:UpdateTypesFile #vim开启taghighlight插件 同时生成tags
:UpdateTypesFileOnly #vim开启taghighlight插件 不生成tags
sudo update-alternatives --config vim #切换vimbanben
1.1 安装vim80 x64(已验证可行)
sudo apt-get install libncurses5-dev libgnome2-dev libgnomeui-dev \
libgtk2.0-dev libatk1.0-dev libbonoboui2-dev \
libcairo2-dev libx11-dev libxpm-dev libxt-dev python-dev \
python3-dev ruby-dev liblua5.1 lua5.1-dev libperl-dev git
dpkg -l | grep vim
sudo rm /usr/local/share/vim -rf
sudo rm /usr/local/bin/vim
cd vim80
./configure --with-features=huge \
--enable-python3interp \
--enable-pythoninterp \
--with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu/ \
--enable-rubyinterp \
--enable-luainterp \
--enable-perlinterp \
--with-python3-config-dir=/usr/lib/python3.5/config-3.5m-x86_64-linux-gnu/ \
--enable-multibyte \
--enable-cscope \
--with-x \
--prefix=/usr/local/vim/
make && sudo make install
sudo cp src/vim /usr/local/bin/
sudo cp src/vim /usr/bin/
sudo update-alternatives --install /usr/bin/editor editor /usr/bin/vim 1
sudo update-alternatives --set editor /usr/bin/vim
sudo update-alternatives --install /usr/bin/vi vi /usr/bin/vim 1
sudo update-alternatives --set vi /usr/bin/vim
vim --version
1.2 安装vim80 x86(已验证可行)
sudo apt install libncurses5-dev
# 源代码及运行时文件: ftp://ftp.vim.org/pub/vim/unix/vim-8.0.tar.bz2
tar jxf vim-8.0.tar.bz2
./configure --with-features=huge \
--enable-python3interp \
--enable-pythoninterp \
--with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu/ \
--enable-rubyinterp \
--enable-luainterp \
--enable-perlinterp \
--with-python3-config-dir=/usr/lib/python3.5/config-3.5m-x86_64-linux-gnu/ \
--enable-multibyte \
--enable-cscope \
--with-x \
--prefix=/usr/local/vim/
make && sudo make install
sudo cp src/vim /usr/local/bin/
2. 安装ripgrep(已验证可行) :Leaderf插件依赖于ctags和ripgrep X86和X64都ok
sudo apt install cargo
git clone git://github.com/BurntSushi/ripgrep or git clone https://github.com/BurntSushi/ripgrep
cd ripgrep
sudo touch ~/.cargo/config && 写入以下内容
[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"
replace-with = 'ustc'
[source.ustc]
registry = "git://mirrors.ustc.edu.cn/crates.io-index"
sudo cargo build --release
./target/release/rg --version
sudo cp ./target/release/rg /usr/local/bin/
3. 安装YouCompleteMe(已验证可行,但对网速有要求)
cd .vim/pluged
git clone git://github.com/Valloric/YouCompleteMe.git or git clone https://github.com/Valloric/YouCompleteMe.git
cd YouCompleteMe
sudo git submodule update --init --recursive (如遇错误,删除错误文件夹,重新运行本指令)
sudo ./install.py --clang-completer
4. 安装搜狗输入法(已验证可行)
add-apt-repository ppa:fcitx-team/nightly %添加源
apt-get update %更新系统
apt-get install fcitx %安装fcitx
apt-get install fcitx-config-gtk %安装fcitx配置工具
apt-get install fcitx-table-all %安装fcitx-table-all
apt-get install im-switch %安装im-switch切换工具
apt-get install -f %安装所有依赖
# 打开系统设置中的language support,将最后一行键盘输入法系统由默认的iBus改为fcitx
apt install libopencc1 fcitx-libs fcitx-libs-qt fonts-droid-fallback
dpkg -i sogoupinyin_2.3.1.0112_amd64.deb
system seeting------->Text Entry-------->左下角"+"--------->找到“Sogoupinyin”--------->"Add"
# 计算机中搜索并打开“fcitx configuration” -------->左下角"+"--------->选择搜狗输入法并添加
5. 安装vim-plug(已验证可行)需要翻墙
curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
call plug#begin('~/.vim/plugged')
Plug 'itchyny/lightline.vim'
# Plug 其他若干
call plug#end()
:source ~/.vimrc
7. git查看ssl版本号
git config http.sslVersion
git config --global --list
git config --global http.sslVersion tlsv1.2
8. 源码升级openssl;升级cUrl版本;升级git
wget https://www.openssl.org/source/ openssl-1.0.2m.tar.gz
tar -zxvf openssl-1.0.2m.tar.gz
cd openssl-1.0.2m
./config -fpic shared && make && make install
echo "/usr/local/ssl/lib" >> /etc/ld.so.conf
ldconfig
wget http://curl.haxx.se/download/curl-7.59.0.tar.gz
tar -xzvf curl*.tar.gz
cd curl*
./configure --with-ssl=/usr/local/ssl --disable-ldap
make && make install
curl -V
wget https://www.kernel.org/pub/software/scm/git git-2.16.2.tar.gz
tar xzf git-2.1.2.tar.gz
make configure
./configure --prefix=/usr/local/git --with-lib=/usr/local/ssl/
make && make install
echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
source /etc/bashrc
git version
9. 卸载
apt-get purge openssl
rm -rf /etc/ssl
apt-get remove curl
apt-get remove git
which -a git
cd /usr/bin/git
rm -rf git*
10. ubuntu下删除所有.git目录
find . -type d -iname ".git" -exec rm -rf {} \;
11. NFS挂载
mount -t nfs -o nolock 192.168.1.120:/nfsroot /nfsroot
http://192.168.1.100/vod.html
http://localhost/vod.html
12.
# for clang-3.8
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.8 1 --slave /usr/bin/clang++ clang++ /usr/bin/clang++-3.8
# for clang-4.0
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-4.0 2 --slave /usr/bin/clang++ clang++ /usr/bin/clang++-4.0
# 切换版本
sudo update-alternatives --config clang
13.查看linux下静态库或动态库是32位还是64位
# 动态库:
file 动态库文件
# 静态库:
objdump -a 静态库文件
14.使用pyenv安装Python出现The Python zlib extension was not compiled. Missing the zlib错误
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils
15.编译YouCompleteMe的ycm_core(ubuntu 14.04.6 i686)
mkdir ~/ycm_build
wget http://llvm.org/releases/3.5.0/llvm-3.5.0.src.tar.xz
tar xf llvm-3.5.0.src.tar.xz
mv llvm-3.5.0.src llvm
cd llvm/tools
wget http://llvm.org/releases/3.5.0/cfe-3.5.0.src.tar.xz
tar xf cfe-3.5.0.src.tar.xz
mv cfe-3.5.0.src clang
cd ../projects
wget http://llvm.org/releases/3.5.0/compiler-rt-3.5.0.src.tar.xz
tar xf compiler-rt-3.5.0.src.tar.xz
mv compiler-rt-3.5.0.src compiler-rt
cd ..
./configure --enable-optimized CC=gcc CXX=g++
make -j2
# 编译成功后的提示: llvm[0]: ***** Completed Release+Asserts Build
sudo make install
clang --version
# clang version 3.5.0 (tags/RELEASE_350/final)
cd ~/ycm_build
mv llvm llvm.sr
cmake -G "Unix Makefiles" ~/.vim/plugged/YouCompleteMe/third_party/ycmd/cpp -DEXTERNAL_LIBCLANG_PATH=~/ycm_build/llvm.src/Release+Asserts/lib/libclang.so
make ycm_core
16. 使用pyenv安装多版本python
git clone git://github.com/yyuu/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
exec $SHELL -l
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils
pyenv versions
pyenv install 2.7.6
pyenv rehash
pyenv install 3.5.3
pyenv rehash
17. Linux : 将make输出全部重定向到文件
make > make_log.txt 2>&1
18. 反向编译
arm-linux-objdump -D u-boot > u-boot.dis
20. vim 不同窗口之间的复制粘贴(vim 必须支持clipboard)
noremap y "+y ||| g:ycm_collect_identifie
noremap p "+p
noremap w bve
noremap W ve
set tags=./tags;,tags
22. u-boot命令(暂没有移植完整驱动的kernel,所以暂使用mini2440的配置)
nand erase.chip
setenv ipaddr 192.168.0.16
setenv serverip 192.168.0.120
saveenv
tftp 30000000 u-boot-lihao.bin; nand erase.part u-boot; nand write 30000000 u-boot
tftp 30000000 uImage; nand erase.part kernel; nand write 30000000 kernel
tftp 30000000 fs_mini_mdev_new.yaffs2; nand erase.part rootfs; nand write.yaffs 30000000 260000 $filesize
set 'nand read 30000000 kernel;bootm 30000000'
set bootargs console=ttySAC0,115200 root=/dev/mtdblock3
set machid 7CF set machid 16a
save
reset
23. arm-linux 3.4.2(暂没有移植完整驱动的kernel,所以暂使用mini2440的配置)
ifconfig eth0 192.168.0.16
# 下载网络内核到RAM 并启动
nfs 30000000 192.168.0.120:/work/nfs_root/uImage_new; bootm 30000000
tftp 30000000 uImage_new; bootm 30000000
tftp 30000000 uImage; bootm 30000000
# 挂载网络文件系统
mount -t nfs -o nolock,vers=2 192.168.0.120:/work/nfs_root/fs_mini_mdev_new /mnt
# uboot设置网络文件系统
set bootargs console=ttySAC0,115200 root=/dev/nfs nfsroot=192.168.0.120:/work/nfs_root/fs_mini_mdev_new ip=192.168.0.16:192.168.0.120:192.168.0.1:255.255.255.0::eth0:off
save
24. VIM默认情况下,函数名是不会高亮的,将下面这段代码添加到/usr/share/vim/vim80/syntax/c.vim文件的末尾即可:
syn match cFunctions "\<[a-zA-Z_][a-zA-Z_0-9]*\>[^()]*)("me=e-2
syn match cFunctions "\<[a-zA-Z_][a-zA-Z_0-9]*\>\s*("me=e-1
hi cFunctions gui=NONE cterm=bold ctermfg=yellow
26. vim-ripgrep插件
Plug 'jremmen/vim-ripgrep'
27. 移植完linux-3.4.2内核,ifconfig: SIOCSIFADDR: No such device
#原因:机器id如果是SMDK2440的16a就会出现上述问题。 暂时解决办法:在uboot界面设置机器id为MINI2440的7CF。
set machid 7CF
28. 开发板运行minigui
第一步:复制库文件
cp /opt/minigui3.2.3/arm/cross/lib/* ../lib/ -rf
第二步:修改开发板上的/etc/MiniGUI.cfg文件
[system]
# GAL engine and default options
gal_engine=fbcon
#IAL engine
ial_engine=cosole
mdev=/dev/input/mice
mtype=IMSP2
[fbcon]
Defaultmode=240x320-16bpp #我的LCD显示器是240x320像素的竖屏
第三步:在/etc/init.d/rcS脚本文件里添加如下内容
/bin/ln –s /dev/vc/0 /dev/tty0 #如不加,则出现如下问题:NEWGAL>FBCON: Can''''''''''''''''t open /dev/tty0: No such file or directory
第四步:测试
./mginit
29. 更新terminator版本
sudo apt purge terminator
cd Downloads/
ls
wget https://mirrors.edge.kernel.org/ubuntu/pool/universe/t/terminator/terminator_1.91-4_all.deb
ls
sudo dpkg -i ./terminator_1.91-4_all.deb
sudo apt install -f
sudo dpkg -i ./terminator_1.91-4_all.deb
terminator
30. minigui报错
1). KERNEL>InitGUI: Initialization of GDI failure
ans:初始化GDI, 主要是字体的初始化
2). LoadSharedResource: No such file or directory
ans:mkdir /var/tmp
31. ubuntu安装测试live555(live.2017.09.12.tar.gz)
http://download.videolan.org/pub/contrib/live555/
tar xvzf live.2017.09.12.tar.gz
cd live/
./genMakefiles linux
make #编译后在live/mediaServer下生成live555MediaServer,拷贝一个.264测试视频文件到/live/mediaServer下
./live555MediaServer
连接上网线,打开VLC播放器,媒体->打开网络串流,输入rtsp://192.168.0.120:8000/tc10.264
32. jz2440安装测试live555(live.2017.09.12.tar.gz)
http://download.videolan.org/pub/contrib/live555/
tar xvzf live.2017.09.12.tar.gz
cd live/
cp config.armlinux config.jz2440
vim config.jz2440 #修改 CROSS_COMPILE?= arm-linux-
./genMakefiles jz2440
make #编译后在live/mediaServer下生成live555MediaServer,拷贝一个.264测试视频文件到/live/mediaServer下
./live555MediaServer
连接上网线,打开VLC播放器,媒体->打开网络串流,输入rtsp://192.168.0.16:80/tc10.264
- 分享
- 举报
-
浏览量:1509次2020-09-21 13:55:54
-
浏览量:2068次2021-12-07 09:35:55
-
2019-09-18 22:02:59
-
浏览量:2776次2020-04-28 16:24:10
-
浏览量:899次2023-06-12 14:34:29
-
浏览量:3960次2021-12-03 16:40:57
-
浏览量:875次2023-12-22 14:13:56
-
浏览量:9106次2017-11-30 20:27:01
-
浏览量:5900次2021-12-10 16:15:34
-
浏览量:645次2023-07-20 17:45:54
-
浏览量:6287次2021-07-08 15:47:11
-
浏览量:631次2024-01-16 18:03:56
-
浏览量:2679次2018-04-22 20:46:42
-
浏览量:2858次2020-08-21 19:39:43
-
浏览量:8289次2022-06-01 10:01:04
-
浏览量:1369次2024-01-10 15:17:17
-
浏览量:937次2023-09-01 13:29:58
-
浏览量:4448次2020-07-31 13:45:09
-
浏览量:2161次2020-08-05 21:02:35
-
广告/SPAM
-
恶意灌水
-
违规内容
-
文不对题
-
重复发帖
qn1587891882
感谢您的打赏,如若您也想被打赏,可前往 发表专栏 哦~
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明