-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcommands.txt
1539 lines (1538 loc) · 69.8 KB
/
commands.txt
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
C:/WINDOWS/System32/wsl.exe
C:\Users\bryan\AppData\Local\Microsoft\WindowsApps\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\ubuntu.exe
npm i @bgoonz11/repoutils
npm i prettier -g
prettier --write .
-----------------------------------------ZIP UTILS-----------------------------------------------------------------------------------------
4.)Recursive-unzip:()===>
find . -name "*.zip" | while read filename; do unzip -o -d "`dirname "$filename"`" "$filename"; done;
find . -name "*.zip" -type f -print -delete
---------------------------------------------------------------------------------------------------------
Install node modules recursevly ( npm i -g recursive-install ):
npm-recursive-install
---------------------------------------------------Main Commands---------------------------------------------------------------------------
find . -empty -type d -print -delete OR find . -depth -exec rmdir {} \;
fdupes -r -f . | grep -v '^$' | xargs rm -v
find . -empty -type f -print -delete
find . -empty -type d -print -delete
find . \( -name ".git" -o -name ".gitignore" -o -name ".gitmodules" -o -name ".gitattributes" \) -exec rm -rf -- {} +
find . \( -name "*SECURITY.txt" -o -name "*RELEASE.txt" -o -name "*CHANGELOG.txt" -o -name "*LICENSE.txt" -o -name "*CONTRIBUTING.txt" -name "*HISTORY.md" -o -name "*LICENSE" -o -name "*SECURITY.md" -o -name "*RELEASE.md" -o -name "*CHANGELOG.md" -o -name "*LICENSE.md" -o -name "*CODE_OF_CONDUCT.md" -o -name "*CONTRIBUTING.md" \) -exec rm -rf -- {} +
### Spotify Playing 🎧
[<img src="https://now-playing-codestackr.vercel.app/api/spotify-playing" alt="ahan8927 Spotify Playing" width="350" />](https://open.spotify.com/user/ablindoldman)
---
find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +
find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +
find . -name 'node-gyp' -type d -prune -exec rm -rf '{}' +
find . -name 'deleteme.txt' -type f -prune -exec rm -rf '{}' +
find . -name 'right.html' -type f -prune -exec rm -rf '{}' +
find . -name 'left.html' -type f -prune -exec rm -rf '{}' +
----------------------------------------------Remove Spaces In File/Folder Names-----------------------------------------------------------
find . -name "* *" -type d | rename 's/ /_/g'
find . -name "* *" -type f | rename 's/ /_/g'
find . -name "* *" -type d | rename 's/#/_/g'
find . -name "* *" -type f | rename 's/.html//g'
------------------------------------Truncate folder names down to 12 char------------------------------------------------------------------------
for d in ./*; do mv $d ${d:0:12}; done
-------------------------------------Remove Numbers From File Names------------------------------------------------------------------------
find $dir -type f | sed 's|\(.*/\)[^A-Z]*\([A-Z].*\)|mv \"&\" \"\1\2\"|' | sh
find $dir -type d | sed 's|\(.*/\)[^A-Z]*\([A-Z].*\)|mv \"&\" \"\1\2\"|' | sh
for i in *.html; do mv "$i" "${i%-*}.html"; done
for i in *.*; do mv "$i" "${i%-*}.${i##*.}"; done
-------------------------------------FIND AND REPLACE IN STRING/FOLDER NAMES----------------------------------------------------------------
find . -type f -exec rename 's/string1/string2/g' {} +
find . -type d -exec rename 's/-master//g' {} +
rename 's/\.js\.download$/.js/' *.js\.download
rename 's/\.html\.markdown$/.md/' *.html\.markdown
find . -type d -exec rename 's/es6//g' {} +
for d in *.; do
tmp=`echo $f | sed -r 's//^(.{5}).*(\..*)$/$1$2/'`
mv -b ./"$f" ./"$tmp"
done
rawFileName=$(basename "$1")
filename="${rawFileName%.*}"
ext="${rawFileName##*.}"
if [[ ${#filename} < 9 ]]; then
echo ${filename:0:8}.${ext}
else
echo $1
fi
rename 's/^(.{10}).*/$1/' *
-------------------------------------------
Remove double extensions :
#!/bin/bash
for file in *.html.html
do
mv "${file}" "${file%.html}"
done
#!/bin/bash
for file in *.html.png
do
mv "${file}" "${file%.png}"
done
#!/bin/bash
for file in *.md.md
do
mv "${file}" "${file%.md}"
done
find . -type f -exec rename's/\.js\.download$/.js/' *.js\.download ' {} +
#!/bin/bash
num=1
length=16
for file in '.'
do
newname=$file
until [[ ! -f $newname ]]
do
(( sublen = length - ${#num} ))
printf -v newname '%.*s%d' "$sublen" "$file" "$num"
(( num++ ))
done
mv "$file" "$newname"
done
sed 's/\/.*\/.*\/.*\/\(.*\)/~\/\1/g' *
---------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------
git pull
git init
git add .
git commit -m"update"
git push -u origin master
git init
git add .
git commit -m"update"
git push -u origin main
git init
git add .
git commit -m"update"
git push -u origin bryan-guner
git init
git add .
git commit -m"update"
git push -u origin gh-pages
git init
git add .
git commit -m"update"
git push -u origin pdf-experiment
git init
git add .
git commit -m"update"
git push -u origin preview
---------------------------------------------------------------------------------------------------------
git pull keeping local changes:
git stash
git pull
git stash pop
---------------------------------------------------------------------------------------------------------
clone all of a user's git repositories
CNTX={users}; NAME={xriley}; PAGE=1
curl "https://api.github.com/$CNTX/$NAME/repos?page=$PAGE&per_page=100" |
grep -e 'git_url*' |
cut -d \" -f 4 |
xargs -L1 git clone
CNTX={users}; NAME={jdrichardsappacad}; PAGE=1
curl "https://api.github.com/$CNTX/$NAME/repos?page=$PAGE&per_page=100" |
grep -e 'git_url*' |
cut -d \" -f 4 |
xargs -L1 git clone
CNTX={users}; NAME={bgoonz}; PAGE=1
curl "https://api.github.com/$CNTX/$NAME/repos?page=$PAGE&per_page=200"?branch=master |
grep -e 'git_url*' |
cut -d \" -f 4 |
xargs -L1 git clone
CNTX={organizations}; NAME={hasura}; PAGE=1
curl "https://api.github.com/$CNTX/$NAME/repos?page=$PAGE&per_page=200"?branch=master |
grep -e 'git_url*' |
cut -d \" -f 4 |
xargs -L1 git clone
Clone Orginization:
#!/bin/bash
for i in $(curl "https://api.github.com/orgs/freeCodeCamp/repos" | grep -oP '"clone_url":\s*"\K[^"]+'); do
echo git clone "$i"
done
Clone Orginization:
#!/bin/bash
for i in $(curl "https://api.github.com/orgs/mdn/repos" | grep -oP '"clone_url":\s*"\K[^"]+'); do
echo git clone "$i"
done
#!/bin/bash
for i in $(curl "https://api.github.com/orgs/react-component/repos" | grep -oP '"clone_url":\s*"\K[^"]+'); do
echo git clone "$i"
done
#!/bin/bash
for i in $(curl "https://api.github.com/orgs/chartjs/repos" | grep -oP '"clone_url":\s*"\K[^"]+'); do
echo git clone "$i"
done
---------------------------------------------------------------------------------------------------------
tree -d -I 'node_modules'
tree -I 'node_modules'
tree -f -I 'node_modules' >TREE.md
tree -f -I 'node_modules' >listing-path.md
tree -f -I 'node_modules' -d >TREE.md
tree -f >README.md
full path:
tree -f ~/
---------------------------------------------------------------------------------------------------------
find . -name *right.html -type f -exec sed -i 's/target="_parent"//g' {} +
find . -name *right.html -type f -exec sed -i 's/target="_parent"//g' {} +
---------------------------------------------------------------------------------------------------------
sudo npm i prettier -g
prettier --write .
"pretty": "prettier --write \"./**/*.{js,jsx,py,md,html,css}\""
Format Python:
black .
---------------------------------------------------------------------------------------------------------
PANDOC
find ./ -iname "*.md" -type f -exec sh -c 'pandoc --standalone "${0}" -o "${0%.md}.html"' {} \;
find ./ -iname "*.html" -type f -exec sh -c 'pandoc --wrap=none --from html --to markdown_strict "${0}" -o "${0%.html}.md"' {} \;
find ./ -iname "*.docx" -type f -exec sh -c 'pandoc "${0}" -o "${0%.docx}.md"' {} \;
---------------------------------------------------------------------------------------------------------
Remove lines contaning string:
sudo sed -i '/githubusercontent/d' ./*sandbox.md
sudo sed -i '/github\.com/d' ./*out.md
sudo sed -i '/author/d' ./*
---------------------------------------------------------------------------------------------------------
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-j0CNLUeiqtyaRmlzUHCPZ+Gy5fQu0dQ6eZ/xAww941Ai1SxSY+0EQqNXNE6DZiVc" crossorigin="anonymous"></script>
https://bgoonz-blog.netlify.app/
<iframe id="inlineFrameExample"
title="Inline Frame Example"
frameborder="no" loading="lazy" allowtransparency="true" allowfullscreen="true"
width="800"
height="800"
src="https://deploy-preview-5--jolly-austin-0c1a1d.netlify.app/organizer">
</iframe>
---------------------------------------------------------------------------------------------------------
https://replit.com/@bgoonz/Data-Structures-Algos-Codebase
https://repl.it/@bgoonz/Data-Structures-Algos-Codebase?lite=true&referrer=https%3A%2F%2Fbryanguner.medium.com
https://repl.it/@bgoonz/interview-prac?lite=true&referrer=https%3A%2F%2Fbryanguner.medium.com
https://repl.it/@bgoonz/Database-Prac?lite=true&referrer=https%3A%2F%2Fbryanguner.medium.com
https://replit.com/@bgoonz/express-sqlite-app#src/routes/indexRoute.js
https://replit.com/@bgoonz/SQLite-starter-Template-Jam#main.sql
https://replit.com/@bgoonz/interview-prac#66-plus-one.js
---------------------------------------------------------------------------------------------------------
sudo sed -i '/stargazers/d' ./repo.txt
sudo sed -i '/node_modules/d' ./index.html
sudo sed -i '/right\.html/d' ./index.html
sudo sed -i '/right\.html/d' ./right.html
---------------------------------------------------------------------------------------------------------
zips directory excluding .git and node_modules all the way down (linux)
#!/bin/bash
TSTAMP=`date '+%Y%m%d-%H%M%S'`
zip -r $1.$TSTAMP.zip $1 -x "**.git/*" -x "**node_modules/*" `shift; echo $@;`
printf "\nCreated: $1.$TSTAMP.zip\n"
# usage:
# - zipdir thedir
# - zip thedir -x "**anotherexcludedsubdir/*" (important the double quotes to prevent glob expansion)
# if in windows/git-bash, add 'zip' command this way:
# https://stackoverflow.com/a/55749636/1482990
---------------------------------------------------------------------------------------------------------
Delete files contaning a certain string:
find . | xargs grep -l www.redhat.com | awk '{print "rm "$1}' > doit.sh
vi doit.sh // check for murphy and his law
source doit.sh
---------------------------------------------------------------------------------------------------------
------------------------------------------------GIT---------------------------------------------------------
------------------------------------------------GIT---------------------------------------------------------
------------------------------------------------GIT---------------------------------------------------------
git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch assets/_index.html' HEAD
---------------------------------------------------------------------------------------------------------
OVERWRITE LOCAL CHANGES:
Important: If you have any local changes, they will be lost. With or without --hard option, any local commits that haven't been pushed will be lost.[*]
If you have any files that are not tracked by Git (e.g. uploaded user content), these files will not be affected.
First, run a fetch to update all origin/<branch> refs to latest:
git fetch --all
Backup your current branch:
git branch backup-master
Then, you have two options:
git reset --hard origin/master
OR If you are on some other branch:
git reset --hard origin/<branch_name>
Explanation:
git fetch downloads the latest from remote without trying to merge or rebase anything.
Then the git reset resets the master branch to what you just fetched. The --hard option changes all the files in your working tree to match the files in origin/master
Remove Submodules:
git submodule deinit
-------------------------------GET GISTS:
wget -q -O - https://api.github.com/users/bgoonz/gists | grep raw_url | awk -F\" '{print $4}' | xargs -n3 wget
wget -q -O - https://api.github.com/users/drodsou/gists | grep raw_url | awk -F\" '{print $4}' | xargs -n1 wget
wget -q -O - https://api.github.com/users/thomasmb/gists | grep raw_url | awk -F\" '{print $4}' | xargs -n1 wget
wget -q -O - https://api.github.com/users/koraktor/gists | grep raw_url | awk -F\" '{print $4}' | xargs -n1 wget
-----------------------------------------
watch -n '100' "git pull && (git ls-files --modified --others --exclude-standard | grep . > /dev/null) && { git add . ; git commit -m '<MESSAGE>' ; git push; }"
-----------------------------------------
git remote remove origin
-----------------------------------------
just clone .git folder:
git clone --bare --branch=master --single-branch https://github.com/bgoonz/My-Web-Dev-Archive.git
---------------------------------------------------------------------------------------------------------
Undo recent pull request:
git reset --hard master@{"10 minutes ago"}
---------------------------------------------------------------------------------------------------------
Open PowerShell and enter wslconfig.exe /l to confirm WSL is installed correctly and list the currently available Linux distributions within your system. Confirm a valid distribution has (default) next to it.
To change the default distribution, enter wslconfig.exe /setdefault "distributionNameAsShownInList"
The terminal not working when running the 32-bit Windows client on 64-bit Windows?#
The easy fix for this issue is to use the 64-bit version. If you must use the 32-bit version, you need to use the sysnative path when configuring your shell path instead of System32. Adding this setting should fix the issue:
"terminal.integrated.shell.windows": "C:\\Windows\\Sysnative\\cmd.exe",
---------------------------------------------------------------------------------------------------------
To remove a submodule you need to:
Delete the relevant section from the .gitmodules file.
Stage the .gitmodules changes git add .gitmodules
Delete the relevant section from .git/config.
Run git rm --cached path_to_submodule (no trailing slash).
Run rm -rf .git/modules/path_to_submodule (no trailing slash).
Commit git commit -m "Removed submodule "
Delete the now untracked submodule files rm -rf path_to_submodule
----------------------------------------Lebab-----------------------------------------------------------------
safe:
lebab --replace ./ --transform arrow
lebab --replace ./ --transform arrow-return
lebab --replace ./ --transform for-of
lebab --replace ./ --transform for-each
lebab --replace ./ --transform arg-rest
lebab --replace ./ --transform arg-spread
lebab --replace ./ --transform obj-method
lebab --replace ./ --transform obj-shorthand
lebab --replace ./ --transform multi-var
ALL:
lebab --replace ./ --transform obj-method
lebab --replace ./ --transform class
lebab --replace ./ --transform arrow
lebab --replace ./ --transform let
lebab --replace ./ --transform arg-spread
lebab --replace ./ --transform arg-rest
lebab --replace ./ --transform for-each
lebab --replace ./ --transform for-of
lebab --replace ./ --transform commonjs
lebab --replace ./ --transform exponent
lebab --replace ./ --transform multi-var
lebab --replace ./ --transform template
lebab --replace ./ --transform default-param
lebab --replace ./ --transform destruct-param
lebab --replace ./ --transform includes
lebab --replace ./ --transform obj-method
lebab --replace ./ --transform class
lebab --replace ./ --transform arrow
lebab --replace ./ --transform arg-spread
lebab --replace ./ --transform arg-rest
lebab --replace ./ --transform for-each
lebab --replace ./ --transform for-of
lebab --replace ./ --transform commonjs
lebab --replace ./ --transform exponent
lebab --replace ./ --transform multi-var
lebab --replace ./ --transform template
lebab --replace ./ --transform default-param
lebab --replace ./ --transform destruct-param
lebab --replace ./ --transform includes
-------------------------------------------
---------------------------------------Trouble Shooting------------------------------------------------------------------
input/Output error
wsl.exe --shutdown
Get-Service LxssManager | Restart-Service
---------------------------------------------------------------------------------------------------------
Fudge2312!
IP: 173.70.97.51
Log into postgres:
sudo -u postgres psql
-------------------------------------------------------------Symbolic Link--------------------------------------------
sudo ln -s ./mnt/c/MY-WEB-DEV
ln -s "$(pwd)" ~/NameOfLink
ln -s "$(pwd)" ~/Downloads
--------------------------------------------
return to bash from zsh
sudo apt --purge remove zsh
----------------Unzip PowerShell UNZIP:
PARAM (
[string] $ZipFilesPath = "./",
[string] $UnzipPath = "./RESULT"
)
$Shell = New-Object -com Shell.Application
$Location = $Shell.NameSpace($UnzipPath)
$ZipFiles = Get-Childitem $ZipFilesPath -Recurse -Include *.ZIP
$progress = 1
foreach ($ZipFile in $ZipFiles) {
Write-Progress -Activity "Unzipping to $($UnzipPath)" -PercentComplete (($progress / ($ZipFiles.Count + 1)) * 100) -CurrentOperation $ZipFile.FullName -Status "File $($Progress) of $($ZipFiles.Count)"
$ZipFolder = $Shell.NameSpace($ZipFile.fullname)
$Location.Copyhere($ZipFolder.items(), 1040) # 1040 - No msgboxes to the user - http://msdn.microsoft.com/en-us/library/bb787866%28VS.85%29.aspx
$progress++
}
cat w07_data-structures-and-algorithms.md* | codedown javascript > code.js
cat README.md* | codedown javascript > code.js
cat interview Questions.md* | codedown javascript > code.js
cat README.md* | codedown javascript > code.js
cat w08_getting-to-know-the-network.html* | codedown javascript > code.js
cat *.html | codedown javascript > code.js
cat *.markdown | codedown javascript > code.js
----------------------------------auto generate readme-----------------------------------------------------------------------
rename existing readme to blueprint.md
npx @appnest/readme generate
---------------------------------------------------------------------------------------------------------
npm i -g mdt-docs-generator
RENAME README.md ===> README_RAW.md
mdt-docs
---------------------------------------------------------------------------------------------------------
---------------------------------Export Medium as Markdown------------------------------------------------------------------------
mediumexporter https://medium.com/codex/fundamental-data-structures-in-javascript-8f9f709c15b4 >ds.md
-------------------------Delete within size range--------------------------------------------------------------------------------
find . -size +386b -a -size -390b -exec rm -f {} \;
find . -size +2000b -exec rm -f {} \;
---------------------------------------------------------------------------------------------------------
Create symbolic link to working directory
ln -s "$(pwd)" ~/mylink
npm install redux-logger redux-thunk styled-components
---------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------
find <mydir> -type f -exec sed -i 's/<string1>/<string2>/g' {} +
find . -type f -exec rename 's/-master//g' {} +
find . -type f -exec rename 's/-theme//g' {} +
find . -type f -exec rename 's/-free//g' {} +
---------------------------------------------------------------------------------------------------------
INSTEAD OF GIT PUSH _F :git reset --hard upstream/master
TRIM ALL(USE WITH CAUTION):
find . -depth -exec rmdir {} \;
find . -empty -type f -print -delete
find . -empty -type d -print -delete
find . \( -name ".git" -o -name ".gitignore" -o -name ".gitmodules" -o -name ".gitattributes" \) -exec rm -rf -- {} +
find . \( -name "*SECURITY.txt" -o -name "*RELEASE.txt" -o -name "*CHANGELOG.txt" -o -name "*LICENSE.txt" -o -name "*CONTRIBUTING.txt" -name "*HISTORY.md" -o -name "*LICENSE" -o -name "*SECURITY.md" -o -name "*RELEASE.md" -o -name "*CHANGELOG.md" -o -name "*LICENSE.md" -o -name "*CODE_OF_CONDUCT.md" -o -name "*CONTRIBUTING.md" \) -exec rm -rf -- {} +
find . \( -name "*SECURITY.txt" -o -name "*RELEASE.txt" -o -name "*CHANGELOG.txt" -o -name "*LICENSE.txt" -o -name "*CONTRIBUTING.txt" -name "*HISTORY.md" -o -name "*LICENSE" -o -name "*SECURITY.md" -o -name "*RELEASE.md" -o -name "*CHANGELOG.md" -o -name "*LICENSE.md" -o -name "*CODE_OF_CONDUCT.md" -o -name "*CONTRIBUTING.md" \) -exec rm -rf -- {} +
---------------------------------------------------------------------------------------------------------
Replace spaces in filenames with underscores
for file in *; do mv "$file" `echo $file | tr ' ' '_'` ; done
----------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------
Netlify error: 1:32:52 AM: Error checking out submodules: fatal: No url found for submodule path '2-content/awesome-resources/Cumulative-Resource-List-master' in .gitmodules
git rm --cached 2-content/awesome-resources/Cumulative-Resource-List-master
----------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------
find . -name "*right.md" -type f -print -delete
find . -name "*right.html" -type f -print -delete
find . -name "*analytics.js" -type f -print -delete
find . -name "*.zip" | while read filename; do unzip -o -d "`dirname "$filename"`" "$filename"; done;
find . -name "*desktop.ini" -type f -print -delete
find . -name "*.zip" -type f -print -delete
find ./ -type f -name *.tar.gz -exec tar -xf {} \;
git remote remove origin
find . -name "*.gz" -type f -print -delete
dac9ba0
find . -name "*.tgz" -type f -print -delete
---------------------------------------------------------------------------------------------------------
lebab --replace ./ --transform obj-method
lebab --replace ./ --transform class
lebab --replace ./ --transform arrow
lebab --replace ./ --transform let
lebab --replace ./ --transform arg-spread
lebab --replace ./ --transform arg-rest
lebab --replace ./ --transform for-each
lebab --replace ./ --transform for-of
lebab --replace ./ --transform commonjs
lebab --replace ./ --transform exponent
lebab --replace ./ --transform multi-var
lebab --replace ./ --transform template
lebab --replace ./ --transform default-param
lebab --replace ./ --transform destruct-param
lebab --replace ./ --transform includes
lebab --replace ./ --transform obj-method
lebab --replace ./ --transform class
lebab --replace ./ --transform arrow
lebab --replace ./ --transform arg-spread
lebab --replace ./ --transform arg-rest
lebab --replace ./ --transform for-each
lebab --replace ./ --transform for-of
lebab --replace ./ --transform commonjs
lebab --replace ./ --transform exponent
lebab --replace ./ --transform multi-var
lebab --replace ./ --transform template
lebab --replace ./ --transform default-param
lebab --replace ./ --transform destruct-param
lebab --replace ./ --transform includes
---------------------------------------------------------------------------------------------------------
PRISM:
<script async defer src="https://cdn.jsdelivr.net/gh/bgoonz/GIT-CDN-FILES/misc/web-dev-utils/personal-utilities/prism/prism.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/bgoonz/GIT-CDN-FILES/prism.css">
---------------------------------------------------------------------------------------------------------
Powershell unzip:
$folderPath="PWD";
Get-ChildItem $folderPath -recurse | %{
if($_.Name -match "^*.`.zip$")
{
$parent="$(Split-Path $_.FullName -Parent)";
write-host "Extracting $($_.FullName) to $parent"
$arguments=@("e", "`"$($_.FullName)`"", "-o`"$($parent)`"");
$ex = start-process -FilePath "`"C:\Path\To\7zip\7z.exe`"" -ArgumentList $arguments -wait -PassThru;
if( $ex.ExitCode -eq 0)
{
write-host "Extraction successful, deleting $($_.FullName)"
rmdir -Path $_.FullName -Force
}
}
}
---------------------------------------------------------------------------------------------------------
<iframe width="560" height="315" src="https://www.youtube.com/embed/xGZSWvFess8?start=2" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
---------------------------------------------------------------------------------------------------------
find ./ -iname "*.md" -type f -exec sh -c 'pandoc --standalone "${0}" -o "${0%.md}.html"' {} \;
for f in *.html; do printf '%s\n' 0a '<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<link rel="stylesheet" href="./prism.css">
<script async defer src="./prism.js"></script>
</head>
<body>;' . x | ex "$f"; done
echo "</body></html>" | tee -a *.html
------------------------------------Concat all files of same type recursively---------------------------------------------------------------------
find /path/to/directory/ -name *.csv -exec cat {} + > merged.file
find './' -name *.html -print0 | xargs -0 -I file cat file > merged.file.html
pandoc *.md > final.md
find . -name *.html -exec cat {} + > merged.file.html
find . -name *.md -exec cat {} + > merged.file.md
find . -name *.html -exec cat {} + > merged.file.html
for f in *.html; do cat "${f}"; echo; done > output.html
for f in *.js; do cat "${f}"; echo; done > output.js
---------------------------------------------------------------------------------------------------------
Flatten all sub folders into one folder contaning files.
find ./ -mindepth 1 -type f -exec mv -t ./ --backup=t '{}' +
------------------------
find . -type f -exec sed -i '/Mirrored from/d' ./*.html {} \;
find . -type f -exec sed -i '/path/d' ./scrap.md {} \;
sudo sed -i '/description/d' *.html
sudo sed -i '/WEEK-/d' README.html
sudo sed -i '/\/\/ Date :/d' *.js
find . -type f -exec sed -i '/Created by/d' ./*.html {} \;
find . -type f -exec sed -i '/Mirrored from/d' ./*.md {} \;
find . -type f -exec sed -i '/image004/d' ./*.html {} \;
find . -type f -exec sed -i '/:::/d' ./*.md {} \;
find . -type f -exec sed -i '/author/d' ./*. {} \;
find . -type f -exec sed -i '/ Created by <span class=\x27author\x27>/d' ./*.html {} \;
find . -type f -exec sed -i '/<p>Document generated by Confluence on/d' ./*.html {} \;
find . -type f -exec sed -i '/<div id="footer-logo"><a href="http:\/\/www\.atlassian\.com\/">Atlassian<\/a><\/div>/d' ./*.html {} \;
find . -type f -exec sed -i '/miguelgrinberg/d' ./*.html {} \;
find . -type f -exec sed -i '/Mirrored from/d' ./*.html {} \;
find . -type f -exec sed -i '/Author/d' ./*.html {} \;
find . -type f -exec sed -i '/class="column-list"/d' ./index.html {} \;
find . -type f -exec sed -i '/Added by HTTrack/d' ./*.html {} \;
---------------------------------------------------------------------------------------------------------
rename -n 's/(.*).{1}/$1/' *
rename -n 's/.{1}$//' *
rename -n 's/(.*).{1}/$1/' *
find . -maxdepth 1 -type d -name '?????????????*' -exec rename -n 's/.{1}$//' {} +
for i in *.; do
mv "$i" "${i:0:-1}"
done
git add .
git commit -m "update"
git push -u origin master
---------------------------------------------------------------------------------------------------------
firstname-lastname-day2
git remote remove origin
---------------------------------------------------------------------------------------------------------
Download website with wget:
wget --wait=2 --level=inf --limit-rate=20K --recursive --page-requisites --user-agent=Mozilla --no-parent --convert-links --adjust-extension --no-clobber -e robots=off
---------------------------------------------------------------------------------------------------------
find . -name "*.xml" -type f -print
s
find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +
find . -name '.vscode' -type d -prune -exec rm -rf '{}' +
---------------------------------------------------------------------------------------------------------
youtube-dl https://www.youtube.com/user/Mihirishere/videos
youtube-dl https://www.youtube.com/user/norwex/videos
---------------------------------------------------------------------------------------------------------
Remove duplicate lines from a text file
You can use this shell command:
COPY
uniq -u input.txt output.txt
---------------------------------------------------------------------------------------------------------
httrack --ext-depth=2
httrack --ext-depth=2 https://kathyguner.norwex.biz/
httrack https://kathyguner.norwex.biz/
httrack --ext-depth=3 https://www.textfixer.com/html/convert-url-to-html-link.php
httrack http://jellydemos.com/html/muziq/muziq-hardrock/index-multipages.html -O "./temp" %e5
httrack --ext-depth=4 http://jellydemos.com/html/muziq/muziq-hardrock/index-multipages.html
httrack --ext-depth=4 https://www.vickielasher.com/
---------------------------------------------------------------------------------------------------------
grab all links from website
lynx -dump https://distrokid.com/hyperfollow/mihirbeg/getting-there | awk '/http/{print $2}' > links2.txt
lynx -dump https://geeksforgeeks.org/top-10-useful-github-repos-that-every-developer-should-follow | awk '/http/{print $2}' > links.md
lynx -dump https://html.com/blog/100-web-development-cheat-sheets | awk '/http/{print $2}' > links.md
wget -qO- www.instagram.com/mihirbeg/ |
grep -Eoi '<a [^>]+>' |
grep -Eo 'href="[^\"]+"' |
grep -Eo '(http|https)://[^/"]+'>output.md
---------------------------------------------------------------------------------------------------------
GitFlow_-_step_by_step_a5dcb946b01f4d66be259ba33733763b
.*(?<=<script)(.*)(?=<\/script>).*
.*\./\.git.*
.*node_modules.*
find . -name "*.zip" -type f -print
find . -name "*.zip" -type f -print -delete
find . -name "*.gitignore" -type f -print -delete
---------------------------------------------------------------------------------------------------------
REMOVE DUPLICATE LINES:
uniq -u input.txt output.txt
uniq -u resources.html output.html
uniq -u testOut.html TESTOUT.html
---------------------------------------------------------------------------------------------------------
2.)find and delete all empty directories()===>
find . -empty -type d -print -delete
---------------------------------------------------------------------------------------------------------
3.)Find and delete all empty files()===>
find . -empty -type f -print -delete
add extension to every file in folder
find . -type f -exec mv '{}' '{}'.html \;
find . -type f -exec mv '{}' '{}'.py \;
find . -type f -exec mv '{}' '{}'.html \;
find . -type f -exec mv '{}' '{}'.png \;
find . -type f -exec mv '{}' '{}'.html \;
find . -type f -exec mv '{}' '{}'.md \;
for f in * ; do
mv "$f" "$f.md"
done
for f in * ; do
mv "$f" "$f.html"
done
for f in * ; do
mv "$f" "$f.css"
done
---------------------------------------------------------------------------------------------------------
delete lines contaning specific string:
sed -i '/normalizerEmpty/d' ./js-in-one-page.html
sed -i '/\.git/d' ./index.html
find . -type f -a \( -name "*.html" -o -name "*.js" -o -name "*.css" -o -name "*.md" \) -a -exec sed -i '/BADSTRING/d' '{}' +
sed -i '//d' ./*.html
find . -type f -a \( -name "*scrap3.md" \) -a -exec sed -i '/stargazers/d' '{}' +
sed -i '//d' ./*.html
find . -type f -a \( -name "*.html" -o -name "*.js" -o -name "*.css" -o -name "*.md" -o -name "*.php" \) -a -exec sed -i '/MIT/d' '{}' +
find . -type f -a -exec sed -i '/author/d' '{}' +
find . -type f -a \( -name "*.html" -o -name "*.md" \) -a -exec sed -i '/[Source]/d' '{}' +
---------------------------------------------------------------------------------------------------------
sudo sed -i '/Author/d' ./*.html
Remove lines of file contaning a string
sudo sed -i '/Mirrored from/d' ./*.html
sudo sed -i '/This is Squarespace/d' ./*.html
sudo sed -i '/\.git/d' ./index.html
sudo sed -i '/assets/d' ./index.html
sudo sed -i '/stargazers/d' ./scrap3.md
---------------------------------------------------------------------------------------------------------
To find a pattern and remove the line containing the pattern below command can be used
find . -name "*" -type f | xargs sed -i -e '/Mirrored from/d'
find . -name '*' -type f | xargs sed -i -e '/Author/d'
find . -name "*" -type f | xargs sed -i -e '/author/d'
sed -n '/author/!p' file
for f in *.html; do printf '%s\n' 0a '<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="https://gist.githubusercontent.com/bgoonz/37bca66ce8441c688900b6f082f10560/raw/2e9a5966431d89b8ce6355e7b8039ba42554978b/CSS-Styling-for-Pandoc-generated-html.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<link rel="stylesheet" href="https://raw.githubusercontent.com/bgoonz/styling-templates/master/bootstrap3/assets/css/bootstrap.min.css"></head>
<body>;' . x | ex "$f"; done
echo "</body></html>" | tee -a *.html
find . -name "*" -type f | xargs sed -i -e '/Mirrored from/d'
---------------------------------------------------------------------------------------------------------
print out the path of every file recursivley
ls -R './' | awk '
/:$/&&f{s=$0;f=0}
/:$/&&!f{sub(/:$/,"");s=$0;f=1;next}
NF&&f{ print s"/"$0 }'>listing.md
---------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------
sed -n -e '/<script>/,/<\/script>/p' getting-there.html >out.js
sed -n -e '/<script>/,/<\/script>/p' *.html >out.js
find . -type f -exec sed -n -e '/<script>/,/<\/script>/p' *.html >out.js ./* {} \;
sed -n -e '/<script>/,/<\/script>/p' *.html >out.js
sed -n -e '/<script>/,/<\/script>/p' *.html >out.js
find . -type f -exec sed -n -e '/<code class="sourceCode javascript">/,/<\/code>/p' *.html >out.html ./* {} \;
find . -type f -exec sed -n -e '/```js/,/```/p' *.html >out.js ./* {} \;
sed -i 's/<script>//g' out.js
sed -i 's/<\/script>//g' out.js
.*\./<script*
(?<=<script)(.*)(?=<\/script>)
---------------------------------------------------------------------------------------------------------
sudo sed -i '/\.git/d' ./index.html
sudo sed -i '/ <div id="footer-logo"><a href="http:\/\/www\.atlassian\.com\/">Atlassian<\/a><\/div>/d' ./*.html
sudo sed -i '/ <a href="http:\/\/www\.atlassian\.com\/">Atlassian<\/a>/d' ./*.html
sudo sed -i '/ Document generated by Confluence on/d' ./*.html
---------------------------------------------------------------------------------------------------------
Resursivley delete node modules
find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +
find . -name 'description\.txt' -type d -prune -exec rm -rf '{}' +
/workspace/my-gists/TESTING/description.txt
find . -name '\.vscode' -type d -prune -exec rm -rf '{}' +
---------------------------------------------------------------------------------------------------------
5.) Remember Git Credentials:
git config --global credential.helper store
---------------------------------------------------------------------------------------------------------
find . \( -name ".git" -o -name ".gitignore" -o -name ".gitmodules" -o -name ".gitattributes" \) -exec rm -rf -- {} +
---------------------------------------------------------------------------------------------------------
------------------
git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch assets/_website-components/0-DOJO/widgets-master/output/info/stats.json' HEAD
git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch assets/_00-4-all-time/_0-Random-Repo/zipped.zip' HEAD
git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch assets/_Resource-Hub-Mark_II/azagent/vstsagent.tar.gz' HEAD
git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch assets/_Resource-Hub-Mark_II/azagent/vstsagent.tar.gz' HEAD
git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch assets/_index.html' HEAD
git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch assets/_f95b7cbda3503d5d3f539e0c8401209c6f7c0c91f6ae2fa510a6efcaeaf697ef' HEAD
git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch assets/_7-assets/Past-Cohort/LambdaSchool-master.zip' HEAD
git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch assets/_PDFS/Head_First_Csharp.pdf' HEAD
git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch git filter-branch --index-filter 'git rm -r
--cached --ignore-unmatch assets/_index.html' HEAD' HEAD
git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch assets/_index.html' HEAD
---------------------------------------------------------------------------------------------------------
nano
When you're done, hit CTRL+O to save and CTRL+X to exit Nano. You'll just need to restart the SSH server with one of the following commands.
$ systemctl restart sshd
$ service sshd restart
---------------------------------------------------------------------------------------------------------
Recursivley Create numbered folders:
n=1;
max=50;
while [ "$n" -le "$max" ]; do
mkdir "s$n"
n=`expr "$n" + 1`;
done
---------------------------------------------------------------------------------------------------------
Command Line: Rename all files in current directory to a certain file extension:
forfiles /S /M * /C "cmd /c rename @file @fname.js"
forfiles /S /M * /C "cmd /c rename @file @fname.html"
forfiles /S /M * /C "cmd /c rename @file @fname.md"
forfiles /S /M * /C "cmd /c rename @file @fname.java"
---------------------------------------------------------------------------------------------------------
The following command would rename all *.txt files to *.doc.
$ rename 's/\.txt$/.doc/' *.txt
rename 's/\.txt$/.js/' *.txt
$ rename 's/\.example$/.sql/' *.example
rename 's/\.js\.download$/.js/' *.js\.download
find . -name "*.htm" -exec rename 's/\.htm$/.html/' '{}' +
find . -name "*.\.js\.download" -exec rename 's/\.js\.download$/.js/' '{}' +
echo "</body></html>" | tee -a *.html
rename 's/\.html\.tmp$/.html/' *.html\.tmp
---------------------------------------------------------------------------------------------------------
find ./ -iname "*.md" -type f -exec sh -c 'pandoc --standalone "${0}" -o "${0%.md}.html"' {} \;
------------------------------------From html >md below---------------------------------------------------------------------
pandoc --wrap=none --from html --to markdown_strict
find ./ -iname "*.html" -type f -exec sh -c 'pandoc "${0}" -o "${0%.html}.md"' {} \;
find ./ -iname "*.html" -type f -exec sh -c 'pandoc --wrap=none --from html --to markdown_strict "${0}" -o "${0%.html}.md"' {} \;
---------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------
Recursivley list every single file in the working directory... 1 per line:
ls -R ./ | awk '
/:$/&&f{s=$0;f=0}
/:$/&&!f{sub(/:$/,"");s=$0;f=1;next}
NF&&f{ print s"/"$0 }'
write-to-txt-file
ls -R ./ | awk '
/:$/&&f{s=$0;f=0}
/:$/&&!f{sub(/:$/,"");s=$0;f=1;next}
NF&&f{ print s"/"$0 }'
--------for only html-files------------------------------------------------------------------------------
find ./ | grep -i "\.html*$"
---------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------
forfiles /S /M *.File /C "cmd /c rename @file @fname.js"
---------------------------------------------------------------------------------------------------------
Recreate folder structure with only specific file types
find . -type f -name '*.md' | cpio -p -d -v './../markdown-folder'
find . -type f -name '*.md' | cpio -p -d -v './..'
find . -type f -name '*.png' | cpio -p -d -v './_ext'
find . -name '*.README.md' | cpio -pdm './extension-readme'
find . -name '*.md' | cpio -pdm './../Markdown'
find . -name '*.git' | cpio -pdm './GIT-FOLDERS'
---------------------------------------------------------------------------------------------------------
7.) ()===>
---------------------------------------------------------------------------------------------------------
8.) Command Prompt: code --list-extensions
for /F "tokens=*" %A in (extensions.list) do code --install-extension %A
---------------------------------------------------------------------------------------------------------
9.)Create a soft link in the home dir
ln -s /mnt/c/0-a-A-October
---------------------------------------------------------------------------------------------------------
10.)
sudo apt update
sudo apt upgrade
git config --global user.name bryan
git config --global user.email [email protected]
sudo apt update
sudo apt install build-essential
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash
. ./.bashrc
nvm install --lts
sudo apt install unzip
npm install -g mocha
npm audit fix -F
npm audit fix -f
npm install -g mocha
sudo apt update
sudo apt upgrade
sudo apt install python3
-----------------------------------------------------------------------------------------------------------
Command Line vscode
code --list-extensions
code --disable-extension <ext-name>
sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker
dockerd
-----------------------------------------------------------------------------------------------------------
killall node
-----------------------------------------------------------------------------------------------------------
sudo service postgresql stop
sudo service postgresql start
sudo service postgresql restart
----------------------------------------
sed -e '/.git/ {
$!N
d
}'index.html
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.
--restrict-file-names=windows \ # Modify filenames to work in Windows as well.
--domains yoursite.com \ # Do not follow links outside this domain.
--no-parent \ # Don't follow links outside the directory you pass in.
https://www.instagram.com/mihirbeg/?hl=en
wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
--restrict-file-names=windows \
--domains website.org \
--no-parent \
https://soybean-tulip-em56.squarespace.com/config/pages
wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
--restrict-file-names=windows \
--domains website.org \
--no-parent \
https://cheatography.com/davechild/cheat-sheets/regular-expressions/
https://ankiweb.net/decks/
-----------------------------------------------------------------------------------------------------------
cat * > ./merged-file.html
find . -type f -exec 'pandoc -s *.docx -t markdown -o example35.md' {} \;
pandoc -s *.docx -t markdown -o example35.md
pandoc -s *.docx > output.md
Copy file structure without the files:
rsync -a -f"+ */" -f"- *" './'/ './../'/
rsync -a -f"+ */" -f"- *" source/ destination/
-----------------------------------------------------------------------------------------------------------
Remove Script tags and their content:
find ./ -iname "*.html" -type f -exec sh -c 'sed "/<script/,/<\/script>/d" *.html' {} \; >testOut.html
-----------------------------------------------------------------------------------------------------------
cat *.html > node-mod-readme.html
-----------------------------------------------------------------------------------------------------------
Powershell remove numbers and dashes from file names:
Dir | Rename-Item –NewName { $_.name –replace " ","_" }
Dir | Rename-Item –NewName { $_.name –replace "1","" }
Dir | Rename-Item –NewName { $_.name –replace "2","" }
Dir | Rename-Item –NewName { $_.name –replace "3","" }
Dir | Rename-Item –NewName { $_.name –replace "4","" }
Dir | Rename-Item –NewName { $_.name –replace "5","" }
Dir | Rename-Item –NewName { $_.name –replace "6","" }
Dir | Rename-Item –NewName { $_.name –replace "7","" }
Dir | Rename-Item –NewName { $_.name –replace "8","" }
Dir | Rename-Item –NewName { $_.name –replace "9","" }
Dir | Rename-Item –NewName { $_.name –replace "9","" }
Dir | Rename-Item –NewName { $_.name –replace "-","" }
Dir | Rename-Item –NewName { $_.name –replace "0","" }
-----------------------------------------------------------------------------------------------------------
#!/bin/sh
# find ./ | grep -i "\.*$" >files
find ./ | sed -E -e 's/([^ ]+[ ]+){8}//' | grep -i "\.*$">files
listing="files"
out=""
html="index.html"
out="basename $out.html"
html="index.html"
cmd() {
echo ' <!DOCTYPE html>'
echo '<html>'
echo '<head>'
echo ' <meta http-equiv="Content-Type" content="text/html">'
echo ' <meta name="Author" content="Bryan Guner">'
echo '<link rel="stylesheet" href="./assets/prism.css">'
echo ' <link rel="stylesheet" href="./assets/style.css">'
echo ' <script async defer src="./assets/prism.js"></script>'
echo " <title> directory </title>"
echo ""
echo '<style>'
echo ' a {'
echo ' color: black;'
echo ' }'
echo ''
echo ' li {'
echo ' border: 1px solid black !important;'
echo ' font-size: 20px;'
echo ' letter-spacing: 0px;'
echo ' font-weight: 700;'
echo ' line-height: 16px;'
echo ' text-decoration: none !important;'
echo ' text-transform: uppercase;'
echo ' background: #194ccdaf !important;'
echo ' color: black !important;'
echo ' border: none;'
echo ' cursor: pointer;'
echo ' justify-content: center;'
echo ' padding: 30px 60px;'
echo ' height: 48px;'
echo ' text-align: center;'
echo ' white-space: normal;'
echo ' border-radius: 10px;'
echo ' min-width: 45em;'
echo ' padding: 1.2em 1em 0;'
echo ' box-shadow: 0 0 5px;'
echo ' margin: 1em;'
echo ' display: grid;'
echo ' -webkit-border-radius: 10px;'
echo ' -moz-border-radius: 10px;'
echo ' -ms-border-radius: 10px;'
echo ' -o-border-radius: 10px;'
echo ' }'
echo ' </style>'
echo '</head>'
echo '<body>'
echo ""
# continue with the HTML stuff
echo ""
echo ""
echo "<ul>"
awk '{print "<li><a href=\""$1"\">",$1," </a></li>"}' $listing
# awk '{print "<li>"};
# {print " <a href=\""$1"\">",$1,"</a></li> "}' \ $listing
echo ""
echo "</ul>"
echo "</body>"
echo "</html>"
}
cmd $listing --sort=extension >>$html
sudo sed -i '/:::/d' ./*.mc
sudo sed -i '/Blog at WordPress/d' ./index.html
find . -type f -exec sed -i '/Blog at WordPress/d' ./* {} \;
sudo sed -i '/right\.html/d' ./index.html
find . -type f -exec sed -i '/walkthrough/d' ./* {} \;
sudo sed -i '/walkthrough/d' ./*.html
sudo sed -i '/index\.html/!d' ./index.html
sudo sed -i '/\.git/d' ./index.html
sudo sed -i '/node_modules/d' ./index.html
sudo sed -i '/right\.html/d' ./index.html
sudo sed -i '/sol\~/d' ./right.html
sudo sed -i '/\.json/d' ./index.html
sudo sed -i '/\.gif/d' ./index.html
sudo sed -i '/\.png/d' ./index.html
sudo sed -i '/\.css/d' ./index.html
sudo sed -i '/\.js/d' ./index.html
sudo sed -i '/\.php/d' ./index.html
sudo sed -i '/\.md/d' ./index.html
sudo sed -i '/\.svg/d' ./index.html
sudo sed -i '/\.jpeg/d' ./index.html
sudo sed -i '/\.jpg/d' ./index.html
sudo sed -i '/\.scss/d' ./index.html
sudo sed -i '/scss/d' ./index.html
sudo sed -i '/\.txt/d' ./index.html
sudo sed -i '/\.ttf/d' ./index.html
sudo sed -i '/\.pdf/d' ./index.html
sudo sed -i '/\.mp4/d' ./index.html
sudo sed -i '/\.pug/d' ./index.html
sudo sed -i '/\.DS_store/d' ./index.html
sudo sed -i '/\.DS_Store/d' ./index.html
sudo sed -i '/\.sql/d' ./index.html
sudo sed -i '/\.py/d' ./index.html
sudo sed -i '/\.xlsx/d' ./index.html
sudo sed -i '/\.JPG/d' ./index.html
sudo sed -i '/\.TTF/d' ./index.html
sudo sed -i '/\.ttf/d' ./index.html
sudo sed -i '/\.eot/d' ./index.html
sudo sed -i '/\.ttc/d' ./index.html
sudo sed -i '/\.PNG/d' ./index.html
sudo sed -i '/\.java/d' ./index.html
sudo sed -i '/\.png/d' ./index.html
sudo sed -i '/\.jpeg/d' ./index.html
sudo sed -i '/\.gif/d' ./index.html
sudo sed -i '/\.go/d' ./index.html
sudo sed -i '/\.vue/d' ./index.html
#!/bin/sh
# find ./ | grep -i "\.*$" >files
find ./ | sed -E -e 's/([^ ]+[ ]+){8}//' | grep -i "\.*$">files
listing="files"
out=""
html="sitemap.html"
out="basename $out.html"
html="sitemap.html"
cmd() {
echo ' <!DOCTYPE html>'
echo '<html>'
echo '<head>'
echo ' <meta http-equiv="Content-Type" content="text/html">'
echo ' <meta name="Author" content="Bryan Guner">'
echo '<link rel="stylesheet" href="./assets/prism.css">'
echo ' <link rel="stylesheet" href="./assets/style.css">'
echo ' <script async defer src="./assets/prism.js"></script>'
echo " <title> directory </title>"
echo ""
echo '<style>'
echo ' a {'
echo ' color: black;'
echo ' }'
echo ''
echo ' li {'
echo ' border: 1px solid black !important;'
echo ' font-size: 20px;'
echo ' letter-spacing: 0px;'
echo ' font-weight: 700;'
echo ' line-height: 16px;'
echo ' text-decoration: none !important;'
echo ' text-transform: uppercase;'
echo ' background: #194ccdaf !important;'
echo ' color: black !important;'
echo ' border: none;'
echo ' cursor: pointer;'
echo ' justify-content: center;'
echo ' padding: 30px 60px;'