Winse Blog

走走停停都是风景, 熙熙攘攘都向最好, 忙忙碌碌都为明朝, 何畏之.

Windows Run Ubuntu

@@更新 2021-05-25 [wsl-Ubuntu 20.04.2 LTS] 配置octopress @@更新 2023-11-28 [wsl-Ubuntu 22.04.2 LTS (Jammy Jellyfish)] 配置octopress

最新版的Windows已经可以安装ubuntu了,算是微软开源后的一个阶段性的成果了。

功能和windows兼容性很强(不像cygwin),软链接、文件权限都是和系统一致的。并且基本所有ubuntu的功能都可以使用,安装jekyll、docker都很顺利。同时打开系统的程序也很方便。非常赞和值得程序员去尝试!!

本文后面会逐渐增加使用过程中的一些操作,今天先更新系统安装、octopress安装、docker安装。

系统安装

直接去微软的官网下载最新版系统ISO,然后安装系统 专业版 (教育版比较干净一些,但是网上没有破解方式啊)。

Ubuntu

The Windows Subsystem for Linux lets developers run Linux environments – including most command-line tools, utilities, and applications – directly on Windows, unmodified, without the overhead of a virtual machine.

安装Ubuntu

最新版的Ubuntu已经进入到稳定版。直接打开商店,搜索Ubuntu,然后安装即可。大概200M的样子,很快就安装了。然后Launch会初始化创建用户。

相关的一些有用的文档:

安装mintty

CMD方式操作Ubuntu太难受了,mintty操作就像SecurtCRT一样,简单方便。安装 wsltty-1.8.0-install ,使用mintty来运行ubuntu。

默认mintty的配置放在 %APPDATA%\wsltty。在子目录theme下可以 http://ciembor.github.io/4bit/ 下载一个主题放到该目录下,然后在mintty配置页面选择该主题。

系统文件

root挂载点:C:\Users\<user>\AppData\Local\lxss or C:\Users\<username>\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState

安装Jekyll

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# https://superuser.com/questions/116625/recursively-change-owner-windows-7
#takeown /f "C:\path\to\folder" /r
#icacls "C:\path\to\folder" /reset /T
用powershell管理员权限 "提"权
PS E:\winsegit\octopress> takeown /F . /R
修改就旧系统的文件属性:
PS E:\winsegit\octopress> cacls *.* /T /G Everyone:F

sudo apt-get update
sudo apt-get install ruby-bundler
sudo apt-get install ruby-dev
sudo apt-get install make
sudo apt-get install gcc
bundle install

sudo gem update
sudo gem uninstall rake
sudo gem install rake -v 10.5.0
# sudo apt-get install nodejs
   
rake preview

winse@DESKTOP-ADH7K1Q:~/winsegit/octopress$ rake preview
/usr/lib/ruby/vendor_ruby/bundler/shared_helpers.rb:78: warning: Insecure world writable dir /mnt/c/Windows/System32 in PATH, mode 040777
Starting to watch source with Jekyll and Compass. Starting Rack on port 4000
/usr/lib/ruby/vendor_ruby/bundler/shared_helpers.rb:78: warning: Insecure world writable dir /mnt/c/Windows/System32 in PATH, mode 040777
/usr/lib/ruby/vendor_ruby/bundler/shared_helpers.rb:78: warning: Insecure world writable dir /mnt/c/Windows/System32 in PATH, mode 040777
/var/lib/gems/2.3.0/gems/liquid-2.6.1/lib/liquid/htmltags.rb:43: warning: key "index0" is duplicated and overwritten on line 46
[2017-10-29 22:48:09] INFO  WEBrick 1.3.1
[2017-10-29 22:48:09] INFO  ruby 2.3.1 (2016-04-26) [x86_64-linux-gnu]
[2017-10-29 22:48:09] INFO  WEBrick::HTTPServer#start: pid=39 port=4000
Configuration file: /mnt/e/winsegit/octopress/_config.yml
            Source: source
       Destination: public
      Generating...
                    done.
                  

