123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810 |
- <!DOCTYPE html>
- <html lang="en" data-default-color-scheme=auto>
- <head><!-- hexo injector head_begin start -->
- <script defer src="https://api.limour.top/vue/0d2f95c1-755d-436b-adf8-eee12a80ed32/script.js"></script>
- <!-- hexo injector head_begin end -->
- <meta charset="UTF-8">
- <link rel="apple-touch-icon" sizes="76x76" href="https://img.limour.top/2023/08/29/64ee07361815a.webp">
- <link rel="icon" href="https://img.limour.top/2023/08/29/64ee07361815a.webp">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
- <meta http-equiv="x-ua-compatible" content="ie=edge">
-
- <meta name="theme-color" content="#2f4154">
- <meta name="author" content="Limour">
- <meta name="keywords" content="">
-
- <meta name="description" content="安装 vscode-web 安装好 docker QUIC 转 SOCKS5 12mkdir -p ~/app/vscode &amp;&amp; cd ~/app/vscode &amp;&amp; nano docker-compose.ymlsudo docker-compose up -d &amp;&amp; sudo docker-compose logs 123456789101">
-
-
-
- <title>【记录】安装生信的代码编写环境 - Limour's Blog</title>
- <link rel="stylesheet" href="https://jscdn.limour.top/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css" />
- <link rel="stylesheet" href="https://jscdn.limour.top/npm/github-markdown-css@4.0.0/github-markdown.min.css" />
- <link rel="stylesheet" href="https://jscdn.limour.top/npm/hint.css@2.7.0/hint.min.css" />
- <!-- 主题依赖的图标库,不要自行修改 -->
- <!-- Do not modify the link that theme dependent icons -->
- <link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_hj8rtnfg7um.css">
- <link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">
- <link rel="stylesheet" href="/css/main.css" />
- <link id="highlight-css" rel="stylesheet" href="/css/highlight.css" />
-
- <link id="highlight-css-dark" rel="stylesheet" href="/css/highlight-dark.css" />
-
-
- <link rel="stylesheet" href="/theme-inject/custom.css">
- <link rel="stylesheet" href="/theme-inject/iconfont.css">
- <script id="fluid-configs">
- var Fluid = window.Fluid || {};
- Fluid.ctx = Object.assign({}, Fluid.ctx)
- var CONFIG = {"hostname":"hexo.limour.top","root":"/","version":"1.9.7","typing":{"enable":false,"typeSpeed":70,"cursorChar":"_","loop":false,"scope":[]},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"left","visible":"hover","icon":"§"},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"code_language":{"enable":true,"default":"TEXT"},"copy_btn":true,"image_caption":{"enable":true},"image_zoom":{"enable":false,"img_url_replace":["",""]},"toc":{"enable":true,"placement":"right","headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"https://jscdn.limour.top/gh/Limour-dev/Sakurairo_Vision/load_svg/inload.svg","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"follow_dnt":true,"baidu":null,"google":{"measurement_id":null},"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname","ignore_local":false}},"search_path":"/local-search.xml","include_content_in_search":true};
- if (CONFIG.web_analytics.follow_dnt) {
- var dntVal = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
- Fluid.ctx.dnt = dntVal && (dntVal.startsWith('1') || dntVal.startsWith('yes') || dntVal.startsWith('on'));
- }
- </script>
- <script src="/js/utils.js" ></script>
- <script src="/js/color-schema.js" ></script>
-
-
- <link rel="canonical" href="https://hexo.limour.top/-ji-lu--an-zhuang-sheng-xin-de-dai-ma-bian-xie-huan-jing"/>
- <meta name="generator" content="Hexo 7.1.1"><link rel="alternate" href="/atom.xml" title="Limour's Blog" type="application/atom+xml">
- <link rel="alternate" href="/rss2.xml" title="Limour's Blog" type="application/rss+xml">
- </head>
- <body>
-
- <header>
-
- <div class="header-inner" style="height: 70vh;">
- <nav id="navbar" class="navbar fixed-top navbar-expand-lg navbar-dark scrolling-navbar">
- <div class="container">
- <a class="navbar-brand" href="/">
- <strong>Limour's Blog</strong>
- </a>
- <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
- data-target="#navbarSupportedContent"
- aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
- <div class="animated-icon"><span></span><span></span><span></span></div>
- </button>
- <!-- Collapsible content -->
- <div class="collapse navbar-collapse" id="navbarSupportedContent">
- <ul class="navbar-nav ml-auto text-center">
-
-
-
-
-
- <li class="nav-item">
- <a class="nav-link" href="https://hexo.limour.top/" target="_self">
- <i class="iconfont icon-home-fill"></i>
- <span>Home</span>
- </a>
- </li>
-
-
-
-
-
-
- <li class="nav-item">
- <a class="nav-link" href="/archives/" target="_self">
- <i class="iconfont icon-archive-fill"></i>
- <span>Archive1</span>
- </a>
- </li>
-
-
-
-
-
-
- <li class="nav-item">
- <a class="nav-link" href="https://occdn.limour.top/archives/" target="_self">
- <i class="iconfont icon-archive-fill"></i>
- <span>Archive2</span>
- </a>
- </li>
-
-
-
-
-
-
- <li class="nav-item">
- <a class="nav-link" href="https://b.limour.top/archives/" target="_self">
- <i class="iconfont icon-archive-fill"></i>
- <span>Archive3</span>
- </a>
- </li>
-
-
-
-
-
-
- <li class="nav-item">
- <a class="nav-link" href="https://od.limour.top/" target="_self">
- <i class="iconfont icon-onedrive"></i>
- <span>Alist</span>
- </a>
- </li>
-
-
-
-
-
-
- <li class="nav-item">
- <a class="nav-link" href="https://orcid.org/0000-0001-8897-1685" target="_self">
- <i class="iconfont icon-orcid"></i>
- <span>Orcid</span>
- </a>
- </li>
-
-
-
-
-
-
- <li class="nav-item">
- <a class="nav-link" href="/links/" target="_self">
- <i class="iconfont icon-link-fill"></i>
- <span>Links</span>
- </a>
- </li>
-
-
-
-
-
-
- <li class="nav-item">
- <a class="nav-link" href="/atom.xml" target="_self">
- <i class="iconfont icon-rss"></i>
- <span>RSS</span>
- </a>
- </li>
-
-
-
- <li class="nav-item" id="search-btn">
- <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
- <i class="iconfont icon-search"></i>
- </a>
- </li>
-
-
-
- <li class="nav-item" id="color-toggle-btn">
- <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">
- <i class="iconfont icon-dark" id="color-toggle-icon"></i>
- </a>
- </li>
-
- </ul>
- </div>
- </div>
- </nav>
-
- <div id="banner" class="banner" parallax=true
- style="background: url('https://img.limour.top/2023/08/29/64ee08e108638.webp') no-repeat center center; background-size: cover;">
- <div class="full-bg-img">
- <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
- <div class="banner-text text-center fade-in-up">
- <div class="h2">
-
- <span id="subtitle">【记录】安装生信的代码编写环境</span>
-
- </div>
-
-
- <div class="mt-3">
-
- <span class="post-meta mr-2">
- <i class="iconfont icon-author" aria-hidden="true"></i>
- Limour
- </span>
-
-
- <span class="post-meta">
- <i class="iconfont icon-date-fill" aria-hidden="true"></i>
- <time datetime="2023-07-09 20:01" pubdate>
- July 9, 2023 pm
- </time>
- </span>
-
- </div>
- <div class="mt-1">
-
- <span class="post-meta mr-2">
- <i class="iconfont icon-chart"></i>
-
- 1.6k words
-
- </span>
-
-
- <span class="post-meta mr-2">
- <i class="iconfont icon-clock-fill"></i>
-
-
-
- 14 mins
-
- </span>
-
-
-
- </div>
-
- </div>
-
- </div>
- </div>
- </div>
- </div>
- </header>
- <main>
-
-
- <div class="container-fluid nopadding-x">
- <div class="row nomargin-x">
- <div class="side-col d-none d-lg-block col-lg-2">
-
- </div>
- <div class="col-lg-8 nopadding-x-md">
- <div class="container nopadding-x-md" id="board-ctn">
- <div id="board">
- <article class="post-content mx-auto">
- <h1 id="seo-header">【记录】安装生信的代码编写环境</h1>
-
- <p id="updated-time" class="note note-info" style="">
-
-
- Last updated on May 18, 2024 pm
-
-
- </p>
-
-
- <div class="markdown-body">
-
- <h2 id="安装-vscode-web">安装 vscode-web</h2>
- <ul>
- <li>安装好 <a href="/DOCKER-an-zhuang-liu-cheng-ji-lu">docker</a></li>
- <li><a href="/-ji-lu-SOCKS5-zhuan-QUIC">QUIC 转 SOCKS5</a></li>
- </ul>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-built_in">mkdir</span> -p ~/app/vscode && <span class="hljs-built_in">cd</span> ~/app/vscode && nano docker-compose.yml<br>sudo docker-compose up -d && sudo docker-compose logs<br></code></pre></td></tr></table></figure>
- <figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><code class="hljs yml"><span class="hljs-attr">version:</span> <span class="hljs-string">"2.1"</span><br><span class="hljs-attr">services:</span><br> <span class="hljs-attr">code-server:</span><br> <span class="hljs-attr">image:</span> <span class="hljs-string">linuxserver/code-server:latest</span><br> <span class="hljs-attr">container_name:</span> <span class="hljs-string">code-server</span><br> <span class="hljs-attr">environment:</span><br> <span class="hljs-bullet">-</span> <span class="hljs-string">PUID=1000</span><br> <span class="hljs-bullet">-</span> <span class="hljs-string">PGID=1000</span><br> <span class="hljs-bullet">-</span> <span class="hljs-string">TZ=Asia/Shanghai</span><br> <span class="hljs-bullet">-</span> <span class="hljs-string">PASSWORD=password</span><br> <span class="hljs-bullet">-</span> <span class="hljs-string">SUDO_PASSWORD=password</span><br> <span class="hljs-bullet">-</span> <span class="hljs-string">PROXY_DOMAIN=code-server.my.domain</span> <span class="hljs-comment">#optional</span><br> <span class="hljs-bullet">-</span> <span class="hljs-string">DEFAULT_WORKSPACE=/config/workspace</span> <span class="hljs-comment">#optional</span><br> <span class="hljs-attr">volumes:</span><br> <span class="hljs-bullet">-</span> <span class="hljs-string">./config:/config</span><br> <span class="hljs-attr">ports:</span><br> <span class="hljs-bullet">-</span> <span class="hljs-number">2441</span><span class="hljs-string">:8443</span><br> <span class="hljs-attr">restart:</span> <span class="hljs-string">unless-stopped</span><br></code></pre></td></tr></table></figure>
- <h3 id="配置代理和中文">配置代理和中文</h3>
- <ul>
- <li>打开Visual Studio Code,点击Manage,在列表中选择Settings</li>
- <li>在弹出的搜索框中输入"proxy",即可看到代理的配置项"Http:Proxy"</li>
- <li>宿主机获取docker0的ip: <code>ip address | grep docker0</code></li>
- <li>然后docker内设置代理 <code>http://docker0的ip:port</code><br>
- 拓展内搜索zh-cn,安装中文界面拓展</li>
- </ul>
- <h3 id="安装-conda">安装 conda</h3>
- <ul>
- <li>回到WORKSPACE,ctrl+~ 调出终端</li>
- <li><code>sudo sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list</code></li>
- <li><code>sudo apt update</code></li>
- <li><code>sudo apt install wget</code></li>
- <li>安装 <a href="/-ji-lu--an-zhuang-conda-bing-geng-huan-qing-hua-yuan">conda</a></li>
- </ul>
- <h3 id="安装nodejs">安装nodejs</h3>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash">conda create -n node -c conda-forge nodejs<br>conda activate node<br>npm config <span class="hljs-built_in">set</span> registry https://registry.npmmirror.com<br></code></pre></td></tr></table></figure>
- <h3 id="使用git">使用git</h3>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><code class="hljs bash">npm create astro@latest<br>git config --global user.email <span class="hljs-string">"youremail"</span><br>git config --global user.name <span class="hljs-string">"yourname"</span><br>git branch -M main && git add . && git commit -m <span class="hljs-string">'Initial commit'</span><br>git remote add origin https://github.com/Limour-dev/chatGPT.git<br>git push --set-upstream origin main --force <span class="hljs-comment"># Creating a personal access token</span><br>git config --global credential.helper cache<br>git push<br></code></pre></td></tr></table></figure>
- <h3 id="hello-world">hello world</h3>
- <figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs js">---<br><span class="hljs-keyword">const</span> search = <span class="hljs-title class_">Astro</span>.<span class="hljs-property">url</span>.<span class="hljs-property">searchParams</span>.<span class="hljs-title function_">get</span>(<span class="hljs-string">'search'</span>)! || <span class="hljs-string">''</span>;<br>---<br><span class="language-xml"><span class="hljs-tag"><<span class="hljs-name">h1</span>></span>{search}<span class="hljs-tag"></<span class="hljs-name">h1</span>></span></span><br></code></pre></td></tr></table></figure>
- <ul>
- <li><a href="https://hexo.limour.top/go/#aHR0cHM6Ly9kb2NzLmFzdHJvLmJ1aWxkL2VuL2d1aWRlcy9zZXJ2ZXItc2lkZS1yZW5kZXJpbmcvI2VuYWJsaW5nLXNzci1pbi15b3VyLXByb2plY3Q=" rel="noopener external nofollow noreferrer">Enabling SSR in Your Project</a></li>
- <li>编辑 chatGPT/src/pages/index.astro</li>
- <li><code>npm run dev</code></li>
- <li>访问 <code>https://vscode.domain/proxy/3000/?search=hello%20world</code> 进行测试</li>
- </ul>
- <h3 id="附加-win下集成conda">附加 win下集成conda</h3>
- <ul>
- <li>进入设置页面,搜索 <code>terminal.integrated.profiles.windows</code></li>
- <li>编辑 <code>setting.json</code>, 给 <code>PowerShell</code> 中添加 <code>args</code></li>
- <li><code>args</code> 的值可以通过查看 conda 快捷方式的属性来获取</li>
- </ul>
- <figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><code class="hljs json"><span class="hljs-attr">"PowerShell"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span><br> <span class="hljs-attr">"source"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"PowerShell"</span><span class="hljs-punctuation">,</span><br> <span class="hljs-attr">"icon"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"terminal-powershell"</span><span class="hljs-punctuation">,</span><br> <span class="hljs-attr">"args"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span><br> <span class="hljs-string">"${env:windir}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"</span><span class="hljs-punctuation">,</span><br> <span class="hljs-string">"-ExecutionPolicy ByPass -NoExit -Command"</span><span class="hljs-punctuation">,</span><br> <span class="hljs-string">"\"& '${env:USERPROFILE}\\miniconda3\\shell\\condabin\\conda-hook.ps1' ; conda activate '${env:USERPROFILE}\\miniconda3' \""</span><br> <span class="hljs-punctuation">]</span><br><span class="hljs-punctuation">}</span><br></code></pre></td></tr></table></figure>
- <h2 id="安装-Jupyter">安装 Jupyter</h2>
- <h3 id="持久化镜像存储">持久化镜像存储</h3>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-built_in">mkdir</span> -p ~/datascience && <span class="hljs-built_in">cd</span> ~/datascience<br>nano docker-compose.yml<br>sudo docker-compose up -d<br>sudo docker-compose logs<br>sudo docker <span class="hljs-built_in">cp</span> -a jupyterR:/opt /home/limour/upload/opt<br>sudo docker <span class="hljs-built_in">cp</span> -a jupyterR:/home/jovyan /home/limour/upload/home<br>sudo docker-compose down && sudo docker volume prune<br></code></pre></td></tr></table></figure>
- <figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><code class="hljs yml"><span class="hljs-attr">version:</span> <span class="hljs-string">'3.3'</span><br><span class="hljs-attr">services:</span><br> <span class="hljs-attr">datascience-notebook:</span><br> <span class="hljs-attr">ports:</span><br> <span class="hljs-bullet">-</span> <span class="hljs-string">'57002:8888'</span><br> <span class="hljs-attr">container_name:</span> <span class="hljs-string">jupyterR</span><br> <span class="hljs-attr">restart:</span> <span class="hljs-string">always</span><br> <span class="hljs-attr">image:</span> <span class="hljs-string">'jupyter/datascience-notebook:r-4.3.1'</span><br> <span class="hljs-attr">command:</span> <span class="hljs-string">start-notebook.sh</span> <span class="hljs-string">--NotebookApp.token='***'</span><br></code></pre></td></tr></table></figure>
- <h3 id="启动镜像">启动镜像</h3>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs bash">nano docker-compose.yml<br>sudo <span class="hljs-built_in">chmod</span> 777 -R /home/limour/upload/<br>sudo docker-compose up -d<br>sudo docker-compose logs<br></code></pre></td></tr></table></figure>
- <figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><code class="hljs yml"><span class="hljs-attr">version:</span> <span class="hljs-string">'3.3'</span><br><span class="hljs-attr">services:</span><br> <span class="hljs-attr">datascience-notebook:</span><br> <span class="hljs-attr">ports:</span><br> <span class="hljs-bullet">-</span> <span class="hljs-string">'57002:8888'</span><br> <span class="hljs-attr">container_name:</span> <span class="hljs-string">jupyterR</span><br> <span class="hljs-attr">restart:</span> <span class="hljs-string">always</span><br> <span class="hljs-attr">volumes:</span><br> <span class="hljs-bullet">-</span> <span class="hljs-string">'/home/limour/upload:/home/jovyan/upload'</span><br> <span class="hljs-bullet">-</span> <span class="hljs-string">'/home/limour/upload/opt:/opt'</span><br> <span class="hljs-bullet">-</span> <span class="hljs-string">'/home/limour/upload/home:/home/jovyan'</span><br> <span class="hljs-attr">image:</span> <span class="hljs-string">'jupyter/datascience-notebook:r-4.3.1'</span><br> <span class="hljs-attr">command:</span> <span class="hljs-string">start-notebook.sh</span> <span class="hljs-string">--NotebookApp.token='***'</span><br></code></pre></td></tr></table></figure>
- <ul>
- <li><a href="/-ji-lu--an-zhuang-npsfrp-fu-wu-duan-yu-ke-hu-duan">NPS内网穿透加NPM面板反代</a></li>
- </ul>
- <h3 id="R包镜像">R包镜像</h3>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash">nano .Rprofile<br>options()<span class="hljs-variable">$repos</span> <span class="hljs-comment">## 查看使用install.packages安装时的默认镜像</span><br>options()<span class="hljs-variable">$BioC_mirror</span> <span class="hljs-comment">##查看使用bioconductor的默认镜像</span><br></code></pre></td></tr></table></figure>
- <figure class="highlight r"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs R">options<span class="hljs-punctuation">(</span>BioC_mirror<span class="hljs-operator">=</span><span class="hljs-string">"https://mirrors.ustc.edu.cn/bioc/"</span><span class="hljs-punctuation">)</span> <span class="hljs-comment">##指定镜像,这个是中国科技大学镜像</span><br>options<span class="hljs-punctuation">(</span><span class="hljs-string">"repos"</span> <span class="hljs-operator">=</span> <span class="hljs-built_in">c</span><span class="hljs-punctuation">(</span>CRAN<span class="hljs-operator">=</span><span class="hljs-string">"https://mirrors.tuna.tsinghua.edu.cn/CRAN/"</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span> <span class="hljs-comment">##指定install.packages安装镜像,这个是清华镜像</span><br>options<span class="hljs-punctuation">(</span>ggrepel.max.overlaps <span class="hljs-operator">=</span> <span class="hljs-literal">Inf</span><span class="hljs-punctuation">)</span><br></code></pre></td></tr></table></figure>
- <h3 id="安装-R-内核">安装 R 内核</h3>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><code class="hljs bash">conda create -n seurat -c conda-forge r-seurat=4.1.1 -y<br>conda activate seurat<br>conda install -c conda-forge r-tidyverse -y<br>conda install -c conda-forge r-irkernel -y<br>Rscript -e <span class="hljs-string">"IRkernel::installspec(name='seurat', displayname='r-seurat')"</span><br>conda install -c conda-forge r-devtools -y<br>Rscript -e <span class="hljs-string">"BiocManager::install('glmGamPoi')"</span><br>wget -e <span class="hljs-string">"https_proxy=http://172.17.0.1:8580"</span> https://github.com/chris-mcginnis-ucsf/DoubletFinder/archive/refs/heads/master.zip -O DoubletFinder-master.zip<br>Rscript -e <span class="hljs-string">"devtools::install_local('DoubletFinder-master.zip')"</span><br></code></pre></td></tr></table></figure>
- <h3 id="安装-python-内核">安装 python 内核</h3>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs bash">conda create -n markdown2pptx -c conda-forge python -y<br>conda install -n markdown2pptx ipykernel -c conda-forge -y<br>conda run -n markdown2pptx python -m ipykernel install --user --name markdown2pptx<br>conda run -n markdown2pptx pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple<br></code></pre></td></tr></table></figure>
- <h3 id="安装-Golang-内核">安装 Golang 内核</h3>
- <ul>
- <li>项目地址 <a href="https://hexo.limour.top/go/#aHR0cHM6Ly9naXRodWIuY29tL2dvcGhlcmRhdGEvZ29waGVybm90ZXM=" rel="noopener external nofollow noreferrer">gophernotes</a></li>
- </ul>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><code class="hljs bash">conda create -n golang -c conda-forge go -y<br>conda activate golang<br>go <span class="hljs-built_in">env</span> -w GO111MODULE=on<br>go <span class="hljs-built_in">env</span> -w GOPROXY=https://mirrors.aliyun.com/goproxy/<br>go install github.com/gopherdata/gophernotes@v0.7.5 <span class="hljs-comment">#去仓库查看最新版本号</span><br><span class="hljs-built_in">mkdir</span> -p ~/.local/share/jupyter/kernels/golang<br><span class="hljs-built_in">cd</span> ~/.local/share/jupyter/kernels/golang<br><span class="hljs-built_in">cp</span> <span class="hljs-string">"<span class="hljs-subst">$(go env GOPATH)</span>"</span>/pkg/mod/github.com/gopherdata/gophernotes@v0.7.5/kernel/* <span class="hljs-string">"."</span><br><span class="hljs-built_in">chmod</span> +w ./kernel.json<br>sed <span class="hljs-string">"s|gophernotes|<span class="hljs-subst">$(go env GOPATH)</span>/bin/gophernotes|"</span> < kernel.json.in > kernel.json<br></code></pre></td></tr></table></figure>
- <h3 id="安装-jupyter-ai-内核">安装 jupyter-ai 内核</h3>
- <ul>
- <li><a href="/Aggregating-Azure-and-OpenAI-APIs-with-OneAPI">获取端点和令牌</a></li>
- <li>填写端点时尾部需要加上 <code>/v1</code></li>
- </ul>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><code class="hljs bash">conda create -n jupyter-ai -c conda-forge jupyter-ai-magics -y<br>conda install -n jupyter-ai -c conda-forge openai -y<br>conda install -n jupyter-ai ipykernel -c conda-forge -y<br>conda run -n jupyter-ai python -m ipykernel install --user --name jupyter-ai<br><span class="hljs-comment"># pip install --upgrade jupyterlab -i https://pypi.tuna.tsinghua.edu.cn/simple # 升级到 JupyterLab 4</span><br><span class="hljs-comment"># pip install jupyter_ai -i https://pypi.tuna.tsinghua.edu.cn/simple</span><br></code></pre></td></tr></table></figure>
- <ul>
- <li>启用拓展并配置端点和令牌</li>
- </ul>
- <figure class="highlight ipython"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs ipython">%load_ext jupyter_ai_magics<br>%env OPENAI_API_BASE=https://xxx/v1<br>%env OPENAI_API_KEY=sk-xxx<br></code></pre></td></tr></table></figure>
- <ul>
- <li>示例</li>
- </ul>
- <figure class="highlight ipython"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs ipython">%%ai chatgpt -f code<br>解决汉诺塔问题的函数<br></code></pre></td></tr></table></figure>
- <p><img src="https://img.limour.top/2023/10/05/651e61bcdb7a1.webp" srcset="https://jscdn.limour.top/gh/Limour-dev/Sakurairo_Vision/load_svg/inload.svg" lazyload alt=""></p>
- <h2 id="安装-rstudio">安装 rstudio</h2>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-built_in">mkdir</span> -p ~/app/rstudio && <span class="hljs-built_in">cd</span> ~/app/rstudio && nano docker-compose.yml<br>sudo docker-compose up -d && sudo docker-compose logs<br></code></pre></td></tr></table></figure>
- <figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><code class="hljs yml"><span class="hljs-attr">version:</span> <span class="hljs-string">'3'</span><br><span class="hljs-attr">services:</span><br> <span class="hljs-attr">rstudio:</span><br> <span class="hljs-attr">image:</span> <span class="hljs-string">dceoy/rstudio-server</span><br> <span class="hljs-attr">container_name:</span> <span class="hljs-string">Rstudio</span><br> <span class="hljs-attr">deploy:</span><br> <span class="hljs-attr">resources:</span><br> <span class="hljs-attr">limits:</span><br> <span class="hljs-attr">cpus:</span> <span class="hljs-string">'0.50'</span><br> <span class="hljs-attr">memory:</span> <span class="hljs-string">500M</span><br> <span class="hljs-attr">reservations:</span><br> <span class="hljs-attr">cpus:</span> <span class="hljs-string">'0.25'</span><br> <span class="hljs-attr">memory:</span> <span class="hljs-string">200M</span><br> <span class="hljs-attr">restart:</span> <span class="hljs-string">always</span><br> <span class="hljs-attr">ports:</span><br> <span class="hljs-bullet">-</span> <span class="hljs-number">57022</span><span class="hljs-string">:8787</span><br> <span class="hljs-attr">volumes:</span><br> <span class="hljs-bullet">-</span> <span class="hljs-string">/home/gene/zl_liu/rstudio:/home/rstudio</span><br> <span class="hljs-bullet">-</span> <span class="hljs-string">/home/gene/upload:/home/rstudio/upload</span><br> <span class="hljs-attr">working_dir:</span> <span class="hljs-string">/home/rstudio</span><br></code></pre></td></tr></table></figure>
- <h3 id="更改-R-版本">更改 R 版本</h3>
- <ul>
- <li>安装 <a href="/-ji-lu--an-zhuang-conda-bing-geng-huan-qing-hua-yuan">conda</a></li>
- </ul>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-comment"># 容器内</span><br>conda create -n r_4_1_3 -c conda-forge r-base=4.1.3 -y<br>conda activate r_4_1_3<br>whereis R<br><span class="hljs-comment"># /home/rstudio/miniconda3/envs/r_4_1_3/bin/R</span><br><span class="hljs-comment"># 容器外</span><br>docker <span class="hljs-built_in">exec</span> -it Rstudio /bin/bash<br><span class="hljs-built_in">chmod</span> 777 -R /etc/rstudio/<br><span class="hljs-built_in">exit</span> <br>nano -K /etc/rstudio/rserver.conf<br><span class="hljs-comment"># Server Configuration File</span><br>rsession-which-r=/home/rstudio/miniconda3/envs/r_4_1_3/bin/R<br>sudo docker-compose restart<br></code></pre></td></tr></table></figure>
- <h3 id="安装-seurat">安装 seurat</h3>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-comment"># 进入terminal,以下操作均在terminal中进行</span><br><span class="hljs-built_in">export</span> R_LIBS_SITE=<span class="hljs-string">""</span><br><span class="hljs-comment"># 在terminal中进入R</span><br>.libPaths(<span class="hljs-string">'/home/rstudio/miniconda3/envs/r_4_1_3/lib/R/library'</span>)<br>.libPaths() 确保没有其他路径<br>remove.packages(<span class="hljs-string">"vctrs"</span>)<br>install.packages(<span class="hljs-string">"vctrs"</span>)<br>install.packages(<span class="hljs-string">'Seurat'</span>)<br>remove.packages(<span class="hljs-string">"cli"</span>)<br>install.packages(<span class="hljs-string">"cli"</span>)<br>install.packages(<span class="hljs-string">"tidyverse"</span>)<br>install.packages(<span class="hljs-string">"plotly"</span>)<br>重启R session<br>library(tidyverse)<br>library(Seurat)<br></code></pre></td></tr></table></figure>
- <h3 id="绘制-3D-umap">绘制 3D-umap</h3>
- <figure class="highlight r"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br></pre></td><td class="code"><pre><code class="hljs R">library<span class="hljs-punctuation">(</span>plotly<span class="hljs-punctuation">)</span><br>library<span class="hljs-punctuation">(</span>Seurat<span class="hljs-punctuation">)</span><br>sample13 <span class="hljs-operator"><-</span> readRDS<span class="hljs-punctuation">(</span><span class="hljs-string">"~/upload/zl_liu/work/Prognosis/scRNA/sample13.rds"</span><span class="hljs-punctuation">)</span><br>sample13 <span class="hljs-operator"><-</span> RunUMAP<span class="hljs-punctuation">(</span>sample13<span class="hljs-punctuation">,</span> dims <span class="hljs-operator">=</span> <span class="hljs-number">1</span><span class="hljs-operator">:</span><span class="hljs-number">10</span><span class="hljs-punctuation">,</span> n.components <span class="hljs-operator">=</span> <span class="hljs-number">3L</span><span class="hljs-punctuation">)</span><br>plot.data <span class="hljs-operator"><-</span> FetchData<span class="hljs-punctuation">(</span>object <span class="hljs-operator">=</span> sample13<span class="hljs-punctuation">,</span> vars <span class="hljs-operator">=</span> <span class="hljs-built_in">c</span><span class="hljs-punctuation">(</span><span class="hljs-string">"UMAP_1"</span><span class="hljs-punctuation">,</span> <span class="hljs-string">"UMAP_2"</span><span class="hljs-punctuation">,</span> <span class="hljs-string">"UMAP_3"</span><span class="hljs-punctuation">,</span> <span class="hljs-string">"seurat_clusters"</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span><br>plot.data<span class="hljs-operator">$</span>label <span class="hljs-operator"><-</span> paste<span class="hljs-punctuation">(</span>rownames<span class="hljs-punctuation">(</span>plot.data<span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span><br><span class="hljs-comment"># Plot your data, in this example my Seurat object had 21 clusters (0-20)</span><br>plot_ly<span class="hljs-punctuation">(</span>data <span class="hljs-operator">=</span> plot.data<span class="hljs-punctuation">,</span> <br> x <span class="hljs-operator">=</span> <span class="hljs-operator">~</span>UMAP_1<span class="hljs-punctuation">,</span> y <span class="hljs-operator">=</span> <span class="hljs-operator">~</span>UMAP_2<span class="hljs-punctuation">,</span> z <span class="hljs-operator">=</span> <span class="hljs-operator">~</span>UMAP_3<span class="hljs-punctuation">,</span> <br> color <span class="hljs-operator">=</span> <span class="hljs-operator">~</span>seurat_clusters<span class="hljs-punctuation">,</span> <br> colors <span class="hljs-operator">=</span> <span class="hljs-built_in">c</span><span class="hljs-punctuation">(</span><span class="hljs-string">"lightseagreen"</span><span class="hljs-punctuation">,</span><br> <span class="hljs-string">"gray50"</span><span class="hljs-punctuation">,</span><br> <span class="hljs-string">"darkgreen"</span><span class="hljs-punctuation">,</span><br> <span class="hljs-string">"red4"</span><span class="hljs-punctuation">,</span><br> <span class="hljs-string">"red"</span><span class="hljs-punctuation">,</span><br> <span class="hljs-string">"turquoise4"</span><span class="hljs-punctuation">,</span><br> <span class="hljs-string">"black"</span><span class="hljs-punctuation">,</span><br> <span class="hljs-string">"yellow4"</span><span class="hljs-punctuation">,</span><br> <span class="hljs-string">"royalblue1"</span><span class="hljs-punctuation">,</span><br> <span class="hljs-string">"lightcyan3"</span><span class="hljs-punctuation">,</span><br> <span class="hljs-string">"peachpuff3"</span><span class="hljs-punctuation">,</span><br> <span class="hljs-string">"khaki3"</span><span class="hljs-punctuation">,</span><br> <span class="hljs-string">"gray20"</span><span class="hljs-punctuation">,</span><br> <span class="hljs-string">"orange2"</span><span class="hljs-punctuation">,</span><br> <span class="hljs-string">"royalblue4"</span><span class="hljs-punctuation">,</span><br> <span class="hljs-string">"yellow3"</span><span class="hljs-punctuation">,</span><br> <span class="hljs-string">"gray80"</span><span class="hljs-punctuation">,</span><br> <span class="hljs-string">"darkorchid1"</span><span class="hljs-punctuation">,</span><br> <span class="hljs-string">"lawngreen"</span><span class="hljs-punctuation">,</span><br> <span class="hljs-string">"plum2"</span><span class="hljs-punctuation">,</span><br> <span class="hljs-string">"darkmagenta"</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">[</span><span class="hljs-number">1</span><span class="hljs-operator">:</span><span class="hljs-number">7</span><span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span><br> type <span class="hljs-operator">=</span> <span class="hljs-string">"scatter3d"</span><span class="hljs-punctuation">,</span> <br> mode <span class="hljs-operator">=</span> <span class="hljs-string">"markers"</span><span class="hljs-punctuation">,</span> <br> marker <span class="hljs-operator">=</span> <span class="hljs-built_in">list</span><span class="hljs-punctuation">(</span>size <span class="hljs-operator">=</span> <span class="hljs-number">5</span><span class="hljs-punctuation">,</span> width<span class="hljs-operator">=</span><span class="hljs-number">2</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span> <span class="hljs-comment"># controls size of points</span><br> text<span class="hljs-operator">=</span><span class="hljs-operator">~</span>label<span class="hljs-punctuation">,</span> <span class="hljs-comment">#This is that extra column we made earlier for which we will use for cell ID</span><br> hoverinfo<span class="hljs-operator">=</span><span class="hljs-string">"text"</span><span class="hljs-punctuation">)</span> <span class="hljs-comment">#When you visualize your plotly object, hovering your mouse pointer over a point shows cell names</span><br></code></pre></td></tr></table></figure>
- <h2 id="安装-notebook">安装 notebook</h2>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-built_in">mkdir</span> -p /home/limour/upload/home && <span class="hljs-built_in">echo</span> `<span class="hljs-built_in">id</span> -u gene`:`<span class="hljs-built_in">id</span> -g gene`<br><span class="hljs-built_in">mkdir</span> -p ~/app/notebook && <span class="hljs-built_in">cd</span> ~/app/notebook && nano docker-compose.yml<br>sudo docker-compose up -d && sudo docker-compose logs<br></code></pre></td></tr></table></figure>
- <figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><code class="hljs yml"><span class="hljs-attr">version:</span> <span class="hljs-string">'3'</span><br><span class="hljs-attr">services:</span><br> <span class="hljs-attr">notebook:</span><br> <span class="hljs-attr">image:</span> <span class="hljs-string">jupyter/r-notebook</span><br> <span class="hljs-attr">user:</span> <span class="hljs-string">"1001:1001"</span> <span class="hljs-comment"># 替换为gene的UID和GID</span><br> <span class="hljs-attr">container_name:</span> <span class="hljs-string">notebook</span><br> <span class="hljs-attr">restart:</span> <span class="hljs-string">unless-stopped</span><br> <span class="hljs-attr">extra_hosts:</span><br> <span class="hljs-bullet">-</span> <span class="hljs-string">'host.docker.internal:host-gateway'</span><br> <span class="hljs-attr">environment:</span><br> <span class="hljs-bullet">-</span> <span class="hljs-string">DOCKER_STACKS_JUPYTER_CMD=nbclassic</span><br> <span class="hljs-bullet">-</span> <span class="hljs-string">TZ=Asia/Shanghai</span><br> <span class="hljs-bullet">-</span> <span class="hljs-string">JUPYTER_GATEWAY_REQUEST_TIMEOUT=600</span><br> <span class="hljs-bullet">-</span> <span class="hljs-string">JUPYTER_GATEWAY_CONNECT_TIMEOUT=600</span><br> <span class="hljs-attr">ports:</span><br> <span class="hljs-bullet">-</span> <span class="hljs-string">'57002:8888'</span><br> <span class="hljs-attr">volumes:</span><br> <span class="hljs-bullet">-</span> <span class="hljs-string">'/home/limour/upload:/home/jovyan/upload'</span><br> <span class="hljs-bullet">-</span> <span class="hljs-string">'/home/limour/upload/home:/home/jovyan'</span><br> <span class="hljs-bullet">-</span> <span class="hljs-string">'/dev/shm:/home/jovyan/tmp'</span><br> <span class="hljs-attr">command:</span> <span class="hljs-string">start-notebook.py</span> <span class="hljs-string">--NotebookApp.token='***'</span><br></code></pre></td></tr></table></figure>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs bash">conda init<br><span class="hljs-built_in">source</span> activate<br>conda config --add envs_dirs /home/jovyan/upload/envs<br>conda create -n mamba conda-forge::mamba=1.5.7<br><span class="hljs-built_in">source</span> activate mamba<br></code></pre></td></tr></table></figure>
- <figure class="highlight nginx"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs nginx"><span class="hljs-attribute">proxy_connect_timeout</span> <span class="hljs-number">600s</span>;<br><span class="hljs-attribute">proxy_read_timeout</span> <span class="hljs-number">600s</span>;<br><span class="hljs-attribute">proxy_send_timeout</span> <span class="hljs-number">600s</span>;<br><span class="hljs-attribute">proxy_buffering</span> <span class="hljs-literal">off</span>;<br></code></pre></td></tr></table></figure>
- <h3 id="R">R</h3>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-built_in">source</span> activate mamba<br>mamba create -n THCA_24_03_14 conda-forge::r-base=4.3.3<br>mamba install -n THCA_24_03_14 conda-forge::r-irkernel=1.3.2<br>mamba run -n THCA_24_03_14 Rscript -e <span class="hljs-string">"IRkernel::installspec(name='THCA_24_03_14', displayname='THCA_24_03_14')"</span><br><span class="hljs-built_in">source</span> activate THCA_24_03_14<br></code></pre></td></tr></table></figure>
- <h3 id="proxychains">proxychains</h3>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-built_in">source</span> activate mamba<br>mamba install conda-forge::unzip<br>mkidr -p ~/dev && mkidr -p ~/etc && <span class="hljs-built_in">cd</span> ~/dev<br>wget https://github.com/rofl0r/proxychains-ng/archive/refs/heads/master.zip<br>unzip master.zip<br><span class="hljs-built_in">mv</span> proxychains-ng-master proxychains-ng && <span class="hljs-built_in">cd</span> proxychains-ng && make<br><span class="hljs-built_in">cat</span> << <span class="hljs-string">EOF >$HOME/etc/proxychains4.conf</span><br><span class="hljs-string">[ProxyList]</span><br><span class="hljs-string">socks5 `cat /etc/hosts | grep host.docker.internal | awk '{print $1}'` 8580</span><br><span class="hljs-string">EOF</span><br><span class="hljs-built_in">alias</span> proxychains=<span class="hljs-string">'$HOME/dev/proxychains-ng/proxychains4 -q -f $HOME/etc/proxychains4.conf'</span><br>proxychains curl https://b.limour.top<br></code></pre></td></tr></table></figure>
- <h2 id="附加-windows端口映射">附加 windows端口映射</h2>
- <figure class="highlight powershell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs powershell">netsh interface portproxy add v4tov4 listenaddress=<span class="hljs-number">0.0</span>.<span class="hljs-number">0.0</span> listenport=<span class="hljs-number">57002</span> connectaddress=<span class="hljs-number">192.168</span>.<span class="hljs-number">243.129</span> connectport=<span class="hljs-number">57002</span><br>netsh interface portproxy show v4tov4<br></code></pre></td></tr></table></figure>
- <ul>
- <li>防火墙入站规则放行端口<code>57002</code></li>
- <li>假设宿主物理机是 <code>192.168.10.247</code>, 其内部的虚拟机是 <code>192.168.243.129</code></li>
- <li>局域网内其他物理机即可访问 <code>http://192.168.10.247:57002/nbclassic/tree?token=xxx</code></li>
- </ul>
-
- </div>
-
- <hr/>
- <div>
- <div class="post-metas my-3">
-
-
- <div class="post-meta">
- <i class="iconfont icon-tags"></i>
-
- <a href="/tags/%E7%94%9F%E4%BF%A1/" class="print-no-link">#生信</a>
-
- <a href="/tags/docker/" class="print-no-link">#docker</a>
-
- <a href="/tags/vscode/" class="print-no-link">#vscode</a>
-
- <a href="/tags/rstudio/" class="print-no-link">#rstudio</a>
-
- <a href="/tags/jupyter/" class="print-no-link">#jupyter</a>
-
- </div>
-
- </div>
-
-
- <div class="license-box my-3">
- <div class="license-title">
- <div>【记录】安装生信的代码编写环境</div>
- <div>https://hexo.limour.top/-ji-lu--an-zhuang-sheng-xin-de-dai-ma-bian-xie-huan-jing</div>
- </div>
- <div class="license-meta">
-
- <div class="license-meta-item">
- <div>Author</div>
- <div>Limour</div>
- </div>
-
-
- <div class="license-meta-item license-meta-date">
- <div>Posted on</div>
- <div>July 9, 2023</div>
- </div>
-
-
- <div class="license-meta-item license-meta-date">
- <div>Updated on</div>
- <div>May 18, 2024</div>
- </div>
-
-
- <div class="license-meta-item">
- <div>Licensed under</div>
- <div>
-
-
-
- <a class="print-no-link" target="_blank" href="https://creativecommons.org/licenses/by-nc-sa/4.0/">
- <span class="hint--top hint--rounded" aria-label="BY - Attribution">
- <i class="iconfont icon-by"></i>
- </span>
- </a>
-
- <a class="print-no-link" target="_blank" href="https://creativecommons.org/licenses/by-nc-sa/4.0/">
- <span class="hint--top hint--rounded" aria-label="NC - Non-commercial">
- <i class="iconfont icon-nc"></i>
- </span>
- </a>
-
- <a class="print-no-link" target="_blank" href="https://creativecommons.org/licenses/by-nc-sa/4.0/">
- <span class="hint--top hint--rounded" aria-label="SA - Share-alike">
- <i class="iconfont icon-sa"></i>
- </span>
- </a>
-
-
- </div>
- </div>
-
- </div>
- <div class="license-icon iconfont"></div>
- </div>
-
- <div class="post-prevnext my-3">
- <article class="post-prev col-6">
-
-
- <a href="/-hu-xi--dong-mai-xue-qi--fei-gong-neng-bao-gao-jian-dan-pan-du" title="【探索】动脉血气&肺功能报告简单判读">
- <i class="iconfont icon-arrowleft"></i>
- <span class="hidden-mobile">【探索】动脉血气&肺功能报告简单判读</span>
- <span class="visible-mobile">Previous</span>
- </a>
-
- </article>
- <article class="post-next col-6">
-
-
- <a href="/-ji-lu--an-zhuang-npsfrp-fu-wu-duan-yu-ke-hu-duan" title="【记录】安装nps/frp服务端与客户端">
- <span class="hidden-mobile">【记录】安装nps/frp服务端与客户端</span>
- <span class="visible-mobile">Next</span>
- <i class="iconfont icon-arrowright"></i>
- </a>
-
- </article>
- </div>
-
- </div>
-
-
-
- <article id="comments" lazyload>
-
- <div id="waline"></div>
- <script type="text/javascript">
- Fluid.utils.loadComments('#waline', function() {
- Fluid.utils.createCssLink('https://cdn.staticfile.org/waline/2.15.5/waline.min.css')
- Fluid.utils.createScript('https://cdn.staticfile.org/waline/2.15.5/waline.min.js', function() {
- var options = Object.assign(
- {"serverURL":"https://comments.limour.top","path":"window.location.pathname","meta":["nick","mail","link"],"requiredMeta":["nick"],"lang":"zh-CN","emoji":["https://jscdn.limour.top/gh/walinejs/emojis/weibo"],"dark":"html[data-user-color-scheme=\"dark\"]","wordLimit":0,"pageSize":10},
- {
- el: '#waline',
- path: window.location.pathname
- }
- )
- Waline.init(options);
- Fluid.utils.waitElementVisible('#waline .vcontent', () => {
- var imgSelector = '#waline .vcontent img:not(.vemoji)';
- Fluid.plugins.imageCaption(imgSelector);
- Fluid.plugins.fancyBox(imgSelector);
- })
- });
- });
- </script>
- <noscript>Please enable JavaScript to view the comments</noscript>
- </article>
-
- </article>
- </div>
- </div>
- </div>
- <div class="side-col d-none d-lg-block col-lg-2">
-
- <aside class="sidebar" style="margin-left: -1rem">
- <div id="toc">
- <p class="toc-header">
- <i class="iconfont icon-list"></i>
- <span>Table of Contents</span>
- </p>
- <div class="toc-body" id="toc-body"></div>
- </div>
- </aside>
- </div>
- </div>
- </div>
-
-
-
-
-
-
- <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
- <i class="iconfont icon-arrowup" aria-hidden="true"></i>
- </a>
-
-
- <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
- aria-hidden="true">
- <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
- <div class="modal-content">
- <div class="modal-header text-center">
- <h4 class="modal-title w-100 font-weight-bold">Search</h4>
- <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
- <span aria-hidden="true">×</span>
- </button>
- </div>
- <div class="modal-body mx-3">
- <div class="md-form mb-5">
- <input type="text" id="local-search-input" class="form-control validate">
- <label data-error="x" data-success="v" for="local-search-input">Keyword</label>
- </div>
- <div class="list-group" id="local-search-result"></div>
- </div>
- </div>
- </div>
- </div>
-
-
- </main>
- <footer>
- <div class="footer-inner">
-
- <div class="footer-content">
- <a target="_blank" rel="nofollow noopener" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=43130202000203"><img src="https://img.limour.top/2023/08/27/64eadeb81d6a0.webp" srcset="https://jscdn.limour.top/gh/Limour-dev/Sakurairo_Vision/load_svg/inload.svg" lazyload>湘公网安备43130202000203号 </a> <a target="_blank" rel="nofollow noopener" href="https://beian.miit.gov.cn/">湘ICP备20008299号 </a> <a target="_blank" rel="nofollow noopener" href="https://icp.gov.moe/?keyword=20210128">萌ICP备20210128号</a> <br> <a href="https://www.foreverblog.cn/" target="_blank"> <img src="https://img.foreverblog.cn/logo_en_default.png" srcset="https://jscdn.limour.top/gh/Limour-dev/Sakurairo_Vision/load_svg/inload.svg" lazyload alt="" style="width:auto;height:24px"> </a> <br> <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/limour-blog/limour-blog.github.io" target="_blank" rel="nofollow noopener"><span>SRC</span></a> <i class="iconfont icon-love"></i> <a href="https://web.archive.org/web/20231130095837/https://effectiveacceleration.tech/" target="_blank" rel="nofollow noopener"><span>e/Acc</span></a>
- </div>
-
-
-
-
- </div>
- </footer>
- <!-- Scripts -->
-
- <script src="https://jscdn.limour.top/npm/nprogress@0.2.0/nprogress.min.js" ></script>
- <link rel="stylesheet" href="https://jscdn.limour.top/npm/nprogress@0.2.0/nprogress.min.css" />
- <script>
- NProgress.configure({"showSpinner":false,"trickleSpeed":100})
- NProgress.start()
- window.addEventListener('load', function() {
- NProgress.done();
- })
- </script>
- <script src="https://jscdn.limour.top/npm/jquery@3.6.4/dist/jquery.min.js" ></script>
- <script src="https://jscdn.limour.top/npm/bootstrap@4.6.1/dist/js/bootstrap.min.js" ></script>
- <script src="/js/events.js" ></script>
- <script src="/js/plugins.js" ></script>
-
- <script src="/js/img-lazyload.js" ></script>
-
-
- <script>
- Fluid.utils.createScript('https://jscdn.limour.top/npm/tocbot@4.20.1/dist/tocbot.min.js', function() {
- var toc = jQuery('#toc');
- if (toc.length === 0 || !window.tocbot) { return; }
- var boardCtn = jQuery('#board-ctn');
- var boardTop = boardCtn.offset().top;
- window.tocbot.init(Object.assign({
- tocSelector : '#toc-body',
- contentSelector : '.markdown-body',
- linkClass : 'tocbot-link',
- activeLinkClass : 'tocbot-active-link',
- listClass : 'tocbot-list',
- isCollapsedClass: 'tocbot-is-collapsed',
- collapsibleClass: 'tocbot-is-collapsible',
- scrollSmooth : true,
- includeTitleTags: true,
- headingsOffset : -boardTop,
- }, CONFIG.toc));
- if (toc.find('.toc-list-item').length > 0) {
- toc.css('visibility', 'visible');
- }
- Fluid.events.registerRefreshCallback(function() {
- if ('tocbot' in window) {
- tocbot.refresh();
- var toc = jQuery('#toc');
- if (toc.length === 0 || !tocbot) {
- return;
- }
- if (toc.find('.toc-list-item').length > 0) {
- toc.css('visibility', 'visible');
- }
- }
- });
- });
- </script>
- <script src=https://lib.baomitu.com/clipboard.js/2.0.11/clipboard.min.js></script>
- <script>Fluid.plugins.codeWidget();</script>
-
- <script>
- Fluid.utils.createScript('https://jscdn.limour.top/npm/anchor-js@4.3.1/anchor.min.js', function() {
- window.anchors.options = {
- placement: CONFIG.anchorjs.placement,
- visible : CONFIG.anchorjs.visible
- };
- if (CONFIG.anchorjs.icon) {
- window.anchors.options.icon = CONFIG.anchorjs.icon;
- }
- var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
- var res = [];
- for (var item of el) {
- res.push('.markdown-body > ' + item.trim());
- }
- if (CONFIG.anchorjs.placement === 'left') {
- window.anchors.options.class = 'anchorjs-link-left';
- }
- window.anchors.add(res.join(', '));
- Fluid.events.registerRefreshCallback(function() {
- if ('anchors' in window) {
- anchors.removeAll();
- var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
- var res = [];
- for (var item of el) {
- res.push('.markdown-body > ' + item.trim());
- }
- if (CONFIG.anchorjs.placement === 'left') {
- anchors.options.class = 'anchorjs-link-left';
- }
- anchors.add(res.join(', '));
- }
- });
- });
- </script>
- <script>Fluid.plugins.imageCaption();</script>
- <script src="/js/local-search.js" ></script>
- <!-- 主题的启动项,将它保持在最底部 -->
- <!-- the boot of the theme, keep it at the bottom -->
- <script src="/js/boot.js" ></script>
-
- <noscript>
- <div class="noscript-warning">Blog works best with JavaScript enabled</div>
- </noscript>
- <!-- hexo injector body_end start -->
- <script defer src="/theme-inject/timeliness.js"></script>
- <!-- hexo injector body_end end --></body>
- </html>
|