-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
262 lines (200 loc) · 11.4 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<title>Home — benIT's notebook — </title>
<meta charset="utf-8">
<meta name="theme-color" content="#ffffff">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="robots" content="noindex, follow">
<link href="/components/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="/css/style.css" rel="stylesheet" type="text/css" />
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="apple-touch-startup-image" href="/images/jackson/2048x2048.png">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="shortcut icon" sizes="76x76" href="/images/jackson/76x76.png">
<link rel="shortcut icon" sizes="120x120" href="/images/jackson/120x120.png">
<link rel="shortcut icon" sizes="128x128" href="/images/jackson/128x128.png">
<link rel="shortcut icon" sizes="152x152" href="/images/jackson/152x152.png">
<link rel="shortcut icon" sizes="196x196" href="/images/jackson/196x196.png">
<link rel="shortcut icon" sizes="512x512" href="/images/jackson/512x512.png">
<link rel="shortcut icon" sizes="1024x1024" href="/images/jackson/1024x1024.png">
<link rel="shortcut icon" sizes="2048x2048" href="/images/jackson/2048x2048.png">
<link rel="apple-touch-icon" sizes="76x76" href="/images/jackson/76x76.png">
<link rel="apple-touch-icon" sizes="120x120" href="/images/jackson/120x120.png">
<link rel="apple-touch-icon" sizes="128x128" href="/images/jackson/128x128.png">
<link rel="apple-touch-icon" sizes="152x152" href="/images/jackson/152x152.png">
<link rel="apple-touch-icon" sizes="196x196" href="/images/jackson/196x196.png">
<link rel="apple-touch-icon" sizes="512x512" href="/images/jackson/512x512.png">
<link rel="apple-touch-icon" sizes="1024x1024" href="/images/jackson/1024x1024.png">
<link rel="apple-touch-icon" sizes="2048x2048" href="/images/jackson/2048x2048.png">
<link rel="stylesheet" href="/components/highlightjs/styles/github.css" />
<link rel="alternate" type="application/atom+xml" href="/atom.xml" title="benIT's notebook activity feed" />
<style>
/** quick fix because bootstrap <pre> has a background-color. */
pre code { background-color: inherit; }
</style>
</head>
<a href="https://github.com/benIT/github-blog"><img style="z-index:1032;position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/e7bbb0521b397edbd5fe43e7f760759336b5e05f/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677265656e5f3030373230302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_green_007200.png"></a>
<body>
<header>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">benIT's notebook </a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="https://github.com/benIT">Github</a></li>
<li><a href="/blog">Posts Archive</a></li>
<li><a href="/blog/categories">Categories</a></li>
<li><a href="/atom.xml">RSS feed</a></li>
<!--<li><a href="/blog/tags">Tags</a></li>-->
<li><a href="/about">About</a></li>
</ul>
</div>
</div>
</nav>
</header>
<div class="mainContent container">
<div class="row-fluid">
<div class="span8">
<article>
<header>
<h2><a href="/blog/2021/10/11/ssh-proxy-jump">ssh proxy jump</a></h2>
</header>
<div>
<h2 id="context">Context</h2>
<p>2 machines:</p>
<ul>
<li>one public, available on internet: <code>bastion-server</code></li>
<li>one private, not available on internet: <code>private-server</code></li>
</ul>
<p>The public machine is allow to connect the private with ssh protocol.</p>
<h2 id="setup-ssh-config">Setup ssh config</h2>
<p>The trick is to make use <code>ProxyJump</code> directive in <code>.ssh/config</code>:</p>
<pre><code>Host bastion-server
User pi
Hostname bastion-server.com
Port 22
Host private-server
User ben
Hostname private-server.com
ProxyJump bastion-server
</code></pre>
<p>NB: public ssh keys must be added to these 2 servers with <code>ssh-copy-id</code> command for instance.</p>
<h2 id="usage">Usage</h2>
<p>We can now execute remote commands on the private server jumping from the bastion server.</p>
<pre><code>ssh private-server hostname
</code></pre>
<p>You can use that to add your computer @IP to the private server. This can be useful when working with a mobile phone as access point:</p>
<pre><code>IP=$(curl -s ifconfig.me) && DATE=$(date +%Y-%m-%d_%T) && echo "adding $IP to ufw at $DATE" && ssh private-server sudo ufw allow from $IP comment ben-sosh-$DATE && ssh private-server sudo ufw status numbered
</code></pre>
<h2 id="source">Source</h2>
<p>https://www.syloe.com/rebonds-ssh/</p>
</div>
</article>
<article>
<header>
<h2><a href="/blog/2021/07/22/sfcast-vuejs">symfonycasts course notes - The Delightful World of Vue</a></h2>
</header>
<div>
<h1 id="about">About</h1>
<p>This is raw notes from the great symfony cast course "The Delightful World of Vue".
Content have been fully copied/pasted from the official <a href="https://symfonycasts.com/screencast/vue">public resource</a>.</p>
<h1 id="notes">Notes</h1>
<p>...</p>
<h2 id="21----where-should-a-piece-of-data-live%3F">21 - Where should a Piece of Data Live?</h2>
<p>https://symfonycasts.com/screencast/vue/data-location#play-
Earlier, I said that you should never, ever change the value of a prop. Props are meant to be read but not modified</p>
<p>What is the purpose of the special mounted() function in Vue?</p>
<p>https://symfonycasts.com/screencast/vue/ajax/activity/376</p>
<p>That's right. It's a special event callback that you can define in your components to do stuff just after a component is mounted in the DOM.</p>
<p>https://symfonycasts.com/screencast/vue/loading/activity/380</p>
<h2 id="28---loading-component">28 - Loading Component</h2>
<p>https://symfonycasts.com/screencast/vue/loading</p>
<p>created will execute as soon as the component is instantiated. Even though the DOM structure still isn't mounted, you can still perform any other operations that deal with reactive data!</p>
<p>mounted, on the other hand, will be executed once the component has been mounted in the DOM. This is useful for any edge case when you need to manipulate the DOM directly!</p>
<h2 id="39---hoisting-data-up">39 - Hoisting Data Up</h2>
<p>https://symfonycasts.com/screencast/vue/hoist-data#play</p>
<p>This is a fairly common situation: you start by putting your data in one component, then later you need to move it higher so that more parts of your app can use it. We did this once earlier: we moved the collapsed boolean data from Sidebar up to Products so that we could use it in more places.</p>
<h2 id="47---watchers%3A-the-good%2C-the-bad-%26-the-useful%21">47 - Watchers: The Good, The Bad & The Useful!</h2>
<p>https://symfonycasts.com/screencast/vue/watcher#play</p>
<p>watcher! Very simply: a watcher is a function that's called by Vue whenever a specific prop or data changes.</p>
</div>
</article>
<article>
<header>
<h2><a href="/blog/2021/05/18/nfs-setup">NFS setup</a></h2>
</header>
<div>
<p><a href="https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-ubuntu-20-04">Source</a>.</p>
<p>In this article, there are 2 linux machines: <code>desktop</code> & <code>laptop</code>.</p>
<p>The desktop machine can be accessed via @IP or using <code>desktop.local</code> alias.</p>
<h2 id="host">Host</h2>
<h3 id="%C2%A0install"> Install</h3>
<pre><code>sudo apt install nfs-kernel-server
</code></pre>
<p>Configure clients access to host share in <code>/etc/exports</code> :</p>
<pre><code>/home 192.168.1.0/24(rw,sync,no_root_squash,no_subtree_check)
</code></pre>
<p>restart service:</p>
<pre><code> service nfs-kernel-server restart
</code></pre>
<h2 id="client">Client</h2>
<h3 id="install">Install</h3>
<pre><code>sudo apt install nfs-common
</code></pre>
<h3 id="create-a-directory">Create a directory</h3>
<pre><code>sudo mkdir -p /mnt/nfs_share_desktop
sudo chown $USER: /mnt/nfs_share_desktop/
</code></pre>
<h3 id="mount">Mount</h3>
<pre><code>sudo mount desktop.local:/home/ben/ /mnt/nfs_share_desktop/
</code></pre>
<p>or via <code>/etc/fstab</code>:</p>
<pre><code>desktop.local:/home /mnt/nfs_share_desktop nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0
</code></pre>
<p>finally:</p>
<pre><code>sudo mount -a
</code></pre>
</div>
</article>
<nav>
<ul class="pager">
<li class="next"><a href="/page/2">Older posts<span aria-hidden="true">→</span></a></li> </ul>
</nav>
</div>
<!--<div class="span4 sidebar">-->
<!--<div class="well">-->
<!--<h4>benIT's notebook</h4>-->
<!--</div>-->
<!--<div class="well sidebar-nav">-->
<!--<h4>Links</h4>-->
<!--<ul class="nav">-->
<!--<li><a href="http://sculpin.io">sculpin.io</a></li>-->
<!--<li><a href="http://twitter.com/getsculpin">@getsculpin</a></li>-->
<!--</ul>-->
<!--</div>-->
<!--</div>-->
</div>
</div>
<footer class="container">
© 2021 benIT's notebook
</footer>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="/components/jquery/jquery.min.js"><\/script>')</script>
<script src="/components/bootstrap/js/bootstrap.min.js"></script>
<script src="/components/highlightjs/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</body>
</html>