上面warning提示也有对应的Issue,但也没所谓暂时不理: https://github.com/Microsoft/WSL/issues/1426

UPDATE 2023年11月18日09:22:51 (WSL1 + rvm)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
winse@DESKTOP-BR4MG38:octopress$ sudo apt install make gcc -y
[sudo] password for winse:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
gcc is already the newest version (4:11.2.0-1ubuntu1).
gcc set to manually installed.
make is already the newest version (4.3-4.1build1).
make set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 101 not upgraded.

winse@DESKTOP-BR4MG38:octopress$ gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
gpg: key 105BD0E739499BDB: 2 duplicate signatures removed
gpg: /home/winse/.gnupg/trustdb.gpg: trustdb created
gpg: key 105BD0E739499BDB: public key "Piotr Kuczynski <piotr.kuczynski@gmail.com>" imported
gpg: key 3804BB82D39DC0E3: public key "Michal Papis (RVM signing) <mpapis@gmail.com>" imported
gpg: Total number processed: 2
gpg:               imported: 2
winse@DESKTOP-BR4MG38:octopress$ curl -sSL https://get.rvm.io | bash -s stable
Downloading https://github.com/rvm/rvm/archive/1.29.12.tar.gz
Downloading https://github.com/rvm/rvm/releases/download/1.29.12/1.29.12.tar.gz.asc
gpg: Signature made Sat 16 Jan 2021 02:46:22 AM CST
gpg:                using RSA key 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
gpg: Good signature from "Piotr Kuczynski <piotr.kuczynski@gmail.com>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 7D2B AF1C F37B 13E2 069D  6956 105B D0E7 3949 9BDB
GPG verified '/home/winse/.rvm/archives/rvm-1.29.12.tgz'
Installing RVM to /home/winse/.rvm/
    RVM PATH line found in /home/winse/.bashrc.
    RVM PATH line not found for Zsh, rerun this command with '--auto-dotfiles' flag to fix it.
    RVM sourcing line found in /home/winse/.bash_profile.
    RVM sourcing line not found for Zsh, rerun this command with '--auto-dotfiles' flag to fix it.
Installation of RVM in /home/winse/.rvm/ is almost complete:

  * To start using RVM you need to run `source /home/winse/.rvm/scripts/rvm`
    in all your open shell windows, in rare cases you need to reopen all shell windows.
Thanks for installing RVM 🙏
Please consider donating to our open collective to help us maintain RVM.

👉  Donate: https://opencollective.com/rvm/donate


winse@DESKTOP-BR4MG38:octopress$

