抱歉,您的浏览器无法访问本站

本页面需要浏览器支持(启用)JavaScript


了解详情 >

一些记不住的Linux和Docker命令。

Jupyter Notebook

1. 安装

升级pip3 pip3 install --upgrade pip&pip3 install jupyter

2.运行

查看帮助jupyter notebook -h

运行jupyter notebook 默认888端口

指定端口 jupyter notebook --port <XXX>

后台运行 jupyter notebook --no-browser

3.主题设置

安装pip3 install jupyterthemes

列出可用的主题jt -l

选择主题jt -t XXX

4.扩展设置

安装

1
2
3
pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user
pip install jupyter_nbextensions_configurator

Homebrew

安装

/usr/bin/ruby -e "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install)"

换源

1
2
git -C "$(brew --repo)" remote set-url origin https://mirrors.ustc.edu.cn/brew.git
git -C "$(brew --repo)" remote set-url origin https:*//mirrors.ustc.edu.cn/brew.git*

使用

1
2
3
4
5
6
7
8
9
10
11
12
13
14
// 查询:
brew search 软件名

// 安装:
brew install 软件名

// 卸载:
brew uninstall 软件名

// 更新 Homebrew:
brew update

// 查看 Homebrew 配置信息:
brew config

iTerm2 + Oh My Zsh

参考地址

被墙了需要手动下载并运行 https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh

设置主题

  • 找到文件 open ~/.zshrc
  • 找到ZSH_THEME="robbyrussell"
  • 主题网站https://github.com/ohmyzsh/ohmyzsh/wiki/Themes

alias

1.进入~/.bashrc 输入alias jn="jupyter notebook"

2.生效source ~/.bashrc

3. 应用程序别名

alias subl="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"

Command Line Tools

  • Apple 家官网:https://developer.apple.com/download/more/
  • 以 Apple ID 登录
  • 在搜索框搜索 Command Line Tools
  • 打开你 macOS 上的 XCode,检查其版本号
  • 下载对应版本的 Command Line Tools 镜像(*.dmg
  • 从镜像里手工安装

Ubuntu 缺少依赖问题

Linux常用命令

用途 命令
关机 shut down -h now
新建root用户 sudo passwd root

换源

1
2
3
4
5
6
7
8
9
10
11
12
13
14
sudo cp /etc/apt/sources.list /etc/apt/sources_init.list

sudo gedit /etc/apt/sources.list

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

Hexo个人博客

安装Gitbrew install git

安装nodejs

1
2
3
4
5
6
7
brew install nodejs

brew install npm
# 测试
node -v
npm -v

安装hexo

1
2
3
4
5
6
7
8
9
10
11
npm install -g hexo-cli
# 测试
hexo -v

hexo init myblog
cd myblog //进入这个myblog文件夹
npm install


hexo g
hexo server

生成SSH添加到GitHub

1
2
3
4
5
6
7
8
9
git config --global user.name "yourname" 
git config --global user.email "youremail"

ssh-keygen -t rsa -C "youremail"

Github->Setting->deploy keys id_rsa.pub

# 测试
ssh -T git@github.com

部署Hexo到Github

1
2
3
4
5
6
7
8
9
10
11
12
13
open _config.yml


deploy:
type: git
repo: https://github.com/YourgithubName/YourgithubName.github.io.git
branch: master

npm install hexo-deployer-git --save

hexo clean
hexo generate
hexo deploy

GitBook

安装

1
npm install gitbook-cli -g

评论