From 6324cfd7b024d1a4e36b20d5f0c295e4abc694dd Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Sun, 21 Mar 2021 18:09:58 +0800 Subject: [PATCH 01/13] [misc] lf for win --- cli/lf/lfrc.win | 5 +++++ win/profile.ps1 | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/cli/lf/lfrc.win b/cli/lf/lfrc.win index 897eb3f..8831d89 100644 --- a/cli/lf/lfrc.win +++ b/cli/lf/lfrc.win @@ -1,5 +1,10 @@ +set icons +set drawbox cmd mkdir %mkdir "$@" cmd fp %powershell -NoProfile -Command Set-Clipboard $env:f cmd fn %powershell -NoProfile -Command Set-Clipboard (Split-Path -Leaf ($env:f -replace '"','')) + + +map rename diff --git a/win/profile.ps1 b/win/profile.ps1 index 6fd1433..4cde92e 100644 --- a/win/profile.ps1 +++ b/win/profile.ps1 @@ -113,3 +113,13 @@ function pass-edit { Remove-Item $tmpfile.FullName -Force } } + +function f { + [Cmdletbinding()] + + $tmpfile = New-TemporaryFile + lf -last-dir-path $tmpfile + $lastdir = Get-Content $tmpfile + Remove-Item $tmpfile + cd $lastdir +} From 2cc47607df0f0e26fc08ce6c46cda3400e91c522 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Thu, 25 Mar 2021 11:54:17 +0800 Subject: [PATCH 02/13] [feature] auto set window title --- cli/tmux/tmux.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cli/tmux/tmux.conf b/cli/tmux/tmux.conf index 18b1754..9e6bf25 100644 --- a/cli/tmux/tmux.conf +++ b/cli/tmux/tmux.conf @@ -9,6 +9,8 @@ set -g pane-base-index 1 set-option -g mouse on #set-option -g mouse-select-pane on set-option -g display-time 4000 +set-option -g set-titles on +set-option -g set-titles-string "#S / #W" ############################ From 59f75acb083dc548d2a36936ee639e5449caa6f0 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Thu, 25 Mar 2021 11:54:29 +0800 Subject: [PATCH 03/13] [bugfix] error when running inside idea --- cli/fish/functions/fish_right_prompt.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/fish/functions/fish_right_prompt.fish b/cli/fish/functions/fish_right_prompt.fish index e4b467e..7048fea 100644 --- a/cli/fish/functions/fish_right_prompt.fish +++ b/cli/fish/functions/fish_right_prompt.fish @@ -9,7 +9,7 @@ function fish_right_prompt test -z $CMD_DURATION -o \( $CMD_DURATION -lt 3000 \) && return test -z $WINDOWID && return set active_window (xdotool getactivewindow 2>/dev/null) - test $active_window -eq $WINDOWID && return + test "$active_window" -eq "$WINDOWID" && return set message (history --max=1) [$duration] notify-send (test "$s" -ne 0 && echo '--icon=dialog-warning') $message end From dffca1979f9e10bae7e61283d228eda8c21adee8 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Thu, 25 Mar 2021 11:54:46 +0800 Subject: [PATCH 04/13] [feature] launch idea on dwm --- bin/idea | 5 +++++ 1 file changed, 5 insertions(+) create mode 100755 bin/idea diff --git a/bin/idea b/bin/idea new file mode 100755 index 0000000..886682f --- /dev/null +++ b/bin/idea @@ -0,0 +1,5 @@ +#!/bin/sh + +wmname LG3D +/home/klesh/Programs/idea-IC-203.7717.32/bin/idea.sh + From 74c750d8cc26141cf2e13699c76d7c9430c1648f Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Sat, 27 Mar 2021 11:02:45 +0800 Subject: [PATCH 05/13] [bugfix] dbeaver interface flicking --- bin/dbe | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 bin/dbe diff --git a/bin/dbe b/bin/dbe new file mode 100755 index 0000000..d46fa93 --- /dev/null +++ b/bin/dbe @@ -0,0 +1,6 @@ +#!/bin/sh + +export GTK_IM_MODULE="ibus" +export QT_IM_MODULE="ibus" +export XMODIFIERS="@im=ibus" +dbeaver From 908858a96eede41c4df79e54c4a1b16cdef8de32 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Sat, 27 Mar 2021 22:28:28 +0800 Subject: [PATCH 06/13] [feature] download youtube video script --- bin/download-yt-video.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 bin/download-yt-video.sh diff --git a/bin/download-yt-video.sh b/bin/download-yt-video.sh new file mode 100755 index 0000000..e492819 --- /dev/null +++ b/bin/download-yt-video.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# +# TheFrenchGhosty's Ultimate YouTube-DL Scripts Collection: The ultimate collection of scripts for YouTube-DL +# https://github.com/TheFrenchGhosty/TheFrenchGhostys-Ultimate-YouTube-DL-Scripts-Collection +# https://github.com/TheFrenchGhosty +# +# + #--datebefore "$(date \ + #--date="30 days ago" +%Y%m%d)" \ + #--batch-file "Source - Unique.txt" 2>&1 | tee output.log + #--no-continue \ + #--no-overwrites \ + +youtube-dlc \ + --format "(bestvideo[vcodec^=av01][height>=4320][fps>30]/bestvideo[vcodec^=vp9.2][height>=4320][fps>30]/bestvideo[vcodec^=vp9][height>=4320][fps>30]/bestvideo[vcodec^=avc1][height>=4320][fps>30]/bestvideo[height>=4320][fps>30]/bestvideo[vcodec^=av01][height>=4320]/bestvideo[vcodec^=vp9.2][height>=4320]/bestvideo[vcodec^=vp9][height>=4320]/bestvideo[vcodec^=avc1][height>=4320]/bestvideo[height>=4320]/bestvideo[vcodec^=av01][height>=2880][fps>30]/bestvideo[vcodec^=vp9.2][height>=2880][fps>30]/bestvideo[vcodec^=vp9][height>=2880][fps>30]/bestvideo[vcodec^=avc1][height>=2880][fps>30]/bestvideo[height>=2880][fps>30]/bestvideo[vcodec^=av01][height>=2880]/bestvideo[vcodec^=vp9.2][height>=2880]/bestvideo[vcodec^=vp9][height>=2880]/bestvideo[vcodec^=avc1][height>=2880]/bestvideo[height>=2880]/bestvideo[vcodec^=av01][height>=2160][fps>30]/bestvideo[vcodec^=vp9.2][height>=2160][fps>30]/bestvideo[vcodec^=vp9][height>=2160][fps>30]/bestvideo[vcodec^=avc1][height>=2160][fps>30]/bestvideo[height>=2160][fps>30]/bestvideo[vcodec^=av01][height>=2160]/bestvideo[vcodec^=vp9.2][height>=2160]/bestvideo[vcodec^=vp9][height>=2160]/bestvideo[vcodec^=avc1][height>=2160]/bestvideo[height>=2160]/bestvideo[vcodec^=av01][height>=1440][fps>30]/bestvideo[vcodec^=vp9.2][height>=1440][fps>30]/bestvideo[vcodec^=vp9][height>=1440][fps>30]/bestvideo[vcodec^=avc1][height>=1440][fps>30]/bestvideo[height>=1440][fps>30]/bestvideo[vcodec^=av01][height>=1440]/bestvideo[vcodec^=vp9.2][height>=1440]/bestvideo[vcodec^=vp9][height>=1440]/bestvideo[vcodec^=avc1][height>=1440]/bestvideo[height>=1440]/bestvideo[vcodec^=av01][height>=1080][fps>30]/bestvideo[vcodec^=vp9.2][height>=1080][fps>30]/bestvideo[vcodec^=vp9][height>=1080][fps>30]/bestvideo[vcodec^=avc1][height>=1080][fps>30]/bestvideo[height>=1080][fps>30]/bestvideo[vcodec^=av01][height>=1080]/bestvideo[vcodec^=vp9.2][height>=1080]/bestvideo[vcodec^=vp9][height>=1080]/bestvideo[vcodec^=avc1][height>=1080]/bestvideo[height>=1080]/bestvideo[vcodec^=av01][height>=720][fps>30]/bestvideo[vcodec^=vp9.2][height>=720][fps>30]/bestvideo[vcodec^=vp9][height>=720][fps>30]/bestvideo[vcodec^=avc1][height>=720][fps>30]/bestvideo[height>=720][fps>30]/bestvideo[vcodec^=av01][height>=720]/bestvideo[vcodec^=vp9.2][height>=720]/bestvideo[vcodec^=vp9][height>=720]/bestvideo[vcodec^=avc1][height>=720]/bestvideo[height>=720]/bestvideo[vcodec^=av01][height>=480][fps>30]/bestvideo[vcodec^=vp9.2][height>=480][fps>30]/bestvideo[vcodec^=vp9][height>=480][fps>30]/bestvideo[vcodec^=avc1][height>=480][fps>30]/bestvideo[height>=480][fps>30]/bestvideo[vcodec^=av01][height>=480]/bestvideo[vcodec^=vp9.2][height>=480]/bestvideo[vcodec^=vp9][height>=480]/bestvideo[vcodec^=avc1][height>=480]/bestvideo[height>=480]/bestvideo[vcodec^=av01][height>=360][fps>30]/bestvideo[vcodec^=vp9.2][height>=360][fps>30]/bestvideo[vcodec^=vp9][height>=360][fps>30]/bestvideo[vcodec^=avc1][height>=360][fps>30]/bestvideo[height>=360][fps>30]/bestvideo[vcodec^=av01][height>=360]/bestvideo[vcodec^=vp9.2][height>=360]/bestvideo[vcodec^=vp9][height>=360]/bestvideo[vcodec^=avc1][height>=360]/bestvideo[height>=360]/bestvideo[vcodec^=avc1][height>=240][fps>30]/bestvideo[vcodec^=av01][height>=240][fps>30]/bestvideo[vcodec^=vp9.2][height>=240][fps>30]/bestvideo[vcodec^=vp9][height>=240][fps>30]/bestvideo[height>=240][fps>30]/bestvideo[vcodec^=avc1][height>=240]/bestvideo[vcodec^=av01][height>=240]/bestvideo[vcodec^=vp9.2][height>=240]/bestvideo[vcodec^=vp9][height>=240]/bestvideo[height>=240]/bestvideo[vcodec^=avc1][height>=144][fps>30]/bestvideo[vcodec^=av01][height>=144][fps>30]/bestvideo[vcodec^=vp9.2][height>=144][fps>30]/bestvideo[vcodec^=vp9][height>=144][fps>30]/bestvideo[height>=144][fps>30]/bestvideo[vcodec^=avc1][height>=144]/bestvideo[vcodec^=av01][height>=144]/bestvideo[vcodec^=vp9.2][height>=144]/bestvideo[vcodec^=vp9][height>=144]/bestvideo[height>=144]/bestvideo)+(bestaudio[acodec^=opus]/bestaudio)/best" \ + --verbose \ + --force-ipv4 \ + --sleep-interval 5 \ + --max-sleep-interval 30 \ + --ignore-errors \ + --download-archive archive.log \ + --add-metadata \ + --write-description \ + --write-info-json \ + --write-annotations \ + --write-thumbnail \ + --embed-thumbnail \ + --all-subs \ + --embed-subs \ + --match-filter "!is_live & !live" \ + --output "%(title)s - %(uploader)s - %(upload_date)s/%(title)s - %(uploader)s - %(upload_date)s [%(id)s].%(ext)s" \ + --merge-output-format "mkv" \ + "$@" 2>/tmp/download-yt-playlist-error.log From 756dde538eaa5428d92e3169a6cd835ad9dbed8a Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Sat, 27 Mar 2021 22:29:08 +0800 Subject: [PATCH 07/13] [feature] hadoop setup --- devel/hadoop.md | 45 +++++++++++++++++++++++++++++++ win/WindowsTerminal/settings.json | 2 +- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 devel/hadoop.md diff --git a/devel/hadoop.md b/devel/hadoop.md new file mode 100644 index 0000000..5a006c3 --- /dev/null +++ b/devel/hadoop.md @@ -0,0 +1,45 @@ + +# Windows + +1. Download / install and setup JDK + 1. extract as d:\programs\java\jdk-xxx + 2. set env var JAVA_HOME=d:\programs\java\jdk-xxx + 3. add PATH `%JAVA_HOME\bin%` +2. Download hadoop from https://mirrors.tuna.tsinghua.edu.cn/apache/hadoop/common/hadoop-3.2.1/hadoop-3.2.1.tar.gz + 1. extract as d:\programs\java\hadoop-3.2.1 + 2. set env var HADOOP_HOME=d:\programs\java\hadoop-3.2.1 + 3. add PATH `%HADOOP_HOME%\bin` and `%HADOOP_HOME%\sbin` + 4. run `hadoop version` see if it's working, if `Could not find or load main class` ocurred because your account name contains space, edit `%HADOOP_HOME%\etc\hadoop\hadoop-env.cmd` file, find line `set HADOOP_IDENT_STRING=%USERNAME%` and change `%USERNAME%` to a fixed string without space +3. Creating hdfs + 1. download windows native files from https://github.com/cdarlint/winutils/tree/master/hadoop-3.2.1/bin extract to `%HADOOP_HOME\BIN` + 2. create folders: + ```ps + mkdir $env:HADOOP_HOME\data\datanode,$env:HADOOP_HOME\data\namenode + ``` + 3. follow guide: https://cwiki.apache.org/confluence/display/HADOOP2/Hadoop2OnWindows + 4. set up hdfs dirs: + ```xml + + dfs.name.dir + /var/local/hadoop/hdfs/name + Determines where on the local filesystem the DFS name node + should store the name table. If this is a comma-delimited list + of directories then the name table is replicated in all of the + directories, for redundancy. + true + + + + dfs.data.dir + /var/local/hadoop/hdfs/data + Determines where on the local filesystem an DFS data node + should store its blocks. If this is a comma-delimited + list of directories, then data will be stored in all named + directories, typically on different devices. + Directories that do not exist are ignored. + + true + + ``` + 5. fix setPosixPermissions error: https://kontext.tech/column/hadoop/379/fix-for-hadoop-321-namenode-format-issue-on-windows-10 + diff --git a/win/WindowsTerminal/settings.json b/win/WindowsTerminal/settings.json index be5722d..08a8ec5 100644 --- a/win/WindowsTerminal/settings.json +++ b/win/WindowsTerminal/settings.json @@ -35,7 +35,7 @@ "cursorShape": "filledBox", // install the non-window-compatible version "fontFace": "agave Nerd Font r", - "fontSize": 14 + "fontSize": 12 }, "list": [ { From 9181d28481d557ca30bfd6fadd1956f3407fa30a Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Wed, 31 Mar 2021 14:40:41 +0800 Subject: [PATCH 08/13] [feature] more sensible auto-cd logic --- cli/fish/config.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/fish/config.fish b/cli/fish/config.fish index 5d3cd59..feaf471 100644 --- a/cli/fish/config.fish +++ b/cli/fish/config.fish @@ -59,7 +59,7 @@ if status is-interactive ~/.profile.fish # === auto cd into last activated directory - test -z "$TMUX" && cd $last_pwd + test "$PWD" = "$HOME" && cd $last_pwd if test -n "$TMUX" function ssh From ffc43f01f5d9667ab33ff0d85c4825f3775d0c7b Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Tue, 6 Apr 2021 17:08:28 +0800 Subject: [PATCH 09/13] [feature] download youtube audio script --- bin/download-yt-mp3.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 bin/download-yt-mp3.sh diff --git a/bin/download-yt-mp3.sh b/bin/download-yt-mp3.sh new file mode 100755 index 0000000..96576c9 --- /dev/null +++ b/bin/download-yt-mp3.sh @@ -0,0 +1,29 @@ +#!/bin/sh +# +# TheFrenchGhosty's Ultimate YouTube-DL Scripts Collection: The ultimate collection of scripts for YouTube-DL +# https://github.com/TheFrenchGhosty/TheFrenchGhostys-Ultimate-YouTube-DL-Scripts-Collection +# https://github.com/TheFrenchGhosty +# +# + +youtube-dlc \ + --format "(bestaudio[acodec^=opus]/bestaudio)/best" \ + --verbose \ + --force-ipv4 \ + --sleep-interval 5 \ + --max-sleep-interval 30 \ + --ignore-errors \ + --no-continue \ + --no-overwrites \ + --download-archive archive.log \ + --add-metadata \ + --write-description \ + --write-info-json \ + --write-annotations \ + --write-thumbnail \ + --embed-thumbnail \ + --extract-audio \ + --match-filter "!is_live & !live" \ + --output "%(title)s - %(uploader)s - %(upload_date)s/%(title)s - %(uploader)s - %(upload_date)s [%(id)s].%(ext)s" \ + --merge-output-format "mkv" \ + "$@" 2>/tmp/download-yt-audio-error.log From 20a70816a198a2183a4893916dab50eb35aa2747 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Tue, 6 Apr 2021 17:27:00 +0800 Subject: [PATCH 10/13] [feature] download audio from yt --- bin/{download-yt-mp3.sh => download-yt-audio.sh} | 12 +++++++++++- bin/download-yt-playlist.sh | 8 ++++---- bin/download-yt-video.sh | 12 +++++++++++- 3 files changed, 26 insertions(+), 6 deletions(-) rename bin/{download-yt-mp3.sh => download-yt-audio.sh} (85%) diff --git a/bin/download-yt-mp3.sh b/bin/download-yt-audio.sh similarity index 85% rename from bin/download-yt-mp3.sh rename to bin/download-yt-audio.sh index 96576c9..9258fb3 100755 --- a/bin/download-yt-mp3.sh +++ b/bin/download-yt-audio.sh @@ -1,4 +1,14 @@ #!/bin/sh + +if [ -z "$*" ] ;then + echo "Usage: $0 " + exit 1 +fi + +if ! command -v yt-dlp 1>/dev/null 2>&1 ;then + sudo pip install yt-dlp +fi + # # TheFrenchGhosty's Ultimate YouTube-DL Scripts Collection: The ultimate collection of scripts for YouTube-DL # https://github.com/TheFrenchGhosty/TheFrenchGhostys-Ultimate-YouTube-DL-Scripts-Collection @@ -6,7 +16,7 @@ # # -youtube-dlc \ +yt-dlp \ --format "(bestaudio[acodec^=opus]/bestaudio)/best" \ --verbose \ --force-ipv4 \ diff --git a/bin/download-yt-playlist.sh b/bin/download-yt-playlist.sh index 47384a2..23eae9b 100755 --- a/bin/download-yt-playlist.sh +++ b/bin/download-yt-playlist.sh @@ -1,11 +1,11 @@ #!/bin/sh -if [ -z '$@' ] ;then - echo "Usage: $0 " +if [ -z "$*" ] ;then + echo "Usage: $0 " exit 1 fi -if ! command -v youtube-dlc 2>&1 1>/dev/null ;then +if ! command -v yt-dlp 1>/dev/null 2>&1 ;then sudo pip install yt-dlp fi @@ -18,7 +18,7 @@ fi #--date="30 days ago" +%Y%m%d)" \ #--batch-file "Source - Playlists.txt" 2>&1 | tee output.log -youtube-dlc \ +yt-dlp \ --format "(bestvideo[vcodec^=av01][height>=4320][fps>30]/bestvideo[vcodec^=vp9.2][height>=4320][fps>30]/bestvideo[vcodec^=vp9][height>=4320][fps>30]/bestvideo[vcodec^=avc1][height>=4320][fps>30]/bestvideo[height>=4320][fps>30]/bestvideo[vcodec^=av01][height>=4320]/bestvideo[vcodec^=vp9.2][height>=4320]/bestvideo[vcodec^=vp9][height>=4320]/bestvideo[vcodec^=avc1][height>=4320]/bestvideo[height>=4320]/bestvideo[vcodec^=av01][height>=2880][fps>30]/bestvideo[vcodec^=vp9.2][height>=2880][fps>30]/bestvideo[vcodec^=vp9][height>=2880][fps>30]/bestvideo[vcodec^=avc1][height>=2880][fps>30]/bestvideo[height>=2880][fps>30]/bestvideo[vcodec^=av01][height>=2880]/bestvideo[vcodec^=vp9.2][height>=2880]/bestvideo[vcodec^=vp9][height>=2880]/bestvideo[vcodec^=avc1][height>=2880]/bestvideo[height>=2880]/bestvideo[vcodec^=av01][height>=2160][fps>30]/bestvideo[vcodec^=vp9.2][height>=2160][fps>30]/bestvideo[vcodec^=vp9][height>=2160][fps>30]/bestvideo[vcodec^=avc1][height>=2160][fps>30]/bestvideo[height>=2160][fps>30]/bestvideo[vcodec^=av01][height>=2160]/bestvideo[vcodec^=vp9.2][height>=2160]/bestvideo[vcodec^=vp9][height>=2160]/bestvideo[vcodec^=avc1][height>=2160]/bestvideo[height>=2160]/bestvideo[vcodec^=av01][height>=1440][fps>30]/bestvideo[vcodec^=vp9.2][height>=1440][fps>30]/bestvideo[vcodec^=vp9][height>=1440][fps>30]/bestvideo[vcodec^=avc1][height>=1440][fps>30]/bestvideo[height>=1440][fps>30]/bestvideo[vcodec^=av01][height>=1440]/bestvideo[vcodec^=vp9.2][height>=1440]/bestvideo[vcodec^=vp9][height>=1440]/bestvideo[vcodec^=avc1][height>=1440]/bestvideo[height>=1440]/bestvideo[vcodec^=av01][height>=1080][fps>30]/bestvideo[vcodec^=vp9.2][height>=1080][fps>30]/bestvideo[vcodec^=vp9][height>=1080][fps>30]/bestvideo[vcodec^=avc1][height>=1080][fps>30]/bestvideo[height>=1080][fps>30]/bestvideo[vcodec^=av01][height>=1080]/bestvideo[vcodec^=vp9.2][height>=1080]/bestvideo[vcodec^=vp9][height>=1080]/bestvideo[vcodec^=avc1][height>=1080]/bestvideo[height>=1080]/bestvideo[vcodec^=av01][height>=720][fps>30]/bestvideo[vcodec^=vp9.2][height>=720][fps>30]/bestvideo[vcodec^=vp9][height>=720][fps>30]/bestvideo[vcodec^=avc1][height>=720][fps>30]/bestvideo[height>=720][fps>30]/bestvideo[vcodec^=av01][height>=720]/bestvideo[vcodec^=vp9.2][height>=720]/bestvideo[vcodec^=vp9][height>=720]/bestvideo[vcodec^=avc1][height>=720]/bestvideo[height>=720]/bestvideo[vcodec^=av01][height>=480][fps>30]/bestvideo[vcodec^=vp9.2][height>=480][fps>30]/bestvideo[vcodec^=vp9][height>=480][fps>30]/bestvideo[vcodec^=avc1][height>=480][fps>30]/bestvideo[height>=480][fps>30]/bestvideo[vcodec^=av01][height>=480]/bestvideo[vcodec^=vp9.2][height>=480]/bestvideo[vcodec^=vp9][height>=480]/bestvideo[vcodec^=avc1][height>=480]/bestvideo[height>=480]/bestvideo[vcodec^=av01][height>=360][fps>30]/bestvideo[vcodec^=vp9.2][height>=360][fps>30]/bestvideo[vcodec^=vp9][height>=360][fps>30]/bestvideo[vcodec^=avc1][height>=360][fps>30]/bestvideo[height>=360][fps>30]/bestvideo[vcodec^=av01][height>=360]/bestvideo[vcodec^=vp9.2][height>=360]/bestvideo[vcodec^=vp9][height>=360]/bestvideo[vcodec^=avc1][height>=360]/bestvideo[height>=360]/bestvideo[vcodec^=avc1][height>=240][fps>30]/bestvideo[vcodec^=av01][height>=240][fps>30]/bestvideo[vcodec^=vp9.2][height>=240][fps>30]/bestvideo[vcodec^=vp9][height>=240][fps>30]/bestvideo[height>=240][fps>30]/bestvideo[vcodec^=avc1][height>=240]/bestvideo[vcodec^=av01][height>=240]/bestvideo[vcodec^=vp9.2][height>=240]/bestvideo[vcodec^=vp9][height>=240]/bestvideo[height>=240]/bestvideo[vcodec^=avc1][height>=144][fps>30]/bestvideo[vcodec^=av01][height>=144][fps>30]/bestvideo[vcodec^=vp9.2][height>=144][fps>30]/bestvideo[vcodec^=vp9][height>=144][fps>30]/bestvideo[height>=144][fps>30]/bestvideo[vcodec^=avc1][height>=144]/bestvideo[vcodec^=av01][height>=144]/bestvideo[vcodec^=vp9.2][height>=144]/bestvideo[vcodec^=vp9][height>=144]/bestvideo[height>=144]/bestvideo)+(bestaudio[acodec^=opus]/bestaudio)/best" \ --verbose \ --force-ipv4 \ diff --git a/bin/download-yt-video.sh b/bin/download-yt-video.sh index e492819..da924e3 100755 --- a/bin/download-yt-video.sh +++ b/bin/download-yt-video.sh @@ -1,4 +1,14 @@ #!/bin/sh + +if [ -z "$*" ] ;then + echo "Usage: $0 " + exit 1 +fi + +if ! command -v yt-dlp 1>/dev/null 2>&1 ;then + sudo pip install yt-dlp +fi + # # TheFrenchGhosty's Ultimate YouTube-DL Scripts Collection: The ultimate collection of scripts for YouTube-DL # https://github.com/TheFrenchGhosty/TheFrenchGhostys-Ultimate-YouTube-DL-Scripts-Collection @@ -11,7 +21,7 @@ #--no-continue \ #--no-overwrites \ -youtube-dlc \ +yt-dlp \ --format "(bestvideo[vcodec^=av01][height>=4320][fps>30]/bestvideo[vcodec^=vp9.2][height>=4320][fps>30]/bestvideo[vcodec^=vp9][height>=4320][fps>30]/bestvideo[vcodec^=avc1][height>=4320][fps>30]/bestvideo[height>=4320][fps>30]/bestvideo[vcodec^=av01][height>=4320]/bestvideo[vcodec^=vp9.2][height>=4320]/bestvideo[vcodec^=vp9][height>=4320]/bestvideo[vcodec^=avc1][height>=4320]/bestvideo[height>=4320]/bestvideo[vcodec^=av01][height>=2880][fps>30]/bestvideo[vcodec^=vp9.2][height>=2880][fps>30]/bestvideo[vcodec^=vp9][height>=2880][fps>30]/bestvideo[vcodec^=avc1][height>=2880][fps>30]/bestvideo[height>=2880][fps>30]/bestvideo[vcodec^=av01][height>=2880]/bestvideo[vcodec^=vp9.2][height>=2880]/bestvideo[vcodec^=vp9][height>=2880]/bestvideo[vcodec^=avc1][height>=2880]/bestvideo[height>=2880]/bestvideo[vcodec^=av01][height>=2160][fps>30]/bestvideo[vcodec^=vp9.2][height>=2160][fps>30]/bestvideo[vcodec^=vp9][height>=2160][fps>30]/bestvideo[vcodec^=avc1][height>=2160][fps>30]/bestvideo[height>=2160][fps>30]/bestvideo[vcodec^=av01][height>=2160]/bestvideo[vcodec^=vp9.2][height>=2160]/bestvideo[vcodec^=vp9][height>=2160]/bestvideo[vcodec^=avc1][height>=2160]/bestvideo[height>=2160]/bestvideo[vcodec^=av01][height>=1440][fps>30]/bestvideo[vcodec^=vp9.2][height>=1440][fps>30]/bestvideo[vcodec^=vp9][height>=1440][fps>30]/bestvideo[vcodec^=avc1][height>=1440][fps>30]/bestvideo[height>=1440][fps>30]/bestvideo[vcodec^=av01][height>=1440]/bestvideo[vcodec^=vp9.2][height>=1440]/bestvideo[vcodec^=vp9][height>=1440]/bestvideo[vcodec^=avc1][height>=1440]/bestvideo[height>=1440]/bestvideo[vcodec^=av01][height>=1080][fps>30]/bestvideo[vcodec^=vp9.2][height>=1080][fps>30]/bestvideo[vcodec^=vp9][height>=1080][fps>30]/bestvideo[vcodec^=avc1][height>=1080][fps>30]/bestvideo[height>=1080][fps>30]/bestvideo[vcodec^=av01][height>=1080]/bestvideo[vcodec^=vp9.2][height>=1080]/bestvideo[vcodec^=vp9][height>=1080]/bestvideo[vcodec^=avc1][height>=1080]/bestvideo[height>=1080]/bestvideo[vcodec^=av01][height>=720][fps>30]/bestvideo[vcodec^=vp9.2][height>=720][fps>30]/bestvideo[vcodec^=vp9][height>=720][fps>30]/bestvideo[vcodec^=avc1][height>=720][fps>30]/bestvideo[height>=720][fps>30]/bestvideo[vcodec^=av01][height>=720]/bestvideo[vcodec^=vp9.2][height>=720]/bestvideo[vcodec^=vp9][height>=720]/bestvideo[vcodec^=avc1][height>=720]/bestvideo[height>=720]/bestvideo[vcodec^=av01][height>=480][fps>30]/bestvideo[vcodec^=vp9.2][height>=480][fps>30]/bestvideo[vcodec^=vp9][height>=480][fps>30]/bestvideo[vcodec^=avc1][height>=480][fps>30]/bestvideo[height>=480][fps>30]/bestvideo[vcodec^=av01][height>=480]/bestvideo[vcodec^=vp9.2][height>=480]/bestvideo[vcodec^=vp9][height>=480]/bestvideo[vcodec^=avc1][height>=480]/bestvideo[height>=480]/bestvideo[vcodec^=av01][height>=360][fps>30]/bestvideo[vcodec^=vp9.2][height>=360][fps>30]/bestvideo[vcodec^=vp9][height>=360][fps>30]/bestvideo[vcodec^=avc1][height>=360][fps>30]/bestvideo[height>=360][fps>30]/bestvideo[vcodec^=av01][height>=360]/bestvideo[vcodec^=vp9.2][height>=360]/bestvideo[vcodec^=vp9][height>=360]/bestvideo[vcodec^=avc1][height>=360]/bestvideo[height>=360]/bestvideo[vcodec^=avc1][height>=240][fps>30]/bestvideo[vcodec^=av01][height>=240][fps>30]/bestvideo[vcodec^=vp9.2][height>=240][fps>30]/bestvideo[vcodec^=vp9][height>=240][fps>30]/bestvideo[height>=240][fps>30]/bestvideo[vcodec^=avc1][height>=240]/bestvideo[vcodec^=av01][height>=240]/bestvideo[vcodec^=vp9.2][height>=240]/bestvideo[vcodec^=vp9][height>=240]/bestvideo[height>=240]/bestvideo[vcodec^=avc1][height>=144][fps>30]/bestvideo[vcodec^=av01][height>=144][fps>30]/bestvideo[vcodec^=vp9.2][height>=144][fps>30]/bestvideo[vcodec^=vp9][height>=144][fps>30]/bestvideo[height>=144][fps>30]/bestvideo[vcodec^=avc1][height>=144]/bestvideo[vcodec^=av01][height>=144]/bestvideo[vcodec^=vp9.2][height>=144]/bestvideo[vcodec^=vp9][height>=144]/bestvideo[height>=144]/bestvideo)+(bestaudio[acodec^=opus]/bestaudio)/best" \ --verbose \ --force-ipv4 \ From 4a28fb8d661be1340f75e7ad3907256dd1af7eba Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Thu, 15 Apr 2021 16:38:57 +0800 Subject: [PATCH 11/13] [feature] script to launch jd-gui --- bin/jd-gui | 3 +++ gui/ncmpcpp/bindings | 42 +++++++++++++++++++++++------------------- 2 files changed, 26 insertions(+), 19 deletions(-) create mode 100755 bin/jd-gui diff --git a/bin/jd-gui b/bin/jd-gui new file mode 100755 index 0000000..7d4a566 --- /dev/null +++ b/bin/jd-gui @@ -0,0 +1,3 @@ +#!/bin/sh + +_JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel" java -jar ~/Programs/bin/jd-gui-1.6.6.jar diff --git a/gui/ncmpcpp/bindings b/gui/ncmpcpp/bindings index 3dd55e7..5c8b961 100644 --- a/gui/ncmpcpp/bindings +++ b/gui/ncmpcpp/bindings @@ -583,44 +583,48 @@ def_key "N" previous_found_item # not used but bound +def_key "space" + select_item def_key "J" + select_item move_sort_order_down def_key "K" - move_sort_order_up + select_item + move_selected_items_up def_key "h" - jump_to_parent_directory + jump_to_parent_directory def_key "l" - enter_directory + enter_directory def_key "l" - run_action + run_action def_key "l" - play_item + play_item def_key "m" - show_media_library + show_media_library def_key "m" - toggle_media_library_columns_mode + toggle_media_library_columns_mode def_key "t" - show_tag_editor + show_tag_editor def_key "v" - show_visualizer + show_visualizer def_key "G" - move_end + move_end def_key "g" - move_home + move_home #jump_to_position_in_song def_key "U" - update_database + update_database def_key "s" - reset_search_engine + reset_search_engine def_key "s" - show_search_engine + show_search_engine def_key "f" - show_browser + show_browser def_key "f" - change_browse_mode + change_browse_mode def_key "x" - delete_playlist_items + delete_playlist_items def_key "X" - delete_browser_items + delete_browser_items def_key "P" - show_playlist + show_playlist From a9c70be2f4ea9b2eb1d4bf212e17383b75fd8f32 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Fri, 16 Apr 2021 10:22:20 +0800 Subject: [PATCH 12/13] [bugfix] J for move item up --- gui/ncmpcpp/bindings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/ncmpcpp/bindings b/gui/ncmpcpp/bindings index 5c8b961..4a58d83 100644 --- a/gui/ncmpcpp/bindings +++ b/gui/ncmpcpp/bindings @@ -587,7 +587,7 @@ def_key "space" select_item def_key "J" select_item - move_sort_order_down + move_selected_items_down def_key "K" select_item move_selected_items_up From 59755b52ada6a8dee3d34c59460386d5a76c8225 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Thu, 13 May 2021 10:15:15 +0800 Subject: [PATCH 13/13] ... --- bin/download-yt-audio.sh | 3 ++- cli/vim/init.vim | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/download-yt-audio.sh b/bin/download-yt-audio.sh index 9258fb3..015f171 100755 --- a/bin/download-yt-audio.sh +++ b/bin/download-yt-audio.sh @@ -15,6 +15,7 @@ fi # https://github.com/TheFrenchGhosty # # + #--output "%(title)s - %(uploader)s - %(upload_date)s/%(title)s - %(uploader)s - %(upload_date)s [%(id)s].%(ext)s" \ yt-dlp \ --format "(bestaudio[acodec^=opus]/bestaudio)/best" \ @@ -34,6 +35,6 @@ yt-dlp \ --embed-thumbnail \ --extract-audio \ --match-filter "!is_live & !live" \ - --output "%(title)s - %(uploader)s - %(upload_date)s/%(title)s - %(uploader)s - %(upload_date)s [%(id)s].%(ext)s" \ + --output "%(uploader)s - %(title)s.%(ext)s" \ --merge-output-format "mkv" \ "$@" 2>/tmp/download-yt-audio-error.log diff --git a/cli/vim/init.vim b/cli/vim/init.vim index 1a6e12f..ad70186 100644 --- a/cli/vim/init.vim +++ b/cli/vim/init.vim @@ -23,6 +23,7 @@ set laststatus=2 set fillchars=vert:\ ,fold:- set clipboard=unnamedplus " system clipboard as default register. for vim to work need installing gvim package set mouse=a +set spell filetype plugin indent on syntax on au! BufWritePost $MYVIMRC source % @@ -83,6 +84,7 @@ au ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red au Syntax * match ExtraWhitespace /\s\+$/ nnoremap es :%s/\s\+$//g + " location jumping nnoremap n :cnext nnoremap p :cprev @@ -313,3 +315,8 @@ autocmd BufEnter,BufRead *.mom :set ft=mom " for yaml need cursorcolumn autocmd FileType yaml :set cursorcolumn + +" spell highlight +highlight clear SpellBad +highlight SpellBad cterm=underline +highlight SpellBad gui=undercurl