Compare commits
4 Commits
master
...
3d5b394e23
| Author | SHA1 | Date | |
|---|---|---|---|
| 3d5b394e23 | |||
| 6136c20390 | |||
| 2184b8bf40 | |||
| c773b46cbd |
49
.aliases
49
.aliases
@@ -63,6 +63,7 @@ expand_path() {
|
||||
ret=$(readlink -m "$ret")
|
||||
echo $ret
|
||||
}
|
||||
|
||||
is_absolute_unix_path() {
|
||||
if [[ $1 =~ ^/ ]]; then echo 1; else echo 0; fi
|
||||
}
|
||||
@@ -119,6 +120,16 @@ open_explorer_here() {
|
||||
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
|
||||
##################
|
||||
@@ -352,6 +363,8 @@ make_vid_dir_and_cd_into() {
|
||||
fi
|
||||
fi
|
||||
|
||||
dir_name=$(remove_extra_spaces "$dir_name")
|
||||
|
||||
printf "${BOLD}Creating directory ${YELLOW}'$dir_name'${NORMAL}\n"
|
||||
mkdir "$dir_name" 2>/dev/null
|
||||
cd "$dir_name"
|
||||
@@ -466,9 +479,10 @@ download_youtube_vid() {
|
||||
|
||||
# Get the video filename.
|
||||
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
|
||||
# Download the video.
|
||||
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.
|
||||
error=$?
|
||||
@@ -604,8 +618,10 @@ function download_youtube_audio() {
|
||||
|
||||
# Get the audio filename.
|
||||
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 audio.
|
||||
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.
|
||||
error=$?
|
||||
@@ -625,6 +641,7 @@ function download_youtube_audio() {
|
||||
actually_download_twitch_chat() {
|
||||
local url="$1"
|
||||
local filename="$2"
|
||||
filename=$(remove_extra_spaces "$filename")
|
||||
|
||||
rechat.exe -d $url "$filename.json"
|
||||
if [[ -f "$filename.json" ]]; then
|
||||
@@ -738,16 +755,18 @@ download_twitch_vid() {
|
||||
|
||||
# Get the video filename.
|
||||
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
|
||||
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
|
||||
printf "${YELLOW}${BOLD}\nUsing yt-dlp to download...${NORMAL}\n"
|
||||
local cmd="yt-dlp.exe -f $yt_dlp_format -o \"$filename\" $opts $url"
|
||||
fi
|
||||
|
||||
printf "${YELLOW}${BOLD}Downloading video\n${NORMAL}"
|
||||
|
||||
eval $cmd # Need to eval in order to preserve the quotes wrapping the filename format string.
|
||||
error=$?
|
||||
|
||||
@@ -759,9 +778,9 @@ download_twitch_vid() {
|
||||
|
||||
if [[ $compress == "1" ]]; then
|
||||
local temp_name="temp_${RANDOM}"
|
||||
extension="${filename##*.}"
|
||||
# 0=cpu, 1=gpu
|
||||
compress-video "$filename" "$temp_name" 0
|
||||
extension="${filename##*.}"
|
||||
mv "$filename" "orig_$filename"
|
||||
mv $temp_name.$extension "$filename"
|
||||
printf "${BOLD}Make sure to delete the original video file\n${NORMAL}"
|
||||
@@ -818,9 +837,12 @@ download_vimeo_vid() {
|
||||
local name_format="%(upload_date>%Y-%m-%d)s-shortname-vimeo-%(id)s"
|
||||
fi
|
||||
|
||||
# Download the video.
|
||||
# Get the video filename.
|
||||
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"
|
||||
eval $cmd # Need to eval in order to preserve the quotes wrapping the filename format string.
|
||||
|
||||
@@ -885,9 +907,12 @@ download_twitter_vid() {
|
||||
format="b"
|
||||
fi
|
||||
|
||||
# Download the video.
|
||||
# Get the video filename.
|
||||
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"
|
||||
eval $cmd # Need to eval in order to preserve the quotes wrapping the filename format string.
|
||||
|
||||
@@ -934,9 +959,12 @@ download_instagram_vid() {
|
||||
|
||||
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)
|
||||
filename=$(remove_extra_spaces "$filename")
|
||||
printf "filename: $filename\n"
|
||||
|
||||
# Download the video.
|
||||
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.
|
||||
|
||||
@@ -1043,6 +1071,7 @@ alias yt-list-desc='download_youtube_uploads_list 1 '
|
||||
alias yt='download_youtube_vid "" $SHORTNAME_OFF $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-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-1080='download_youtube_vid "137+140" $SHORTNAME_OFF $TRANSCRIBE_OFF'
|
||||
alias yt-1080-shortname='download_youtube_vid "137+140" $SHORTNAME_ON $TRANSCRIBE_OFF'
|
||||
@@ -1187,6 +1216,8 @@ alias compress-video-hard='_compress_video_hard'
|
||||
alias cv='compress-video'
|
||||
alias cvh='compress-video-hard'
|
||||
alias jv='join-video'
|
||||
alias av='analyze-volume'
|
||||
alias aa='analyze-volume'
|
||||
alias nv='normalize-volume'
|
||||
alias na='normalize-volume'
|
||||
alias tv='trim-video'
|
||||
|
||||
4
.vimrc
4
.vimrc
@@ -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>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_cmd = 'CtrlPTag' " Search tags by default.
|
||||
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_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:] != '/'
|
||||
let l:normalized_path1 .= '/'
|
||||
endif
|
||||
|
||||
@@ -41,6 +41,11 @@
|
||||
127.0.0.1 mpa.autodesk.com #[Autodesk Analytics Client Service]
|
||||
127.0.0.1 sv.symcd.com #[Autodesk Download Manager]
|
||||
|
||||
# Dangerous polyfill
|
||||
|
||||
127.0.0.1 polyfill.io
|
||||
|
||||
|
||||
# Very invasive info tracker
|
||||
127.0.0.1 static.audienceinsights.net
|
||||
127.0.0.1 api.behavioralengine.com
|
||||
@@ -15820,3 +15825,15 @@
|
||||
127.0.0.1 spynetalt.microsoft.com
|
||||
# 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
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
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
|
||||
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.**
|
||||
|
||||
@@ -81,6 +81,12 @@
|
||||
* Computer Configuration > Administrative Templates > Network > QoS Packet Scheduler > Limit reservable bandwidth
|
||||
* 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
|
||||
* Open User Account Control settings
|
||||
* 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"
|
||||
|
||||
* 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
|
||||
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.
|
||||
|
||||
* Add custom hosts file
|
||||
|
||||
Reference in New Issue
Block a user