Loading...
Navigation
Table of Contents

常用软件配置Tech

网易云音乐歌词

http://music.163.com/api/song/media?id=186016
#其中186016为歌曲ID

VLC

字体用Microsoft Yahei UI


bat批量重命名

@echo off
setlocal enabledelayedexpansion
set sum=23
for  %%x in (*) do (
    if not "%%x"=="demo.bat" (
        set /a sum+=1
        rename "%%x" "!sum!.jpg"
))
pause

把文件保存为demo.bat; 本例的重命名是从24.jpg开始


Java

环境:Java Update 131之后版本, Win10 2017
只需在系统变量PATH中添加C:\Program Files\Java\jdk1.8.0_131\bin, C:\Program Files\Java\jdk1.8.0_131\jre\bin这两条.


Git Bash

中文乱码:Options - Text里的Character Set改成GBK.


Anaconda

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes

参考官方Doc和一份翻译版本的中文文档.

多环境下的Jupyter

默认安装好Anaconda, Jupyter的kernel是只有root位置C:\\Anaconda\\python.exe的; 可以通过添加kernel的方法添加envs下的子环境. 首先把root位置添加到kernel列表, 即python -m ipykernel install --user, 此时会发现C:\Users\username\AppData\Roaming\jupyter\kernels里多了python 3文件夹, 复制一下这个文件夹, 并重命名来对应envs里面的子环境, 再把里面的kernel.json修改一下就可以了; 注意, 子环境里面也必须安装好ipykernel才能正常使用, 即conda install ipykernel.

安装anaconda2

清华大学镜像站

wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda2-5.2.0-Linux-x86_64.sh
bash Anacondaxxxxx.bash -p PATH -u

其中PATH是自己的安装路径,这样就可以更改Anaconda默认的安装路径了

使用source ~/.bashrc启用自己的anaconda环境.


TensorFlow

参考官网

pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.4.0-cp27-none-linux_x86_64.whl
mkdir whls
cd whls
pip download https://pypi.tuna.tsinghua.edu.cn/packages/91/b5/5219622fa7c17197eb1611eaa045270737e1a57eb854ef5359aac7d79cd7/tensorflow_gpu-1.4.0-cp27-cp27mu-manylinux1_x86_64.whl
# 会自动下载所有当前环境(python2)下的依赖包
scp -r whls .... # 拷贝whls进入另一台无法联网的机器, 然后切换机器
cd whls
python install *
# 注意如果import tensorflow as tf出现numpy.dtype的问题, 说明numpy版本太新了, 重装一个旧版本即可

tensorboard

tensorboard --port=6066 --logdir=log

VSCode

  • VSCode和S一样, 在win平台上都是通过Ctrl+Shift+P来调出控制台.

  • Beautify: 美化javascript, JSON, CSS, Sass, HTML等文件样式

  • Material Theme: 如题, 安装好之后可以在控制台中输入theme启用

  • Python: 可以右键直接运行py文件

  • Java Run: 可以直接Alt+B编译运行Java文件, 输出界面自动会给错误

  • LaTeX Workshop:

    • 右键可直接编译latex文件, 之后会在下方问题出显示error和warning, 鼠标悬浮在warning上, 可能在左侧出现小灯泡提示
    • 预览状态下, 右键tex文件可以跳转pdf, Ctrl+鼠标左键可以pdf跳转tex
    • 在配置文件里配置toolchain, 其中command为空, 这样默认用pdflatex编译, 详见json
    • 如果想用其它的编译工具, 如xelatex, 可以在tex首行加入% !TEX program = xelatex
{
  "editor.fontFamily": "Consolas, 'Microsoft Yahei'",
  "editor.fontSize": 16,
  "editor.renderWhitespace": "all",
  "editor.wordWrap": "on",
  "editor.minimap.enabled": false,
  "files.autoSave": "off",
  "markdown.preview.fontFamily": "Consolas, 'Microsoft Yahei'",
  "terminal.integrated.fontFamily": "Consolas, 'Microsoft Yahei'",
  "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
  "explorer.openEditors.visible": 20,
  //Material Theme
  "workbench.colorTheme": "Visual Studio Dark",
  //LaTeX Workshop
  "latex-workshop.latex.recipes": [
    {
      "name": "latexmk",
      "command": "latexmk",
      "args": [
        "-synctex=1",
        "-interaction=nonstopmode",
        "-file-line-error",
        "-pdf",
        "-outdir=%OUTDIR%",
        "%DOC%"
      ],
      "env": {}
    },
    {
      "name": "pdflatex",
      "command": "pdflatex",
      "args": [
        "-synctex=1",
        "-interaction=nonstopmode",
        "-file-line-error",
        "%DOC%"
      ],
      "env": {}
    },
    {
      "name": "pdflatex ➞ biber ➞ pdflatex`×2",
      "tools": [
        "pdflatex",
        "biber",
        "pdflatex",
        "pdflatex"
      ]
    }
  ],
  "latex-workshop.latex.tools": [
    {
      "name": "pdflatex",
      "command": "pdflatex",
      "args": [
        "-synctex=1",
        "-interaction=nonstopmode",
        "-file-line-error",
        "%DOC%"
      ]
    },
    {
      "name": "biber",
      "command": "biber",
      "args": [
        "%DOCFILE%"
      ]
    }
  ],
  "cSpell.language": "en",
  "telemetry.enableTelemetry": false,
  "telemetry.enableCrashReporter": false,
  "latex-workshop.view.pdf.viewer": "tab",
  "python.linting.pylintEnabled": true,
  "git.autofetch": false,
  "editor.cursorBlinking": "smooth",
  "workbench.statusBar.feedback.visible": false,
  "workbench.startupEditor": "newUntitledFile",
  "latex-workshop.latex.autoBuild.run": "never",
  "latex-workshop.showContextMenu": true
}

其中latex的编译方式只提供了pdflatex一步的方式, 更多参考官方页面.


Sublime

{
    "color_scheme": "Packages/Color Scheme - Default/Mariana.sublime-color-scheme",
    "draw_white_space": "all",
    "font_size": 14,
    "line_padding_bottom": 2,
    "line_padding_top": 2,
    "open_files_in_new_window": false,
    "theme": "Adaptive.sublime-theme",
    "translate_tabs_to_spaces": true,
    "show_encoding": true,
    "word_wrap": true,
    "highlight_line": true,
}


Transmission

以当前用户运行transmission, 参考这里最后一条.

transmission-daemon --config-dir /home/USER/.config/transmission-daemon

nginx配置参考这里.

location /download/ {
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_set_header X-NginX-Proxy true;
    proxy_http_version 1.1;
    proxy_set_header Connection "";
    proxy_pass_header X-Transmission-Session-Id;
    add_header   Front-End-Https   on;

    location /download/rpc {
        proxy_pass http://127.0.0.1:9093;
    }

    location /download/web/ {
        proxy_pass http://127.0.0.1:9093;
    }

    location /download/upload {
        proxy_pass http://127.0.0.1:9093;
    }

    location /download/web/style/ {
        alias /usr/share/transmission/web/style/;
    }

    location /download/web/javascript/ {
        alias /usr/share/transmission/web/javascript/;
    }

    location /download/web/images/ {
        alias /usr/share/transmission/web/images/;
    }
    location /download/ {
        return 301 https://$server_name/download/web;
    }
}

Last updated on Mar 24, 2019.