-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
1101 lines (778 loc) · 76.6 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
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
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang=en>
<head>
<meta charset="utf-8">
<title>Pelssers Consultancy</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<meta name="description" content="Freelance Java developer">
<meta property="og:type" content="website">
<meta property="og:title" content="Pelssers Consultancy">
<meta property="og:url" content="http://pelssersconsultancy.com/index.html">
<meta property="og:site_name" content="Pelssers Consultancy">
<meta property="og:description" content="Freelance Java developer">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Pelssers Consultancy">
<meta name="twitter:description" content="Freelance Java developer">
<link rel="icon" href="/css/images/favicon.png" />
<link rel="stylesheet" href="/vendor/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="/vendor/open-sans/styles.css">
<link rel="stylesheet" href="/vendor/source-code-pro/styles.css">
<link rel="stylesheet" href="/css/style.css">
<script src="/vendor/jquery/2.1.3/jquery.min.js"></script>
<link rel="stylesheet" href="/vendor/fancybox/jquery.fancybox.css">
<script type="text/javascript">
(function(i,s,o,g,r,a,m) {i['GoogleAnalyticsObject']=r;i[r]=i[r]||function() {
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-76950512-1', 'auto');
ga('send', 'pageview');
</script>
</head>
<body>
<div id="container">
<header id="header">
<div id="header-main" class="header-inner">
<div class="outer">
<a href="/" id="logo">
<i class="logo"></i>
<!--<span class="site-title">Pelssers Consultancy</span>-->
</a>
<nav id="main-nav">
<a class="main-nav-link" href="/.">Home</a>
<a class="main-nav-link" href="/archives">Archives</a>
<a class="main-nav-link" href="/categories">Categories</a>
<a class="main-nav-link" href="/tags">Tags</a>
<a class="main-nav-link" href="/about">About</a>
</nav>
<nav id="sub-nav">
<div class="profile" id="profile-nav">
<a id="profile-anchor" href="javascript:;">
<img class="avatar" src="/css/images/robbypelssers.png" />
<i class="fa fa-caret-down"></i>
</a>
</div>
</nav>
<div id="search-form-wrap">
<form class="search-form">
<input type="text" class="ins-search-input search-form-input" placeholder="Search" />
<button type="submit" class="search-form-submit"></button>
</form>
<div class="ins-search">
<div class="ins-search-mask"></div>
<div class="ins-search-container">
<div class="ins-input-wrapper">
<input type="text" class="ins-search-input" placeholder="Type something..." />
<span class="ins-close ins-selectable"><i class="fa fa-times-circle"></i></span>
</div>
<div class="ins-section-wrapper">
<div class="ins-section-container"></div>
</div>
</div>
</div>
<script>
(function (window) {
var INSIGHT_CONFIG = {
TRANSLATION: {
POSTS: 'Posts',
PAGES: 'Pages',
CATEGORIES: 'Categories',
TAGS: 'Tags',
UNTITLED: '(Untitled)',
},
ROOT_URL: '/',
CONTENT_URL: '/content.json',
};
window.INSIGHT_CONFIG = INSIGHT_CONFIG;
})(window);
</script>
<script src="/js/insight.js"></script>
</div>
</div>
</div>
<div id="main-nav-mobile" class="header-sub header-inner">
<table class="menu outer">
<tr>
<td><a class="main-nav-link" href="/.">Home</a></td>
<td><a class="main-nav-link" href="/archives">Archives</a></td>
<td><a class="main-nav-link" href="/categories">Categories</a></td>
<td><a class="main-nav-link" href="/tags">Tags</a></td>
<td><a class="main-nav-link" href="/about">About</a></td>
<td>
<div class="search-form">
<input type="text" class="ins-search-input search-form-input" placeholder="Search" />
</div>
</td>
</tr>
</table>
</div>
</header>
<div class="outer">
<aside id="profile">
<div class="inner profile-inner">
<div class="base-info profile-block">
<img id="avatar" src="/css/images/robbypelssers.png" />
<h2 id="name">Robby Pelssers</h2>
<h3 id="title">Java Web Developer</h3>
<span id="location"><i class="fa fa-map-marker"></i>Beek LB, the Netherlands</span>
<a id="follow" target="_blank" href="https://twitter.com/robby_pelssers">FOLLOW</a>
</div>
<div class="article-info profile-block">
<div class="article-info-block">
5
<span>posts</span>
</div>
<div class="article-info-block">
11
<span>tags</span>
</div>
</div>
<div class="profile-block social-links">
<table>
<tr>
<td><a href="http://github.com/pelssersconsultancy" target="_blank" title="github"><i class="fa fa-github"></i></a></td>
<td><a href="https://twitter.com/robby_pelssers" target="_blank" title="twitter"><i class="fa fa-twitter"></i></a></td>
<td><a href="https://www.facebook.com/robby.pelssers" target="_blank" title="facebook"><i class="fa fa-facebook"></i></a></td>
</tr>
</table>
</div>
</div>
</aside>
<section id="main">
<article id="post-Finding-project-in-workspace-with-specific-maven-dependency" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016/07/18/Finding-project-in-workspace-with-specific-maven-dependency/">Finding project in workspace with specific maven dependency</a>
</h1>
<div class="article-meta">
<div class="article-date">
<i class="fa fa-calendar"></i>
<a href="/2016/07/18/Finding-project-in-workspace-with-specific-maven-dependency/">
<time datetime="2016-07-18T18:12:48.000Z" itemprop="datePublished">2016-07-18</time>
</a>
</div>
<div class="article-tag">
<i class="fa fa-tag"></i>
<a class="tag-link" href="/tags/Maven/">Maven</a>, <a class="tag-link" href="/tags/Shell/">Shell</a>
</div>
</div>
</header>
<div class="article-entry" itemprop="articleBody">
<h3 id="1-Context"><a href="#1-Context" class="headerlink" title="1. Context"></a>1. Context</h3><p>You have several projects in your workspace and you were wondering which projects are depending on a specific version of a maven dependency. </p>
<p>This article will show you how to solve this from the command line.</p>
<h3 id="2-Generating-Maven-Tree"><a href="#2-Generating-Maven-Tree" class="headerlink" title="2. Generating Maven Tree"></a>2. Generating Maven Tree</h3><p>To print the dependency tree of a Maven pom, you can run the following command:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">$ mvn dependency:tree</div></pre></td></tr></table></figure>
<p>Output for e.g. javaslang submodule would be</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div></pre></td><td class="code"><pre><div class="line">robbypelssers1@Macbook-Robby-Pelssers:~/Documents/pelssers/javaslang/javaslang$ mvn dependency:tree</div><div class="line">[INFO] Scanning for projects...</div><div class="line">[INFO]</div><div class="line">[INFO] ------------------------------------------------------------------------</div><div class="line">[INFO] Building Javaslang 3.0.0-SNAPSHOT</div><div class="line">[INFO] ------------------------------------------------------------------------</div><div class="line">[INFO]</div><div class="line">[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ javaslang ---</div><div class="line">[INFO] io.javaslang:javaslang:jar:3.0.0-SNAPSHOT</div><div class="line">[INFO] +- io.javaslang:javaslang-match:jar:3.0.0-SNAPSHOT:compile</div><div class="line">[INFO] +- junit:junit:jar:4.12:test</div><div class="line">[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test</div><div class="line">[INFO] \- org.assertj:assertj-core:jar:3.3.0:test</div><div class="line">[INFO] ------------------------------------------------------------------------</div><div class="line">[INFO] BUILD SUCCESS</div><div class="line">[INFO] ------------------------------------------------------------------------</div><div class="line">[INFO] Total time: 0.745s</div><div class="line">[INFO] Finished at: Mon Jul 18 20:10:16 CEST 2016</div><div class="line">[INFO] Final Memory: 17M/309M</div><div class="line">[INFO] ------------------------------------------------------------------------</div></pre></td></tr></table></figure>
<h3 id="3-Filtering-on-the-line-with-specific-maven-dependency-for-e-g-hamcrest-core-version-1-3"><a href="#3-Filtering-on-the-line-with-specific-maven-dependency-for-e-g-hamcrest-core-version-1-3" class="headerlink" title="3. Filtering on the line with specific maven dependency for e.g. hamcrest-core version 1.3"></a>3. Filtering on the line with specific maven dependency for e.g. hamcrest-core version 1.3</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">robbypelssers1@Macbook-Robby-Pelssers:~/Documents/pelssers/javaslang/javaslang$ mvn dependency:tree | grep org.hamcrest:hamcrest-core:jar:1.3</div><div class="line">[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test</div></pre></td></tr></table></figure>
<h3 id="4-Finding-all-pom-files-in-workspace-or-specific-project"><a href="#4-Finding-all-pom-files-in-workspace-or-specific-project" class="headerlink" title="4. Finding all pom files in workspace or specific project"></a>4. Finding all pom files in workspace or specific project</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div></pre></td><td class="code"><pre><div class="line">robbypelssers1@Macbook-Robby-Pelssers:~/Documents/pelssers/javaslang$ find . -name pom.xml</div><div class="line">./javaslang/pom.xml</div><div class="line">./javaslang-benchmark/pom.xml</div><div class="line">./javaslang-gwt/example/pom.xml</div><div class="line">./javaslang-gwt/pom.xml</div><div class="line">./javaslang-match/pom.xml</div><div class="line">./javaslang-pure/pom.xml</div><div class="line">./javaslang-test/pom.xml</div><div class="line">./pom.xml</div></pre></td></tr></table></figure>
<h3 id="5-Pipe-the-search-results-pom-files-as-input-for-generating-dependeny-tree"><a href="#5-Pipe-the-search-results-pom-files-as-input-for-generating-dependeny-tree" class="headerlink" title="5. Pipe the search results (pom files) as input for generating dependeny tree"></a>5. Pipe the search results (pom files) as input for generating dependeny tree</h3><p>Ideally we want to pipe all pom’s as input for generating the maven dependency tree and next filter on the specific dependency.</p>
<p>The problem is you will ony output something like</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test</div></pre></td></tr></table></figure>
<p>So we still don’t now what file lead to this output printed to the shell.</p>
<p>We can however use following little trick. We basically first find all pom files, next we first make sure to print which one we are processing. Next we execute inside the folder of the respective pom the maven dependency tree command. </p>
<p>Now we need to make sure we both grep for lines containing ‘Processing’ AND also lines containing our maven dependency.</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">javaslang$ find . -name pom.xml -exec echo 'Processing {}' \; -execdir mvn -f {} dependency:tree \; | grep "org.hamcrest:hamcrest-core:jar:1.3\|Processing"</div></pre></td></tr></table></figure>
<p>This will result in below output:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div></pre></td><td class="code"><pre><div class="line">Processing ./javaslang/pom.xml</div><div class="line">[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test</div><div class="line">Processing ./javaslang-benchmark/pom.xml</div><div class="line">[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test</div><div class="line">Processing ./javaslang-gwt/example/pom.xml</div><div class="line">Processing ./javaslang-gwt/pom.xml</div><div class="line">Processing ./javaslang-match/pom.xml</div><div class="line">[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test</div><div class="line">Processing ./javaslang-pure/pom.xml</div><div class="line">[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test</div><div class="line">Processing ./javaslang-test/pom.xml</div><div class="line">[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test</div><div class="line">Processing ./pom.xml</div><div class="line">[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test</div><div class="line">[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test</div><div class="line">[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test</div><div class="line">[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test</div><div class="line">[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test</div></pre></td></tr></table></figure>
</div>
<footer class="article-footer">
<div class="share-container">
</div>
<a data-url="http://pelssersconsultancy.com/2016/07/18/Finding-project-in-workspace-with-specific-maven-dependency/" data-id="citlgwnuy000a9w7r2eagfpyx" class="article-share-link"><i class="fa fa-share"></i>Share</a>
<script>
(function ($) {
// Prevent duplicate binding
if (typeof(__SHARE_BUTTON_BINDED__) === 'undefined' || !__SHARE_BUTTON_BINDED__) {
__SHARE_BUTTON_BINDED__ = true;
} else {
return;
}
$('body').on('click', function() {
$('.article-share-box.on').removeClass('on');
}).on('click', '.article-share-link', function(e) {
e.stopPropagation();
var $this = $(this),
url = $this.attr('data-url'),
encodedUrl = encodeURIComponent(url),
id = 'article-share-box-' + $this.attr('data-id'),
offset = $this.offset(),
box;
if ($('#' + id).length) {
box = $('#' + id);
if (box.hasClass('on')){
box.removeClass('on');
return;
}
} else {
var html = [
'<div id="' + id + '" class="article-share-box">',
'<input class="article-share-input" value="' + url + '">',
'<div class="article-share-links">',
'<a href="https://twitter.com/intent/tweet?url=' + encodedUrl + '" class="fa fa-twitter article-share-twitter" target="_blank" title="Twitter"></a>',
'<a href="https://www.facebook.com/sharer.php?u=' + encodedUrl + '" class="fa fa-facebook article-share-facebook" target="_blank" title="Facebook"></a>',
'<a href="http://pinterest.com/pin/create/button/?url=' + encodedUrl + '" class="fa fa-pinterest article-share-pinterest" target="_blank" title="Pinterest"></a>',
'<a href="https://plus.google.com/share?url=' + encodedUrl + '" class="fa fa-google article-share-google" target="_blank" title="Google+"></a>',
'</div>',
'</div>'
].join('');
box = $(html);
$('body').append(box);
}
$('.article-share-box.on').hide();
box.css({
top: offset.top + 25,
left: offset.left
}).addClass('on');
}).on('click', '.article-share-box', function (e) {
e.stopPropagation();
}).on('click', '.article-share-box-input', function () {
$(this).select();
}).on('click', '.article-share-box-link', function (e) {
e.preventDefault();
e.stopPropagation();
window.open(this.href, 'article-share-box-window-' + Date.now(), 'width=500,height=450');
});
})(jQuery);
</script>
<a href="http://pelssersconsultancy.com/2016/07/18/Finding-project-in-workspace-with-specific-maven-dependency/#comments" class="article-comment-link disqus-comment-count" data-disqus-url="http://pelssersconsultancy.com/2016/07/18/Finding-project-in-workspace-with-specific-maven-dependency/">Comments</a>
</footer>
</div>
</article>
<article id="post-How-to-use-different-SSH-keys-for-different-Github-accounts" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016/05/13/How-to-use-different-SSH-keys-for-different-Github-accounts/">How to use different SSH keys for different Github accounts</a>
</h1>
<div class="article-meta">
<div class="article-date">
<i class="fa fa-calendar"></i>
<a href="/2016/05/13/How-to-use-different-SSH-keys-for-different-Github-accounts/">
<time datetime="2016-05-13T07:48:18.000Z" itemprop="datePublished">2016-05-13</time>
</a>
</div>
<div class="article-tag">
<i class="fa fa-tag"></i>
<a class="tag-link" href="/tags/Github/">Github</a>, <a class="tag-link" href="/tags/SSH/">SSH</a>
</div>
</div>
</header>
<div class="article-entry" itemprop="articleBody">
<img src="/2016/05/13/How-to-use-different-SSH-keys-for-different-Github-accounts/github-preview.gif" alt="Github image" title="Github image">
<h3 id="1-Context"><a href="#1-Context" class="headerlink" title="1. Context"></a>1. Context</h3><p>As self-employed developer I have two github accounts:</p>
<ul>
<li>1 account for personal use <a href="https://github.com/robbypelssers" target="_blank" rel="external">robbypelssers</a></li>
<li>1 account for my company <a href="https://github.com/pelssersconsultancy" target="_blank" rel="external">pelssersconsultancy</a></li>
</ul>
<p>So I would like to use a different ssh key to authenticate with per account.</p>
<p>The default ssh key is coupled to <a href="https://github.com/robbypelssers" target="_blank" rel="external">robbypelssers</a> and I created a second ssh key for <a href="https://github.com/pelssersconsultancy" target="_blank" rel="external">pelssersconsultancy</a>.</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">robbypelssers1@Macbook-Robby-Pelssers:~/.ssh$ ls -la *pelssersconsultancy*</div><div class="line">-rw------- 1 robbypelssers1 staff 3243 Apr 23 11:39 id_pelssersconsultancy_rsa</div><div class="line">-rw-r--r-- 1 robbypelssers1 staff 757 Apr 23 11:39 id_pelssersconsultancy_rsa.pub</div></pre></td></tr></table></figure>
<p>In order to always couple the my private .ssh key ‘id_pelssersconsultancy_rsa’ to<br>any repository from pelssersconsultancy I added the following entry to .ssh/config</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line">robbypelssers1@Macbook-Robby-Pelssers:~/.ssh$ more config</div><div class="line">Host github.com-pelssersconsultancy</div><div class="line"> HostName github.com</div><div class="line"> User git</div><div class="line"> IdentityFile ~/.ssh/id_pelssersconsultancy_rsa</div></pre></td></tr></table></figure>
<p>So in order to checkout the project <a href="https://github.com/pelssersconsultancy/mytodolist" target="_blank" rel="external">mytodolist</a> normally I would do </p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">$ git clone [email protected]:pelssersconsultancy/mytodolist.git</div></pre></td></tr></table></figure>
<p>but instead now I can do</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">$ git clone [email protected]:pelssersconsultancy/mytodolist.git</div></pre></td></tr></table></figure>
<p>Just to verify:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">$ git remote show origin</div><div class="line"> remote origin</div><div class="line"> Fetch URL: [email protected]:pelssersconsultancy/mytodolist.git</div><div class="line"> Push URL: [email protected]:pelssersconsultancy/mytodolist.git</div></pre></td></tr></table></figure>
</div>
<footer class="article-footer">
<div class="share-container">
</div>
<a data-url="http://pelssersconsultancy.com/2016/05/13/How-to-use-different-SSH-keys-for-different-Github-accounts/" data-id="citlgwnux00089w7rsyxa42zr" class="article-share-link"><i class="fa fa-share"></i>Share</a>
<script>
(function ($) {
// Prevent duplicate binding
if (typeof(__SHARE_BUTTON_BINDED__) === 'undefined' || !__SHARE_BUTTON_BINDED__) {
__SHARE_BUTTON_BINDED__ = true;
} else {
return;
}
$('body').on('click', function() {
$('.article-share-box.on').removeClass('on');
}).on('click', '.article-share-link', function(e) {
e.stopPropagation();
var $this = $(this),
url = $this.attr('data-url'),
encodedUrl = encodeURIComponent(url),
id = 'article-share-box-' + $this.attr('data-id'),
offset = $this.offset(),
box;
if ($('#' + id).length) {
box = $('#' + id);
if (box.hasClass('on')){
box.removeClass('on');
return;
}
} else {
var html = [
'<div id="' + id + '" class="article-share-box">',
'<input class="article-share-input" value="' + url + '">',
'<div class="article-share-links">',
'<a href="https://twitter.com/intent/tweet?url=' + encodedUrl + '" class="fa fa-twitter article-share-twitter" target="_blank" title="Twitter"></a>',
'<a href="https://www.facebook.com/sharer.php?u=' + encodedUrl + '" class="fa fa-facebook article-share-facebook" target="_blank" title="Facebook"></a>',
'<a href="http://pinterest.com/pin/create/button/?url=' + encodedUrl + '" class="fa fa-pinterest article-share-pinterest" target="_blank" title="Pinterest"></a>',
'<a href="https://plus.google.com/share?url=' + encodedUrl + '" class="fa fa-google article-share-google" target="_blank" title="Google+"></a>',
'</div>',
'</div>'
].join('');
box = $(html);
$('body').append(box);
}
$('.article-share-box.on').hide();
box.css({
top: offset.top + 25,
left: offset.left
}).addClass('on');
}).on('click', '.article-share-box', function (e) {
e.stopPropagation();
}).on('click', '.article-share-box-input', function () {
$(this).select();
}).on('click', '.article-share-box-link', function (e) {
e.preventDefault();
e.stopPropagation();
window.open(this.href, 'article-share-box-window-' + Date.now(), 'width=500,height=450');
});
})(jQuery);
</script>
<a href="http://pelssersconsultancy.com/2016/05/13/How-to-use-different-SSH-keys-for-different-Github-accounts/#comments" class="article-comment-link disqus-comment-count" data-disqus-url="http://pelssersconsultancy.com/2016/05/13/How-to-use-different-SSH-keys-for-different-Github-accounts/">Comments</a>
</footer>
</div>
</article>
<article id="post-Using-MapReduce-with-Morphia-and-MongoDB" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016/05/10/Using-MapReduce-with-Morphia-and-MongoDB/">Using MapReduce with Morphia and MongoDB</a>
</h1>
<div class="article-meta">
<div class="article-date">
<i class="fa fa-calendar"></i>
<a href="/2016/05/10/Using-MapReduce-with-Morphia-and-MongoDB/">
<time datetime="2016-05-10T12:43:33.000Z" itemprop="datePublished">2016-05-10</time>
</a>
</div>
<div class="article-tag">
<i class="fa fa-tag"></i>
<a class="tag-link" href="/tags/MapReduce/">MapReduce</a>, <a class="tag-link" href="/tags/MongoDB/">MongoDB</a>, <a class="tag-link" href="/tags/Morphia/">Morphia</a>
</div>
</div>
</header>
<div class="article-entry" itemprop="articleBody">
<img src="/2016/05/10/Using-MapReduce-with-Morphia-and-MongoDB/mapreduce-mongodb.jpg" alt="Map Reduce MongoDB" title="Map Reduce MongoDB">
<h3 id="1-Precondition"><a href="#1-Precondition" class="headerlink" title="1. Precondition"></a>1. Precondition</h3><p>You have a database called <strong>HELLOWORLD</strong> with 1 collection called <strong>Person</strong> containing following documents:</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div><div class="line">36</div><div class="line">37</div><div class="line">38</div></pre></td><td class="code"><pre><div class="line">[</div><div class="line">{</div><div class="line"> <span class="string">"firstName"</span>: <span class="string">"John"</span>,</div><div class="line"> <span class="string">"lastName"</span>: <span class="string">"Doe"</span>,</div><div class="line"> <span class="string">"age"</span>: <span class="number">35</span>,</div><div class="line"> <span class="string">"location"</span>: {</div><div class="line"> <span class="string">"country"</span>: <span class="string">"NL"</span>,</div><div class="line"> <span class="string">"city"</span>: <span class="string">"Maastricht"</span></div><div class="line"> }</div><div class="line">},</div><div class="line">{</div><div class="line"> <span class="string">"firstName"</span>: <span class="string">"Mark"</span>,</div><div class="line"> <span class="string">"lastName"</span>: <span class="string">"Doe"</span>,</div><div class="line"> <span class="string">"age"</span>: <span class="number">45</span>, </div><div class="line"> <span class="string">"location"</span>: {</div><div class="line"> <span class="string">"country"</span>: <span class="string">"NL"</span>,</div><div class="line"> <span class="string">"city"</span>: <span class="string">"Eindhoven"</span></div><div class="line"> }</div><div class="line">},</div><div class="line">{</div><div class="line"> <span class="string">"firstName"</span>: <span class="string">"Pieter"</span>,</div><div class="line"> <span class="string">"lastName"</span>: <span class="string">"Nelissen"</span>,</div><div class="line"> <span class="string">"age"</span>: <span class="number">55</span>, </div><div class="line"> <span class="string">"location"</span>: {</div><div class="line"> <span class="string">"country"</span>: <span class="string">"NL"</span>,</div><div class="line"> <span class="string">"city"</span>: <span class="string">"Amsterdam"</span></div><div class="line"> }</div><div class="line">},</div><div class="line">{</div><div class="line"> <span class="string">"firstName"</span>: <span class="string">"Edgard"</span>,</div><div class="line"> <span class="string">"lastName"</span>: <span class="string">"Lejeune"</span>,</div><div class="line"> <span class="string">"age"</span>: <span class="number">25</span>, </div><div class="line"> <span class="string">"location"</span>: {</div><div class="line"> <span class="string">"country"</span>: <span class="string">"FR"</span>,</div><div class="line"> <span class="string">"city"</span>: <span class="string">"Paris"</span></div><div class="line"> }</div><div class="line">}</div><div class="line">]</div></pre></td></tr></table></figure>
<h3 id="2-Find-number-of-persons-per-city-for-country-NL"><a href="#2-Find-number-of-persons-per-city-for-country-NL" class="headerlink" title="2. Find number of persons per city for country NL"></a>2. Find number of persons per city for country NL</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div></pre></td><td class="code"><pre><div class="line">robbypelssers1@macbookpelssers:~$ mongo</div><div class="line">MongoDB shell version: 3.2.3</div><div class="line">connecting to: test</div><div class="line">> use HELLOWORLD</div><div class="line">switched to db HELLOWORLD</div><div class="line">></div><div class="line"></div><div class="line"></div><div class="line">var mapFunc = function() { emit(this.location.city, this.age); };</div><div class="line"></div><div class="line">var reduceFunc = function(k, v) { return Array.sum(v); };</div><div class="line"></div><div class="line">db.Person.mapReduce(mapFunc,reduceFunc, {out: { inline: 1 }, query: {"location.country": "NL"}})</div></pre></td></tr></table></figure>
<h3 id="3-Output-from-shell"><a href="#3-Output-from-shell" class="headerlink" title="3. Output from shell"></a>3. Output from shell</h3><figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div></pre></td><td class="code"><pre><div class="line">{</div><div class="line"> <span class="string">"results"</span> : [</div><div class="line"> {</div><div class="line"> <span class="string">"_id"</span> : <span class="string">"Amsterdam"</span>,</div><div class="line"> <span class="string">"value"</span> : <span class="number">55</span></div><div class="line"> },</div><div class="line"> {</div><div class="line"> <span class="string">"_id"</span> : <span class="string">"Eindhoven"</span>,</div><div class="line"> <span class="string">"value"</span> : <span class="number">45</span></div><div class="line"> },</div><div class="line"> {</div><div class="line"> <span class="string">"_id"</span> : <span class="string">"Maastricht"</span>,</div><div class="line"> <span class="string">"value"</span> : <span class="number">35</span></div><div class="line"> }</div><div class="line"> ],</div><div class="line"> <span class="string">"timeMillis"</span> : <span class="number">13</span>,</div><div class="line"> <span class="string">"counts"</span> : {</div><div class="line"> <span class="string">"input"</span> : <span class="number">3</span>,</div><div class="line"> <span class="string">"emit"</span> : <span class="number">3</span>,</div><div class="line"> <span class="string">"reduce"</span> : <span class="number">0</span>,</div><div class="line"> <span class="string">"output"</span> : <span class="number">3</span></div><div class="line"> },</div><div class="line"> <span class="string">"ok"</span> : <span class="number">1</span></div><div class="line">}</div></pre></td></tr></table></figure>
<h3 id="4-How-to-do-it-in-Java-using-Morphia-and-MongoDB-Java-driver"><a href="#4-How-to-do-it-in-Java-using-Morphia-and-MongoDB-Java-driver" class="headerlink" title="4. How to do it in Java using Morphia and MongoDB Java driver"></a>4. How to do it in Java using Morphia and MongoDB Java driver</h3><figure class="highlight java"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div></pre></td><td class="code"><pre><div class="line">Datastore datastore = ... </div><div class="line">DBCollection collection = datastore.getCollection(Person.class);</div><div class="line">DBObject query = <span class="keyword">new</span> BasicDBObject(<span class="string">"location.country"</span>, <span class="string">"NL"</span>);</div><div class="line">String mapFunc = <span class="string">"function() { emit(this.location.city, this.age); }"</span>;</div><div class="line">String reduceFunc = <span class="string">"function(k, v) { return Array.sum(v); }"</span>;</div><div class="line"></div><div class="line">MapReduceCommand mapReduceCommand = <span class="keyword">new</span> MapReduceCommand(collection, mapFunc, reduceFunc, <span class="keyword">null</span>,</div><div class="line"> MapReduceCommand.OutputType.INLINE, query);</div><div class="line"></div><div class="line">MapReduceOutput output = collection.mapReduce(mapReduceCommand);</div><div class="line"> </div><div class="line">output.results().forEach(result -> {</div><div class="line"> DBObject key = (DBObject) result.get(<span class="string">"_id"</span>);</div><div class="line"> Double value = (Double) result.get(<span class="string">"value"</span>);</div><div class="line"> <span class="comment">//do something with this data....</span></div><div class="line">});</div></pre></td></tr></table></figure>
</div>
<footer class="article-footer">
<div class="share-container">
</div>
<a data-url="http://pelssersconsultancy.com/2016/05/10/Using-MapReduce-with-Morphia-and-MongoDB/" data-id="citlgwnur00069w7rmjb97iaq" class="article-share-link"><i class="fa fa-share"></i>Share</a>
<script>
(function ($) {
// Prevent duplicate binding
if (typeof(__SHARE_BUTTON_BINDED__) === 'undefined' || !__SHARE_BUTTON_BINDED__) {
__SHARE_BUTTON_BINDED__ = true;
} else {
return;
}
$('body').on('click', function() {
$('.article-share-box.on').removeClass('on');
}).on('click', '.article-share-link', function(e) {
e.stopPropagation();
var $this = $(this),
url = $this.attr('data-url'),
encodedUrl = encodeURIComponent(url),
id = 'article-share-box-' + $this.attr('data-id'),
offset = $this.offset(),
box;
if ($('#' + id).length) {
box = $('#' + id);
if (box.hasClass('on')){
box.removeClass('on');
return;
}
} else {
var html = [
'<div id="' + id + '" class="article-share-box">',
'<input class="article-share-input" value="' + url + '">',
'<div class="article-share-links">',
'<a href="https://twitter.com/intent/tweet?url=' + encodedUrl + '" class="fa fa-twitter article-share-twitter" target="_blank" title="Twitter"></a>',
'<a href="https://www.facebook.com/sharer.php?u=' + encodedUrl + '" class="fa fa-facebook article-share-facebook" target="_blank" title="Facebook"></a>',
'<a href="http://pinterest.com/pin/create/button/?url=' + encodedUrl + '" class="fa fa-pinterest article-share-pinterest" target="_blank" title="Pinterest"></a>',
'<a href="https://plus.google.com/share?url=' + encodedUrl + '" class="fa fa-google article-share-google" target="_blank" title="Google+"></a>',
'</div>',
'</div>'
].join('');
box = $(html);
$('body').append(box);
}
$('.article-share-box.on').hide();
box.css({
top: offset.top + 25,
left: offset.left
}).addClass('on');
}).on('click', '.article-share-box', function (e) {
e.stopPropagation();
}).on('click', '.article-share-box-input', function () {
$(this).select();
}).on('click', '.article-share-box-link', function (e) {
e.preventDefault();
e.stopPropagation();
window.open(this.href, 'article-share-box-window-' + Date.now(), 'width=500,height=450');
});
})(jQuery);
</script>
<a href="http://pelssersconsultancy.com/2016/05/10/Using-MapReduce-with-Morphia-and-MongoDB/#comments" class="article-comment-link disqus-comment-count" data-disqus-url="http://pelssersconsultancy.com/2016/05/10/Using-MapReduce-with-Morphia-and-MongoDB/">Comments</a>
</footer>
</div>
</article>
<article id="post-How-fast-are-your-collections" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016/04/25/How-fast-are-your-collections/">How fast are your collections?</a>
</h1>
<div class="article-meta">
<div class="article-date">
<i class="fa fa-calendar"></i>
<a href="/2016/04/25/How-fast-are-your-collections/">
<time datetime="2016-04-25T18:03:28.000Z" itemprop="datePublished">2016-04-25</time>
</a>
</div>
<div class="article-tag">
<i class="fa fa-tag"></i>
<a class="tag-link" href="/tags/JRebel/">JRebel</a>, <a class="tag-link" href="/tags/performance/">performance</a>
</div>
</div>
</header>
<div class="article-entry" itemprop="articleBody">
<h3 id="JRebel-Collections-cheat-sheet"><a href="#JRebel-Collections-cheat-sheet" class="headerlink" title="JRebel Collections cheat sheet"></a>JRebel Collections cheat sheet</h3> <img src="/2016/04/25/How-fast-are-your-collections/jrebel_collections_cheatsheet.png" alt="collections cheat sheet" title="collections cheat sheet">
</div>
<footer class="article-footer">
<div class="share-container">
</div>
<a data-url="http://pelssersconsultancy.com/2016/04/25/How-fast-are-your-collections/" data-id="citlgwnuk00029w7rwisf34cj" class="article-share-link"><i class="fa fa-share"></i>Share</a>
<script>
(function ($) {
// Prevent duplicate binding
if (typeof(__SHARE_BUTTON_BINDED__) === 'undefined' || !__SHARE_BUTTON_BINDED__) {
__SHARE_BUTTON_BINDED__ = true;
} else {
return;
}
$('body').on('click', function() {
$('.article-share-box.on').removeClass('on');
}).on('click', '.article-share-link', function(e) {
e.stopPropagation();
var $this = $(this),
url = $this.attr('data-url'),
encodedUrl = encodeURIComponent(url),
id = 'article-share-box-' + $this.attr('data-id'),
offset = $this.offset(),
box;
if ($('#' + id).length) {
box = $('#' + id);
if (box.hasClass('on')){
box.removeClass('on');
return;
}
} else {
var html = [
'<div id="' + id + '" class="article-share-box">',
'<input class="article-share-input" value="' + url + '">',
'<div class="article-share-links">',
'<a href="https://twitter.com/intent/tweet?url=' + encodedUrl + '" class="fa fa-twitter article-share-twitter" target="_blank" title="Twitter"></a>',
'<a href="https://www.facebook.com/sharer.php?u=' + encodedUrl + '" class="fa fa-facebook article-share-facebook" target="_blank" title="Facebook"></a>',
'<a href="http://pinterest.com/pin/create/button/?url=' + encodedUrl + '" class="fa fa-pinterest article-share-pinterest" target="_blank" title="Pinterest"></a>',
'<a href="https://plus.google.com/share?url=' + encodedUrl + '" class="fa fa-google article-share-google" target="_blank" title="Google+"></a>',
'</div>',
'</div>'
].join('');
box = $(html);
$('body').append(box);
}
$('.article-share-box.on').hide();
box.css({
top: offset.top + 25,
left: offset.left
}).addClass('on');
}).on('click', '.article-share-box', function (e) {
e.stopPropagation();
}).on('click', '.article-share-box-input', function () {
$(this).select();
}).on('click', '.article-share-box-link', function (e) {
e.preventDefault();
e.stopPropagation();
window.open(this.href, 'article-share-box-window-' + Date.now(), 'width=500,height=450');
});
})(jQuery);
</script>
<a href="http://pelssersconsultancy.com/2016/04/25/How-fast-are-your-collections/#comments" class="article-comment-link disqus-comment-count" data-disqus-url="http://pelssersconsultancy.com/2016/04/25/How-fast-are-your-collections/">Comments</a>
</footer>
</div>
</article>
<article id="post-How-to-setup-your-own-blog" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016/04/08/How-to-setup-your-own-blog/">How to setup your own blog with Github Pages and Hexo</a>
</h1>
<div class="article-meta">
<div class="article-date">
<i class="fa fa-calendar"></i>
<a href="/2016/04/08/How-to-setup-your-own-blog/">
<time datetime="2016-04-08T20:54:02.000Z" itemprop="datePublished">2016-04-08</time>
</a>
</div>
<div class="article-category">
<i class="fa fa-folder"></i>
<a class="article-category-link" href="/categories/Tutorials/">Tutorials</a>
</div>
<div class="article-tag">
<i class="fa fa-tag"></i>
<a class="tag-link" href="/tags/Github/">Github</a>, <a class="tag-link" href="/tags/Hexo/">Hexo</a>, <a class="tag-link" href="/tags/Markdown/">Markdown</a>
</div>
</div>
</header>
<div class="article-entry" itemprop="articleBody">
<h3 id="1-Create-a-new-github-account"><a href="#1-Create-a-new-github-account" class="headerlink" title="1. Create a new github account"></a>1. Create a new github account</h3><p> Navigate to <a href="https://github.com" target="_blank" rel="external">Github</a> and click the Signup button. It is important to choose the same<br> username as the one you want to use for [<strong>username</strong>].github.io</p>
<p> Let’s assume you created a github account with username [<strong>johndoe</strong>] and email address [<strong>[email protected]</strong>].</p>
<h3 id="2-Create-a-new-repository"><a href="#2-Create-a-new-repository" class="headerlink" title="2. Create a new repository"></a>2. Create a new repository</h3><p> <a href="https://pages.github.com" target="_blank" rel="external">Github pages</a> explains how to setup your own blog site, so you can check it for reference.<br> Log in on <a href="https://github.com" target="_blank" rel="external">Github</a> and click on the button ‘New Repository’. </p>
<p> Now you should see a similar page like below with Owner [<strong>johndoe</strong>]. Fill in [<strong>johndoe.github.io</strong>] as repository name.</p>
<img src="/2016/04/08/How-to-setup-your-own-blog/creating_repository.png" alt="Creating github repository" title="Creating github repository">
<h3 id="3-Setup-you-ssh-key-for-github"><a href="#3-Setup-you-ssh-key-for-github" class="headerlink" title="3. Setup you ssh key for github"></a>3. Setup you ssh key for github</h3><p>Github is a versioning system where each different version of any file belonging to your site will be saves and tracked. </p>
<p>However, in order to be able to save your files from your computer to github, you need to do following steps:</p>
<ul>
<li><p>generate an ssh-key for the above created github account</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div></pre></td><td class="code"><pre><div class="line">johndoe@laptop:~$ ssh-keygen -t rsa -b 4096 -C "[email protected]"</div><div class="line">Generating public/private rsa key pair.</div><div class="line">Enter file in which to save the key (/Users/johndoe/.ssh/id_rsa): /Users/johndoe/.ssh/id_johndoe_rsa</div><div class="line">Enter passphrase (empty for no passphrase):</div><div class="line">Enter same passphrase again:</div><div class="line">Your identification has been saved in /Users/johndoe/.ssh/id_johndoe_rsa.</div><div class="line">Your public key has been saved in /Users/johndoe/.ssh/id_johndoe_rsa.pub.</div><div class="line">The key fingerprint is:</div><div class="line">SHA256:zFNrmBSufsH/URijFp/+rO9iKlRmj8XRjB1HasidLDE [email protected]</div><div class="line">The key's randomart image is:</div><div class="line">+---[RSA 4096]----+</div><div class="line">| . E=.oo|</div><div class="line">| . . .o*++ |</div><div class="line">| o o.*.* |</div><div class="line">| * ++=oB |</div><div class="line">| . S+=++ . |</div><div class="line">| . .*.... |</div><div class="line">| ... . o |</div><div class="line">| .. .o+ |</div><div class="line">| ..oo== |</div><div class="line">+----[SHA256]-----+</div></pre></td></tr></table></figure>
</li>
<li><p>Verify the following two files have been generated</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">johndoe@laptop:~$ ls -la .ssh</div><div class="line">-rw------- 1 johndoe staff 3243 23 apr 16:39 id_johndoe_rsa</div><div class="line">-rw-r--r-- 1 johndoe staff 743 23 apr 16:39 id_johndoe_rsa.pub</div></pre></td></tr></table></figure>
</li>
<li><p>Copy the contents of the public key to the clipboard</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">$ cat .ssh/id_johndoe_rsa.pub | pbcopy</div></pre></td></tr></table></figure>
</li>
<li><p>Go the the <a href="https://github.com" target="_blank" rel="external">Github</a> and click on Settings. </p>
</li>
</ul>
<img src="/2016/04/08/How-to-setup-your-own-blog/github_settings.png" alt="Edit your github settings" title="Edit your github settings">
<ul>
<li><p>Next click on ‘SSH and GPG keys’ in the left menu. Now click on the button ‘New SSH key’. </p>
<p>Fill in a title like ‘SSH key of John Doe’ and paste the string that you copied into<br>the clipboard before’ which should look a bit like below.</p>
</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDddmyo4+UtzzUju6GwBGQu6NatFVmnDSZrykeqnXLSFT6JY1Ky57x62h80eFkmewauqnVZO09H8klkFMXDeuoweGeYFqowG+c5XwKsTIr4hC5Zxw+9CRa71xk7Xppdc4ROVZsbHVgb4F1kPkcNe4O9R+lyZqRNOb1clwngPfusyzH1WWl60fqhyU9n7WlqwdJ/ih9so8FgvmPYM27uKexOtcF7YWlXYnCLN1n8eRdGvTN01fRtON7zwxj3CyB+qD1JXfumneP0bcYSvBpVNZFDcRBclP7KluvEFYWDaZ8GH7xLJtrf34rIACE7LOFRWFYSTz5BI66794BGhastyczRcPZOzWa1ZQSsdB5iNLX8U32ZLqI71rA8tiViVGqpcVGkCRrl/QetdMEuebf67clXd4bp+AC8753UYfeIYAp0+uAT9zwnZWoBg3JW+RtwzeG7Hg8N3WnB6ULU0PqnA2fUtu0Fm4LpK9YcmRJ+izr6SlcZH87nK/rLcqv99vJSEaIcJz4+IBgZ8MKzfIZ5thritMD8xbKqMkGl1D6oG2ggR+WvnVgSlzdczHXreDy/KHWFDvTH/Vivta5EuOo7mRPkSAB2Ml809ev0+Ul6UvyJXYdTu5+ne5KzSHYWZV+C2lsT/aDT2gmsKNhlyPZOgwvn6IGinTKbO40QEjYozkPxFw== [email protected]</div></pre></td></tr></table></figure>
<ul>
<li>Create a new .ssh/config file or append to existing config file following host<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">Host github.com-johndoe</div><div class="line"> HostName github.com</div><div class="line"> User git</div><div class="line"> IdentityFile ~/.ssh/id_johndoe_rsa</div></pre></td></tr></table></figure>
</li>
</ul>
<h3 id="4-Make-sure-you-have-NPM-and-NodeJs-installed"><a href="#4-Make-sure-you-have-NPM-and-NodeJs-installed" class="headerlink" title="4. Make sure you have NPM and NodeJs installed"></a>4. Make sure you have <a href="https://www.npmjs.com/" target="_blank" rel="external">NPM</a> and <a href="https://nodejs.org" target="_blank" rel="external">NodeJs</a> installed</h3><h3 id="5-Make-sure-you-have-git-installed"><a href="#5-Make-sure-you-have-git-installed" class="headerlink" title="5. Make sure you have git installed"></a>5. Make sure you have <a href="https://git-scm.com/download" target="_blank" rel="external">git</a> installed</h3><h3 id="6-Install-Hexo"><a href="#6-Install-Hexo" class="headerlink" title="6. Install Hexo"></a>6. Install <a href="https://hexo.io/" target="_blank" rel="external">Hexo</a></h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line">$ npm install hexo-cli -g</div><div class="line">$ hexo init blog</div><div class="line">$ cd blog</div><div class="line">$ npm install</div><div class="line">$ hexo server</div></pre></td></tr></table></figure>
<p>Browse to <a href="http://localhost:4000" target="_blank" rel="external">http://localhost:4000</a> and verify you see the initial empty blog. To shutdown the server again just press ctrl-c</p>
<h3 id="7-Look-for-a-theme-you-like-to-use-and-install-it"><a href="#7-Look-for-a-theme-you-like-to-use-and-install-it" class="headerlink" title="7. Look for a theme you like to use and install it."></a>7. Look for a <a href="https://hexo.io/themes/" target="_blank" rel="external">theme</a> you like to use and install it.</h3><p> I chose the <a href="https://github.com/ppoffice/hexo-theme-icarus" target="_blank" rel="external">icarus</a> theme. To install it change directory into your newly created <strong>blog</strong> folder and clone the theme using git</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">$ git clone https://github.com/ppoffice/hexo-theme-icarus.git themes/icarus</div></pre></td></tr></table></figure>
<h3 id="8-Adapt-the-following-in-the-file-“blog-config-yml”"><a href="#8-Adapt-the-following-in-the-file-“blog-config-yml”" class="headerlink" title="8. Adapt the following in the file “blog/_config.yml”"></a>8. Adapt the following in the file “blog/_config.yml”</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div></pre></td><td class="code"><pre><div class="line"># Site</div><div class="line">title: Pelssers Consultancy</div><div class="line">author: Robby Pelssers</div><div class="line">language: en</div><div class="line"></div><div class="line"></div><div class="line"># URL</div><div class="line">url: http://pelssersconsultancy.github.io/</div><div class="line"></div><div class="line"># Writing</div><div class="line">new_post_name: :year-:month-:day-:title.md # File name of new posts</div><div class="line">post_asset_folder: true</div><div class="line"></div><div class="line">## Themes: https://hexo.io/themes/</div><div class="line">theme: icarus</div><div class="line"></div><div class="line"># Deployment</div><div class="line">## Docs: https://hexo.io/docs/deployment.html</div><div class="line">deploy:</div><div class="line"> type: git</div><div class="line"> repo: [email protected]:johndoe/johndoe.github.io.git</div><div class="line"> branch: master</div></pre></td></tr></table></figure>
<h3 id="9-Rename-the-file-‘blog-themes-icarus-config-yml-example’-to-‘-config-yml’"><a href="#9-Rename-the-file-‘blog-themes-icarus-config-yml-example’-to-‘-config-yml’" class="headerlink" title="9. Rename the file ‘blog/themes/icarus/_config.yml.example’ to ‘_config.yml’"></a>9. Rename the file ‘blog/themes/icarus/_config.yml.example’ to ‘_config.yml’</h3><h3 id="10-Adapt-the-file-‘blog-themes-icarus-config-yml’-to-your-needs-E-g"><a href="#10-Adapt-the-file-‘blog-themes-icarus-config-yml’-to-your-needs-E-g" class="headerlink" title="10. Adapt the file ‘blog/themes/icarus/_config.yml’ to your needs. E.g.:"></a>10. Adapt the file ‘blog/themes/icarus/_config.yml’ to your needs. E.g.:</h3><h3 id="11-Create-your-first-blog-post"><a href="#11-Create-your-first-blog-post" class="headerlink" title="11. Create your first blog post"></a>11. Create your first blog post</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">robbypelssers1@Macbook-Robby-Pelssers:~/Documents/pelssersconsultancy/blog$ hexo new "My First Blog Post"</div><div class="line">INFO Created: ~/Documents/pelssersconsultancy/blog/source/_posts/2016-04-23-My-First-Blog-Post.md</div></pre></td></tr></table></figure>
<p>As you can see a skeleton <a href="https://guides.github.com/features/mastering-markdown/" target="_blank" rel="external">markdown</a> file gets generated. </p>
<p>The markdown for this first blog article looks like:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div></pre></td><td class="code"><pre><div class="line"># How to setup your own blog</div><div class="line"></div><div class="line">### 1. Create a new github account</div><div class="line"></div><div class="line"> Navigate to [Github] and click the Signup button. It is important to choose the same </div><div class="line"> username as the one you want to use for [**username**].github.io</div><div class="line"> </div><div class="line"> Let's assume you created a github account with username [**johndoe**] and email address [**[email protected]**].</div><div class="line"></div><div class="line">### 2. Create a new repository </div><div class="line"></div><div class="line"> [Github pages] explains how to setup your own blog site, so you can check it for reference. </div><div class="line"> Log in on [Github] and click on the button 'New Repository'. </div><div class="line"></div><div class="line"> Now you should see a similar page like below with Owner [**johndoe**]. Fill in [**johndoe.github.io**] as repository name.</div><div class="line"></div><div class="line"> {% asset_img creating_repository.png Creating github repository %} </div><div class="line"></div><div class="line">### 3. Setup you ssh key for github</div><div class="line">Github is a versioning system where each different version of any file belonging to your site will be saves and tracked. </div><div class="line"></div><div class="line">...</div><div class="line">...</div><div class="line">...</div><div class="line"></div><div class="line">[Github]: https://github.com</div><div class="line">[Github pages]: https://pages.github.com</div><div class="line">[pelssersconsultancy]: http://pelssersconsultancy.github.io</div><div class="line">[NodeJS]: https://nodejs.org</div><div class="line">[NPM]: https://www.npmjs.com/</div><div class="line">[git]: https://git-scm.com/download</div><div class="line">[Hexo]: https://hexo.io/</div><div class="line">[theme]: https://hexo.io/themes/</div><div class="line">[icarus]: https://github.com/ppoffice/hexo-theme-icarus</div><div class="line">[markdown]: https://guides.github.com/features/mastering-markdown/</div></pre></td></tr></table></figure>
<h3 id="12-Generate-the-site"><a href="#12-Generate-the-site" class="headerlink" title="12.Generate the site"></a>12.Generate the site</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">$ hexo generate</div></pre></td></tr></table></figure>
<h3 id="13-Deploy-your-site-to-github"><a href="#13-Deploy-your-site-to-github" class="headerlink" title="13. Deploy your site to github"></a>13. Deploy your site to github</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">$ hexo deploy</div></pre></td></tr></table></figure>
</div>
<footer class="article-footer">
<div class="share-container">
</div>
<a data-url="http://pelssersconsultancy.com/2016/04/08/How-to-setup-your-own-blog/" data-id="citlgwnuf00009w7r2fbxlqt5" class="article-share-link"><i class="fa fa-share"></i>Share</a>
<script>
(function ($) {
// Prevent duplicate binding
if (typeof(__SHARE_BUTTON_BINDED__) === 'undefined' || !__SHARE_BUTTON_BINDED__) {
__SHARE_BUTTON_BINDED__ = true;
} else {
return;
}
$('body').on('click', function() {
$('.article-share-box.on').removeClass('on');
}).on('click', '.article-share-link', function(e) {
e.stopPropagation();
var $this = $(this),
url = $this.attr('data-url'),
encodedUrl = encodeURIComponent(url),
id = 'article-share-box-' + $this.attr('data-id'),
offset = $this.offset(),
box;
if ($('#' + id).length) {
box = $('#' + id);
if (box.hasClass('on')){
box.removeClass('on');
return;
}
} else {
var html = [
'<div id="' + id + '" class="article-share-box">',
'<input class="article-share-input" value="' + url + '">',
'<div class="article-share-links">',
'<a href="https://twitter.com/intent/tweet?url=' + encodedUrl + '" class="fa fa-twitter article-share-twitter" target="_blank" title="Twitter"></a>',
'<a href="https://www.facebook.com/sharer.php?u=' + encodedUrl + '" class="fa fa-facebook article-share-facebook" target="_blank" title="Facebook"></a>',
'<a href="http://pinterest.com/pin/create/button/?url=' + encodedUrl + '" class="fa fa-pinterest article-share-pinterest" target="_blank" title="Pinterest"></a>',
'<a href="https://plus.google.com/share?url=' + encodedUrl + '" class="fa fa-google article-share-google" target="_blank" title="Google+"></a>',
'</div>',
'</div>'
].join('');
box = $(html);
$('body').append(box);
}
$('.article-share-box.on').hide();
box.css({
top: offset.top + 25,
left: offset.left
}).addClass('on');
}).on('click', '.article-share-box', function (e) {
e.stopPropagation();
}).on('click', '.article-share-box-input', function () {
$(this).select();
}).on('click', '.article-share-box-link', function (e) {
e.preventDefault();
e.stopPropagation();
window.open(this.href, 'article-share-box-window-' + Date.now(), 'width=500,height=450');
});
})(jQuery);
</script>
<a href="http://pelssersconsultancy.com/2016/04/08/How-to-setup-your-own-blog/#comments" class="article-comment-link disqus-comment-count" data-disqus-url="http://pelssersconsultancy.com/2016/04/08/How-to-setup-your-own-blog/">Comments</a>
</footer>
</div>
</article>
</section>
<aside id="sidebar">
<div class="widget-wrap">
<h3 class="widget-title">recent</h3>
<div class="widget">
<ul id="recent-post" class="">
<li>
<div class="item-thumbnail">
<a href="/2016/07/18/Finding-project-in-workspace-with-specific-maven-dependency/" class="thumbnail">
<span class="thumbnail-image thumbnail-none"></span>
</a>
</div>
<div class="item-inner">
<p class="item-category"></p>
<p class="item-title"><a href="/2016/07/18/Finding-project-in-workspace-with-specific-maven-dependency/" class="title">Finding project in workspace with specific maven dependency</a></p>
<p class="item-date"><time datetime="2016-07-18T18:12:48.000Z" itemprop="datePublished">2016-07-18</time></p>
</div>
</li>
<li>
<div class="item-thumbnail">
<a href="/2016/05/13/How-to-use-different-SSH-keys-for-different-Github-accounts/" class="thumbnail">
<span style="background-image:url(/2016/05/13/How-to-use-different-SSH-keys-for-different-Github-accounts/github-preview.gif)" alt="How to use different SSH keys for different Github accounts" class="thumbnail-image"></span>
</a>
</div>
<div class="item-inner">
<p class="item-category"></p>
<p class="item-title"><a href="/2016/05/13/How-to-use-different-SSH-keys-for-different-Github-accounts/" class="title">How to use different SSH keys for different Github accounts</a></p>
<p class="item-date"><time datetime="2016-05-13T07:48:18.000Z" itemprop="datePublished">2016-05-13</time></p>
</div>
</li>
<li>
<div class="item-thumbnail">
<a href="/2016/05/10/Using-MapReduce-with-Morphia-and-MongoDB/" class="thumbnail">
<span style="background-image:url(/2016/05/10/Using-MapReduce-with-Morphia-and-MongoDB/mapreduce-mongodb.jpg)" alt="Using MapReduce with Morphia and MongoDB" class="thumbnail-image"></span>
</a>
</div>
<div class="item-inner">
<p class="item-category"></p>
<p class="item-title"><a href="/2016/05/10/Using-MapReduce-with-Morphia-and-MongoDB/" class="title">Using MapReduce with Morphia and MongoDB</a></p>
<p class="item-date"><time datetime="2016-05-10T12:43:33.000Z" itemprop="datePublished">2016-05-10</time></p>
</div>
</li>
<li>
<div class="item-thumbnail">
<a href="/2016/04/25/How-fast-are-your-collections/" class="thumbnail">
<span style="background-image:url(/2016/04/25/How-fast-are-your-collections/jrebel_collections_cheatsheet.png)" alt="How fast are your collections?" class="thumbnail-image"></span>
</a>
</div>
<div class="item-inner">
<p class="item-category"></p>
<p class="item-title"><a href="/2016/04/25/How-fast-are-your-collections/" class="title">How fast are your collections?</a></p>
<p class="item-date"><time datetime="2016-04-25T18:03:28.000Z" itemprop="datePublished">2016-04-25</time></p>
</div>
</li>
<li>
<div class="item-thumbnail">
<a href="/2016/04/08/How-to-setup-your-own-blog/" class="thumbnail">
<span style="background-image:url(/2016/04/08/How-to-setup-your-own-blog/creating_repository.png)" alt="How to setup your own blog with Github Pages and Hexo" class="thumbnail-image"></span>
</a>
</div>
<div class="item-inner">
<p class="item-category"><a class="article-category-link" href="/categories/Tutorials/">Tutorials</a></p>
<p class="item-title"><a href="/2016/04/08/How-to-setup-your-own-blog/" class="title">How to setup your own blog with Github Pages and Hexo</a></p>