Compare commits

9 Commits

5 changed files with 145 additions and 56 deletions

114
.aliases
View File

@@ -63,6 +63,7 @@ expand_path() {
ret=$(readlink -m "$ret") ret=$(readlink -m "$ret")
echo $ret echo $ret
} }
is_absolute_unix_path() { is_absolute_unix_path() {
if [[ $1 =~ ^/ ]]; then echo 1; else echo 0; fi if [[ $1 =~ ^/ ]]; then echo 1; else echo 0; fi
} }
@@ -119,6 +120,16 @@ open_explorer_here() {
fi fi
} }
remove_extra_spaces() {
# Replace consecutive spaces with a single space.
#
# We're using this in the various vid/audio download functions because
# Windows seems to strip extra spaces when creating a file, so we need
# to match this behaviour in order to do post-processing after downloading.
ret=$(echo "$1" | tr -s ' ')
echo "$ret"
}
################## ##################
# Building code # Building code
################## ##################
@@ -253,17 +264,7 @@ alias exp='echo "Use e instead."'
alias f='fg' alias f='fg'
alias hist='history' alias hist='history'
alias histroy='history' alias histroy='history'
alias irb='irb --readline -r irb/completion'
alias lcc='lein clean'
alias lca='lein cljsbuild auto dev'
alias ldi='lein deps install'
alias lsd='lein start-dev'
alias moon='curl wttr.in/moon -A "curl"' alias moon='curl wttr.in/moon -A "curl"'
alias reguard='killall -9 ruby ; guard'
alias rb='rbenv'
alias rbg='rbenv gemset active'
alias rbp='cd $RBENV_PATH/versions/$(rbenv version | sed -e "s/ (set.*$//")'
alias rbl='cd $RBENV_PATH/versions/$(rbenv version | sed -e "s/ (set.*$//")/lib/ruby'
alias rc='rclone' alias rc='rclone'
alias rcc='rclone copy' alias rcc='rclone copy'
alias restart='sudo shutdown now -r' alias restart='sudo shutdown now -r'
@@ -277,9 +278,6 @@ alias t='tree'
alias tag='ctags -R .' alias tag='ctags -R .'
alias v='vim' alias v='vim'
alias vi='vim' alias vi='vim'
alias vh='vagrant halt'
alias vs='vagrant ssh'
alias vu='vagrant up'
alias vimrc='vim ~/.vimrc' alias vimrc='vim ~/.vimrc'
alias weather='curl wttr.in/toronto -A "curl"' alias weather='curl wttr.in/toronto -A "curl"'
@@ -352,6 +350,8 @@ make_vid_dir_and_cd_into() {
fi fi
fi fi
dir_name=$(remove_extra_spaces "$dir_name")
printf "${BOLD}Creating directory ${YELLOW}'$dir_name'${NORMAL}\n" printf "${BOLD}Creating directory ${YELLOW}'$dir_name'${NORMAL}\n"
mkdir "$dir_name" 2>/dev/null mkdir "$dir_name" 2>/dev/null
cd "$dir_name" cd "$dir_name"
@@ -466,9 +466,10 @@ download_youtube_vid() {
# Get the video filename. # Get the video filename.
local filename=$(yt-dlp.exe --get-filename -f $format -o "$name_format.%(ext)s" $opts $url) local filename=$(yt-dlp.exe --get-filename -f $format -o "$name_format.%(ext)s" $opts $url)
filename=$(remove_extra_spaces "$filename")
printf "filename: $filename\n" printf "filename: $filename\n"
# Download # Download the video.
local cmd="yt-dlp.exe -f $format -o \"$filename\" $opts $url" local cmd="yt-dlp.exe -f $format -o \"$filename\" $opts $url"
eval $cmd # Need to eval in order to preserve the quotes wrapping the filename format string. eval $cmd # Need to eval in order to preserve the quotes wrapping the filename format string.
error=$? error=$?
@@ -491,15 +492,22 @@ download_youtube_vid() {
printf "${BOLD}Finished downloading ${YELLOW}$filename${NORMAL}\n" printf "${BOLD}Finished downloading ${YELLOW}$filename${NORMAL}\n"
} }
#
# You can control which videos are downloaded using the opts param:
# --playlist-start NUMBER (1-indexed)
# --playlist-end NUMBER
# --playlist-items ITEMS (Can be something like 1,2,5 or a range like 1-3,7,10-20)
#
download_youtube_playlist() { download_youtube_playlist() {
local format="$1" local format="$1"
local url="$2" local url="$2"
local dir_name="$3" local dir_name="$3"
shift 3 shift 3
local opts="$@" local opts="$@ --write-sub --sub-lang en --embed-subs"
if [[ $url == "" ]]; then if [[ $url == "" || $dir_name == "" ]]; then
error "Usage: <url> <directory name (optional)> <optional args>" error "Usage: <url> <directory name> <optional args>"
return return
fi fi
@@ -512,22 +520,18 @@ download_youtube_playlist() {
opts+=" --merge-output-format mp4" opts+=" --merge-output-format mp4"
fi fi
opts+=" --write-sub --sub-lang en --embed-subs"
if [[ $dir_name != "" ]]; then
make_vid_dir_and_cd_into $url "$dir_name" make_vid_dir_and_cd_into $url "$dir_name"
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
return return
fi fi
fi
local cmd="yt-dlp.exe -f $format -o \"v%(playlist_index)03d--%(upload_date>%Y-%m-%d)s-%(title)s-yt-%(id)s.%(ext)s\" $opts $url" local cmd="yt-dlp.exe -f $format -o \"%(playlist_index)03d--%(upload_date>%Y-%m-%d)s-%(title)s-yt-%(id)s.%(ext)s\" $opts $url"
eval $cmd # Need to eval in order to preserve the quotes wrapping the filename format string. eval $cmd # Need to eval in order to preserve the quotes wrapping the filename format string.
# Removing any trailing subtitle files # Removing any trailing subtitle files
rm *.vtt *.srt 2>/dev/null rm *.vtt *.srt 2>/dev/null
if [[ $dir_name == "1" ]]; then cd ..; fi cd ..
printf "${BOLD}Finished downloading the playlist\n${NORMAL}" printf "${BOLD}Finished downloading the playlist\n${NORMAL}"
} }
@@ -604,8 +608,10 @@ function download_youtube_audio() {
# Get the audio filename. # Get the audio filename.
local filename=$(yt-dlp.exe --get-filename -f $format -o "$name_format.%(ext)s" $opts $url) local filename=$(yt-dlp.exe --get-filename -f $format -o "$name_format.%(ext)s" $opts $url)
filename=$(remove_extra_spaces "$filename")
printf "filename: $filename\n" printf "filename: $filename\n"
# Download the audio.
local cmd="yt-dlp.exe -f $format -o \"$filename\" $opts $url" local cmd="yt-dlp.exe -f $format -o \"$filename\" $opts $url"
eval $cmd # Need to eval in order to preserve the quotes wrapping the filename format string. eval $cmd # Need to eval in order to preserve the quotes wrapping the filename format string.
error=$? error=$?
@@ -625,6 +631,7 @@ function download_youtube_audio() {
actually_download_twitch_chat() { actually_download_twitch_chat() {
local url="$1" local url="$1"
local filename="$2" local filename="$2"
filename=$(remove_extra_spaces "$filename")
rechat.exe -d $url "$filename.json" rechat.exe -d $url "$filename.json"
if [[ -f "$filename.json" ]]; then if [[ -f "$filename.json" ]]; then
@@ -738,16 +745,18 @@ download_twitch_vid() {
# Get the video filename. # Get the video filename.
local filename=$(yt-dlp.exe --get-filename -f $yt_dlp_format -o "$name_format.%(ext)s" $opts $url) local filename=$(yt-dlp.exe --get-filename -f $yt_dlp_format -o "$name_format.%(ext)s" $opts $url)
filename=$(remove_extra_spaces "$filename")
printf "filename: $filename\n"
# Download # Download the video.
if [[ $subscriber_vod == "0" ]]; then if [[ $subscriber_vod == "0" ]]; then
local cmd="streamlink.exe --twitch-low-latency --twitch-disable-ads --twitch-disable-hosting --force --force-progress $opts $url $streamlink_format -O | ffmpeg -i pipe:0 -c copy \"$filename\"" printf "${YELLOW}${BOLD}\nUsing streamlink to download...${NORMAL}\n"
local cmd="streamlink.exe --twitch-low-latency --twitch-disable-ads --twitch-disable-hosting --force --progress=force $opts $url $streamlink_format -O | ffmpeg -i pipe:0 -c copy \"$filename\""
else else
printf "${YELLOW}${BOLD}\nUsing yt-dlp to download...${NORMAL}\n"
local cmd="yt-dlp.exe -f $yt_dlp_format -o \"$filename\" $opts $url" local cmd="yt-dlp.exe -f $yt_dlp_format -o \"$filename\" $opts $url"
fi fi
printf "${YELLOW}${BOLD}Downloading video\n${NORMAL}"
eval $cmd # Need to eval in order to preserve the quotes wrapping the filename format string. eval $cmd # Need to eval in order to preserve the quotes wrapping the filename format string.
error=$? error=$?
@@ -759,9 +768,9 @@ download_twitch_vid() {
if [[ $compress == "1" ]]; then if [[ $compress == "1" ]]; then
local temp_name="temp_${RANDOM}" local temp_name="temp_${RANDOM}"
extension="${filename##*.}"
# 0=cpu, 1=gpu # 0=cpu, 1=gpu
compress-video "$filename" "$temp_name" 0 compress-video "$filename" "$temp_name" 0
extension="${filename##*.}"
mv "$filename" "orig_$filename" mv "$filename" "orig_$filename"
mv $temp_name.$extension "$filename" mv $temp_name.$extension "$filename"
printf "${BOLD}Make sure to delete the original video file\n${NORMAL}" printf "${BOLD}Make sure to delete the original video file\n${NORMAL}"
@@ -818,9 +827,12 @@ download_vimeo_vid() {
local name_format="%(upload_date>%Y-%m-%d)s-shortname-vimeo-%(id)s" local name_format="%(upload_date>%Y-%m-%d)s-shortname-vimeo-%(id)s"
fi fi
# Download the video. # Get the video filename.
local filename=$(yt-dlp.exe --get-filename -f $format -o "$name_format.%(ext)s" $opts $url) local filename=$(yt-dlp.exe --get-filename -f $format -o "$name_format.%(ext)s" $opts $url)
filename=$(remove_extra_spaces "$filename")
printf "filename: $filename\n"
# Download the video.
local cmd="yt-dlp.exe -f $format -o \"$filename\" $opts $url" local cmd="yt-dlp.exe -f $format -o \"$filename\" $opts $url"
eval $cmd # Need to eval in order to preserve the quotes wrapping the filename format string. eval $cmd # Need to eval in order to preserve the quotes wrapping the filename format string.
@@ -864,13 +876,14 @@ download_twitter_vid() {
printf "${BOLD}Downloading Twitter vid.${NORMAL}\n" printf "${BOLD}Downloading Twitter vid.${NORMAL}\n"
local opts=""
if [[ $vid_name == "" ]]; then if [[ $vid_name == "" ]]; then
local name_format="%(upload_date>%Y-%m-%d)s-%(title)s-twitter-%(id)s" local name_format="%(upload_date>%Y-%m-%d)s-%(title)s-twitter-%(id)s"
local opts=""
else else
local name_format="%(upload_date>%Y-%m-%d)s-${vid_name}-twitter-%(id)s" local name_format="%(upload_date>%Y-%m-%d)s-${vid_name}-twitter-%(id)s"
shift 4 shift 4
local opts="$@" opts="$@"
fi fi
if [[ $make_folder == "1" ]]; then if [[ $make_folder == "1" ]]; then
@@ -885,9 +898,12 @@ download_twitter_vid() {
format="b" format="b"
fi fi
# Download the video. # Get the video filename.
local filename=$(yt-dlp.exe --get-filename -f $format -o "$name_format.%(ext)s" $opts $url) local filename=$(yt-dlp.exe --get-filename -f $format -o "$name_format.%(ext)s" $opts $url)
filename=$(remove_extra_spaces "$filename")
printf "filename: $filename\n"
# Download the video.
local cmd="yt-dlp.exe -f $format -o \"$filename\" $opts $url" local cmd="yt-dlp.exe -f $format -o \"$filename\" $opts $url"
eval $cmd # Need to eval in order to preserve the quotes wrapping the filename format string. eval $cmd # Need to eval in order to preserve the quotes wrapping the filename format string.
@@ -916,13 +932,14 @@ download_instagram_vid() {
printf "${BOLD}Downloading Instagram vid.${NORMAL}\n" printf "${BOLD}Downloading Instagram vid.${NORMAL}\n"
local opts=""
if [[ $vid_name == "" ]]; then if [[ $vid_name == "" ]]; then
local name_format="%(upload_date>%Y-%m-%d)s-%(title)s-ig-%(id)s" local name_format="%(upload_date>%Y-%m-%d)s-%(title)s-ig-%(id)s"
local opts=""
else else
local name_format="%(upload_date>%Y-%m-%d)s-${vid_name}-ig-%(id)s" local name_format="%(upload_date>%Y-%m-%d)s-${vid_name}-ig-%(id)s"
shift 4 shift 4
local opts="$@" opts="$@"
fi fi
if [[ $make_folder == "1" ]]; then if [[ $make_folder == "1" ]]; then
@@ -934,9 +951,12 @@ download_instagram_vid() {
format="b" # best available format="b" # best available
# Download the video. # Get the video filename.
local filename=$(yt-dlp.exe --get-filename -f $format -o "$name_format.%(ext)s" $opts $url) local filename=$(yt-dlp.exe --get-filename -f $format -o "$name_format.%(ext)s" $opts $url)
filename=$(remove_extra_spaces "$filename")
printf "filename: $filename\n"
# Download the video.
local cmd="yt-dlp.exe -f $format -o \"$filename\" $opts $url" local cmd="yt-dlp.exe -f $format -o \"$filename\" $opts $url"
eval $cmd # Need to eval in order to preserve the quotes wrapping the filename format string. eval $cmd # Need to eval in order to preserve the quotes wrapping the filename format string.
@@ -1043,6 +1063,7 @@ alias yt-list-desc='download_youtube_uploads_list 1 '
alias yt='download_youtube_vid "" $SHORTNAME_OFF $TRANSCRIBE_OFF' alias yt='download_youtube_vid "" $SHORTNAME_OFF $TRANSCRIBE_OFF'
alias yt-shortname='download_youtube_vid "" $SHORTNAME_ON $TRANSCRIBE_OFF' alias yt-shortname='download_youtube_vid "" $SHORTNAME_ON $TRANSCRIBE_OFF'
alias yt-1440='download_youtube_vid "620+140" $SHORTNAME_OFF $TRANSCRIBE_OFF' alias yt-1440='download_youtube_vid "620+140" $SHORTNAME_OFF $TRANSCRIBE_OFF'
alias yt-1440p60='download_youtube_vid "400+140" $SHORTNAME_OFF $TRANSCRIBE_OFF'
alias yt-1440-shortname='download_youtube_vid "620+140" $SHORTNAME_OFF $TRANSCRIBE_OFF' alias yt-1440-shortname='download_youtube_vid "620+140" $SHORTNAME_OFF $TRANSCRIBE_OFF'
alias yt-1080='download_youtube_vid "137+140" $SHORTNAME_OFF $TRANSCRIBE_OFF' alias yt-1080='download_youtube_vid "137+140" $SHORTNAME_OFF $TRANSCRIBE_OFF'
alias yt-1080-shortname='download_youtube_vid "137+140" $SHORTNAME_ON $TRANSCRIBE_OFF' alias yt-1080-shortname='download_youtube_vid "137+140" $SHORTNAME_ON $TRANSCRIBE_OFF'
@@ -1059,11 +1080,12 @@ alias yt-720-t='download_youtube_vid "136+140" $SHORTNAME_OFF $TRANSC
alias yt-720-shortname-t='download_youtube_vid "136+140" $SHORTNAME_ON $TRANSCRIBE_ON' alias yt-720-shortname-t='download_youtube_vid "136+140" $SHORTNAME_ON $TRANSCRIBE_ON'
#--------------------------- #---------------------------
alias yt-playlist='download_youtube_playlist ""' alias yt-playlist='download_youtube_playlist ""'
alias yt-playlist-list='download_youtube_playlist_list ' alias yt-playlist-audio='download_youtube_playlist "140"'
alias yt-playlist-1440='download_youtube_playlist "620+140"' alias yt-playlist-1440='download_youtube_playlist "620+140"'
alias yt-playlist-1080='download_youtube_playlist "137+140"' alias yt-playlist-1080='download_youtube_playlist "137+140"'
alias yt-playlist-720='download_youtube_playlist "136+140"' alias yt-playlist-720='download_youtube_playlist "136+140"'
alias yt-playlist-tiny='download_youtube_playlist "160+140"' alias yt-playlist-tiny='download_youtube_playlist "160+140"'
alias yt-playlist-list='download_youtube_playlist_list '
#--------------------------- #---------------------------
alias yt-audio='download_youtube_audio' alias yt-audio='download_youtube_audio'
@@ -1187,6 +1209,8 @@ alias compress-video-hard='_compress_video_hard'
alias cv='compress-video' alias cv='compress-video'
alias cvh='compress-video-hard' alias cvh='compress-video-hard'
alias jv='join-video' alias jv='join-video'
alias av='analyze-volume'
alias aa='analyze-volume'
alias nv='normalize-volume' alias nv='normalize-volume'
alias na='normalize-volume' alias na='normalize-volume'
alias tv='trim-video' alias tv='trim-video'
@@ -1252,6 +1276,19 @@ git_create_stash_patch() {
printf "${BOLD}${YELLOW}Created $file for stash@{$stashNum}.${NORMAL}\n" printf "${BOLD}${YELLOW}Created $file for stash@{$stashNum}.${NORMAL}\n"
} }
git_print_tracked_file_sizes() {
git ls-tree -r -l HEAD | sort -k 4 -nr | awk '{
sha = substr($3, 1, 7); # Truncate the commit SHA to 7 characters
if ($4 >= 1024 * 1024) {
printf "%s sha:%s %06.2f MB %s\n", $2, sha, $4 / 1024 / 1024, $5
} else if ($4 >= 1024) {
printf "%s sha:%s %06.2f KB %s\n", $2, sha, $4 / 1024, $5
} else {
printf "%s sha:%s %04d B %s\n", $2, sha, $4, $5
}
}'
}
alias am='git commit --amend' alias am='git commit --amend'
alias amno='git_amend_nocheckin' alias amno='git_amend_nocheckin'
alias ama='git commit --amend -C head --author' alias ama='git commit --amend -C head --author'
@@ -1314,8 +1351,8 @@ alias gmffm='git merge --ff-only master'
alias gmffs='git merge --ff-only --squash' alias gmffs='git merge --ff-only --squash'
alias gmtheirs='git merge -Xtheirs' alias gmtheirs='git merge -Xtheirs'
alias gp='git push' alias gp='git push'
alias gpa='git push --all && echo "pushing tags..." && git push --tags' alias gpa='echo "pushing all branches..." && git push --all && echo "pushing tags..." && git push --tags'
alias gpaf='git push --all -f && echo "pushing tags..." && git push --tags -f' alias gpaf='echo "force pushing all branches..." && git push --all -f && echo "force pushing tags..." && git push --tags -f'
alias gpf='git push -f' alias gpf='git push -f'
alias gpff='git pull --ff-only' alias gpff='git pull --ff-only'
alias gplu='git pull --set-upstream origin HEAD' alias gplu='git pull --set-upstream origin HEAD'
@@ -1378,6 +1415,7 @@ alias gx='git reset --hard'
alias gxx='git reset --hard HEAD~1' alias gxx='git reset --hard HEAD~1'
alias gxom='git reset --hard origin/master' alias gxom='git reset --hard origin/master'
alias gstats='echo "Total commits: $(git rev-list HEAD --count)"; echo "\nAuthor breakdown:"; git shortlog | grep -E "^[^ ]"' alias gstats='echo "Total commits: $(git rev-list HEAD --count)"; echo "\nAuthor breakdown:"; git shortlog | grep -E "^[^ ]"'
alias gsize='git_print_tracked_file_sizes'
alias gwip="git add . && git commit -m \"WIP\"" alias gwip="git add . && git commit -m \"WIP\""
#################################################################################################### ####################################################################################################

6
.vimrc
View File

@@ -165,7 +165,7 @@ let g:campo_extensions_that_run_ctags = ['c','cpp','h','hpp','inc','cs','py','as
" recursive crawl. " recursive crawl.
" @note The CreateCtags function will always ignore .git and node_modules " @note The CreateCtags function will always ignore .git and node_modules
" regardless of this variable's value. " regardless of this variable's value.
let g:campo_ctags_exclude = ['*.txt', '*.config', '.cache', 'run_tree'] let g:campo_ctags_exclude = ['*.txt', '*.config', '.cache', 'run_tree', 'build']
" This is included in the ctags autocmd args. You can use this to customize " This is included in the ctags autocmd args. You can use this to customize
" how ctags are built. " how ctags are built.
@@ -923,6 +923,8 @@ noremap <leader>gm :call CtrlP_JaiSearch('modules')<cr> " Search in Jai modules
noremap <leader>gh :call CtrlP_JaiSearch('how_to')<cr> " Search in Jai how_to noremap <leader>gh :call CtrlP_JaiSearch('how_to')<cr> " Search in Jai how_to
noremap <leader>ge :call CtrlP_JaiSearch('examples')<cr> " Search in Jai examples noremap <leader>ge :call CtrlP_JaiSearch('examples')<cr> " Search in Jai examples
" @note we're using a modified version of ctrlp that removes duplicate tags
" when using multiple tag files. See https://github.com/sir-pinecone/ctrlp.vim/commit/5cceab
let g:ctrlp_map = '<leader>f' let g:ctrlp_map = '<leader>f'
let g:ctrlp_cmd = 'CtrlPTag' " Search tags by default. let g:ctrlp_cmd = 'CtrlPTag' " Search tags by default.
let g:ctrlp_by_filename = 1 " File search by filename as opposed to full path. let g:ctrlp_by_filename = 1 " File search by filename as opposed to full path.
@@ -1055,7 +1057,7 @@ fu! IsPathContained(path1, path2) abort
let l:normalized_path1 = substitute(fnamemodify(a:path1, ':p'), '\', '/', 'g') let l:normalized_path1 = substitute(fnamemodify(a:path1, ':p'), '\', '/', 'g')
let l:normalized_path2 = substitute(fnamemodify(a:path2, ':p'), '\', '/', 'g') let l:normalized_path2 = substitute(fnamemodify(a:path2, ':p'), '\', '/', 'g')
" Ensure paths end with a directory separator " Ensure paths end with a directory separator.
if l:normalized_path1[-1:] != '/' if l:normalized_path1[-1:] != '/'
let l:normalized_path1 .= '/' let l:normalized_path1 .= '/'
endif endif

View File

@@ -92,17 +92,43 @@ if [[ $bucket == "" || $path == "" || $temp_dir == "" ]]; then
exit 1 exit 1
fi fi
printf "${BOLD}Restoring ${GREEN}$bucket:$path${NORMAL}${BOLD} with local temp folder ${GREEN}$temp_dir${NORMAL}\n" printf "Restoring ${BOLD}${GREEN}$bucket:$path${NORMAL} with local temp folder ${BOLD}${GREEN}$temp_dir${NORMAL}\n"
mkdir -p "$temp_dir" mkdir -p "$temp_dir"
pushd "$temp_dir" &>/dev/null pushd "$temp_dir" &>/dev/null
aws s3api list-objects-v2 --bucket $bucket --prefix $path --query "Contents[?StorageClass=='DEEP_ARCHIVE']" --output text | LC_ALL=C awk '{print substr($0, index($0, $2))}' | awk '{NF-=3};3' > all_objects_list.txt items="$(aws s3api list-objects-v2 --bucket $bucket --prefix $path --query "Contents[?StorageClass=='DEEP_ARCHIVE']" --output text)"
# Generate the main script that will kick off the restoration. error=$?
printf "while read x; do\n printf \"aws s3api restore-object --restore-request '{\\\\\"Days\\\\\":$days_available,\\\\\"GlacierJobParameters\\\\\":{\\\\\"Tier\\\\\":\\\\\"$restore_tier\\\\\"}}' --bucket $bucket --key \\\\\"\$x\\\\\"\\\\n\"\n aws s3api restore-object --restore-request \"{\\\\\"Days\\\\\":$days_available,\\\\\"GlacierJobParameters\\\\\":{\\\\\"Tier\\\\\":\\\\\"$restore_tier\\\\\"}}\" --bucket $bucket --key \"\$x\"\ndone < all_objects_list.txt\nprintf \"\\\\nDone! You can now delete this folder.\\\\nYour files are currently being restored. The time it takes to restore can be found in the AWS docs - just look for the $restore_tier restore tier, which is what you used.\\\\nOnce restored, download the files from the S3 site or better yet use RCloneBrowser.\\\\n\"\n" > run.sh if [[ ! $error -eq 0 ]]; then
chmod +x run.sh error "Error: failed to run the aws command. Aborting."
exit 1
fi
printf "${BOLD}You can now run ${GREEN}$temp_dir/run.sh${NORMAL}${BOLD} to start the restoration process.\n" if [[ $items == "None" ]]; then
error "Didn't find any files. Check that your bucket name and path is correct."
exit 1
fi
# Format the items list.
output="$(echo "$items" | LC_ALL=C awk '{print substr($0, index($0, $2))}' | awk '{NF-=3};3')"
mapfile -t lines_array <<< "$output"
num_items="${#lines_array[@]}"
printf "Number of items to restore: ${BOLD}${YELLOW}$num_items${NORMAL}\n"
printf "${BOLD}${RED}Proceed?\n> ${NORMAL}"
read -e proceed
if [[ $proceed == "1" || $proceed == "y" || $proceed == "Y" || $proceed == "yes" || $proceed == "YES" ]]; then
echo "$output" > all_objects_list.txt
# Generate the main script that will kick off the restoration.
printf "while read x; do\n printf \"aws s3api restore-object --restore-request '{\\\\\"Days\\\\\":$days_available,\\\\\"GlacierJobParameters\\\\\":{\\\\\"Tier\\\\\":\\\\\"$restore_tier\\\\\"}}' --bucket $bucket --key \\\\\"\$x\\\\\"\\\\n\"\n aws s3api restore-object --restore-request \"{\\\\\"Days\\\\\":$days_available,\\\\\"GlacierJobParameters\\\\\":{\\\\\"Tier\\\\\":\\\\\"$restore_tier\\\\\"}}\" --bucket $bucket --key \"\$x\"\ndone < all_objects_list.txt\nprintf \"\\\\nDone! You can now delete this folder.\\\\nYour files are currently being restored. The time it takes to restore can be found in the AWS docs - just look for the $restore_tier restore tier, which is what you used.\\\\nOnce restored, download the files from the S3 site or better yet use RCloneBrowser.\\\\n\"\n" > run.sh
chmod +x run.sh
printf "${BOLD}You can now run ${GREEN}$temp_dir/run.sh${NORMAL}${BOLD} to start the restoration process.\n"
else
echo Aborting.
fi
popd &>/dev/null popd &>/dev/null

View File

@@ -41,6 +41,11 @@
127.0.0.1 mpa.autodesk.com #[Autodesk Analytics Client Service] 127.0.0.1 mpa.autodesk.com #[Autodesk Analytics Client Service]
127.0.0.1 sv.symcd.com #[Autodesk Download Manager] 127.0.0.1 sv.symcd.com #[Autodesk Download Manager]
# Dangerous polyfill
127.0.0.1 polyfill.io
# Very invasive info tracker # Very invasive info tracker
127.0.0.1 static.audienceinsights.net 127.0.0.1 static.audienceinsights.net
127.0.0.1 api.behavioralengine.com 127.0.0.1 api.behavioralengine.com
@@ -15820,3 +15825,15 @@
127.0.0.1 spynetalt.microsoft.com 127.0.0.1 spynetalt.microsoft.com
# End of en inserted by Spybot Anti-Beacon for Windows 10 # End of en inserted by Spybot Anti-Beacon for Windows 10
# TailscaleHostsSectionStart
# This section contains MagicDNS entries for Tailscale.
# Do not edit this section manually.
100.69.212.80 gamma.sir-pinecone.github.beta.tailscale.net.
100.69.212.80 gamma.taile86d5.ts.net. gamma
100.105.152.57 quark.sir-pinecone.github.beta.tailscale.net.
100.105.152.57 quark.taile86d5.ts.net. quark
100.90.157.82 samsung-sm-s901w.sir-pinecone.github.beta.tailscale.net.
100.90.157.82 samsung-sm-s901w.taile86d5.ts.net. samsung-sm-s901w
# TailscaleHostsSectionEnd

View File

@@ -11,7 +11,7 @@
that they're corporate systems have been hacked multiple times in the last year). Anyway, this feature is fucking that they're corporate systems have been hacked multiple times in the last year). Anyway, this feature is fucking
dumb and you can be sure that all mobo vendors are using this stupid shit. I don't blame them though since Microsoft dumb and you can be sure that all mobo vendors are using this stupid shit. I don't blame them though since Microsoft
built this for them. There's no way to stop this from happening other than to disable the platform entirely. built this for them. There's no way to stop this from happening other than to disable the platform entirely.
* Run `disable-windows-platform-binary-table.reg` and reboot. * Open `disable-windows-platform-binary-table.reg` and reboot.
**Make a system restore point before proceeding.** **Make a system restore point before proceeding.**
@@ -81,6 +81,12 @@
* Computer Configuration > Administrative Templates > Network > QoS Packet Scheduler > Limit reservable bandwidth * Computer Configuration > Administrative Templates > Network > QoS Packet Scheduler > Limit reservable bandwidth
* Enable it and set the % to 0. * Enable it and set the % to 0.
* Disable auto folder type discovery to speed up opening folders with a lot of files
* Open `disable-folder-type-auto-discovery.reg` from this folder.
* Turn off drive indexing for all drives since we'll be using Everything app for search and it does its own indexing.
* Right-click a drive, under `General` tab uncheck `Allow files on this drive to have contents indiexed ...`
* Disable UAC screen dimming * Disable UAC screen dimming
* Open User Account Control settings * Open User Account Control settings
* Drag the slider down to the notch that doesn't dim the screen. * Drag the slider down to the notch that doesn't dim the screen.
@@ -182,10 +188,10 @@ processor time and is generally useless.
* Windows settings -> System -> Multitasking -> uncheck "When I snap a window, show what I can snap next to it" * Windows settings -> System -> Multitasking -> uncheck "When I snap a window, show what I can snap next to it"
* Restore classic Windows Photo Viewer app (the default Win10 photos app is fucking awful): * Restore classic Windows Photo Viewer app (the default Win10 photos app is fucking awful):
* Run photo_viewer.reg from this folder. * Open `photo_viewer.reg` from this folder.
* You'll need to change the default app for the various image extensions. Don't change gif types * You'll need to change the default app for the various image extensions. Don't change gif types
though because photo viewer doesn't support animations. though because photo viewer doesn't support animations.
* Now run disable-are-you-sure-you-want-to-open-with-the-default-program-dialog.reg to stop it * Open `disable-are-you-sure-you-want-to-open-with-the-default-program-dialog.reg` to stop it
from occasionally asking if you still want to use photo viewer. from occasionally asking if you still want to use photo viewer.
* Add custom hosts file * Add custom hosts file