Skip to content

Latest commit

 

History

History
1605 lines (847 loc) · 41.6 KB

File metadata and controls

1605 lines (847 loc) · 41.6 KB

Log into postgres: sudo -u postgres psql -------------------------------------------------------------Symbolic Link-------------------------------------------- sudo ln -s ./mnt/c/MY-WEB-DEV

cat w07_data-structures-and-algorithms.md* | codedown javascript > code.js

cat interview Questions.md* | codedown javascript > code.js

cat w08_getting-to-know-the-network.html* | codedown javascript > code.js

----------------------------------auto generate readme-----------------------------------------------------------------------

rename existing readme to blueprint.md

npx @appnest/readme generate


Remove numbbers from file names

find $dir -type f | sed 's|(./)[^A-Z]([A-Z].*)|mv "&" "\1\2"|' | sh

---------------------------------Export Medium as Markdown------------------------------------------------------------------------

mediumexporter https://medium.com/codex/fundamental-data-structures-in-javascript-8f9f709c15b4 >ds.md


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 -- {} +


Flatten all sub folders into one folder contaning files.

find ./ -mindepth 2 -type f -exec mv -t ./ --backup=t '{}' +


find . -type f -exec sed -i '/appacademy/d' ./*.html {} ;

find . -type f -exec sed -i '/appacademy/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 '/Mirrored from/d' ./*.html {} ;

find . -type f -exec sed -i '/toberemoved/d' ./*.html {} ; toberemoved Mirrored from

Replace spaces in filenames with underscores

for file in *; do mv "$file" echo $file | tr ' ' '_' ; done




mv 'file' $(echo 'file' | sed -e 's/[^A-Za-z0-9._-]/_/g')

function RecurseDirs () { oldIFS=$IFS IFS=$'\n' for f in "$@" do

YOUR CODE HERE!

find ./ -iname "*.md" -type f -exec sh -c 'pandoc "${0}" -o "${0%.md}.html"' {} ;

for f in *.html; do printf '%s\n' 0a '

<title>Document</title> <script async defer src="./prism.js"></script> ;' . x | ex "$f"; done echo "" | tee -a *.html
    if [[ -d "${f}" ]]; then
        cd "${f}"
        RecurseDirs $(ls -1 ".")
        cd ..
    fi
done
IFS=$oldIFS

} RecurseDirs "./"

function RecurseDirs () { oldIFS=$IFS IFS=$'\n' for f in "$@" do

YOUR CODE HERE!

find . -type f -exec sed -n -e '/javascript/,//p' .html >out.js ./ {} ;

    if [[ -d "${f}" ]]; then
        cd "${f}"
        RecurseDirs $(ls -1 ".")
        cd ..
    fi
done
IFS=$oldIFS

} RecurseDirs "./"

--------------------------------------------Sanatize--------------------------------------------------------------

function RecurseDirs () { oldIFS=$IFS IFS=$'\n' for f in "$@" do

YOUR CODE HERE!

mv 'file' $(echo 'file' | sed -e 's/[^A-Za-z0-9._-]/_/g')

    if [[ -d "${f}" ]]; then
        cd "${f}"
        RecurseDirs $(ls -1 ".")
        cd ..
    fi
done
IFS=$oldIFS

} RecurseDirs "./"


function RecurseDirs () { oldIFS=$IFS IFS=$'\n' for f in "$@" do

YOUR CODE HERE!

#!/bin/bash ( IFS=$'\n' for y in $(ls $1) do mv $1/echo $y | sed 's/ /\\ /g' $1/echo "$y" | sed 's/ /_/g' done )

    if [[ -d "${f}" ]]; then
        cd "${f}"
        RecurseDirs $(ls -1 ".")
        cd ..
    fi
done
IFS=$oldIFS

} RecurseDirs "./"

function RecurseDirs () { oldIFS=$IFS IFS=$'\n' for f in "$@" do

YOUR CODE HERE!

#!/bin/bash ( IFS=$'\n' for y in $(ls $1) do mv $1/echo $y | sed 's/ /\\ /g' $1/echo "$y" | sed 's/ /_/g' done )

    if [[ -d "${f}" ]]; then
        cd "${f}"
        RecurseDirs $(ls -1 ".")
        cd ..
    fi
done
IFS=$oldIFS

} RecurseDirs "./"

function RecurseDirs () { oldIFS=$IFS IFS=$'\n' for f in "$@" do

YOUR CODE HERE!

for file in *; do mv "$file" echo $file | tr '_' '.' ; done

    if [[ -d "${f}" ]]; then
        cd "${f}"
        RecurseDirs $(ls -1 ".")
        cd ..
    fi
done
IFS=$oldIFS

} RecurseDirs "./"

for file in *; do mv "$file" echo $file | tr ' ' '_' ; done

function RecurseDirs () { oldIFS=$IFS IFS=$'\n' for f in "$@" do

YOUR CODE HERE!

for file in *; do mv "$file" echo $file | tr '_' '.' ; done

    if [[ -d "${f}" ]]; then
        cd "${f}"
        RecurseDirs $(ls -1 ".")
        cd ..
    fi
done
IFS=$oldIFS

} RecurseDirs "./"

for file in *; do mv "$file" echo $file | tr ' ' '_' ; done




4.)Recursive-unzip:()===>

find . -name "*.zip" | while read filename; do unzip -o -d "dirname "$filename"" "$filename"; done;

find . -name "*.zip" -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 {} ;

find . -name "*.gz" -type f -print -delete

find . -name "*.tgz" -type f -print -delete

find ./ -iname "*.md" -type f -exec sh -c 'pandoc "${0}" -o "${0%.md}.html"' {} ;

for f in *.html; do printf '%s\n' 0a '

<title>Document</title> <script async defer src="./prism.js"></script> ;' . x | ex "$f"; done echo "" | tee -a *.html

VIM:

#Save file and quit

< :wq >


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


App-Academy-Notes-master

find . -name "*.xml" -type f -print

find . -name 'node_modules' -type d -prune -exec rm -rf '{}' + 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

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

Install node modules recursevly (npm i -g recursive-install):

npm-recursive-install


.(?<=<script)(.)(?=</script>).* ../.git. .node_modules.

find . -name ".zip" -type f -print find . -name ".zip" -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

for f in * ; do mv "$f" "$f.html" done

find . -type f -exec mv '{}' '{}'.html ;

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 2

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 ".html" -o -name ".js" -o -name ".css" -o -name ".md" -o -name "*.php" ) -a -exec sed -i '/MIT/d' '{}' +

find . -type f -a ( -name ".html" -o -name ".md" ) -a -exec sed -i '/[Source]/d' '{}' +

Remove lines of file contaning a string

sudo sed -i '/.git/d' ./index.html sudo sed -i '/assets/d' ./index.html

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'

for f in *.html; do printf '%s\n' 0a '

<title>Document</title> ;' . x | ex "$f"; done echo "" | 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>/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 '/