惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 三生石上(FineUI控件)
Blog — PlanetScale
Blog — PlanetScale
B
Blog
GbyAI
GbyAI
爱范儿
爱范儿
月光博客
月光博客
N
Netflix TechBlog - Medium
T
Tailwind CSS Blog
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
Vercel News
Vercel News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
WordPress大学
WordPress大学
The GitHub Blog
The GitHub Blog
Recent Announcements
Recent Announcements
腾讯CDC
MyScale Blog
MyScale Blog
V
Visual Studio Blog
The Cloudflare Blog
Microsoft Security Blog
Microsoft Security Blog
A
About on SuperTechFans
Google DeepMind News
Google DeepMind News
Last Week in AI
Last Week in AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

夜行人

回家路上 第一期的直播演示项目 震动检测器 正能量 在线参观CodeLab Neverland 发布 CodeLab Adapter 3.3.1 DynamicTable 之 纸糊方向盘 CodeLab DynamicTable: 一个可实施的技术方案 CodeLab Insight 发布 Alpha 版 情人节 Home Assistant 周报 && IoT 周报 (02) Joplin: 关注隐私的 Evernote 开源替代软件 浏览器的未来与 Web 传感器 Home Assistant 周报 && IoT 周报 (01) 百宝箱(01) 论自由 介绍 WebThings Home Assistant 周报 && iot 周报 (00) 百宝箱(00) 毛姆读书心得 传世之作 周末徒步 CodeLab Adapter ❤️ Jupyter/Python 航班 躲雨 夏令营途中 [译]思想--作为一种技术 The future of coding 美国之行 三门问题的程序模拟
ubuntu server日常
2015-08-15 · via 夜行人

#系统信息

  • lsb_release -a:发行版信息
  • uname
  • uname -a:Unix/kernel 信息

#支持中文

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
sudo apt-get install language-pack-zh-hant language-pack-zh-hans
sudo vim /etc/environment
LANG="zh_CN.UTF8"
LANGUAGE="zh_CN:zh:en_US:en"




sudo vim /etc/default/locale
LANG="zh_CN.UTF-8"
LANGUAGE="zh_CN:zh"

sudo reboot

#设置fish为默认的shell

1
2
sudo apt-get install fish
chsh -s /usr/bin/fish

#使用mosh连接远程服务器 想在mac下使用mosh连接服务器(服务器端也需要安装mosh),两边的语言环境最好相同(可都做以上「支持中文」设置),否则可能因为LANG的问题报错

#IP vim /etc/network/interfaces

###以DHCP方式配置网卡

1
2
auto eth0  
iface eth0 inet dhcp

重启使网络生效:sudo /etc/init.d/networking restart

###配置静态IP

1
2
3
4
5
6
7
8
# The primary network interface  
auto eth0  
iface eth0 inet static  
address 192.168.2.1  
gateway 192.168.2.254  
netmask 255.255.255.0  
#network 192.168.2.0  
#broadcast 192.168.2.255 

重启生效:sudo /etc/init.d/networking restart

#配置DNS sudo vim /etc/resolvconf/resolv.conf.d/tail

添加内容格式和/etc/resolv.conf相同:nameserver 8.8.8.8

重启使网络生效:sudo /etc/init.d/resolvconf restart

#查看端口 sudo lsof -i:8000 :查看8000端口被什么占用

###永久生效

sudo vim /etc/resolvconf/resolv.conf.d/base
sudo resolvconf -u

#交换分区

1
2
3
4
5
6
7
sudo dd if=/dev/zero of=/swapfile count=4096 bs=1M # sudo dd if=/dev/zero of=/wwjdata/swapfile count=8096 bs=1M
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo echo "/swapfile swap swap auto 0 0" | sudo tee -a /etc/fstab
sudo sysctl -w vm.swappiness=10
sudo echo vm.swappiness = 10 | sudo tee -a /etc/sysctl.conf

#设置ssh免登陆 ssh-copy-id ~/.ssh/id_rsa.pub wwj@192.168。1.100

#z jump look at startMyUbuntu.sh

删除

sudo apt-get remove –purge xxx

systemctl

Systemctl是一个systemd工具,主要负责控制systemd系统和服务管理器。

Systemd是一个系统管理守护进程、工具和库的集合

进程管理推荐用supervisor,这里介绍些 systemctl

  • 分析启动时各个进程花费的时间: systemd-analyze blame
  • 如何激活服务并在启动时启用或禁用服务
    • systemctl is-active ajenti.service
    • systemctl enable ajenti.service
    • systemctl disable ajenti.service

#资料

文章作者 种瓜

上次更新 2015-08-15