##-> @see https://github.com/rvm/rvm/issues/4764#issuecomment-624796884
  Open your terminal
  run /etc/apt/sources.list using vi /etc/apt/sources.list (It is possible that you can't save this file, and might get "permission denied" error. SO, in that case, open this file with sudo vi /etc/apt/sources.list)
  after opening it, go to the end of file and paste this line:
  deb http://security.ubuntu.com/ubuntu bionic-security main
  save this file by typing :wq
  now, paste this command in terminal:
  sudo apt update && apt-cache policy libssl1.0-dev
  You will see an update like libssl1.0-dev: Installed: (none) Candidate: 1.0.2n-1ubuntu5.3 Version table: 1.0.2n-1ubuntu5.3 500 500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
  then, run this command:
  sudo apt-get install libssl1.0-dev

winse@DESKTOP-BR4MG38:~$ sudo apt update && apt-cache policy libssl1.0-dev
Hit:1 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:2 http://archive.ubuntu.com/ubuntu jammy InRelease
Get:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Get:4 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Hit:5 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Err:4 http://security.ubuntu.com/ubuntu bionic-security InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
Get:6 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [1,162 kB]
Get:7 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [998 kB]
Reading package lists... Done
W: GPG error: http://security.ubuntu.com/ubuntu bionic-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
E: The repository 'http://security.ubuntu.com/ubuntu bionic-security InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

##--> @see https://askubuntu.com/questions/943539/the-following-signatures-couldnt-be-verified-because-the-public-key-is-not-avai

winse@DESKTOP-BR4MG38:~$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3B4FE6ACC0B21F32
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
Executing: /tmp/apt-key-gpghome.Ak5EisV4UJ/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3B4FE6ACC0B21F32
gpg: key 3B4FE6ACC0B21F32: public key "Ubuntu Archive Automatic Signing Key (2012) <ftpmaster@ubuntu.com>" imported
gpg: Total number processed: 1
gpg:               imported: 1

winse@DESKTOP-BR4MG38:~$ sudo apt update && apt-cache policy libssl1.0-dev
Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:3 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Hit:4 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:5 http://security.ubuntu.com/ubuntu bionic-security InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
103 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
libssl1.0-dev:
  Installed: (none)
  Candidate: 1.0.2n-1ubuntu5.13
  Version table:
     1.0.2n-1ubuntu5.13 500
        500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages

winse@DESKTOP-BR4MG38:~$ sudo apt-get install libssl1.0-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libssl1.0.0
The following NEW packages will be installed:
  libssl1.0-dev libssl1.0.0
0 upgraded, 2 newly installed, 0 to remove and 103 not upgraded.
Need to get 2,455 kB of archives.
After this operation, 10.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libssl1.0.0 amd64 1.0.2n-1ubuntu5.13 [1,089 kB]
Get:2 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libssl1.0-dev amd64 1.0.2n-1ubuntu5.13 [1,366 kB]
Fetched 2,455 kB in 4s (665 kB/s)
Preconfiguring packages ...
Selecting previously unselected package libssl1.0.0:amd64.
(Reading database ... 29956 files and directories currently installed.)
Preparing to unpack .../libssl1.0.0_1.0.2n-1ubuntu5.13_amd64.deb ...
Unpacking libssl1.0.0:amd64 (1.0.2n-1ubuntu5.13) ...
Selecting previously unselected package libssl1.0-dev:amd64.
Preparing to unpack .../libssl1.0-dev_1.0.2n-1ubuntu5.13_amd64.deb ...
Unpacking libssl1.0-dev:amd64 (1.0.2n-1ubuntu5.13) ...
Setting up libssl1.0.0:amd64 (1.0.2n-1ubuntu5.13) ...
Setting up libssl1.0-dev:amd64 (1.0.2n-1ubuntu5.13) ...
Processing triggers for libc-bin (2.35-0ubuntu3.1) ...
winse@DESKTOP-BR4MG38:~$

winse@DESKTOP-BR4MG38:octopress$ rvm install 2.3
Searching for binary rubies, this might take some time.
No binary rubies available for: ubuntu/22.04/x86_64/ruby-2.3.8.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for ubuntu.
Requirements installation successful.
Installing Ruby from source to: /home/winse/.rvm/rubies/ruby-2.3.8, this may take a while depending on your cpu(s)...
ruby-2.3.8 - #downloading ruby-2.3.8, this may take a while depending on your connection...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 13.7M  100 13.7M    0     0  3149k      0  0:00:04  0:00:04 --:--:-- 3149k
ruby-2.3.8 - #extracting ruby-2.3.8 to /home/winse/.rvm/src/ruby-2.3.8.....
ruby-2.3.8 - #configuring..........................................................
ruby-2.3.8 - #post-configuration..
ruby-2.3.8 - #compiling.............................................................................................................................................................................................................................................
ruby-2.3.8 - #installing..............
ruby-2.3.8 - #making binaries executable..
ruby-2.3.8 - #downloading rubygems-3.0.9
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  865k  100  865k    0     0   701k      0  0:00:01  0:00:01 --:--:--  701k
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.3.8 - #extracting rubygems-3.0.9.....
ruby-2.3.8 - #removing old rubygems........
ruby-2.3.8 - #installing rubygems-3.0.9................................................................
ruby-2.3.8 - #gemset created /home/winse/.rvm/gems/ruby-2.3.8@global
ruby-2.3.8 - #importing gemset /home/winse/.rvm/gemsets/global.gems..............................there was an error installing gem rubygems-bundler
.............................
ruby-2.3.8 - #generating global wrappers........
ruby-2.3.8 - #gemset created /home/winse/.rvm/gems/ruby-2.3.8
ruby-2.3.8 - #importing gemsetfile /home/winse/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.3.8 - #generating default wrappers........
ruby-2.3.8 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.3.8 - #complete
Ruby was built without documentation, to build it run: rvm docs generate-ri
winse@DESKTOP-BR4MG38:octopress$

winse@DESKTOP-BR4MG38:octopress$ rvm list
   ruby-2.3.8 [ x86_64 ]

# Default ruby not set. Try 'rvm alias create default <ruby>'.

# => - current
# =* - current && default
#  * - default

winse@DESKTOP-BR4MG38:octopress$

winse@DESKTOP-BR4MG38:octopress$ bash --login
winse@DESKTOP-BR4MG38:octopress$ rvm use 2.3.8 --default
Using /home/winse/.rvm/gems/ruby-2.3.8

##--> @see https://mirrors.tuna.tsinghua.edu.cn/help/rubygems/

winse@DESKTOP-BR4MG38:octopress$ unset HTTPS_PROXY
winse@DESKTOP-BR4MG38:octopress$ bundle config mirror.https://rubygems.org https://mirrors.tuna.tsinghua.edu.cn/rubygems

winse@DESKTOP-BR4MG38:octopress$ bundle install
Fetching source index from https://mirrors.tuna.tsinghua.edu.cn/rubygems/
Resolving dependencies...
Fetching rake 10.5.0
Installing rake 10.5.0
Fetching RedCloth 4.2.9
Installing RedCloth 4.2.9 with native extensions
Fetching bigdecimal 1.3.2
Installing bigdecimal 1.3.2 with native extensions
Fetching blankslate 2.1.2.4
Installing blankslate 2.1.2.4
Using bundler 1.17.3
Fetching timers 1.1.0
Installing timers 1.1.0
Fetching celluloid 0.15.2
Installing celluloid 0.15.2
Fetching chunky_png 1.3.1
Installing chunky_png 1.3.1
Fetching fast-stemmer 1.0.2
Installing fast-stemmer 1.0.2 with native extensions
Fetching classifier 1.3.4
Installing classifier 1.3.4
Fetching coffee-script-source 1.7.1
Installing coffee-script-source 1.7.1
Fetching execjs 2.2.1
Installing execjs 2.2.1
Fetching coffee-script 2.3.0
Installing coffee-script 2.3.0
Fetching colorator 0.1
Installing colorator 0.1
Fetching fssm 0.2.10
Installing fssm 0.2.10
Fetching sass 3.2.19
Installing sass 3.2.19
Fetching compass 0.12.6
Installing compass 0.12.6
Fetching ffi 1.9.3
Installing ffi 1.9.3 with native extensions
Fetching tilt 1.4.1
Installing tilt 1.4.1
Fetching haml 4.0.5
Installing haml 4.0.5
Fetching jekyll-coffeescript 1.0.0
Installing jekyll-coffeescript 1.0.0
Fetching jekyll-gist 1.1.0
Installing jekyll-gist 1.1.0
Fetching jekyll-paginate 1.0.0
Installing jekyll-paginate 1.0.0
Fetching jekyll-sass-converter 1.0.0
Installing jekyll-sass-converter 1.0.0
Fetching rb-fsevent 0.9.4
Installing rb-fsevent 0.9.4
Fetching rb-inotify 0.9.5
Installing rb-inotify 0.9.5
Fetching listen 2.7.9
Installing listen 2.7.9
Fetching jekyll-watch 1.0.0
Installing jekyll-watch 1.0.0
Fetching kramdown 1.4.0
Installing kramdown 1.4.0
Fetching liquid 2.6.1
Installing liquid 2.6.1
Fetching mercenary 0.3.4
Installing mercenary 0.3.4
Fetching posix-spawn 0.3.8
Installing posix-spawn 0.3.8 with native extensions
Fetching yajl-ruby 1.1.0
Installing yajl-ruby 1.1.0 with native extensions
Fetching pygments.rb 0.6.0
Installing pygments.rb 0.6.0
Fetching redcarpet 3.1.2
Installing redcarpet 3.1.2 with native extensions
Fetching safe_yaml 1.0.4
Installing safe_yaml 1.0.4
Fetching parslet 1.5.0
Installing parslet 1.5.0
Fetching toml 0.1.1
Installing toml 0.1.1
Fetching jekyll 2.1.1
Installing jekyll 2.1.1
Fetching jekyll-date-format 1.0.0
Installing jekyll-date-format 1.0.0
Fetching jekyll-page-hooks 1.3.0
Installing jekyll-page-hooks 1.3.0
Fetching jekyll-sitemap 0.5.0
Installing jekyll-sitemap 0.5.0
Fetching json 1.8.2
Installing json 1.8.2 with native extensions
Fetching rack 1.5.2
Installing rack 1.5.2
Fetching rack-protection 1.5.3
Installing rack-protection 1.5.3
Fetching rdiscount 2.1.7.1
Installing rdiscount 2.1.7.1 with native extensions
Fetching rubypants 0.2.0
Installing rubypants 0.2.0
Fetching sass-globbing 1.0.0
Installing sass-globbing 1.0.0
Fetching sinatra 1.4.5
Installing sinatra 1.4.5
Fetching stringex 1.4.0
Installing stringex 1.4.0
Bundle complete! 16 Gemfile dependencies, 50 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
Post-install message from haml:

HEADS UP! Haml 4.0 has many improvements, but also has changes that may break
your application:

* Support for Ruby 1.8.6 dropped
* Support for Rails 2 dropped
* Sass filter now always outputs <style> tags
* Data attributes are now hyphenated, not underscored
* html2haml utility moved to the html2haml gem
* Textile and Maruku filters moved to the haml-contrib gem

For more info see:

http://rubydoc.info/github/haml/haml/file/CHANGELOG.md

winse@DESKTOP-BR4MG38:octopress$

winse@DESKTOP-BR4MG38:octopress$ rake preview
Starting to watch source with Jekyll and Compass. Starting Rack on port 14000
/home/winse/.rvm/gems/ruby-2.3.8/gems/liquid-2.6.1/lib/liquid/htmltags.rb:43: warning: key "index0" is duplicated and overwritten on line 46
[2023-11-18 09:42:44] INFO  WEBrick 1.3.1
[2023-11-18 09:42:44] INFO  ruby 2.3.8 (2018-10-18) [x86_64-linux]
[2023-11-18 09:42:44] INFO  WEBrick::HTTPServer#start: pid=24150 port=14000
Configuration file: /mnt/e/winsegit/octopress/_config.yml
            Source: source
       Destination: public
      Generating...
                    done.

UPDATE 2021-05-25 24:09 (wsl-linux + rvm)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
sudo apt-get update
sudo apt-get install make
sudo apt-get install gcc

## https://ruby-china.org/wiki/rvm-guide

winse@LAPTOP-I9ECVAQ4:e$ gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB

# curl -sSL https://get.rvm.io | bash -s stable
# https://raw.githubusercontent.com/rvm/rvm/master/binscripts/rvm-installer
winse@LAPTOP-I9ECVAQ4:e$ cat rvm-installer.txt | bash -s stable 

winse@LAPTOP-I9ECVAQ4:e$ echo "ruby_url=https://cache.ruby-china.com/pub/ruby" > ~/.rvm/user/db


# 依赖安装
## https://www.garron.me/en/linux/install-ruby-2-3-3-ubuntu.html
Edit this file /etc/apt/sources.list and add this line to the end of it.

deb http://security.ubuntu.com/ubuntu bionic-security main

After that run:

sudo apt update && apt-cache policy libssl1.0-dev

Finally,

sudo apt-get install libssl1.0-dev

##END

winse@LAPTOP-I9ECVAQ4:~$ rvm install 2.3

winse@LAPTOP-I9ECVAQ4:~$ rvm list

winse@LAPTOP-I9ECVAQ4:~$ bash --login
winse@LAPTOP-I9ECVAQ4:~$ rvm use 2.3.8 --default
Using /home/winse/.rvm/gems/ruby-2.3.8

## 
winse@LAPTOP-I9ECVAQ4:octopress$ bundle install

winse@LAPTOP-I9ECVAQ4:octopress$ rake preview

winse@DESKTOP-BR4MG38:~$ ln -s /mnt/e/local/npp/notepad++.exe text

安装docker

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
winse@DESKTOP-ADH7K1Q:~$ uname -r
4.4.0-43-Microsoft
winse@DESKTOP-ADH7K1Q:~$ uname -a
Linux DESKTOP-ADH7K1Q 4.4.0-43-Microsoft #1-Microsoft Wed Dec 31 14:42:53 PST 2014 x86_64 x86_64 x86_64 GNU/Linux

winse@DESKTOP-ADH7K1Q:~$  sudo apt-get install \
     apt-transport-https \
     ca-certificates \
     curl \
     software-properties-common

winse@DESKTOP-ADH7K1Q:~$ lsb_release -cs
xenial
winse@DESKTOP-ADH7K1Q:~$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
OK
winse@DESKTOP-ADH7K1Q:~$ sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

winse@DESKTOP-ADH7K1Q:~$ sudo apt-get update

winse@DESKTOP-ADH7K1Q:~$ sudo apt-get install docker-ce

winse@DESKTOP-ADH7K1Q:~$ sudo service docker start
 * Starting Docker: docker                                                                                                                     [ OK ]
winse@DESKTOP-ADH7K1Q:~$ sudo docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
winse@DESKTOP-ADH7K1Q:~$ sudo docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
winse@DESKTOP-ADH7K1Q:~$

运行windows系统应用

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
winse@DESKTOP-ADH7K1Q:~$ ln -s /mnt/e/local/usr/share/npp/notepad++.exe text

winse@DESKTOP-ADH7K1Q:~$ cp -r ../winse-cygwin/new_post.sh ./
winse@DESKTOP-ADH7K1Q:~$ cat new_post.sh
cd ~/winsegit/octopress/
rake new_post["$1"] | tail -1 | awk -F: '{print $2}' | while read line
do
name=${line#source/_posts/}
newpath=source/_stash/$name
mv $line $newpath

echo -e "\n\n--END" >>$newpath

~/text $newpath &
done

winse@DESKTOP-ADH7K1Q:~$ ./new_post.sh "windows run ubuntu"
/usr/lib/ruby/vendor_ruby/bundler/shared_helpers.rb:78: warning: Insecure world writable dir /mnt/c in PATH, mode 040777
mkdir -p source/_posts

重新配置git

用powershell修改原来的权限后,然后用shell来进行设置。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#powershell
takeown /F . /R
cacls *.* /T /G Everyone:F

#ubuntu shell
winse@DESKTOP-ADH7K1Q:~$ cp -r ../winse-cygwin/.ssh ./

winse@DESKTOP-ADH7K1Q:~$ cd .ssh
winse@DESKTOP-ADH7K1Q:~/.ssh$ chmod 600 id_rsa authorized_keys
winse@DESKTOP-ADH7K1Q:~/.ssh$ chmod 644 id_rsa.pub config

winse@DESKTOP-ADH7K1Q:~/winsegit/octopress/_deploy$ rm -rf *
winse@DESKTOP-ADH7K1Q:~/winsegit/octopress/_deploy$ git clone git@github.com:winse/winse.github.com.git ./

winse@DESKTOP-ADH7K1Q:~/winsegit/octopress$ git config --global user.email winseliu@qq.com
winse@DESKTOP-ADH7K1Q:~/winsegit/octopress$ git config --global user.name winse

winse@DESKTOP-ADH7K1Q:~/winsegit/octopress$ rake preview
winse@DESKTOP-ADH7K1Q:~/winsegit/octopress$ sh public.git.sh

–END

Comments