• [shell] 在没有sudo和root权限的机器上配置应用 && python2指南


    在没有sudo和root权限的机器上配置应用

    basic idea: 全部符号链接到 ~/bin/

    ls -s ~/bin/app /path/to/app
    
    • 1

    原因: 环境变量是易于配置的.

    bash_profile && bashrc

    PATH=$PATH:~/bin/

    A shell can be interactive or non-interactive.
    An interactive shell can be either login or non-login shell.

    • A login shell is invoked when a user login to the terminal either remotely via ssh or locally, or when Bash is launched with the --login option.
    • An interactive non-login shell is invoked from the login shell, such as when typing bash in the shell prompt or when opening a new Gnome terminal tab.

    .bash_profile is read and executed when Bash is invoked as an interactive login shell, while .bashrc is executed for an interactive non-login shell.
    Use .bash_profile to run commands that should run only once, such as customizing the $PATH environment variable.

    以上是比较规范的做法, 实际上可以

    # .bash_profile
    source ~/.bashrc
    
    • 1
    • 2

    离线配置 oh-my-zsh neovim

    ohmyzsh zsh-autosuggestions zsh-syntax-highlighting 获取

    github 下载 master, 即

    • ohmyzsh-master.zip
    • zsh-autosuggestions-master.zip
    • zsh-syntax-highlighting-master.zip

    ohmyzsh 离线安装

    修改 $ZSH/tools/install.sh

    1. 删去 git clone
    2. 删去 if [ -d “$ZSH” ]; then 判断

    进一步配置 .zshrc

    提示: 无unicode的ohmyzsh主题: ys

    因为没有chsh的权限 在 .bashrc 末尾添加

    • echo ‘\033[91minto zsh\033[0m’
    • zsh

    zsh-autosuggestions zsh-syntax-highlighting 离线安装

    直接解压到 $ZSH/custom/plugin

    离线安装 neovim

    github 下载 release (linux x86_64 .tar.gz), 直接解压获取二进制, 符号链接到 ~/bin/nvim

    alias结束战斗

    • alias vim=“nvim”
    • alias vi=“nvim”
    • alias ipy=“python -m IPython” # alias ipy2=“python -m IPython”

    感谢

    shell无疑是无拘无束的

    只要我们有稳定的 scripts/binary

    就能仅通过shell通过配置让他们一键运行


    python2指南

    python3的重要改进

    1. 抛出异常必须是BaseException的子类
    2. map filter 必须是迭代器
    3. print repr 必须是函数调用
    4. unicode天然支持 无需指明u"…"
    5. 整数类型 && 整数除法语义
    6. __init__.py

    python 重要命令行参数: -m

    示例

    python2.7 -m IPython

    虽然不够丰富,但是!cmd %magic等基本feature可以使用

  • 相关阅读:
    对遗留系统的处理——(一)系统评价
    【图像去噪】基于隐马尔可夫模型实现图像去噪处理附matlab代码
    数字化营销系统如何为消费者提供精细化服务?又有哪些特点?
    Redis 主从同步原理
    如何使用Hibernate Envers审核数据,包括用户名信息
    计算机毕业设计(附源码)python裕民镇养老院信息管理系统
    人工智能安全-2-非平衡数据处理(2)
    【多媒体文件格式】AVI、WAV、RIFF
    java惠生活网站计算机毕业设计MyBatis+系统+LW文档+源码+调试部署
    GO 语言的函数
  • 原文地址:https://blog.csdn.net/int_main_Roland/article/details/126267430