Ubuntu又双叒叕被玩坏了,命令汇总

Thursday, June 14, 2018

Ubuntu又双叒叕被玩坏了,命令汇总

Ubuntu又又又被玩坏了,汇总备用,持续更新

zsh & oh my zsh

sudo apt-get install zsh
chsh -s /bin/zsh
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

静态ip

vi /etc/network/interfaces

# 添加内容
auto enp2s0
iface enp2s0 inet static
address 192.168.1.17
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8

sudo service network-manager restart
sudo ip addr flush enp2s0
sudo systemctl restart networking.service

emacs

sudo apt-get install libgtk2.0-dev
sudo apt-get install libxpm-dev
sudo apt-get install libjpeg62-dev
sudo apt-get install libgif-dev
sudo apt-get install libtiff5-dev
sudo apt-get install silversearcher-ag
sudo apt-get install libgnutls-dev (emacs26.1)

# 使emacs支持查看pdf
sudo apt-get install xpdf
sudo apt-get install ghostscript

git clone --recursive https://github.com/wuzehv/Emacs.d ~/.emacs.d

# 设置emacs使用fcitx输入法
vi /etc/environment
# 添加内容,并重启
LC_CTYPE="zh_CN.UTF-8"

echo "export TERM=xterm-256color" >> ~/.zshrc

source code pro

unzip fonts.zip -d /usr/share/fonts/opentype/scp
sudo fc-cache -f -v

ssr客户端

sudo dpkg -i electron*.deb

git & clone特别慢,需要有vpn

sudo apt-get install git
git config --global http.https://github.com.proxy https://127.0.0.1:12333
git config --global https.https://github.com.proxy https://127.0.0.1:12333
git config --global credential.helper store

搜狗输入法

sudo add-apt-repository ppa:fcitx-team/nightly
sudo apt-get update
sudo apt-get install fcitx
sudo apt-get install fcitx-config-gtk
sudo apt-get install fcitx-table-all
sudo dpkg -i sougou*.deb

fzf

git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install

enhancd

git clone https://github.com/b4b4r07/enhancd ~/.enhancd
source ~/.enhancd/init.sh
echo source ~/.enhancd/init.sh >> ~/.zshrc

php编译安装

sudo apt-get install libssl-dev libcurl4-openssl-dev pkg-config
sudo apt-get install libxml2-dev
./configure --prefix=/usr/local/php --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysqli --with-pdo-mysql --enable-mbstring --with-curl

echo 'export PATH=$PATH:/usr/local/php/bin:/usr/local/php/sbin' >> ~/.zshrc

MySQL

# 添加用户
groupadd mysql
useradd -r -g mysql -s /bin/false mysql

# 安装依赖
apt-get install g++
apt-get install openssl

# 编译及安装
cd mysql_version/cmake
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql
make && make install

echo 'export PATH=$PATH:/usr/local/mysql/bin' >> ~/.zshrc

# 初始化工作需要给足权限
chmod -R mysql:mysql /usr/local/mysql/

# 初始化,创建表空间文件等
mysqld --initialize --user=mysql

# 生成配置文件
mysql_install_db --user=mysql

# 启动
mysqld_safe --user=mysql &

# 设置root用户密码
mysqladmin -u root password 'kkkkkk'

# 支持service命令操作
cp support-files/mysql.server /etc/init.d/mysql.server

google

sudo wget https://repo.fdzh.org/chrome/google-chrome.list -P /etc/apt/sources.list.d/
sudo wget -q -O - https://dl.google.com/linux/linux_signing_key.pub  | sudo apt-key add -
sudo apt-get update
sudo apt-get install google-chrome-stable

2018.7.8 update

不知道为什么电脑启动后没有工具栏和菜单栏了,找了好久下面的命令对于Ubuntu 16.04 LTS有效,网上提到的其他方法无效。

rm -rf ~/.cache

update 2019.01.22

最近换上了debian,配置了下用root远程连接(方案来源于网络):

/etc/gdm3/daemon.conf
[security]
AllowRoot=true

/etc/pam.d/gdm-password
# auth  required        pam_succeed_if.so user != root quiet_success

/etc/ssh/sshd_config
PermitRootLogin yes

service sshd restart
Linux

指针赋值与strcpy

json_encode()与json_decode()特殊情况汇总