-
Notifications
You must be signed in to change notification settings - Fork 0
/
reference.html
2081 lines (2023 loc) · 111 KB
/
reference.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">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="google" value="notranslate">
<link rel="icon" type="image/png" href="/icon.png">
<link href="https://fonts.googleapis.com/css?family=Cutive+Mono" rel="stylesheet">
<title itemprop="name">Axton: About Me</title>
<meta name="theme-color" content="#212121">
<style>
* {
cursor: text;
-webkit-tap-highlight-color: transparent
}
body.bg-white ::selection {
background-color: #000;
color: #fff
}
body.bg-black ::selection,body.bg-dblue ::selection,body.bg-dgray ::selection,body.bg-dgreen ::selection {
background-color: #fff!important;
color: #000!important
}
body {
font-size: 17px!important;
background-color: #fff;
padding: 5px;
overflow-x: hidden
}
body,pre {
font-family: Cutive Mono,Courier New,Consolas,monospace!important;
margin: 0
}
pre {
margin-right: 30px
}
.about,pre {
float: left
}
.input-text {
border: none!important;
-moz-appearance: none!important;
-webkit-appearance: none!important;
outline: 0!important;
box-sizing: border-box!important;
padding-right: 45px
}
.input-text,.input-text * {
background-color: transparent!important;
font-size: 17px!important;
font-family: Cutive Mono,Courier New,Consolas,monospace!important;
word-break: break-all!important;
color: #000!important
}
.input-text * {
display: inline!important;
white-space: pre-wrap!important
}
.input-lable {
position: absolute;
top: 100%;
left: 0;
z-index: 1;
width: 100%
}
.clear {
clear: both
}
#main {
line-height: 23px;
word-wrap: break-word;
position: relative
}
.ls-dir {
color: #228de4
}
.ls-sh {
color: #e422ca
}
#main a {
color: #000
}
#main a:hover {
text-decoration: none!important
}
.content {
display: inline-block;
width: 100%;
word-break: break-all
}
.info {
color: rgba(0,0,0,.3)
}
.catmode {
display: none
}
body.bg-agreen.fc-white a,body.fc-white .input-text,body.fc-white .input-text *,body.fc-white a {
color: #fff!important
}
body.bg-agreen.fc-gray a,body.fc-gray .input-text,body.fc-gray .input-text *,body.fc-gray a {
color: #969696!important
}
body.fc-white .info {
color: hsla(0,0%,100%,.3)
}
body.fc-gray .info {
color: hsla(0,0%,59%,.3)
}
.js {
color: #ebd63d
}
.nginx {
color: #009539
}
.sf {
color: #005db9
}
.sflogo {
color: #0097a7
}
.aslogo {
color: #607d8b
}
.bg-white,.bg-white .con-lost {
background-color: #fff
}
.bg-black,.bg-black .con-lost {
background-color: #000
}
.bg-dgray,.bg-dgray .con-lost {
background-color: #323232
}
.bg-dblue,.bg-dblue .con-lost {
background-color: #1e3946
}
.bg-dgreen,.bg-dgreen .con-lost {
background-color: #0d3936
}
.fc-black,.fc-black .con-lost {
color: #000
}
.fc-gray,.fc-gray .con-lost {
color: #969696
}
.bg-black.bg-demo,.bg-dblue.bg-demo,.bg-dgray.bg-demo,.bg-dgreen.bg-demo,.fc-white,.fc-white .con-lost {
color: #fff
}
.bg-white.bg-demo {
color: #000
}
.fc-white.fc-demo {
background-color: #000
}
.fc-black.fc-demo {
background-color: #fff
}
.as-failed {
color: #b90000
}
.as-successed {
color: #00b919
}
.ls {
float: left
}
.help-item {
width: 130px;
float: left
}
.precolor,.preleave,.preoption {
display: none;
word-break: break-all
}
.con-lost {
height: 100%;
top: 0;
left: 0;
z-index: 10;
display: none
}
.con-lost,.con-lost>div {
position: fixed;
width: 100%
}
.con-lost>div {
text-align: center;
top: 50%;
transform: translateY(-50%);
z-index: 11
}
.con-lost-text {
font-size: 27px;
font-weight: 700
}
.retry {
font-size: 18px;
line-height: 30px
}
.soft-keyboard-self {
width: 100%;
background-color: rgba(33,33,33,.5);
color: #fff;
position: fixed;
bottom: 0;
left: 0;
display: none;
z-index: 12;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none
}
.soft-keyboard-fill {
width: calc(100% + 10px);
position: absolute;
top: 100%;
left: -5px;
display: none;
height: 30px;
z-index: 8
}
.soft-keyboard-self>div.key {
width: calc(20% - 1px);
text-align: center;
height: 30px;
display: inline-block;
font-size: 17px;
line-height: 30px;
background-color: transparent;
cursor: pointer
}
#ac-tip {
opacity: .3
}
.lan-div {
display: inline;
box-sizing: border-box;
margin: 0;
border-left: 1px solid hsla(0,0%,100%,.3)
}
.input-lable,.input-lable span {
word-break: break-all!important
}
@supports(-webkit-backdrop-filter:none) or (backdrop-filter:none) {
.soft-keyboard-self {
-webkit-backdrop-filter: blur(30px);
backdrop-filter: blur(30px)
}
}
@media(max-width: 400px) {
.input-text,.input-text *,body {
font-size:15px!important
}
.soft-keyboard-self>div.key {
font-size: 15px
}
}
</style>
</head>
<body>
<div id="main">
Hi, I'm Axton, a secondary school student from China.<br>
Try to find more infomation about me!<br>
Type 'help' to get help.<br>
Have fun :-)<br>
<br>
<span class="info">
AxtonShell 2.0.0<br>Based on BASH
</span>
<br>
<div class="content">
<br>
</div>
<div class="input-lable">
<span class="prefix">
<span>[</span>
<span id='usr'>usr</span>
<span>@axton.cc </span>
<span id='position'>~</span>
<span>]#</span>
</span>
<span class="preblank"> </span>
<span class="precolor">Type the number of the color: </span>
<span class="preoption">Type the number of the option: </span>
<span class="preleave">Type a message: </span>
<span class="input-text" contenteditable spellcheck="false" autocomplete="off" autocorrect="off"></span>
<span id="ac-tip"></span>
<span class="catmode"> </span>
<div class="soft-keyboard-fill soft-keyboard"></div>
</div>
<div class="soft-keyboard-self soft-keyboard">
<div id="c-c" class="key">Ctrl-C</div>
<div class="lan-div"></div>
<div id="enter" class="key">Enter</div>
<div class="lan-div"></div>
<div id="tab" class="key">Tab</div>
<div class="lan-div"></div>
<div id="up" class="key">↑</div>
<div class="lan-div"></div>
<div id="down" class="key">↓</div>
</div>
<div class="con-lost">
<div>
<span class="con-lost-text">Connection Lost</span>
<br>
<span class="retry">Enter to reconnect
</div>
</div>
<script src="jquery.min.js"></script>
<script>
"use strict";
if (!localStorage.getItem("as-bg")) {
localStorage.setItem("as-bg", "1")
} else {
let bgColor = localStorage.getItem("as-bg");
if (bgColor === "1") {
$('body').addClass("bg-white")
} else if (bgColor === "2") {
$('body').addClass("bg-black");
$("meta[name='theme-color']").attr('content', "#000000")
} else if (bgColor === "3") {
$('body').addClass("bg-dgray");
$("meta[name='theme-color']").attr('content', "#323232")
} else if (bgColor === "4") {
$('body').addClass("bg-dblue");
$("meta[name='theme-color']").attr('content', "#1e3946")
} else if (bgColor === "5") {
$('body').addClass("bg-dgreen");
$("meta[name='theme-color']").attr('content', "#0d3936")
} else {
localStorage.setItem("as-bg", "1");
$('body').addClass("bg-white")
}
}
if (!localStorage.getItem("as-fc")) {
localStorage.setItem("as-fc", "1")
} else {
let fColor = localStorage.getItem("as-fc");
if (fColor === "1") {
$('body').addClass("fc-black")
} else if (fColor === "2") {
$('body').addClass("fc-gray")
} else if (fColor === "3") {
$('body').addClass("fc-white")
} else {
localStorage.setItem("as-fc", "1");
$('body').addClass("fc-black")
}
}
let autoCompleteTag = true;
if (!localStorage.getItem("ac")) {
localStorage.setItem("ac", "1")
} else {
let autoCompleteVal = localStorage.getItem("ac");
if (autoCompleteVal === "2") {
autoCompleteTag = false
} else if (autoCompleteVal !== "1") {
localStorage.setItem("ac", "1")
}
}
if (!localStorage.getItem("sk")) {
if (navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)) {
$('.soft-keyboard').show()
}
localStorage.setItem("sk", "1")
} else {
let softKeyboardStatus = localStorage.getItem("sk");
if (softKeyboardStatus === "1") {
if (navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)) {
$('.soft-keyboard').show()
}
} else if (softKeyboardStatus === "2") {
$('.soft-keyboard').show()
} else if (softKeyboardStatus !== "3") {
if (navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)) {
$('.soft-keyboard').show()
}
localStorage.setItem("sk", "1")
}
}
let uped = new Date();
if (!localStorage.getItem("up")) {
localStorage.setItem("up", uped)
} else {
uped = new Date(Date.parse(localStorage.getItem("up")))
}
let renderedStr = "Someting went wrong :-(<br>";
function postList() {
renderedStr = 'Last 10 posts in my blog.<br>More in [Flyhigher](<a target="_blank" rel="noopener" href="http://flyhigher.top">http://flyhigher.top</a>)<br>';
$.ajax({
url: "/blog",
timeout: 10000,
success: function(data) {
for (let i in data) {
let postTitleInApi = data[i].title.rendered;
let postUrlInApi = data[i].link;
renderedStr = renderedStr + '<br>- [' + postTitleInApi + '](<a target="_blank" rel="noopener" href="' + postUrlInApi + '">' + postUrlInApi + '</a>)'
}
renderedStr = renderedStr + "<br>"
},
error: function() {
renderedStr = 'Can not get posts from my blog. Connection failed.<br>'
}
})
}
postList();
let stopId;
let inputBack = "";
let isStoped = false;
let rebootTime = 0;
let commandRunning = [];
let cour;
let tabList = ['./', 'axtonshell', 'cd', 'cat', 'clear', 'help', 'hello', 'hey', 'hi', 'ls', 'logout', 'reboot', 'screenfetch', 'sudo', 'uname'];
$('.input-lable').click(function() {
$('.input-text').focus()
});
$('.input-text').focus(function() {
isStoped = false;
window.requestAnimationFrame(decodeInput)
});
$('.input-text').blur(function() {
isStoped = true;
window.cancelAnimationFrame(stopId)
});
function decodeInput() {
if (!catMode && !colorMode && !fcMode && !conMode && !con2Mode) {
let inputText = $('.input-text').text();
if (inputText !== inputBack) {
if (inputText === "") {
$('.input-text').css("padding-right", "45px")
} else {
$('.input-text').css("padding-right", "0")
}
autoComplete(deleteHtml($('.input-text').text()));
inputBack = $('.input-text').text()
}
}
if (isStoped) {
return
} else {
stopId = window.requestAnimationFrame(decodeInput)
}
}
$('.input-text').focus();
function autoComplete(input) {
$("#ac-tip").text("");
tabList = [];
if (input === "") {
tabList = ['./', 'axtonshell', 'cd', 'cat', 'clear', 'help', 'hello', 'hey', 'hi', 'ls', 'logout', 'reboot', 'screenfetch', 'sudo', 'uname'];
return false
}
let acComPrsed = input.split(" ");
let acCommandList = ['axtonshell', 'cd', 'cat', 'clear', 'help', 'hello', 'hey', 'hi', 'ls', 'logout', 'reboot', 'screenfetch', 'sudo', 'uname', '../'];
let comNeeded = acComPrsed[acComPrsed.length - 1];
let found = false;
if (acComPrsed.length === 1 || acComPrsed[acComPrsed.length - 2] === "sudo" || acComPrsed[acComPrsed.length - 2] === "||" || acComPrsed[acComPrsed.length - 2] === "&&") {
for (let i in acCommandList) {
if (acCommandList[i].substr(0, comNeeded.length) === comNeeded) {
if ($("#ac-tip").text() === "" && autoCompleteTag && !skMode && !colorMode && !catMode && !fcMode && !lmMode) {
$("#ac-tip").text(acCommandList[i].substr(comNeeded.length))
}
found = true;
tabList.push(acComPrsed[acComPrsed.length - 1] + acCommandList[i].substr(comNeeded.length))
}
}
} else if (acComPrsed[acComPrsed.length - 2] === "axtonshell") {
let asCommandList = ['-a', '-b', '-f', '-s', '--about', '--help'];
for (let i in asCommandList) {
if (asCommandList[i].substr(0, comNeeded.length) === comNeeded) {
if ($("#ac-tip").text() === "" && autoCompleteTag && !skMode && !colorMode && !catMode && !fcMode && !lmMode) {
$("#ac-tip").text(asCommandList[i].substr(comNeeded.length))
}
found = true;
tabList.push(acComPrsed[acComPrsed.length - 1] + asCommandList[i].substr(comNeeded.length))
}
}
} else if (acComPrsed[acComPrsed.length - 2] === "uname") {
let asCommandList = ['-a', '-i', '-m', '-n', '-o ', '-p', '-r', '-s', '-v', '--help'];
for (let i in asCommandList) {
if (asCommandList[i].substr(0, comNeeded.length) === comNeeded) {
if ($("#ac-tip").text() === "" && autoCompleteTag && !skMode && !colorMode && !catMode && !fcMode && !lmMode) {
$("#ac-tip").text(asCommandList[i].substr(comNeeded.length))
}
found = true;
tabList.push(acComPrsed[acComPrsed.length - 1] + asCommandList[i].substr(comNeeded.length))
}
}
}
if (!found) {
let fetchList = [];
let fetchListRaw = false;
if (prsPath(comNeeded, false) !== false) {
fetchListRaw = positionToObj(positionVi)
} else if (comNeeded.indexOf("/") === -1) {
fetchListRaw = positionToObj(positionRe)
}
if (fetchListRaw["type"] === "dir" && fetchListRaw !== false) {
$.extend(true, fetchList, fetchListRaw["content"]);
if (fetchListRaw["name"] !== "/") {
fetchList.push({
name: "..",
comm_name: "..",
sudo: false,
type: "dir",
content: []
})
}
let acPathPrsed = comNeeded.split("/");
acPathPrsed = acPathPrsed[acPathPrsed.length - 1];
for (let i in fetchList) {
if (fetchList[i]["name"].substr(0, acPathPrsed.length) === acPathPrsed) {
if (fetchList[i]["type"] === "dir") {
if ($("#ac-tip").text() === "" && autoCompleteTag && !skMode && !colorMode && !catMode && !fcMode && !lmMode) {
$("#ac-tip").text(fetchList[i]["name"].substr(acPathPrsed.length) + "/")
}
tabList.push(comNeeded + fetchList[i]["name"].substr(acPathPrsed.length) + "/")
} else {
if ($("#ac-tip").text() === "" && autoCompleteTag && !skMode && !colorMode && !catMode && !fcMode && !lmMode) {
$("#ac-tip").text(fetchList[i]["name"].substr(acPathPrsed.length))
}
tabList.push(comNeeded + fetchList[i]["name"].substr(acPathPrsed.length))
}
} else if (fetchList[i]["comm_name"].substr(0, acPathPrsed.length) === acPathPrsed) {
if (fetchList[i]["type"] === "dir") {
if ($("#ac-tip").text() === "" && autoCompleteTag && !skMode && !colorMode && !catMode && !fcMode && !lmMode) {
$("#ac-tip").text(fetchList[i]["comm_name"].substr(acPathPrsed.length) + "/")
}
tabList.push(comNeeded + fetchList[i]["comm_name"].substr(acPathPrsed.length) + "/")
} else {
if ($("#ac-tip").text() === "" && autoCompleteTag && !skMode && !colorMode && !catMode && !fcMode && !lmMode) {
$("#ac-tip").text(fetchList[i]["comm_name"].substr(acPathPrsed.length))
}
tabList.push(comNeeded + fetchList[i]["comm_name"].substr(acPathPrsed.length))
}
}
}
}
}
}
const logo = " @@@OOOO, <br>" + " @@@@@@@OOO/[.,[OOO, <br>" + " ,@@@@@@OOOOO` . =OO@@, <br>" + " ,@@@@@@@@OO` ,OOOO OOO@@@, <br>" + ",O@@@@OOOO/ ,OOOOOO OOO@@@@,<br>" + "O@@@@OOOO` =OOOOOO[ ,OO@@@@OO<br>" + "@@@@@OOO. =OO@@@@OO<br>" + "@@@@@OO OOO]]OOOO OOO@@@@OO<br>" + "O@@@@O /OOO@@@@O^ =OOO@@@@OO<br>" + " @@@@^ =@OOO@@@@/ ,OO@O@@@@O <br>" + " ,@@@ ^@O@@@@OOO OO@@@@OOO, <br>" + " ,@@@O]/O@@@@OOOO]]OO@@@@OO, <br>" + " ,OOO@@@@@@@@@@@@OOO, <br>" + " @@@OOOO, ";
let rootMode = 0
, sudoMode = 0
, historyMode = 0
, tabMode = 0
, catMode = 0
, colorMode = 0
, fcMode = 0
, skMode = 0
, conMode = 0
, con2Mode = 0
, running = 0
, lmMode = 0;
const files = [{
"name": "/",
"comm_name": "/",
"sudo": true,
"type": "dir",
"content": [{
"name": "usr",
"comm_name": "~",
"sudo": false,
"type": "dir",
"content": [{
"name": "blog",
"comm_name": "blog",
"sudo": false,
"type": "dir",
"content": [{
"name": "post_list.md",
"comm_name": "post_list.md",
"sudo": false,
"type": "file",
"content": "--POSTLIST--"
}]
}, {
"name": "contact",
"comm_name": "contact",
"sudo": false,
"type": "dir",
"content": [{
"name": "leave_a_message.sh",
"comm_name": "leave_a_message.sh",
"sudo": false,
"type": "file",
"content": '--MESSAGEMODE--'
}, {
"name": "README.md",
"comm_name": "README.md",
"sudo": false,
"type": "file",
"content": '# Contact me<br><br>- Github: [@yrccondor](<a target="_blank" rel="noopener" href="https://github.com/yrccondor">https://github.com/yrccondor</a>)<br>- Telegram: [@YrcAxton](<a target="_blank" rel="noopener" href="https://t.me/YrcAxton">https://t.me/YrcAxton</a>)<br>- Email: yrc371106#hotmail.com<br>- QQ: 1834341100<br>- Tel.: `getDNS.search(\'tel.axton.cc\',\'TXT\');`<br>- Blog: [FLyhigher](<a target="_blank" rel="noopener" href="https://flyhigher.top">https://flyhigher.top</a>)'
}]
}, {
"name": "introduction.md",
"comm_name": "introduction.md",
"sudo": false,
"type": "file",
"content": "高三狗一只,Axton 是我的代号,坐标浙江某城市。<br><br>喜欢电脑,会打代码,会剪视频加特效,偶尔做做音乐。<br><br>摄影是我的爱好,虽然我没有牛逼的装备。<br><br>我会一点二胡,看得懂谱子,不是很精通。<br><br>### More details<br>- 会打代码,会一些乱七八糟的语言。有 PHP,ASP,Python,C,HTML+CSS+Javascript,Java 以及 VB<br>- 但实际上呢,代码不精,封装无力,啥新技术也不会,主业写 Bug 副业 Debug,是个弱渣<br>- 最喜欢的编辑器是 VS code,Atom 再见<br>- 勉强会玩 Linux<br>- 会剪视频加特效,用着 Adobe 全家桶<br>- 会一点 Cinema4D 和 Mocha,然而不算精通<br>- 有时会做音乐,没有 MIDI 键盘所以很累。FL Studio 内建音色而已<br>- 会折腾树莓派以及 Arduino<br>- GitHub 蒟蒻一只<br>- 沉迷于 PPT 自定义动画<br>- 除了码程序,另一个爱好就是摄影。入坑 6 年,尼康党,不撕<br>- 已经摸熟了同学的D810,然而母上大人还是不让我换新机。目前使用 D3100<br>- 不太想拿自己的摄影作品参加比赛2333<br>- 喜欢欧美歌,不入欧美圈<br>- 半二次<br>- 混迹于祖国东南沿海一所苦逼高中,梦想只是浙大<br>- 目前在研究 Python 算法和机器学习,无奈数学是个坎所以很慢<br>- 算导党"
}, {
"name": "projects",
"comm_name": "projects",
"sudo": false,
"type": "dir",
"content": [{
"name": "README.md",
"comm_name": "README.md",
"sudo": false,
"type": "file",
"content": '# Projects<br><br>- [MDx](<a target="_blank" rel="noopener" href="https://github.com/yrccondor/mdx">https://github.com/yrccondor/mdx</a>) A Material Design WordPress Theme<br>- [Certificate checker](<a target="_blank" rel="noopener" href="https://ssl.flyhigher.top">https://ssl.flyhigher.top</a>) Check SSL certificates automatically<br>- [SLock](<a target="_blank" rel="noopener" href="https://flyhigher.top/develop/408.html">https://flyhigher.top/develop/408.html</a>) A smart lock powered by Respiberry Pi<br>- [These Postos](<a target="_blank" rel="noopener" href="https://photo.axton.cc">https://photo.axton.cc/</a>) Photos taken by myself<br>- [Hommy](<a target="_blank" rel="noopener" href="https://flyhigher.top/develop/594.html">https://flyhigher.top/develop/594.html</a>) A smart assistant helps people to manage their finance (Team Work)'
}]
}]
}, {
"name": "resume.md",
"comm_name": "resume.md",
"sudo": true,
"type": "file",
"content": "Okay, just contact me if you want it."
}]
}];
let positionRe = {
"deepth": 2,
"d_1": 1,
"d_2": 0,
"d_3": 0
};
let positionVi = {
"deepth": 2,
"d_1": 1,
"d_2": 0,
"d_3": 0
};
let displayPosition = "~";
let username = "usr";
let commandList = ['sudo', 'cd', 'ls', 'cat', 'logout', 'uname', 'hey', 'hi', 'hello', 'help', 'clear', 'screenfetch', 'axtonshell', '~', '/', './', '../', '#', 'echo', ';', '(', ')', '\'', '"', ':', '^', '!', '{', '}', '&', 'reboot'];
let hisCommand = [];
let inputCache = "";
if (!localStorage.getItem("his_list")) {
localStorage.setItem("his_list", "")
} else {
if (localStorage.getItem("his_list") !== "") {
hisCommand = JSON.parse(localStorage.getItem("his_list"))
}
}
function runCommand(command) {
let commandDet = command["content"];
if (commandDet['name'] === 'cat') {
if (!commandDet['args'][0]) {
catMode = 1;
$('.prefix,.preblank').hide();
$('.catmode').show();
return {
"content": "--CATMODE--",
"sta": true
}
} else {
let res = "";
let fileObj = {};
let succ = true;
for (let i = 0; i < commandDet['args'].length; i++) {
if (prsPath(commandDet['args'][i], true)) {
fileObj = positionToObj(positionVi);
if (!fileObj["sudo"] || (fileObj["sudo"] && commandDet['sudo']) || (fileObj["sudo"] && positionToObj(positionRe)["sudo"])) {
if (fileObj['type'] === 'dir') {
res = res + 'cat: ' + commandDet['args'][i] + ': Is a directory<br>';
succ = false
} else {
if (fileObj['content'] === "--POSTLIST--") {
res = res + renderedStr
} else if (fileObj['content'] === "--MESSAGEMODE--") {
return {
"content": "cat: " + commandDet['args'][i] + ": File locked by axtonshell<br>",
"sta": false
}
} else {
res = res + fileObj['content'] + "<br>"
}
}
} else {
res = res + "cat: " + commandDet['args'][i] + ": Access denied<br>";
succ = false
}
} else {
res = res + "cat: " + commandDet['args'][i] + ": No such file or directory<br>";
succ = false
}
}
if (succ) {
return {
"content": res,
"sta": true
}
} else {
return {
"content": res,
"sta": false
}
}
}
} else if (!commandDet['known']) {
if (commandDet['sudo']) {
return {
"content": "sudo: " + commandDet['name'] + ": command not found<br>",
"sta": false
}
} else {
return {
"content": "-bash: " + commandDet['name'] + ": command not found<br>",
"sta": false
}
}
}
if (commandDet['name'] === 'sudo') {
return {
"content": "usage: sudo [command][ args]...<br>",
"sta": true
}
}
if (commandDet['name'] === 'help') {
return {
"content": "[sudo ]command[ Options...]<br>You can use following commands:<div><div class=\"help-item\">cd</div><div class=\"help-item\">ls</div><div class=\"help-item\">cat</div><div class=\"help-item\">uname</div><div class=\"help-item\">clear</div><div class=\"help-item\">screenfetch</div><div class=\"help-item\">logout</div><div class=\"help-item\">reboot</div><div class=\"help-item\">help</div><div class=\"clear\"></div></div><br>For changing the settings of the shell:<br>axtonshell<br><br>Besides, there are some hidden commands, try to find them!<br>",
"sta": true
}
}
if (commandDet['name'] === 'clear') {
return {
"content": "--CLEARMODE--",
"sta": true
}
}
if (commandDet['name'] === 'hi') {
return {
"content": "Hey!<br>",
"sta": true
}
}
if (commandDet['name'] === '^') {
return {
"content": "-bash: :s^: no previous substitution<br>",
"sta": false
}
}
if (commandDet['name'].substr(0, 2) === '^f') {
return {
"content": "-bash: :s^" + commandDet['name'].substr(2) + ": substitution failed<br>",
"sta": false
}
}
if (commandDet['name'] === ':' || commandDet['name'] === '!' || commandDet['name'] === '#') {
return {
"content": "--CDBLANKMODE--",
"sta": true
}
}
if (commandDet['name'] === 'echo') {
return {
"content": " <br>",
"sta": true
}
}
if (commandDet['name'] === '(' || commandDet['name'] === ')' || commandDet['name'] === '{' || commandDet['name'] === '}' || commandDet['name'] === '\'' || commandDet['name'] === '"' || commandDet['name'] === '&' || commandDet['name'] === ';') {
return {
"content": "-bash: Can not run code<br>",
"sta": false
}
}
if (commandDet['name'] === 'cd') {
if (!commandDet['args'][0]) {
return {
"content": "--CDBLANKMODE--",
"sta": true
}
} else {
if (prsPath(commandDet['args'][0], true)) {
let targetObj = positionToObj(positionVi);
if (targetObj["type"] === 'file') {
if (commandDet['sudo']) {
return {
"content": "/bin/cd: line 2: cd: " + commandDet['args'][0] + ": Not a directory<br>",
"sta": false
}
} else {
return {
"content": "-bash: cd: " + commandDet['args'][0] + ": Not a directory<br>",
"sta": false
}
}
} else {
if (targetObj["sudo"] && !commandDet['sudo'] && !positionToObj(positionRe)["sudo"]) {
return {
"content": "-bash: cd: " + commandDet['args'][0] + ": Access denied<br>",
"sta": false
}
} else {
positionRe = Object.assign({}, positionVi);
let displayBackup = displayPosition;
displayPosition = targetObj["comm_name"];
$('#position').text(displayPosition);
return {
"content": "--CDMODE--" + displayBackup,
"sta": true
}
}
}
} else {
if (commandDet['sudo']) {
return {
"content": "/bin/cd: line 2: cd: " + commandDet['args'][0] + ": No such file or directory<br>",
"sta": false
}
} else {
return {
"content": "-bash: cd: " + commandDet['args'][0] + ": No such file or directory<br>",
"sta": false
}
}
}
}
}
if (commandDet['name'] === 'hey' || commandDet['name'] === 'hello') {
return {
"content": "Hi~<br>",
"sta": true
}
}
if (commandDet['name'] === 'logout') {
return {
"content": '--LOGOUTMODE--',
"sta": true
}
}
if (commandDet['name'] === 'reboot') {
if (!commandDet['args'][0]) {
return {
"content": '--REBOOTMODE--',
"sta": true
}
} else if (commandDet['args'][0] === "-w") {
return {
"content": '--FAKEREBOOTMODE--',
"sta": true
}
} else {
if (commandDet['args'][0] !== "-b" && commandDet['args'][0] !== "-f" && commandDet['args'][0] !== "-i" && commandDet['args'][0] !== "-n") {
return {
"content": "reboot: invalid option -- '" + commandDet['args'][0].substr(1) + "'<br>",
"sta": false
}
} else {
return {
"content": '--REBOOTMODE--',
"sta": true
}
}
}
}
if (commandDet['name'] === '~' || commandDet['name'].indexOf("/") >= 0) {
if (commandDet['sudo']) {
return {
"content": 'sudo: ' + commandDet['name'] + ': command not found<br>',
"sta": false
}
} else {
if (prsPath(commandDet['name'], true)) {
let fileObj = positionToObj(positionVi);
if (fileObj["type"] === "dir") {
return {
"content": '-bash: ' + commandDet['name'] + ': Is a directory<br>',
"sta": false
}
} else {
if (fileObj["name"].substr(-3) === ".sh") {
if (fileObj["sudo"] && !positionToObj(positionRe)["sudo"]) {
return {
"content": "-bash: " + commandDet['name'] + ": Access denied<br>",
"sta": false
}
} else {
return {
"content": fileObj["content"],
"sta": true
}
}
} else {
return {
"content": '-bash: ' + commandDet['name'] + ': Permission denied<br>',
"sta": false
}
}
}
} else {
return {
"content": '-bash: ' + commandDet['name'] + ': No such file or directory<br>',
"sta": false
}
}
}
}
if (commandDet['name'] === 'screenfetch') {
let nowDate = new Date();
let day = parseInt((nowDate - uped) / 1000 / 60 / 60 / 24);
let hour = parseInt((nowDate - uped) / 1000 / 60 / 60) - day * 24;
let min = parseInt((nowDate - uped) / 1000 / 60) - day * 24 * 60 - hour * 60;
let sec = parseInt((nowDate - uped) / 1000) - day * 24 * 60 * 60 - hour * 60 * 60 - min * 60;
return {
"content": "<br><div><pre class=\"sflogo\">" + logo + "</pre><div class=\"about info\"> <br><span class=\"sf\">usr@axton.cc</span><br>OS: <span class=\"sf\">AxtonOs</span><br>Kernel: <span class=\"sf\">7.10.0-693.2.2.el7.x86_64</span><br>Shell: <span class=\"sf\">AxtonShell 2.0.0</span><br>Uptime: <span class=\"sf\">" + day + "d " + hour + "h " + min + "m " + sec + "s</span><br>Resolution: <span class=\"sf\">" + parseInt(window.screen.width) + "x" + parseInt(window.screen.height) + "</span><br>Font: <span class=\"sf\">Cutive Mono</span><br></div><div class=\"clear\"></div></div><br>",
"sta": true
}
}
if (commandDet['name'] === 'ls') {
if (!commandDet['args'][0]) {
let res = "<div class=\"out-ls\">";
let fileObj = positionToObj(positionRe);
let lsWidth = 0;
let lsWidthMax = 0;
if (fileObj['type'] === 'file') {
return {
"content": fileObj['comm_name'] + "<br>",
"sta": true
}
} else {
for (let k = 0; k < fileObj["content"].length; k++) {
lsWidth = textWidth(fileObj["content"][k]["name"] + "--");
if (lsWidth > lsWidthMax) {
lsWidthMax = lsWidth
}
}
for (let i = 0; i < fileObj["content"].length; i++) {
if (fileObj["content"][i]["type"] === "dir") {
res = res + "<div class=\"ls ls-dir\" style=\"width:" + lsWidthMax + "px\">" + fileObj["content"][i]["name"] + "</div>"
} else if (fileObj["content"][i]["type"] === "file" && fileObj["content"][i]["name"].indexOf(".sh") === fileObj["content"][i]["name"].length - 3) {
res = res + "<div class=\"ls ls-sh\" style=\"width:" + lsWidthMax + "px\">" + fileObj["content"][i]["name"] + "</div>"
} else {
res = res + "<div class=\"ls\" style=\"width:" + lsWidthMax + "px\">" + fileObj["content"][i]["name"] + "</div>"
}
}
return {
"content": res + "<div class=\"clear\"></div></div>",
"sta": true
}
}