From fe31e086e7c775f54fca892622bcb1229eeed13f Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Tue, 12 Feb 2019 18:05:12 -0500 Subject: [PATCH 01/87] --- ubuntu 18 fresh install.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 ubuntu 18 fresh install.md diff --git a/ubuntu 18 fresh install.md b/ubuntu 18 fresh install.md new file mode 100644 index 0000000..a69dd42 --- /dev/null +++ b/ubuntu 18 fresh install.md @@ -0,0 +1,21 @@ +## Packages +sudo apt-get install python-pip p7zip-full smplayer cmus speedtest-cli zsh curl wget git git-gui filezilla pavucontrol ufw servefile nmap +pip install youtube-dl + +## Web installs +docker #https://download.docker.com +sublimetext #https://download.sublimetext.com/ +chrome #https://www.chrome.com/ +syncthing #https://apt.syncthing.net/ + +## Change history-size +HISTSIZE=10000 +HISTFILESIZE=20000 + +## Gnome extensions +Caffeine +Dash to dock | sudo apt remove gnome-shell-extension-ubuntu-dock # https://github.com/micheleg/dash-to-dock/issues/643 +suspend button + +## Shortcuts +systemctl suspend \ No newline at end of file From 9146567c01da5eb1fb6934dda63d0e24f78f3cd8 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Tue, 12 Feb 2019 18:06:38 -0500 Subject: [PATCH 02/87] --- ubuntu 18 fresh install.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/ubuntu 18 fresh install.md b/ubuntu 18 fresh install.md index a69dd42..79dc1bc 100644 --- a/ubuntu 18 fresh install.md +++ b/ubuntu 18 fresh install.md @@ -1,21 +1,21 @@ ## Packages -sudo apt-get install python-pip p7zip-full smplayer cmus speedtest-cli zsh curl wget git git-gui filezilla pavucontrol ufw servefile nmap -pip install youtube-dl +`sudo apt-get install python-pip p7zip-full smplayer cmus speedtest-cli zsh curl wget git git-gui filezilla pavucontrol ufw servefile nmap` +`pip install youtube-dl` ## Web installs -docker #https://download.docker.com -sublimetext #https://download.sublimetext.com/ -chrome #https://www.chrome.com/ -syncthing #https://apt.syncthing.net/ +- docker #https://download.docker.com +- sublimetext #https://download.sublimetext.com/ +- chrome #https://www.chrome.com/ +- syncthing #https://apt.syncthing.net/ ## Change history-size -HISTSIZE=10000 -HISTFILESIZE=20000 +`HISTSIZE=10000 +HISTFILESIZE=20000` ## Gnome extensions -Caffeine -Dash to dock | sudo apt remove gnome-shell-extension-ubuntu-dock # https://github.com/micheleg/dash-to-dock/issues/643 -suspend button +- Caffeine +- Dash to dock | sudo apt remove gnome-shell-extension-ubuntu-dock # https://github.com/micheleg/dash-to-dock/issues/643 +- suspend button ## Shortcuts systemctl suspend \ No newline at end of file From cfda6bb9bdbbbd1395733ceee7dcbc4446ec2f58 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Tue, 12 Feb 2019 18:10:50 -0500 Subject: [PATCH 03/87] --- ubuntu 18 fresh install.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/ubuntu 18 fresh install.md b/ubuntu 18 fresh install.md index 79dc1bc..121b9d8 100644 --- a/ubuntu 18 fresh install.md +++ b/ubuntu 18 fresh install.md @@ -1,6 +1,8 @@ ## Packages -`sudo apt-get install python-pip p7zip-full smplayer cmus speedtest-cli zsh curl wget git git-gui filezilla pavucontrol ufw servefile nmap` -`pip install youtube-dl` +```bash +sudo apt-get install python-pip p7zip-full smplayer cmus speedtest-cli zsh curl wget git git-gui filezilla pavucontrol ufw servefile nmap +pip install youtube-dl +``` ## Web installs - docker #https://download.docker.com @@ -9,13 +11,15 @@ - syncthing #https://apt.syncthing.net/ ## Change history-size -`HISTSIZE=10000 -HISTFILESIZE=20000` +```bash +HISTSIZE=10000 +HISTFILESIZE=20000 +``` ## Gnome extensions - Caffeine - Dash to dock | sudo apt remove gnome-shell-extension-ubuntu-dock # https://github.com/micheleg/dash-to-dock/issues/643 - suspend button -## Shortcuts +## Custom shortcuts systemctl suspend \ No newline at end of file From 5c7e79a52495aa7b650dc5b90b0b1cb76ad5666c Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Mon, 9 Sep 2019 17:15:51 +0000 Subject: [PATCH 04/87] --- ubuntu 18 fresh install.md | 40 +++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/ubuntu 18 fresh install.md b/ubuntu 18 fresh install.md index 121b9d8..3364fcf 100644 --- a/ubuntu 18 fresh install.md +++ b/ubuntu 18 fresh install.md @@ -1,25 +1,47 @@ -## Packages +## Update & Upgrade +```bash +sudo apt update && sudo apt upgrade -y +``` + +## Install Packages ```bash sudo apt-get install python-pip p7zip-full smplayer cmus speedtest-cli zsh curl wget git git-gui filezilla pavucontrol ufw servefile nmap pip install youtube-dl ``` ## Web installs -- docker #https://download.docker.com -- sublimetext #https://download.sublimetext.com/ -- chrome #https://www.chrome.com/ -- syncthing #https://apt.syncthing.net/ +- docker # https://download.docker.com +- VSCode # https://code.visualstudio.com/ +- chrome # https://www.chrome.com/ +- syncthing # https://apt.syncthing.net/ -## Change history-size +## Edit ~/.zshrc +### Change history-size ```bash HISTSIZE=10000 HISTFILESIZE=20000 ``` +### Add shortcut "Alt+:" [to iterate through arguments](https://medium.com/r/?url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F4009412%2Fhow-to-use-arguments-from-previous-command%2F55069846%2355069846) +```bash +autoload -Uz copy-earlier-word +zle -N copy-earlier-word +bindkey "^[:" copy-earlier-word +``` + +### Enable most +```bash +export PAGER=most +``` ## Gnome extensions - Caffeine -- Dash to dock | sudo apt remove gnome-shell-extension-ubuntu-dock # https://github.com/micheleg/dash-to-dock/issues/643 -- suspend button +- Dash to dock https://extensions.gnome.org/extension/307/dash-to-dock/ `sudo apt remove gnome-shell-extension-ubuntu-doc` https://github.com/micheleg/dash-to-dock/issues/643 +- suspend button NetSpeed https://extensions.gnome.org/extension/104/netspeed/ +- NetSpeed https://extensions.gnome.org/extension/104/netspeed/ ## Custom shortcuts -systemctl suspend \ No newline at end of file +- `systemctl suspend` +- Cmus https://medium.com/@madacol/configure-cmus-music-player-on-the-terminal-in-ubuntu-3c513d2d2cd0 + +## StartUp +- Cmus `gnome-terminal -- cmus` \ No newline at end of file From 34c851a40a6efe3a34d5e4f70292a207e735fd37 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Mon, 9 Sep 2019 17:17:19 +0000 Subject: [PATCH 05/87] --- ubuntu 18 fresh install.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ubuntu 18 fresh install.md b/ubuntu 18 fresh install.md index 3364fcf..4e27147 100644 --- a/ubuntu 18 fresh install.md +++ b/ubuntu 18 fresh install.md @@ -6,7 +6,8 @@ sudo apt update && sudo apt upgrade -y ## Install Packages ```bash sudo apt-get install python-pip p7zip-full smplayer cmus speedtest-cli zsh curl wget git git-gui filezilla pavucontrol ufw servefile nmap -pip install youtube-dl + +pip install youtube-dl tldr ``` ## Web installs From a0759af1325694d02442840411bbe20ad83e9dd3 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Mon, 9 Sep 2019 17:18:57 +0000 Subject: [PATCH 06/87] --- ubuntu 18 fresh install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ubuntu 18 fresh install.md b/ubuntu 18 fresh install.md index 4e27147..78becca 100644 --- a/ubuntu 18 fresh install.md +++ b/ubuntu 18 fresh install.md @@ -22,7 +22,7 @@ pip install youtube-dl tldr HISTSIZE=10000 HISTFILESIZE=20000 ``` -### Add shortcut "Alt+:" [to iterate through arguments](https://medium.com/r/?url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F4009412%2Fhow-to-use-arguments-from-previous-command%2F55069846%2355069846) +### Add shortcut "Alt+:" [to iterate through arguments](https://stackoverflow.com/questions/4009412/how-to-use-arguments-from-previous-command/55069846#55069846) ```bash autoload -Uz copy-earlier-word zle -N copy-earlier-word From 0d3700772a16bb73901a1b3c4a614b7ea1c519f2 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Mon, 9 Sep 2019 17:21:44 +0000 Subject: [PATCH 07/87] --- ubuntu 18 fresh install.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ubuntu 18 fresh install.md b/ubuntu 18 fresh install.md index 78becca..b66edbf 100644 --- a/ubuntu 18 fresh install.md +++ b/ubuntu 18 fresh install.md @@ -15,6 +15,7 @@ pip install youtube-dl tldr - VSCode # https://code.visualstudio.com/ - chrome # https://www.chrome.com/ - syncthing # https://apt.syncthing.net/ +- Zsh-syntax-highlighting # https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/INSTALL.md ## Edit ~/.zshrc ### Change history-size From c2a6c46063b876cbad7a751a8553c4c5ae22140a Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Mon, 9 Sep 2019 17:22:11 +0000 Subject: [PATCH 08/87] --- ubuntu 18 fresh install.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ubuntu 18 fresh install.md b/ubuntu 18 fresh install.md index b66edbf..df5ef33 100644 --- a/ubuntu 18 fresh install.md +++ b/ubuntu 18 fresh install.md @@ -11,11 +11,11 @@ pip install youtube-dl tldr ``` ## Web installs -- docker # https://download.docker.com -- VSCode # https://code.visualstudio.com/ -- chrome # https://www.chrome.com/ -- syncthing # https://apt.syncthing.net/ -- Zsh-syntax-highlighting # https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/INSTALL.md +- docker: https://download.docker.com +- VSCode: https://code.visualstudio.com/ +- chrome: https://www.chrome.com/ +- syncthing: https://apt.syncthing.net/ +- Zsh-syntax-highlighting: https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/INSTALL.md ## Edit ~/.zshrc ### Change history-size From 33be9253f7559dacf8ea61246f0fd6499879e61e Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Sat, 12 Oct 2019 21:27:15 +0000 Subject: [PATCH 09/87] --- ubuntu 18 fresh install.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/ubuntu 18 fresh install.md b/ubuntu 18 fresh install.md index df5ef33..0f29c78 100644 --- a/ubuntu 18 fresh install.md +++ b/ubuntu 18 fresh install.md @@ -5,9 +5,10 @@ sudo apt update && sudo apt upgrade -y ## Install Packages ```bash -sudo apt-get install python-pip p7zip-full smplayer cmus speedtest-cli zsh curl wget git git-gui filezilla pavucontrol ufw servefile nmap +sudo apt-get install python3-pip zsh curl wget git +sudo apt-get install p7zip-full smplayer cmus speedtest-cli git-gui filezilla pavucontrol ufw servefile nmap fail2ban gimp most colordiff mosh gconf-editor byobu -pip install youtube-dl tldr +pip3 install youtube-dl tldr ``` ## Web installs @@ -18,11 +19,6 @@ pip install youtube-dl tldr - Zsh-syntax-highlighting: https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/INSTALL.md ## Edit ~/.zshrc -### Change history-size -```bash -HISTSIZE=10000 -HISTFILESIZE=20000 -``` ### Add shortcut "Alt+:" [to iterate through arguments](https://stackoverflow.com/questions/4009412/how-to-use-arguments-from-previous-command/55069846#55069846) ```bash autoload -Uz copy-earlier-word From 30df4af44341624c222bdfa264fb73661fd0d3f6 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Sat, 12 Oct 2019 21:28:22 +0000 Subject: [PATCH 10/87] --- ubuntu 18 fresh install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ubuntu 18 fresh install.md b/ubuntu 18 fresh install.md index 0f29c78..9d4b7cd 100644 --- a/ubuntu 18 fresh install.md +++ b/ubuntu 18 fresh install.md @@ -6,7 +6,7 @@ sudo apt update && sudo apt upgrade -y ## Install Packages ```bash sudo apt-get install python3-pip zsh curl wget git -sudo apt-get install p7zip-full smplayer cmus speedtest-cli git-gui filezilla pavucontrol ufw servefile nmap fail2ban gimp most colordiff mosh gconf-editor byobu +sudo apt-get install p7zip-full smplayer cmus speedtest-cli git-gui filezilla pavucontrol ufw servefile nmap fail2ban gimp most colordiff mosh dconf-editor byobu pip3 install youtube-dl tldr ``` From 2ab24b64c4ebed1d8b17daf30376e7392832730c Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Sat, 12 Oct 2019 21:28:48 +0000 Subject: [PATCH 11/87] --- ubuntu 18 fresh install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ubuntu 18 fresh install.md b/ubuntu 18 fresh install.md index 9d4b7cd..6968d1b 100644 --- a/ubuntu 18 fresh install.md +++ b/ubuntu 18 fresh install.md @@ -6,7 +6,7 @@ sudo apt update && sudo apt upgrade -y ## Install Packages ```bash sudo apt-get install python3-pip zsh curl wget git -sudo apt-get install p7zip-full smplayer cmus speedtest-cli git-gui filezilla pavucontrol ufw servefile nmap fail2ban gimp most colordiff mosh dconf-editor byobu +sudo apt-get install p7zip-full smplayer cmus speedtest-cli git-gui filezilla pavucontrol ufw servefile nmap fail2ban gimp most colordiff mosh dconf-editor pip3 install youtube-dl tldr ``` From 282373142edb30788d0e376b1a2a529360f7c9df Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Tue, 29 Oct 2019 01:15:28 +0000 Subject: [PATCH 12/87] --- ubuntu 18 fresh install.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ubuntu 18 fresh install.md b/ubuntu 18 fresh install.md index 6968d1b..290e3a3 100644 --- a/ubuntu 18 fresh install.md +++ b/ubuntu 18 fresh install.md @@ -11,6 +11,9 @@ sudo apt-get install p7zip-full smplayer cmus speedtest-cli git-gui filezilla pa pip3 install youtube-dl tldr ``` +## External Repositories +- Antimicro `sudo add-apt-repository ppa:mdeguzis/libregeek && sudo apt update` + ## Web installs - docker: https://download.docker.com - VSCode: https://code.visualstudio.com/ From 1eaf5265b5957b871b1c89d828278ada6afa0972 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Wed, 6 Nov 2019 15:06:16 +0000 Subject: [PATCH 13/87] --- TerminalShorcuts.md | 57 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 TerminalShorcuts.md diff --git a/TerminalShorcuts.md b/TerminalShorcuts.md new file mode 100644 index 0000000..e9d9b5a --- /dev/null +++ b/TerminalShorcuts.md @@ -0,0 +1,57 @@ +#TL;DR +Alt+0+.: inserts last command without the arguments + +--- + +Tested on Ubuntu 18.04 with the default binding settings *(i.e Emacs key bindings)* + +--- + +# You can combine keyboard shortcuts + +Let's consider the last command to be: + + mv foo bar + +up , Ctrl+w: last command without the last word = `mv foo` + +Alt+0+.: first argument of last command = `mv` + +## Some useful shortcuts: + + - Alt+.: insert last argument from last command *(repeat to go back in history)* + - Alt+number+.: insert #nth last argument from last command *(repeat to go back in history)* + - Alt+- , number , Alt+., **zsh:** Alt+-+#+.: insert #nth first argument from last command *(repeat to go back in history)* + + + - **Cut commands** (relative to cursor's position) + - Ctrl+w: cuts last word + - Alt+d: cuts next word + - Ctrl+k: cuts everything after + - Ctrl+u, **zsh:** Alt+w: cuts everything before + - **zsh:** Ctrl+u: cuts the entire command *(In bash you can combine Ctrl+u , Ctrl+k)* + - Ctrl+y: paste characters previously cut with any **Cut command**. *In bash You can chain **cut commands**, and Ctrl+y will paste them all.* + - Ctrl+_: undo last edit *(very useful when exceeding Ctrl+w)* + - Ctrl+left: move to last word + - Ctrl+right: move to next word + - home or Ctrl+a: move to start of command + - end or Ctrl+e: move to end of command + +### To see all shortcuts available +- **bash:** `bind -lp` +- **zsh:** `bindkey -L` + +## Unfortunately there are some limitations + "words" only includes `a-zA-Z` characters, so any symbol character will stop word-shortcuts. + +So if last argument was a url and you want to erase it with Ctrl+w it will be a pain. + +E.g: `curl -I --header "Connection: Keep-Alive" https://stackoverflow.com/questions/38176514/re-run-previous-command-with-different-arguments` + +To erase that **url** using Ctrl+w, you'd have to repeat it 12 times. + + +--- + + +It would be great to have similar shortcuts that only stops at the **space character** \ No newline at end of file From 1a54c36b84ef2eb68a1c52f087a28c7d6a7fd70e Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Wed, 6 Nov 2019 15:06:32 +0000 Subject: [PATCH 14/87] --- TerminalShorcuts.md | 1 + 1 file changed, 1 insertion(+) diff --git a/TerminalShorcuts.md b/TerminalShorcuts.md index e9d9b5a..0abcc00 100644 --- a/TerminalShorcuts.md +++ b/TerminalShorcuts.md @@ -1,4 +1,5 @@ #TL;DR + Alt+0+.: inserts last command without the arguments --- From f354285d23543f6a55e6763d53985e0978b71c2c Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Wed, 6 Nov 2019 15:07:01 +0000 Subject: [PATCH 15/87] --- TerminalShorcuts.md | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/TerminalShorcuts.md b/TerminalShorcuts.md index 0abcc00..67248a1 100644 --- a/TerminalShorcuts.md +++ b/TerminalShorcuts.md @@ -1,15 +1,3 @@ -#TL;DR - -Alt+0+.: inserts last command without the arguments - ---- - -Tested on Ubuntu 18.04 with the default binding settings *(i.e Emacs key bindings)* - ---- - -# You can combine keyboard shortcuts - Let's consider the last command to be: mv foo bar From b235a4959d32703d3bb4c4b63c4ad6edd036b481 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Wed, 6 Nov 2019 15:08:19 +0000 Subject: [PATCH 16/87] --- TerminalShorcuts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TerminalShorcuts.md b/TerminalShorcuts.md index 67248a1..34ccb99 100644 --- a/TerminalShorcuts.md +++ b/TerminalShorcuts.md @@ -14,7 +14,7 @@ Let's consider the last command to be: - **Cut commands** (relative to cursor's position) - - Ctrl+w: cuts last word + - Ctrl+w: cuts last word - Alt+d: cuts next word - Ctrl+k: cuts everything after - Ctrl+u, **zsh:** Alt+w: cuts everything before From 604ece742f0be0eef5bf0d209911ea4a12a93eba Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Wed, 6 Nov 2019 15:08:45 +0000 Subject: [PATCH 17/87] --- TerminalShorcuts.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/TerminalShorcuts.md b/TerminalShorcuts.md index 34ccb99..2a511a9 100644 --- a/TerminalShorcuts.md +++ b/TerminalShorcuts.md @@ -15,11 +15,11 @@ Let's consider the last command to be: - **Cut commands** (relative to cursor's position) - Ctrl+w: cuts last word - - Alt+d: cuts next word - - Ctrl+k: cuts everything after - - Ctrl+u, **zsh:** Alt+w: cuts everything before - - **zsh:** Ctrl+u: cuts the entire command *(In bash you can combine Ctrl+u , Ctrl+k)* - - Ctrl+y: paste characters previously cut with any **Cut command**. *In bash You can chain **cut commands**, and Ctrl+y will paste them all.* + - Alt+d: cuts next word + - Ctrl+k: cuts everything after + - Ctrl+u, **zsh:** Alt+w: cuts everything before + - **zsh:** Ctrl+u: cuts the entire command *(In bash you can combine Ctrl+u , Ctrl+k)* + - Ctrl+y: paste characters previously cut with any **Cut command**. *In bash You can chain **cut commands**, and Ctrl+y will paste them all.* - Ctrl+_: undo last edit *(very useful when exceeding Ctrl+w)* - Ctrl+left: move to last word - Ctrl+right: move to next word From a4fd8b48f525e1dd9ddc5ae8abdb81d13df598bc Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Wed, 6 Nov 2019 15:09:56 +0000 Subject: [PATCH 18/87] --- TerminalShorcuts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TerminalShorcuts.md b/TerminalShorcuts.md index 2a511a9..c63c4c5 100644 --- a/TerminalShorcuts.md +++ b/TerminalShorcuts.md @@ -19,7 +19,7 @@ Let's consider the last command to be: - Ctrl+k: cuts everything after - Ctrl+u, **zsh:** Alt+w: cuts everything before - **zsh:** Ctrl+u: cuts the entire command *(In bash you can combine Ctrl+u , Ctrl+k)* - - Ctrl+y: paste characters previously cut with any **Cut command**. *In bash You can chain **cut commands**, and Ctrl+y will paste them all.* + - Ctrl+y: paste characters previously cut with any **Cut command**. *In bash you can chain **cut commands**, and Ctrl+y will paste them all.* - Ctrl+_: undo last edit *(very useful when exceeding Ctrl+w)* - Ctrl+left: move to last word - Ctrl+right: move to next word From 491ab2bccfc93964c7f0adbb35958ef3eebc3a99 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Wed, 6 Nov 2019 15:28:55 +0000 Subject: [PATCH 19/87] --- TerminalShorcuts.md => bash-zsh_TerminalShorcuts.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename TerminalShorcuts.md => bash-zsh_TerminalShorcuts.md (100%) diff --git a/TerminalShorcuts.md b/bash-zsh_TerminalShorcuts.md similarity index 100% rename from TerminalShorcuts.md rename to bash-zsh_TerminalShorcuts.md From 1c4319803b52b40e133da7f529a1dc2dd67c1803 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Mon, 23 Dec 2019 20:54:24 +0000 Subject: [PATCH 20/87] --- ubuntu 18 fresh install.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/ubuntu 18 fresh install.md b/ubuntu 18 fresh install.md index 290e3a3..bf54020 100644 --- a/ubuntu 18 fresh install.md +++ b/ubuntu 18 fresh install.md @@ -12,7 +12,21 @@ pip3 install youtube-dl tldr ``` ## External Repositories -- Antimicro `sudo add-apt-repository ppa:mdeguzis/libregeek && sudo apt update` + +### Antimicro +```bash +sudo add-apt-repository ppa:mdeguzis/libregeek +``` +As of today, a bionic package is still not available, but the artful works!. + +`sudo nano /etc/apt/sources.list.d/mdeguzis-ubuntu-libregeek-bionic.list` Replace `bionic` with `artful` +```bash +sudo apt update +sudo apt install antimicro +``` + +https://github.com/AntiMicro/antimicro/issues +https://gist.github.com/madacol/19f8c71ba98f484a4294ccfe90e88e6e ## Web installs - docker: https://download.docker.com From 1e359614c72f445180783d6f7ff2d208a248a95d Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Mon, 23 Dec 2019 20:56:27 +0000 Subject: [PATCH 21/87] --- ubuntu 18 fresh install.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ubuntu 18 fresh install.md b/ubuntu 18 fresh install.md index bf54020..ea63e19 100644 --- a/ubuntu 18 fresh install.md +++ b/ubuntu 18 fresh install.md @@ -17,16 +17,14 @@ pip3 install youtube-dl tldr ```bash sudo add-apt-repository ppa:mdeguzis/libregeek ``` -As of today, a bionic package is still not available, but the artful works!. +As of today, a bionic package is still not available, but the artful works!. https://github.com/AntiMicro/antimicro/issues `sudo nano /etc/apt/sources.list.d/mdeguzis-ubuntu-libregeek-bionic.list` Replace `bionic` with `artful` ```bash sudo apt update sudo apt install antimicro ``` - -https://github.com/AntiMicro/antimicro/issues -https://gist.github.com/madacol/19f8c71ba98f484a4294ccfe90e88e6e +Put config file https://gist.github.com/madacol/19f8c71ba98f484a4294ccfe90e88e6e in `~/.config/antimicro` ## Web installs - docker: https://download.docker.com From dc925d378f84fda2eee1dbbe987913d0ed0bc825 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Tue, 14 Jan 2020 14:27:37 +0000 Subject: [PATCH 22/87] --- ubuntu 18 fresh install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ubuntu 18 fresh install.md b/ubuntu 18 fresh install.md index ea63e19..1a0ccb2 100644 --- a/ubuntu 18 fresh install.md +++ b/ubuntu 18 fresh install.md @@ -6,7 +6,7 @@ sudo apt update && sudo apt upgrade -y ## Install Packages ```bash sudo apt-get install python3-pip zsh curl wget git -sudo apt-get install p7zip-full smplayer cmus speedtest-cli git-gui filezilla pavucontrol ufw servefile nmap fail2ban gimp most colordiff mosh dconf-editor +sudo apt-get install p7zip-full smplayer cmus speedtest-cli git-gui filezilla pavucontrol ufw servefile nmap fail2ban gimp most colordiff mosh dconf-editor fonts-noto & pip3 install youtube-dl tldr ``` From fd5ff13777ce14bdc45d39a614cd81752d9aaa7a Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Sat, 1 Feb 2020 22:25:43 -0500 Subject: [PATCH 23/87] Added apt packages `ncdu qcalc jq tor` --- ubuntu 18 fresh install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ubuntu 18 fresh install.md b/ubuntu 18 fresh install.md index ea63e19..8945788 100644 --- a/ubuntu 18 fresh install.md +++ b/ubuntu 18 fresh install.md @@ -6,7 +6,7 @@ sudo apt update && sudo apt upgrade -y ## Install Packages ```bash sudo apt-get install python3-pip zsh curl wget git -sudo apt-get install p7zip-full smplayer cmus speedtest-cli git-gui filezilla pavucontrol ufw servefile nmap fail2ban gimp most colordiff mosh dconf-editor +sudo apt-get install p7zip-full smplayer cmus speedtest-cli git-gui filezilla pavucontrol ufw servefile nmap fail2ban gimp most colordiff mosh dconf-editor ncdu qcalc jq tor pip3 install youtube-dl tldr ``` From 80ce278b2beeababa9f0ddfeb45a78ffaa267905 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Fri, 7 Feb 2020 14:50:38 -0500 Subject: [PATCH 24/87] Gnome extension: Dash to dock: Typo in the package that needs to be removed --- ubuntu 18 fresh install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ubuntu 18 fresh install.md b/ubuntu 18 fresh install.md index 8945788..b3f3774 100644 --- a/ubuntu 18 fresh install.md +++ b/ubuntu 18 fresh install.md @@ -48,7 +48,7 @@ export PAGER=most ## Gnome extensions - Caffeine -- Dash to dock https://extensions.gnome.org/extension/307/dash-to-dock/ `sudo apt remove gnome-shell-extension-ubuntu-doc` https://github.com/micheleg/dash-to-dock/issues/643 +- Dash to dock https://extensions.gnome.org/extension/307/dash-to-dock/ `sudo apt remove gnome-shell-extension-ubuntu-dock` https://github.com/micheleg/dash-to-dock/issues/643 - suspend button NetSpeed https://extensions.gnome.org/extension/104/netspeed/ - NetSpeed https://extensions.gnome.org/extension/104/netspeed/ From 69b43a22a0826cc085e827e19d79729a3c083e7b Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Sat, 15 Feb 2020 12:50:37 -0500 Subject: [PATCH 25/87] DB_MYSQL_TRANSACTIONS.es.md --- DB_MYSQL_TRANSACTIONS.es.md | 86 +++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 DB_MYSQL_TRANSACTIONS.es.md diff --git a/DB_MYSQL_TRANSACTIONS.es.md b/DB_MYSQL_TRANSACTIONS.es.md new file mode 100644 index 0000000..2ac6e1a --- /dev/null +++ b/DB_MYSQL_TRANSACTIONS.es.md @@ -0,0 +1,86 @@ +[//]: # "Ctrl+K,V o Ctrl+Shift+V - Para ver vista previa en VSCode" + +# Comandos principales + +- `START TRANSACTION` se utiliza para abrir una transacción (desactiva temporalmente el modo `autocommit`). +- `COMMIT` se utiliza para que los cambios que están pendientes de la transacción actual, se vuelvan permanentes en la BD y cierra la transacción. +- `ROLLBACK` para deshechar cualquier cambio pendiente que se haya hecho en la transacción actual y cierra la transacción. + +MYSQL por defecto funciona con el modo `autocommit` activado, eso quiere decir que cualquier consulta es una transacción implicitamente, osea, si hacen un `UPDATE ...` en el fondo InnoDB ejecuta algo parecido a esto: + +```sql +START TRANSACTION; + UPDATE ... +COMMIT; +``` + +Si ese `UPDATE ...` falla estando el modo `autocommit` activado, entonces automáticamente se ejecuta un `ROLLBACK` + +# Usos + +## Ejecutar todo o nada + +Supongamos que queremos ejecutar una serie de consultas que modifican la BD, pero queremos que se ejecuten todas, y que si cualquiera falla que se deshagan los cambios. + +Podemos hacer algo así: + +```sql +BEGIN + + START TRANSACTION; + .. Consulta 1 .. + .. Consulta 2 .. # Esta consulta siempre falla + .. Consulta 3 .. + COMMIT; + +END +``` + +Al ejecutar ese procedimiento almacenado, se abre una transacción, se ejecuta la **Consulta 1**, y al intentar la **Consulta 2** falla. + +Hay un problema aquí, la transacción no se deshace, sino que queda abierta, osea, tiene cambios hechos de la **Consulta 1**, pero no se han hecho permanentes en la BD (`COMMIT`), ni tampoco se han devuelto los cambios (`ROLLBACK`). Y puede ocurrir cualquiera de los dos escenarios. Por ejemplo si se cierra la conexión, la BD ejecuta un `ROLLBACK` y si se ejecuta cualquiera de estas consultas https://dev.mysql.com/doc/refman/8.0/en/implicit-commit.html se genera un `COMMIT` implicitamente. + +Si en este estado de la BD se hace un `SELECT` para verificar si en la BD se hicieron los cambios de la **Consulta 1**, se va a obtener distintas respuestas dependiendo de si el `SELECT` se ejecuta desde la misma conexión/sesión o no. + +Cuando se abre una transacción y se hace un cambio, ese cambio solamente es visible para esa misma sesión que abrió la transacción. + +### Solución + +Explicitamente hacer `ROLLBACK` cuando ocurra un error. + +Para eso definimos un *HANDLER* para los errores, es como el equivalente a un `try ... catch` pero afecta a todo el procedimeinto almacenado + +```sql +BEGIN + DECLARE EXIT HANDLER FOR SQLEXCEPTION + BEGIN + ROLLBACK; + RESIGNAL; + END; + + START TRANSACTION; + .. Consulta 1 .. + .. Consulta 2 .. # Esta consulta siempre falla + .. Consulta 3 .. + COMMIT; + +END +``` + +Ahora cuando la **Consulta 2** falle, se dispara el handler, y se ejecutan los comandos `ROLLBACK` y `RESIGNAL`. *RESIGNAL* sirve para que se vuelva a lanzar el error, ya que de lo contrario el procedimiento almacenado termina *"exitosamente"* a pesar de que hubo un error. + +## Bloquear tablas + +Luego de abrir una transaccion con `START TRANSACTION` las consultas como el `INSERT`, `UPDATE` o `DELETE` bloquean las tablas, registros o índices que afecten, hasta que dicha transacción se cierre ya sea con un `COMMIT` o un `ROLLBACK`. + +Esto sirve para que cualquier otra consulta que quiera leer o modificar los elementos bloqueados, deban esperar hasta que la transacción que los bloquea se cierre y los libere. + +Los `SELECT` normales no generan ningun bloqueo, para eso existen el `SELECT ... FOR SHARE` y el `SELECT ... FOR UPDATE`. + +En términos simples el **FOR SHARE** bloquea los elementos seleccionados para que otra consulta no pueda escribir sobre ellos hasta que se cierre la transacción, y el **FOR UPDATE** adicionalmente impide que tampoco puedan leerlos (igual que los `INSERT`, `UPDATE` o `DELETE`). Mas información https://dev.mysql.com/doc/refman/8.0/en/innodb-locking-reads.html + +### Recomendaciones + +Hay que analizar detalladamente todo lo que se mete dentro de una transacción, y reducirlo a lo mas mínimo posible, para evitar [Deadlocks](https://dev.mysql.com/doc/refman/5.7/en/innodb-deadlocks.html) o retrasos debido a bloqueos innecesarios. + +Usar índices en todos los `WHERE` de las consultas que bloquean, para que dichos bloqueos sean lo mas óptimos posibles, y se bloquee solo lo que hace falta bloquear. \ No newline at end of file From 94acb98c2fdedc86defa42c5bb138c5d4d081acd Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Mon, 2 Mar 2020 21:05:01 -0500 Subject: [PATCH 26/87] Added sinkSwitcher --- ubuntu 18 fresh install.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ubuntu 18 fresh install.md b/ubuntu 18 fresh install.md index 14acc67..3b24824 100644 --- a/ubuntu 18 fresh install.md +++ b/ubuntu 18 fresh install.md @@ -26,6 +26,10 @@ sudo apt install antimicro ``` Put config file https://gist.github.com/madacol/19f8c71ba98f484a4294ccfe90e88e6e in `~/.config/antimicro` +### SinkSwitcher + +https://github.com/madacol/sinkSwitcher + ## Web installs - docker: https://download.docker.com - VSCode: https://code.visualstudio.com/ From d033536d202524126514729c4073030327cf59ee Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Fri, 3 Apr 2020 11:36:32 -0500 Subject: [PATCH 27/87] Moved *insert commands* to its own section, and specified repeat commands only works in Linux --- bash-zsh_TerminalShorcuts.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bash-zsh_TerminalShorcuts.md b/bash-zsh_TerminalShorcuts.md index c63c4c5..33d4fb5 100644 --- a/bash-zsh_TerminalShorcuts.md +++ b/bash-zsh_TerminalShorcuts.md @@ -8,9 +8,12 @@ Let's consider the last command to be: ## Some useful shortcuts: - - Alt+.: insert last argument from last command *(repeat to go back in history)* - - Alt+number+.: insert #nth last argument from last command *(repeat to go back in history)* - - Alt+- , number , Alt+., **zsh:** Alt+-+#+.: insert #nth first argument from last command *(repeat to go back in history)* + - **Select previous arguments** + - Alt+.: insert last argument from last command. + - Alt+number+.: insert #nth last argument from last command. + - Alt+- , number , Alt+., **zsh:** Alt+-+#+.: insert #nth first argument from last command. + + *In Linux you can repeat commands to go back in history* - **Cut commands** (relative to cursor's position) From 2cbeb1a314ffa8bcc8c7b9c5812bbbb58196982d Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Fri, 3 Apr 2020 12:31:22 -0500 Subject: [PATCH 28/87] Organized for general use --- bash-zsh_TerminalShorcuts.md | 67 +++++++++++++++++++++--------------- 1 file changed, 39 insertions(+), 28 deletions(-) diff --git a/bash-zsh_TerminalShorcuts.md b/bash-zsh_TerminalShorcuts.md index 33d4fb5..4129b0b 100644 --- a/bash-zsh_TerminalShorcuts.md +++ b/bash-zsh_TerminalShorcuts.md @@ -1,3 +1,41 @@ +# Shortcuts + +*For Ubuntu's default keybinding settings (i.e Emacs keybindings)* + +## Insert previous arguments + - Alt+.: insert last argument from last command. + - Alt+number+.: insert #nth last argument from last command. + - Alt+- , number , Alt+., **zsh:** Alt+-+#+.: insert #nth first argument from last command. + +*In Linux you can repeat commands to go back in history* + +## Cut/Paste commands +*(relative to cursor's position)* + - Ctrl+w: cuts last word + - Alt+d: cuts next word + - Ctrl+k: cuts everything after + - Ctrl+u, **zsh:** Alt+w: cuts everything before + - **zsh:** Ctrl+u: cuts the entire command *(In bash you can combine Ctrl+u , Ctrl+k)* + - Ctrl+y: paste characters previously cut with any **Cut command**. *In bash you can chain **cut commands**, and Ctrl+y will paste them all.* + + +## Move cursor + - Ctrl+left: move to last word + - Ctrl+right: move to next word + - home or Ctrl+a: move to start of command + - end or Ctrl+e: move to end of command + + +## Other + - Ctrl+_: undo last edit *(very useful when exceeding Ctrl+w)* + +# To see all shortcuts available + - **bash:** `bind -lp` + - **zsh:** `bindkey -L` + +# Other examples + +## Common usecases Let's consider the last command to be: mv foo bar @@ -6,34 +44,7 @@ Let's consider the last command to be: Alt+0+.: first argument of last command = `mv` -## Some useful shortcuts: - - - **Select previous arguments** - - Alt+.: insert last argument from last command. - - Alt+number+.: insert #nth last argument from last command. - - Alt+- , number , Alt+., **zsh:** Alt+-+#+.: insert #nth first argument from last command. - - *In Linux you can repeat commands to go back in history* - - - - **Cut commands** (relative to cursor's position) - - Ctrl+w: cuts last word - - Alt+d: cuts next word - - Ctrl+k: cuts everything after - - Ctrl+u, **zsh:** Alt+w: cuts everything before - - **zsh:** Ctrl+u: cuts the entire command *(In bash you can combine Ctrl+u , Ctrl+k)* - - Ctrl+y: paste characters previously cut with any **Cut command**. *In bash you can chain **cut commands**, and Ctrl+y will paste them all.* - - Ctrl+_: undo last edit *(very useful when exceeding Ctrl+w)* - - Ctrl+left: move to last word - - Ctrl+right: move to next word - - home or Ctrl+a: move to start of command - - end or Ctrl+e: move to end of command - -### To see all shortcuts available -- **bash:** `bind -lp` -- **zsh:** `bindkey -L` - -## Unfortunately there are some limitations +# Limitations "words" only includes `a-zA-Z` characters, so any symbol character will stop word-shortcuts. So if last argument was a url and you want to erase it with Ctrl+w it will be a pain. From a087e26fb3770cdcd3f08c41bef2a762a8a1cecd Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Fri, 3 Apr 2020 12:32:03 -0500 Subject: [PATCH 29/87] Example to section `Insert previous arguments` --- bash-zsh_TerminalShorcuts.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bash-zsh_TerminalShorcuts.md b/bash-zsh_TerminalShorcuts.md index 4129b0b..8b298d5 100644 --- a/bash-zsh_TerminalShorcuts.md +++ b/bash-zsh_TerminalShorcuts.md @@ -9,6 +9,17 @@ *In Linux you can repeat commands to go back in history* +### Example: + +Last command is: + + mv foo bar + + - Alt+0+.: insert first argument of last command = `mv` + - Alt+2+.: insert last 2nd argument of last command = `foo` + - up , Ctrl+w: last command without the last word = `mv foo` + + ## Cut/Paste commands *(relative to cursor's position)* - Ctrl+w: cuts last word From d79533b24653741c68442a70290d2024f63685a9 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Fri, 3 Apr 2020 12:32:48 -0500 Subject: [PATCH 30/87] Added a custom shortcut for zsh, to iterate through the arguments in a previous command --- bash-zsh_TerminalShorcuts.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/bash-zsh_TerminalShorcuts.md b/bash-zsh_TerminalShorcuts.md index 8b298d5..a2176cd 100644 --- a/bash-zsh_TerminalShorcuts.md +++ b/bash-zsh_TerminalShorcuts.md @@ -44,6 +44,33 @@ Last command is: - **bash:** `bind -lp` - **zsh:** `bindkey -L` +# Custom shortcuts +## Iterate through the arguments in a previous command +*only works in zsh, and probably only Linux* + +run or add this to your `~/.zshrc` + + autoload -Uz copy-earlier-word + zle -N copy-earlier-word + bindkey "^[:" copy-earlier-word + +Now use Alt+. to go as back as you want, then use Alt+: to iterate through the arguments + +### Example: +Last command is + + echo 1 2 3 4 5 + +- Alt+.: `5` +- Alt+.+:: `4` +- Alt+.+:+:: `3` +- Alt+.+:+:+:: `2` +- Alt+.+:+:+:+:: `1` +- Alt+.+:+:+:+:+:: `echo` + +source: https://stackoverflow.com/a/34861762/3163120 + + # Other examples ## Common usecases From 30c7a5b09ef098b9895b2781e2e7e3151aede44c Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Fri, 3 Apr 2020 12:38:05 -0500 Subject: [PATCH 31/87] Fixed hierarchy --- bash-zsh_TerminalShorcuts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash-zsh_TerminalShorcuts.md b/bash-zsh_TerminalShorcuts.md index a2176cd..ae803fa 100644 --- a/bash-zsh_TerminalShorcuts.md +++ b/bash-zsh_TerminalShorcuts.md @@ -40,7 +40,7 @@ Last command is: ## Other - Ctrl+_: undo last edit *(very useful when exceeding Ctrl+w)* -# To see all shortcuts available +## To see all shortcuts available - **bash:** `bind -lp` - **zsh:** `bindkey -L` From 3f86a5ed250c638c28dd33f2119d7321a7ad46f9 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Fri, 3 Apr 2020 12:48:48 -0500 Subject: [PATCH 32/87] Improved description and instructions for custom shortcut `Iterate through arguments` --- bash-zsh_TerminalShorcuts.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bash-zsh_TerminalShorcuts.md b/bash-zsh_TerminalShorcuts.md index ae803fa..bebbd02 100644 --- a/bash-zsh_TerminalShorcuts.md +++ b/bash-zsh_TerminalShorcuts.md @@ -45,15 +45,21 @@ Last command is: - **zsh:** `bindkey -L` # Custom shortcuts -## Iterate through the arguments in a previous command +## Iterate through arguments *only works in zsh, and probably only Linux* -run or add this to your `~/.zshrc` +### Description +Insert any argument of a previous command by iterating one by one until selection + +### Setup Instructions +run this: autoload -Uz copy-earlier-word zle -N copy-earlier-word bindkey "^[:" copy-earlier-word +*(to make this permanent, add it to your `~/.zshrc` and restart shell)* + Now use Alt+. to go as back as you want, then use Alt+: to iterate through the arguments ### Example: From 2951ee6e407d373eb8f9d48079f7761676a3ef04 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Fri, 3 Apr 2020 12:56:14 -0500 Subject: [PATCH 33/87] # -> number --- bash-zsh_TerminalShorcuts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash-zsh_TerminalShorcuts.md b/bash-zsh_TerminalShorcuts.md index bebbd02..125aa3a 100644 --- a/bash-zsh_TerminalShorcuts.md +++ b/bash-zsh_TerminalShorcuts.md @@ -5,7 +5,7 @@ ## Insert previous arguments - Alt+.: insert last argument from last command. - Alt+number+.: insert #nth last argument from last command. - - Alt+- , number , Alt+., **zsh:** Alt+-+#+.: insert #nth first argument from last command. + - Alt+- , number , Alt+., **zsh:** Alt+-+number+.: insert #nth first argument from last command. *In Linux you can repeat commands to go back in history* From 6f81d1879598c4daac8d3ad96f815edae9cd6421 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Thu, 16 Apr 2020 13:15:37 -0500 Subject: [PATCH 34/87] New: Install `youtube-dl` in android --- install youtube-dl in android.md | 48 ++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 install youtube-dl in android.md diff --git a/install youtube-dl in android.md b/install youtube-dl in android.md new file mode 100644 index 0000000..b4fec40 --- /dev/null +++ b/install youtube-dl in android.md @@ -0,0 +1,48 @@ +[//]: # "Ctrl+K,V o Ctrl+Shift+V - Para ver vista previa en VSCode" + +Tutorial to fast install [youtube-dl](https://github.com/ytdl-org/youtube-dl/) in android and configure it to download any url shared to it. Based on https://www.reddit.com/r/Piracy/comments/baufql/youtubedl_the_easy_way_on_android/ + +# Quick Install + +## Install Termux +https://termux.com/ + +## Open Termux and run this: + +### Install youtube-dl + + termux-setup-storage && + mkdir -p ~/.config/youtube-dl && + echo "# Default Output Directory and Pattern + -o /data/data/com.termux/files/home/storage/downloads/%(extractor_key)s/%(uploader)s/%(title)s-%(id)s.%(ext)s" > ~/.config/youtube-dl/config && + mkdir ~/bin && + echo "#!/bin/bash + url=$1 + youtube-dl $url" > ~/bin/termux-url-opener && + chmod +x ~/bin/termux-url-opener && + apt update && apt upgrade && apt install python ffmpeg && pip install youtube-dl + +### Extras (install nano, and add special keys to keyboard) + mkdir ~/.termux + echo "extra-keys = [ \ + ['ESC', '/', '|', 'HOME', 'UP', 'END', 'PGUP', '-'], \ + ['TAB','CTRL', 'ALT', 'LEFT', 'DOWN', 'RIGHT', 'PGDN', '~'] \ + ]" > ~/.termux/termux.properties + apt install nano + +### All-In-One (youtube-dl + extras) + termux-setup-storage && + mkdir -p ~/.config/youtube-dl && + echo "# Default Output Directory and Pattern + -o /data/data/com.termux/files/home/storage/downloads/%(extractor_key)s/%(uploader)s/%(title)s-%(id)s.%(ext)s" > ~/.config/youtube-dl/config && + mkdir ~/bin && + echo "#!/bin/bash + url=$1 + youtube-dl $url" > ~/bin/termux-url-opener && + chmod +x ~/bin/termux-url-opener && + mkdir ~/.termux && + echo "extra-keys = [ \ + ['ESC', '/', '|', 'HOME', 'UP', 'END', 'PGUP', '-'], \ + ['TAB','CTRL', 'ALT', 'LEFT', 'DOWN', 'RIGHT', 'PGDN', '~'] \ + ]" > ~/.termux/termux.properties && + apt update && apt upgrade && apt install nano python ffmpeg && pip install youtube-dl From a9098f9b865d2d605c95da0d6a1cb4a76ec52826 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Thu, 16 Apr 2020 13:20:47 -0500 Subject: [PATCH 35/87] Moved the `apt install ...` commands to the begining --- install youtube-dl in android.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install youtube-dl in android.md b/install youtube-dl in android.md index b4fec40..25944f7 100644 --- a/install youtube-dl in android.md +++ b/install youtube-dl in android.md @@ -12,6 +12,7 @@ https://termux.com/ ### Install youtube-dl termux-setup-storage && + apt update && apt upgrade && apt install python ffmpeg && pip install youtube-dl && mkdir -p ~/.config/youtube-dl && echo "# Default Output Directory and Pattern -o /data/data/com.termux/files/home/storage/downloads/%(extractor_key)s/%(uploader)s/%(title)s-%(id)s.%(ext)s" > ~/.config/youtube-dl/config && @@ -19,8 +20,7 @@ https://termux.com/ echo "#!/bin/bash url=$1 youtube-dl $url" > ~/bin/termux-url-opener && - chmod +x ~/bin/termux-url-opener && - apt update && apt upgrade && apt install python ffmpeg && pip install youtube-dl + chmod +x ~/bin/termux-url-opener ### Extras (install nano, and add special keys to keyboard) mkdir ~/.termux @@ -32,6 +32,7 @@ https://termux.com/ ### All-In-One (youtube-dl + extras) termux-setup-storage && + apt update && apt upgrade && apt install nano python ffmpeg && pip install youtube-dl && mkdir -p ~/.config/youtube-dl && echo "# Default Output Directory and Pattern -o /data/data/com.termux/files/home/storage/downloads/%(extractor_key)s/%(uploader)s/%(title)s-%(id)s.%(ext)s" > ~/.config/youtube-dl/config && @@ -44,5 +45,4 @@ https://termux.com/ echo "extra-keys = [ \ ['ESC', '/', '|', 'HOME', 'UP', 'END', 'PGUP', '-'], \ ['TAB','CTRL', 'ALT', 'LEFT', 'DOWN', 'RIGHT', 'PGDN', '~'] \ - ]" > ~/.termux/termux.properties && - apt update && apt upgrade && apt install nano python ffmpeg && pip install youtube-dl + ]" > ~/.termux/termux.properties \ No newline at end of file From b120ffd60cb2a05c243aa75a5ac4562245eb1c83 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Thu, 16 Apr 2020 13:26:08 -0500 Subject: [PATCH 36/87] Improved comments and titles --- install youtube-dl in android.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/install youtube-dl in android.md b/install youtube-dl in android.md index 25944f7..2c14f6c 100644 --- a/install youtube-dl in android.md +++ b/install youtube-dl in android.md @@ -1,6 +1,8 @@ [//]: # "Ctrl+K,V o Ctrl+Shift+V - Para ver vista previa en VSCode" -Tutorial to fast install [youtube-dl](https://github.com/ytdl-org/youtube-dl/) in android and configure it to download any url shared to it. Based on https://www.reddit.com/r/Piracy/comments/baufql/youtubedl_the_easy_way_on_android/ +Tutorial to fast install [youtube-dl](https://github.com/ytdl-org/youtube-dl/) in android and configure it to download any url shared to it. + +*Based on https://www.reddit.com/r/Piracy/comments/baufql/youtubedl_the_easy_way_on_android/* # Quick Install @@ -9,7 +11,7 @@ https://termux.com/ ## Open Termux and run this: -### Install youtube-dl +### Install and configure youtube-dl termux-setup-storage && apt update && apt upgrade && apt install python ffmpeg && pip install youtube-dl && From 0845c4e964bedc41f11df18570288bbc310b72e0 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Fri, 7 Feb 2020 11:35:29 -0500 Subject: [PATCH 37/87] Create ubuntu_network.md --- ubuntu_network.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 ubuntu_network.md diff --git a/ubuntu_network.md b/ubuntu_network.md new file mode 100644 index 0000000..8d29e6e --- /dev/null +++ b/ubuntu_network.md @@ -0,0 +1,41 @@ +# NetworkManager + +- `nm-applet` to run old GUI and activate `Enable Networking`. + +- `nm-connection-editor` to edit any weird configuration in the connections. + +- You can also see what the **NetworkManager** is doing with these commands. +```bash +# Run one by one to see if anything is useful +nmcli device + +nmcli + +nmcli device show +``` + +if your network device says `unmanaged`, it means **NetworkManager** will not try to use that device to connect. + +--- + +# Netplan + +```bash +# Create a config file +sudo nano /etc/netplan/ethernet.yaml +``` +and enter this +```bash +network: + version: 2 + renderer: networkd + ethernets: + eno1: + dhcp4: true +``` +replace `eno1` with whatever your device is (mine was `ens33`). +To see your list of devices, run `ip addr`. + +Finally apply the new configurations + + sudo netplan apply From 3d8b299d917fcd54fd5f6555bdc0a923e984d495 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Fri, 7 Feb 2020 11:38:43 -0500 Subject: [PATCH 38/87] Update ubuntu_network.md --- ubuntu_network.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ubuntu_network.md b/ubuntu_network.md index 8d29e6e..2709b6c 100644 --- a/ubuntu_network.md +++ b/ubuntu_network.md @@ -8,13 +8,11 @@ ```bash # Run one by one to see if anything is useful nmcli device - nmcli - nmcli device show ``` -if your network device says `unmanaged`, it means **NetworkManager** will not try to use that device to connect. +`unmanaged` means **NetworkManager** will not manage that device. --- From 6a065eb8b2dcbb989b16eefbd2b56d045b268fbd Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Fri, 7 Feb 2020 11:51:38 -0500 Subject: [PATCH 39/87] ubuntu_network: added documentations --- ubuntu_network.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ubuntu_network.md b/ubuntu_network.md index 2709b6c..a84a980 100644 --- a/ubuntu_network.md +++ b/ubuntu_network.md @@ -14,6 +14,8 @@ nmcli device show `unmanaged` means **NetworkManager** will not manage that device. +### Documentation: https://help.ubuntu.com/community/NetworkManager + --- # Netplan @@ -37,3 +39,5 @@ To see your list of devices, run `ip addr`. Finally apply the new configurations sudo netplan apply + +### Documentation: https://netplan.io/reference#examples From 33026752570948d572571020a195dab7a355810c Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Wed, 10 Jun 2020 12:17:31 -0500 Subject: [PATCH 40/87] Moved troubleshoot docs into i'ts own folder --- ubuntu_network.md => troubleshoot/ubuntu_network.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ubuntu_network.md => troubleshoot/ubuntu_network.md (100%) diff --git a/ubuntu_network.md b/troubleshoot/ubuntu_network.md similarity index 100% rename from ubuntu_network.md rename to troubleshoot/ubuntu_network.md From fe40a8a25883427672713903211e63da5c189143 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Thu, 16 Apr 2020 13:47:46 -0500 Subject: [PATCH 41/87] Added comments to code, and added index to each section --- install youtube-dl in android.md | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/install youtube-dl in android.md b/install youtube-dl in android.md index 2c14f6c..a3095d1 100644 --- a/install youtube-dl in android.md +++ b/install youtube-dl in android.md @@ -4,35 +4,52 @@ Tutorial to fast install [youtube-dl](https://github.com/ytdl-org/youtube-dl/) i *Based on https://www.reddit.com/r/Piracy/comments/baufql/youtubedl_the_easy_way_on_android/* -# Quick Install +1. [Install and configure youtube-dl](#Install-and-configure-youtube-dl) +2. [Extras](#Extras) +3. [All-In-One](#All-In-One) -## Install Termux +# Install Termux https://termux.com/ -## Open Termux and run this: +# Open Termux and run this: -### Install and configure youtube-dl +## Install and configure youtube-dl +```bash + # Ask for storage permission termux-setup-storage && + # Install youtube-dl apt update && apt upgrade && apt install python ffmpeg && pip install youtube-dl && + # Configure to download videos in `Downloads/{URL's provider (e.g. Youtube)}/{uploader}/{filename}` mkdir -p ~/.config/youtube-dl && echo "# Default Output Directory and Pattern -o /data/data/com.termux/files/home/storage/downloads/%(extractor_key)s/%(uploader)s/%(title)s-%(id)s.%(ext)s" > ~/.config/youtube-dl/config && + # Configure to open shared URLs with `youtube-dl {url}` mkdir ~/bin && echo "#!/bin/bash url=$1 youtube-dl $url" > ~/bin/termux-url-opener && chmod +x ~/bin/termux-url-opener +``` -### Extras (install nano, and add special keys to keyboard) +## Extras + +```bash + # Add special keys to keyboard mkdir ~/.termux echo "extra-keys = [ \ ['ESC', '/', '|', 'HOME', 'UP', 'END', 'PGUP', '-'], \ ['TAB','CTRL', 'ALT', 'LEFT', 'DOWN', 'RIGHT', 'PGDN', '~'] \ ]" > ~/.termux/termux.properties + # Install nano apt install nano +``` -### All-In-One (youtube-dl + extras) +## All-In-One + +youtube-dl + extras + +```bash termux-setup-storage && apt update && apt upgrade && apt install nano python ffmpeg && pip install youtube-dl && mkdir -p ~/.config/youtube-dl && @@ -47,4 +64,5 @@ https://termux.com/ echo "extra-keys = [ \ ['ESC', '/', '|', 'HOME', 'UP', 'END', 'PGUP', '-'], \ ['TAB','CTRL', 'ALT', 'LEFT', 'DOWN', 'RIGHT', 'PGDN', '~'] \ - ]" > ~/.termux/termux.properties \ No newline at end of file + ]" > ~/.termux/termux.properties +``` From 83d1e51c14890c18c49fe1d758a105434bdf3c32 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Thu, 16 Apr 2020 14:22:49 -0500 Subject: [PATCH 42/87] Improved title for clarity --- install youtube-dl in android.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install youtube-dl in android.md b/install youtube-dl in android.md index a3095d1..37a1a36 100644 --- a/install youtube-dl in android.md +++ b/install youtube-dl in android.md @@ -11,7 +11,7 @@ Tutorial to fast install [youtube-dl](https://github.com/ytdl-org/youtube-dl/) i # Install Termux https://termux.com/ -# Open Termux and run this: +# Open Termux and run one of these: ## Install and configure youtube-dl From 02b1d2944b544811f14e83467c45e093df135204 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Wed, 10 Jun 2020 12:31:57 -0500 Subject: [PATCH 43/87] New: es: Bitcoin --- Bitcoin Explicacion.es.md | 46 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Bitcoin Explicacion.es.md diff --git a/Bitcoin Explicacion.es.md b/Bitcoin Explicacion.es.md new file mode 100644 index 0000000..5938062 --- /dev/null +++ b/Bitcoin Explicacion.es.md @@ -0,0 +1,46 @@ +# Como funcionan los fees + +Cada ~10m (varia mucho, muchas veces hasta se tarda mas de 30m) se genera un bloque que como máximo puede pesar hasta 1Mb de informacion. + +La transaccion mas común y simple es de 2 entradas y 2 salidas, y esa pesa mas de 100 bytes, eso quiere decir que en un bloque caben menos de 10.000 transacciones. + +Lo mineros son los encargados de decidir cuales transacciones entran o no en un bloque, y por lo general, ellos le dan prioridad a las que tengan mejor fee (la que tenga la mayor densidad de BTC, osea la mayor **BTC/vbyte**) + +En esta pagina https://bitcoinfees.earn.com puedes ver estimaciones de los fees actuales. Ahorita están absurdamente bajos, osea una transaccion normal te puede estar costando menos de 300 satoshis(0.025$) menos de 2,5 centavos de dolar. Con una wallet en la que tu tengas el control, tú decides cuantos fees vas a pagar. Si no pagas comision, corres el riesgo de que ni uno de los mineros meta tu transaccion en la blockchain y nunca se confirme. En la práctica los fees dependen principalmente de 2 cosas: +- Congestión de la red, cuantas transacciones tienes haciendote competencia en el valor del fee (BTC/vbyte) +- Cuanto estás dispuesto a esperar + +Fijate en la página, cada fila es un rango de fee/byte medido en **satoshis/byte**, el tamaño de la barra indica cuantas transacciones hay/habido en ese rango, y a la derecha, al final, hay una estimacion de minutos de espera (En la práctica varía) + +El peso de una transaccion no solo depende de la cantidad de entradas y salidas, tambien depende del tipo de direcciones de las salidas (y quizas tambien de las entradas, not sure). Y existen 3 tipos de direcciones: +- 1... (clásica) +- 3... (Segwit envuelto en un script, para hacerlo compatible con la clásica) +- bc1... (Segwit nativo) + +El primero es el mas ineficiente (el que pesa mas en una transaccion), y el último es el mas eficiente. +Ya todos los servicios se han adaptado al mas eficiente, asi que asegurate de que la wallet que uses tenga direcciones que empiecen por **bc1...** + + +# Wallets centralizadas vs descentralizadas + +Las wallet descentralizadas modernas al momento de creacion generan un número aleatorio, que es básicamente el alma de tu wallet, de hecho, ese número **es** tu wallet, y quien lo tenga puede gastar tus BTC. Ese número te lo muestran en el formato **seed/semilla**, que es una lista de 12-24 palabras, es simplemente una forma mas presentable de mostrar el numero, ya que es mas facil de memorizar, y de transcribir. +Y muchas wallet van un paso mas allá e implementan el estandar **BIP39**, para encriptar esa **seed** con un **password** que tú escojas, y en estos casos para recuperar tu wallet vas a necesitar tanto la seed, como el password. Esta opcion es la que uso yo, porque entonces yo guardo tranquilamente mi **seed** en todos lados, sin preocuparme si alguien la llega a obtener, y solo me preocupo de guardar bien la clave, que es mas corta y aún mas fácil de memorizar y de guardar. (Es importante escoger una buena clave, mas q todo q sea larga, o te le pueden hacer bruteforce) + +La necesidad de guardar bien esa clave es la desventaja que tienen las wallet descentralizadas vs las centralizadas/custodeadas, es muy facil cagarla, desde dejar muy a la vista la clave secreta, o por guardarla muy bien se te pierde. O como tengos todos mis ahorros y gran parte de mi familia me toca tambien pensar en tener backups que mi familia pueda recuperar si me llego a morir de coñazo. + + +# lightning + +Está construido encima de Bitcoin. Y está basado en una especie de contrato entre 2 partes, y cada parte puede decidir meter X cantidad de BTC para usarlos dentro de ese canal, y mientras ese canal está abierto ambas partes pueden tranzar sin comision alguna, porque no son transacciones que se guardan en la blockchain, son transacciones totalmente privadas. +Y aquí es donde entra lightning como tal, porque bajo ciertas condiciones, se pueden conectar los canales entre sí para así poder transferirle a entidades con las que no tengas canales abierto directamente. + +Ventajas: +- Transacciones son casi instantáneas. +- Fees son aún mas bajos. Gratis si con quien abriste el canal de lightning es el mismo a quien le vas a pagar. + +Desventajas: +- No es suficiente con guardar la **seed** y **password**, tu aplicacion tambien necesita guardar cada cambio que se haga en tus canales abiertos. (La única aplicacion que probé creo que tenia para configurar Google Drive para guardar todos esos cambios). +- Tu aplicacion tiene que estar pendiente de la red cada cierto tiempo (dependiendo de cuando tiempo se le configuró al canal, por lo general varios días) +- Capacidad limitada de cantidad de Bitcoins que puedes enviar, depende de la capacidad de los canales de la ruta que atraviesa la transacción. + +Lightning sigue en desarrollo activo, y algunas de las desventajas son mejorables sacrificando decentralizacion, como hace Phoenix Wallet, que me parece un muy buen tradeoff para noobs. \ No newline at end of file From 9cf80686f6fc406ba0d6b9cd49c54ff3410ce469 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Sat, 13 Jun 2020 15:50:03 -0500 Subject: [PATCH 44/87] youtube-dl: Added dialog to ask if to download video or audio --- install youtube-dl in android.md | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/install youtube-dl in android.md b/install youtube-dl in android.md index 37a1a36..c38e110 100644 --- a/install youtube-dl in android.md +++ b/install youtube-dl in android.md @@ -19,16 +19,34 @@ https://termux.com/ # Ask for storage permission termux-setup-storage && # Install youtube-dl - apt update && apt upgrade && apt install python ffmpeg && pip install youtube-dl && + apt update && apt upgrade && apt install python ffmpeg dialog && pip install youtube-dl && # Configure to download videos in `Downloads/{URL's provider (e.g. Youtube)}/{uploader}/{filename}` mkdir -p ~/.config/youtube-dl && echo "# Default Output Directory and Pattern -o /data/data/com.termux/files/home/storage/downloads/%(extractor_key)s/%(uploader)s/%(title)s-%(id)s.%(ext)s" > ~/.config/youtube-dl/config && # Configure to open shared URLs with `youtube-dl {url}` mkdir ~/bin && - echo "#!/bin/bash - url=$1 - youtube-dl $url" > ~/bin/termux-url-opener && + echo '#!/bin/bash + URL=$1 + HEIGHT=15 + WIDTH=40 + CHOICE_HEIGHT=4 + + CHOICE=$(dialog \ + --menu "Que desea descargar?" \ + $HEIGHT $WIDTH $CHOICE_HEIGHT \ + Video "" \ + Audio "" \ + 2>&1 >/dev/tty) + + case $CHOICE in + Video) + youtube-dl $URL + ;; + Audio) + youtube-dl -x $URL + ;; + esac' > ~/bin/termux-url-opener && chmod +x ~/bin/termux-url-opener ``` From 72cc7c30ef76c3d5ce484bcc5fc396316adc3aa2 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Sat, 13 Jun 2020 15:55:52 -0500 Subject: [PATCH 45/87] Removed intermediate folder **uploader** from the download path Added link to Termux's documentation about **extra keys** --- install youtube-dl in android.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/install youtube-dl in android.md b/install youtube-dl in android.md index c38e110..73cd01e 100644 --- a/install youtube-dl in android.md +++ b/install youtube-dl in android.md @@ -20,10 +20,10 @@ https://termux.com/ termux-setup-storage && # Install youtube-dl apt update && apt upgrade && apt install python ffmpeg dialog && pip install youtube-dl && - # Configure to download videos in `Downloads/{URL's provider (e.g. Youtube)}/{uploader}/{filename}` + # Configure to download videos in `Downloads/{URL's provider (e.g. Youtube)}/{filename}` mkdir -p ~/.config/youtube-dl && echo "# Default Output Directory and Pattern - -o /data/data/com.termux/files/home/storage/downloads/%(extractor_key)s/%(uploader)s/%(title)s-%(id)s.%(ext)s" > ~/.config/youtube-dl/config && + -o /data/data/com.termux/files/home/storage/downloads/%(extractor_key)s/%(title)s-%(id)s.%(ext)s" > ~/.config/youtube-dl/config && # Configure to open shared URLs with `youtube-dl {url}` mkdir ~/bin && echo '#!/bin/bash @@ -54,6 +54,7 @@ https://termux.com/ ```bash # Add special keys to keyboard + # source: https://wiki.termux.com/wiki/Touch_Keyboard#Extra_Keys_Row(s) mkdir ~/.termux echo "extra-keys = [ \ ['ESC', '/', '|', 'HOME', 'UP', 'END', 'PGUP', '-'], \ From 1644a58e5624688086c11bd1fe0842d8f89e7309 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Sun, 14 Jun 2020 15:32:38 -0500 Subject: [PATCH 46/87] Fix: Crashed when downloading from long tweets truncate `title` to 150 characters --- install youtube-dl in android.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install youtube-dl in android.md b/install youtube-dl in android.md index 73cd01e..72266d4 100644 --- a/install youtube-dl in android.md +++ b/install youtube-dl in android.md @@ -23,7 +23,7 @@ https://termux.com/ # Configure to download videos in `Downloads/{URL's provider (e.g. Youtube)}/{filename}` mkdir -p ~/.config/youtube-dl && echo "# Default Output Directory and Pattern - -o /data/data/com.termux/files/home/storage/downloads/%(extractor_key)s/%(title)s-%(id)s.%(ext)s" > ~/.config/youtube-dl/config && + -o /data/data/com.termux/files/home/storage/downloads/%(extractor_key)s/%(title).150s-%(id)s.%(ext)s" > ~/.config/youtube-dl/config && # Configure to open shared URLs with `youtube-dl {url}` mkdir ~/bin && echo '#!/bin/bash From 7a23ffdda2e5d08d1ea40427ca4d0ead2c737a0a Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Sun, 14 Jun 2020 18:47:04 -0500 Subject: [PATCH 47/87] Reorganized options --- install youtube-dl in android.md | 91 +++++++++++++++++++++++--------- 1 file changed, 66 insertions(+), 25 deletions(-) diff --git a/install youtube-dl in android.md b/install youtube-dl in android.md index 72266d4..5dd195f 100644 --- a/install youtube-dl in android.md +++ b/install youtube-dl in android.md @@ -2,6 +2,8 @@ Tutorial to fast install [youtube-dl](https://github.com/ytdl-org/youtube-dl/) in android and configure it to download any url shared to it. +For example, Youtube's videos will be downloaded to `Downloads/Youtube/` + *Based on https://www.reddit.com/r/Piracy/comments/baufql/youtubedl_the_easy_way_on_android/* 1. [Install and configure youtube-dl](#Install-and-configure-youtube-dl) @@ -13,7 +15,47 @@ https://termux.com/ # Open Termux and run one of these: -## Install and configure youtube-dl +## All-In-One + +Youtube-dl + Termux extras + +```bash + termux-setup-storage && + apt update && apt upgrade && apt install nano python ffmpeg && pip install youtube-dl && + mkdir -p ~/.config/youtube-dl && + echo "# Default Output Directory and Pattern + -o /data/data/com.termux/files/home/storage/downloads/%(extractor_key)s/%(title).150s-%(id)s.%(ext)s" > ~/.config/youtube-dl/config && + mkdir ~/bin && + echo '#!/bin/bash + URL=$1 + HEIGHT=15 + WIDTH=40 + CHOICE_HEIGHT=4 + + CHOICE=$(dialog \ + --menu "Que desea descargar?" \ + $HEIGHT $WIDTH $CHOICE_HEIGHT \ + Video "" \ + Audio "" \ + 2>&1 >/dev/tty) + + case $CHOICE in + Video) + youtube-dl $URL + ;; + Audio) + youtube-dl -x $URL + ;; + esac' > ~/bin/termux-url-opener && + chmod +x ~/bin/termux-url-opener && + mkdir ~/.termux && + echo "extra-keys = [ \ + ['ESC', '/', '|', 'HOME', 'UP', 'END', 'PGUP', '-'], \ + ['TAB','CTRL', 'ALT', 'LEFT', 'DOWN', 'RIGHT', 'PGDN', '~'] \ + ]" > ~/.termux/termux.properties +``` + +## Youtube-dl ```bash # Ask for storage permission @@ -50,7 +92,28 @@ https://termux.com/ chmod +x ~/bin/termux-url-opener ``` -## Extras +## Youtube-dl (only video) + +```bash + # Ask for storage permission + termux-setup-storage && + # Install youtube-dl + apt update && apt upgrade && apt install python ffmpeg && pip install youtube-dl && + # Configure to download videos in `Downloads/{URL's provider (e.g. Youtube)}/{filename}` + mkdir -p ~/.config/youtube-dl && + echo "# Default Output Directory and Pattern + -o /data/data/com.termux/files/home/storage/downloads/%(extractor_key)s/%(title).150s-%(id)s.%(ext)s" > ~/.config/youtube-dl/config && + # Configure to open shared URLs with `youtube-dl {url}` + mkdir ~/bin && + echo "#!/bin/bash + url=$1 + youtube-dl $url" > ~/bin/termux-url-opener && + chmod +x ~/bin/termux-url-opener +``` + +If you only want audio, replace `youtube-dl $url` with `youtube-dl -x $url` + +## Termux extras ```bash # Add special keys to keyboard @@ -62,26 +125,4 @@ https://termux.com/ ]" > ~/.termux/termux.properties # Install nano apt install nano -``` - -## All-In-One - -youtube-dl + extras - -```bash - termux-setup-storage && - apt update && apt upgrade && apt install nano python ffmpeg && pip install youtube-dl && - mkdir -p ~/.config/youtube-dl && - echo "# Default Output Directory and Pattern - -o /data/data/com.termux/files/home/storage/downloads/%(extractor_key)s/%(uploader)s/%(title)s-%(id)s.%(ext)s" > ~/.config/youtube-dl/config && - mkdir ~/bin && - echo "#!/bin/bash - url=$1 - youtube-dl $url" > ~/bin/termux-url-opener && - chmod +x ~/bin/termux-url-opener && - mkdir ~/.termux && - echo "extra-keys = [ \ - ['ESC', '/', '|', 'HOME', 'UP', 'END', 'PGUP', '-'], \ - ['TAB','CTRL', 'ALT', 'LEFT', 'DOWN', 'RIGHT', 'PGDN', '~'] \ - ]" > ~/.termux/termux.properties -``` +``` \ No newline at end of file From 96dc4b1321e71928e94d7429cd65f8e82677a0d4 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Sun, 14 Jun 2020 20:07:31 -0500 Subject: [PATCH 48/87] Clarified each option, added a just `youtube-dl` option, added `Usage` section Improved the index and wording in general --- install youtube-dl in android.md | 112 ++++++++++++++++++------------- 1 file changed, 65 insertions(+), 47 deletions(-) diff --git a/install youtube-dl in android.md b/install youtube-dl in android.md index 5dd195f..c739588 100644 --- a/install youtube-dl in android.md +++ b/install youtube-dl in android.md @@ -1,61 +1,27 @@ [//]: # "Ctrl+K,V o Ctrl+Shift+V - Para ver vista previa en VSCode" -Tutorial to fast install [youtube-dl](https://github.com/ytdl-org/youtube-dl/) in android and configure it to download any url shared to it. - -For example, Youtube's videos will be downloaded to `Downloads/Youtube/` +Tutorial to install [youtube-dl](https://github.com/ytdl-org/youtube-dl/) in android via [termux](https://termux.com/), and configure it to download links shared from another app. *Based on https://www.reddit.com/r/Piracy/comments/baufql/youtubedl_the_easy_way_on_android/* -1. [Install and configure youtube-dl](#Install-and-configure-youtube-dl) -2. [Extras](#Extras) -3. [All-In-One](#All-In-One) +# Usage + +Click **Share**, select **Termux**, choose video or audio, and that's it!, it will be saved to `Downloads/{Provider}/` e.g `Downloads/Youtube/` # Install Termux https://termux.com/ # Open Termux and run one of these: -## All-In-One +1. [Youtube-dl + sharing + dialog **(Recommended)**](#Youtube-dl-+-sharing-+-dialog-**(Recommended)**) +2. [Youtube-dl + sharing](#Youtube-dl-+-sharing) +3. [Youtube-dl](#Youtube-dl) +4. [Termux extras](#Termux-extras) +5. [All-In-One](#All-In-One) -Youtube-dl + Termux extras +## Youtube-dl + sharing + dialog **(Recommended)** -```bash - termux-setup-storage && - apt update && apt upgrade && apt install nano python ffmpeg && pip install youtube-dl && - mkdir -p ~/.config/youtube-dl && - echo "# Default Output Directory and Pattern - -o /data/data/com.termux/files/home/storage/downloads/%(extractor_key)s/%(title).150s-%(id)s.%(ext)s" > ~/.config/youtube-dl/config && - mkdir ~/bin && - echo '#!/bin/bash - URL=$1 - HEIGHT=15 - WIDTH=40 - CHOICE_HEIGHT=4 - - CHOICE=$(dialog \ - --menu "Que desea descargar?" \ - $HEIGHT $WIDTH $CHOICE_HEIGHT \ - Video "" \ - Audio "" \ - 2>&1 >/dev/tty) - - case $CHOICE in - Video) - youtube-dl $URL - ;; - Audio) - youtube-dl -x $URL - ;; - esac' > ~/bin/termux-url-opener && - chmod +x ~/bin/termux-url-opener && - mkdir ~/.termux && - echo "extra-keys = [ \ - ['ESC', '/', '|', 'HOME', 'UP', 'END', 'PGUP', '-'], \ - ['TAB','CTRL', 'ALT', 'LEFT', 'DOWN', 'RIGHT', 'PGDN', '~'] \ - ]" > ~/.termux/termux.properties -``` - -## Youtube-dl +After sharing to termux, a dialog will appear so you can choose to download video or just audio ```bash # Ask for storage permission @@ -92,7 +58,9 @@ Youtube-dl + Termux extras chmod +x ~/bin/termux-url-opener ``` -## Youtube-dl (only video) +## Youtube-dl + sharing + +This will always download video. But if you always want just audio, replace `youtube-dl $url` with `youtube-dl -x $url` ```bash # Ask for storage permission @@ -111,7 +79,17 @@ Youtube-dl + Termux extras chmod +x ~/bin/termux-url-opener ``` -If you only want audio, replace `youtube-dl $url` with `youtube-dl -x $url` +## Youtube-dl + +This will only install youtube-dl in termux, you need to run it manually from the terminal, e.g `youtube-dl https://youtu.be/blahblahblah` + +```bash + # Ask for storage permission + termux-setup-storage && + # Install youtube-dl + apt update && apt upgrade && apt install python ffmpeg && pip install youtube-dl +``` + ## Termux extras @@ -125,4 +103,44 @@ If you only want audio, replace `youtube-dl $url` with `youtube-dl -x $url` ]" > ~/.termux/termux.properties # Install nano apt install nano +``` + +## All-In-One + +Youtube-dl + sharing + dialog + Termux extras + +```bash + termux-setup-storage && + apt update && apt upgrade && apt install nano python ffmpeg && pip install youtube-dl && + mkdir -p ~/.config/youtube-dl && + echo "# Default Output Directory and Pattern + -o /data/data/com.termux/files/home/storage/downloads/%(extractor_key)s/%(title).150s-%(id)s.%(ext)s" > ~/.config/youtube-dl/config && + mkdir ~/bin && + echo '#!/bin/bash + URL=$1 + HEIGHT=15 + WIDTH=40 + CHOICE_HEIGHT=4 + + CHOICE=$(dialog \ + --menu "Que desea descargar?" \ + $HEIGHT $WIDTH $CHOICE_HEIGHT \ + Video "" \ + Audio "" \ + 2>&1 >/dev/tty) + + case $CHOICE in + Video) + youtube-dl $URL + ;; + Audio) + youtube-dl -x $URL + ;; + esac' > ~/bin/termux-url-opener && + chmod +x ~/bin/termux-url-opener && + mkdir ~/.termux && + echo "extra-keys = [ \ + ['ESC', '/', '|', 'HOME', 'UP', 'END', 'PGUP', '-'], \ + ['TAB','CTRL', 'ALT', 'LEFT', 'DOWN', 'RIGHT', 'PGDN', '~'] \ + ]" > ~/.termux/termux.properties ``` \ No newline at end of file From 9ec356385b11f69a047d6b45987980b02fbb68f7 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Sun, 14 Jun 2020 20:13:04 -0500 Subject: [PATCH 49/87] Fix: Broken indexes with special characters --- install youtube-dl in android.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/install youtube-dl in android.md b/install youtube-dl in android.md index c739588..791f3c9 100644 --- a/install youtube-dl in android.md +++ b/install youtube-dl in android.md @@ -13,11 +13,11 @@ https://termux.com/ # Open Termux and run one of these: -1. [Youtube-dl + sharing + dialog **(Recommended)**](#Youtube-dl-+-sharing-+-dialog-**(Recommended)**) -2. [Youtube-dl + sharing](#Youtube-dl-+-sharing) -3. [Youtube-dl](#Youtube-dl) -4. [Termux extras](#Termux-extras) -5. [All-In-One](#All-In-One) +1. [Youtube-dl + sharing + dialog **(Recommended)**](#youtube-dl--sharing--dialog-recommended) +2. [Youtube-dl + sharing](#youtube-dl--sharing) +3. [Youtube-dl](#youtube-dl) +4. [Termux extras](#termux-extras) +5. [All-In-One](#all-in-one) ## Youtube-dl + sharing + dialog **(Recommended)** From cd7137420f26b113b5a3200505b732cdea70c8c9 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Sun, 14 Jun 2020 20:18:46 -0500 Subject: [PATCH 50/87] `apt upgrade` doesn't ask for confirmation anymore --- install youtube-dl in android.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install youtube-dl in android.md b/install youtube-dl in android.md index 791f3c9..77678c7 100644 --- a/install youtube-dl in android.md +++ b/install youtube-dl in android.md @@ -27,7 +27,7 @@ After sharing to termux, a dialog will appear so you can choose to download vide # Ask for storage permission termux-setup-storage && # Install youtube-dl - apt update && apt upgrade && apt install python ffmpeg dialog && pip install youtube-dl && + apt update && apt upgrade -y && apt install python ffmpeg dialog && pip install youtube-dl && # Configure to download videos in `Downloads/{URL's provider (e.g. Youtube)}/{filename}` mkdir -p ~/.config/youtube-dl && echo "# Default Output Directory and Pattern @@ -66,7 +66,7 @@ This will always download video. But if you always want just audio, replace `you # Ask for storage permission termux-setup-storage && # Install youtube-dl - apt update && apt upgrade && apt install python ffmpeg && pip install youtube-dl && + apt update && apt upgrade -y && apt install python ffmpeg && pip install youtube-dl && # Configure to download videos in `Downloads/{URL's provider (e.g. Youtube)}/{filename}` mkdir -p ~/.config/youtube-dl && echo "# Default Output Directory and Pattern @@ -87,7 +87,7 @@ This will only install youtube-dl in termux, you need to run it manually from th # Ask for storage permission termux-setup-storage && # Install youtube-dl - apt update && apt upgrade && apt install python ffmpeg && pip install youtube-dl + apt update && apt upgrade -y && apt install python ffmpeg && pip install youtube-dl ``` @@ -111,7 +111,7 @@ Youtube-dl + sharing + dialog + Termux extras ```bash termux-setup-storage && - apt update && apt upgrade && apt install nano python ffmpeg && pip install youtube-dl && + apt update && apt upgrade -y && apt install nano python ffmpeg && pip install youtube-dl && mkdir -p ~/.config/youtube-dl && echo "# Default Output Directory and Pattern -o /data/data/com.termux/files/home/storage/downloads/%(extractor_key)s/%(title).150s-%(id)s.%(ext)s" > ~/.config/youtube-dl/config && From 7b257b08294d81ec066137ed5b1991f2c03dc6f4 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Thu, 18 Jun 2020 15:40:11 -0500 Subject: [PATCH 51/87] Better descriptions to each Install-option --- install youtube-dl in android.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install youtube-dl in android.md b/install youtube-dl in android.md index 77678c7..780ba57 100644 --- a/install youtube-dl in android.md +++ b/install youtube-dl in android.md @@ -21,7 +21,7 @@ https://termux.com/ ## Youtube-dl + sharing + dialog **(Recommended)** -After sharing to termux, a dialog will appear so you can choose to download video or just audio +After sharing a URL to termux, a dialog will appear so you can choose to download video or just audio ```bash # Ask for storage permission @@ -60,7 +60,7 @@ After sharing to termux, a dialog will appear so you can choose to download vide ## Youtube-dl + sharing -This will always download video. But if you always want just audio, replace `youtube-dl $url` with `youtube-dl -x $url` +Afeter sharing URL to termux this will automatically download the video. But if you always want just audio, replace `youtube-dl $url` with `youtube-dl -x $url` ```bash # Ask for storage permission @@ -81,7 +81,7 @@ This will always download video. But if you always want just audio, replace `you ## Youtube-dl -This will only install youtube-dl in termux, you need to run it manually from the terminal, e.g `youtube-dl https://youtu.be/blahblahblah` +This will only install youtube-dl in termux, sharing a URL to Termux will not work, you'll need to run the command manually from the terminal, e.g `youtube-dl https://youtu.be/blahblahblah` ```bash # Ask for storage permission From 0c9d6f0f1f120ad360608aefa1c4ea5b5055ae23 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Tue, 23 Jun 2020 16:34:52 -0500 Subject: [PATCH 52/87] typo `Afeter` -> `After` --- install youtube-dl in android.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install youtube-dl in android.md b/install youtube-dl in android.md index 780ba57..dcec8c0 100644 --- a/install youtube-dl in android.md +++ b/install youtube-dl in android.md @@ -60,7 +60,7 @@ After sharing a URL to termux, a dialog will appear so you can choose to downloa ## Youtube-dl + sharing -Afeter sharing URL to termux this will automatically download the video. But if you always want just audio, replace `youtube-dl $url` with `youtube-dl -x $url` +After sharing URL to termux this will automatically download the video. But if you always want just audio, replace `youtube-dl $url` with `youtube-dl -x $url` ```bash # Ask for storage permission From d99cdd7805074edd0c3489df77f5b783b923ba59 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Fri, 26 Jun 2020 16:53:59 -0500 Subject: [PATCH 53/87] no ask for confirmation in `apt install` --- install youtube-dl in android.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/install youtube-dl in android.md b/install youtube-dl in android.md index dcec8c0..414a057 100644 --- a/install youtube-dl in android.md +++ b/install youtube-dl in android.md @@ -27,7 +27,7 @@ After sharing a URL to termux, a dialog will appear so you can choose to downloa # Ask for storage permission termux-setup-storage && # Install youtube-dl - apt update && apt upgrade -y && apt install python ffmpeg dialog && pip install youtube-dl && + apt update && apt upgrade -y && apt install -y python ffmpeg dialog && pip install youtube-dl && # Configure to download videos in `Downloads/{URL's provider (e.g. Youtube)}/{filename}` mkdir -p ~/.config/youtube-dl && echo "# Default Output Directory and Pattern @@ -66,7 +66,7 @@ After sharing URL to termux this will automatically download the video. But if y # Ask for storage permission termux-setup-storage && # Install youtube-dl - apt update && apt upgrade -y && apt install python ffmpeg && pip install youtube-dl && + apt update && apt upgrade -y && apt install -y python ffmpeg && pip install youtube-dl && # Configure to download videos in `Downloads/{URL's provider (e.g. Youtube)}/{filename}` mkdir -p ~/.config/youtube-dl && echo "# Default Output Directory and Pattern @@ -87,7 +87,7 @@ This will only install youtube-dl in termux, sharing a URL to Termux will not wo # Ask for storage permission termux-setup-storage && # Install youtube-dl - apt update && apt upgrade -y && apt install python ffmpeg && pip install youtube-dl + apt update && apt upgrade -y && apt install -y python ffmpeg && pip install youtube-dl ``` @@ -102,7 +102,7 @@ This will only install youtube-dl in termux, sharing a URL to Termux will not wo ['TAB','CTRL', 'ALT', 'LEFT', 'DOWN', 'RIGHT', 'PGDN', '~'] \ ]" > ~/.termux/termux.properties # Install nano - apt install nano + apt install -y nano ``` ## All-In-One @@ -111,7 +111,7 @@ Youtube-dl + sharing + dialog + Termux extras ```bash termux-setup-storage && - apt update && apt upgrade -y && apt install nano python ffmpeg && pip install youtube-dl && + apt update && apt upgrade -y && apt install -y nano python ffmpeg && pip install youtube-dl && mkdir -p ~/.config/youtube-dl && echo "# Default Output Directory and Pattern -o /data/data/com.termux/files/home/storage/downloads/%(extractor_key)s/%(title).150s-%(id)s.%(ext)s" > ~/.config/youtube-dl/config && From 2819ebd74831fad6e7c8448368a0b72b3a23a78b Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Sat, 27 Jun 2020 18:29:29 -0500 Subject: [PATCH 54/87] Scripts can now re-run without failing mkdir command doesn't fail anymore if folder already exist --- install youtube-dl in android.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/install youtube-dl in android.md b/install youtube-dl in android.md index 414a057..1a0d090 100644 --- a/install youtube-dl in android.md +++ b/install youtube-dl in android.md @@ -33,7 +33,7 @@ After sharing a URL to termux, a dialog will appear so you can choose to downloa echo "# Default Output Directory and Pattern -o /data/data/com.termux/files/home/storage/downloads/%(extractor_key)s/%(title).150s-%(id)s.%(ext)s" > ~/.config/youtube-dl/config && # Configure to open shared URLs with `youtube-dl {url}` - mkdir ~/bin && + mkdir -p ~/bin && echo '#!/bin/bash URL=$1 HEIGHT=15 @@ -72,7 +72,7 @@ After sharing URL to termux this will automatically download the video. But if y echo "# Default Output Directory and Pattern -o /data/data/com.termux/files/home/storage/downloads/%(extractor_key)s/%(title).150s-%(id)s.%(ext)s" > ~/.config/youtube-dl/config && # Configure to open shared URLs with `youtube-dl {url}` - mkdir ~/bin && + mkdir -p ~/bin && echo "#!/bin/bash url=$1 youtube-dl $url" > ~/bin/termux-url-opener && @@ -96,7 +96,7 @@ This will only install youtube-dl in termux, sharing a URL to Termux will not wo ```bash # Add special keys to keyboard # source: https://wiki.termux.com/wiki/Touch_Keyboard#Extra_Keys_Row(s) - mkdir ~/.termux + mkdir -p ~/.termux echo "extra-keys = [ \ ['ESC', '/', '|', 'HOME', 'UP', 'END', 'PGUP', '-'], \ ['TAB','CTRL', 'ALT', 'LEFT', 'DOWN', 'RIGHT', 'PGDN', '~'] \ @@ -115,7 +115,7 @@ Youtube-dl + sharing + dialog + Termux extras mkdir -p ~/.config/youtube-dl && echo "# Default Output Directory and Pattern -o /data/data/com.termux/files/home/storage/downloads/%(extractor_key)s/%(title).150s-%(id)s.%(ext)s" > ~/.config/youtube-dl/config && - mkdir ~/bin && + mkdir -p ~/bin && echo '#!/bin/bash URL=$1 HEIGHT=15 @@ -138,7 +138,7 @@ Youtube-dl + sharing + dialog + Termux extras ;; esac' > ~/bin/termux-url-opener && chmod +x ~/bin/termux-url-opener && - mkdir ~/.termux && + mkdir -p ~/.termux && echo "extra-keys = [ \ ['ESC', '/', '|', 'HOME', 'UP', 'END', 'PGUP', '-'], \ ['TAB','CTRL', 'ALT', 'LEFT', 'DOWN', 'RIGHT', 'PGDN', '~'] \ From 842f1ba1e5313a3f6f4414d270ec012547888476 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Sat, 27 Jun 2020 18:31:27 -0500 Subject: [PATCH 55/87] Downloads -> Download --- install youtube-dl in android.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install youtube-dl in android.md b/install youtube-dl in android.md index 1a0d090..c567eba 100644 --- a/install youtube-dl in android.md +++ b/install youtube-dl in android.md @@ -28,7 +28,7 @@ After sharing a URL to termux, a dialog will appear so you can choose to downloa termux-setup-storage && # Install youtube-dl apt update && apt upgrade -y && apt install -y python ffmpeg dialog && pip install youtube-dl && - # Configure to download videos in `Downloads/{URL's provider (e.g. Youtube)}/{filename}` + # Configure to download videos in `Download/{URL's provider (e.g. Youtube)}/{filename}` mkdir -p ~/.config/youtube-dl && echo "# Default Output Directory and Pattern -o /data/data/com.termux/files/home/storage/downloads/%(extractor_key)s/%(title).150s-%(id)s.%(ext)s" > ~/.config/youtube-dl/config && @@ -67,7 +67,7 @@ After sharing URL to termux this will automatically download the video. But if y termux-setup-storage && # Install youtube-dl apt update && apt upgrade -y && apt install -y python ffmpeg && pip install youtube-dl && - # Configure to download videos in `Downloads/{URL's provider (e.g. Youtube)}/{filename}` + # Configure to download videos in `Download/{URL's provider (e.g. Youtube)}/{filename}` mkdir -p ~/.config/youtube-dl && echo "# Default Output Directory and Pattern -o /data/data/com.termux/files/home/storage/downloads/%(extractor_key)s/%(title).150s-%(id)s.%(ext)s" > ~/.config/youtube-dl/config && From cbd6729c17d382cf1bb60375558148c2202c77f9 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Sat, 27 Jun 2020 18:54:11 -0500 Subject: [PATCH 56/87] Improved installing instructions and added `Usage:` section --- install youtube-dl in android.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/install youtube-dl in android.md b/install youtube-dl in android.md index c567eba..a46ef05 100644 --- a/install youtube-dl in android.md +++ b/install youtube-dl in android.md @@ -21,8 +21,6 @@ https://termux.com/ ## Youtube-dl + sharing + dialog **(Recommended)** -After sharing a URL to termux, a dialog will appear so you can choose to download video or just audio - ```bash # Ask for storage permission termux-setup-storage && @@ -58,9 +56,21 @@ After sharing a URL to termux, a dialog will appear so you can choose to downloa chmod +x ~/bin/termux-url-opener ``` +- Paste the script above 🖢 in the Termux console and press Enter +- A prompt to enable storage will appear, press y then Enter +- That's all!, just wait for it to finish upgrading/installing + +### Usage: + +Share an URL to termux, a dialog will ask you to choose if download **video** or just **audio** + ## Youtube-dl + sharing -After sharing URL to termux this will automatically download the video. But if you always want just audio, replace `youtube-dl $url` with `youtube-dl -x $url` +### Usage: + +Share URL to termux, this will automatically download the video. + +But if you always want to download just audio, replace `youtube-dl $url` with `youtube-dl -x $url` in the script below 🖣 ```bash # Ask for storage permission From 4a96d4407660d7782500964131f45f0d86ade1ec Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Fri, 3 Jul 2020 20:24:03 -0500 Subject: [PATCH 57/87] New: Ssh server as a Tor hidden service --- Ssh server as a Tor hidden service.md | 57 +++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 Ssh server as a Tor hidden service.md diff --git a/Ssh server as a Tor hidden service.md b/Ssh server as a Tor hidden service.md new file mode 100644 index 0000000..d30e336 --- /dev/null +++ b/Ssh server as a Tor hidden service.md @@ -0,0 +1,57 @@ +*Shamelessly copied from https://www.techrepublic.com/article/how-to-run-an-ssh-connection-through-tor/* + +--- + +# Install Tor + +Install Tor on both client and server: + + sudo apt-get install tor -y + +# Configure Tor + +In the ssh's server let's edit tor's config file `/etc/tor/torrc`: + + sudo nano /etc/tor/torrc + +At the bottom of that file, add this: + + HiddenServiceDir /var/lib/tor/ssh/ + HiddenServicePort 22 + +Save and close file. + +Restart Tor: + + sudo systemctl restart tor + +And that's basically it!!! + +After restarting Tor, it will generate all the necessary files within `/var/lib/tor/ssh`, there you'll find the hostname (.onion address) you need to connect to the server. + +To find out that hostname: + + sudo cat /var/lib/tor/ssh/hostname + +You should get something like `riludi2kstjwmlzn.onion` + +# Connect to the Tor hidden ssh server + + torify ssh ... + +For example: + + torify ssh jack@riludi2kstjwmlzn.onion + +You can even make a config entry in `~/.ssh/config`, like this: + +``` +Host serverTor + User jack + HostName riludi2kstjwmlzn.onion + Port 22 +``` + +Now you can simply connect with: + + torify ssh serverTor \ No newline at end of file From 3dedc2289cdebec0a7b1748fa7de52f61522dce5 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Tue, 7 Jul 2020 20:40:48 -0500 Subject: [PATCH 58/87] New: es: Ssh server as a Tor hidden service --- Ssh server as a Tor hidden service.es.md | 64 ++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 Ssh server as a Tor hidden service.es.md diff --git a/Ssh server as a Tor hidden service.es.md b/Ssh server as a Tor hidden service.es.md new file mode 100644 index 0000000..733da72 --- /dev/null +++ b/Ssh server as a Tor hidden service.es.md @@ -0,0 +1,64 @@ +*copiado sin verguenza alguna de https://www.techrepublic.com/article/how-to-run-an-ssh-connection-through-tor/* + +--- + +# Instalar Tor + +Instalar Tor en el cliente y en el servidor: + + sudo apt-get install tor -y + +# Configurar Tor + +1. En el servidor vamos a editar el archivo de configuración de tor `/etc/tor/torrc`: + + + sudo nano /etc/tor/torrc + +2. Al final del archivo vamos a agregar esto: + + HiddenServiceDir /var/lib/tor/ssh/ + HiddenServicePort 22 + + Ctrl+x para guardar y cerrar el archivo. + +3. Reiniciar Tor: + + sudo systemctl restart tor + +# Obtener la direccion .onion + +Estará en el archivo `hostname` en la carpeta configurada anteriormente `/var/lib/tor/ssh/` + + sudo cat /var/lib/tor/ssh/hostname + +Deberia arrojarte algo así: `riludi2kstjwmlzn.onion` + +# Conectarse al servidor ssh con la direccion .onion + +```bash +torify ssh ... # solo reemplazar el dominio/ip por la direccion .onion` +``` + + +Por ejemplo: + + torify ssh jack@riludi2kstjwmlzn.onion + +## Opcional + +Para no tener que recordar la direccion **.onion** puedes configurar los parámetros de conexión en el archivo `~/.ssh/config` + + nano ~/.ssh/config + +Ingresar configuracion: + + Host serverTor + User jack + HostName riludi2kstjwmlzn.onion + Port 22 + + +Ahora puedes conectarte así: + + torify ssh serverTor \ No newline at end of file From dde9dfa75f44b022f31c21663e73d541c7cc9084 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Tue, 7 Jul 2020 21:37:19 -0500 Subject: [PATCH 59/87] Ssh: Simplified and improved instructions --- Ssh server as a Tor hidden service.es.md | 2 +- Ssh server as a Tor hidden service.md | 45 +++++++++++++----------- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/Ssh server as a Tor hidden service.es.md b/Ssh server as a Tor hidden service.es.md index 733da72..917e525 100644 --- a/Ssh server as a Tor hidden service.es.md +++ b/Ssh server as a Tor hidden service.es.md @@ -37,7 +37,7 @@ Deberia arrojarte algo así: `riludi2kstjwmlzn.onion` # Conectarse al servidor ssh con la direccion .onion ```bash -torify ssh ... # solo reemplazar el dominio/ip por la direccion .onion` +torify ssh ... # reemplazar el dominio/ip por la direccion .onion` ``` diff --git a/Ssh server as a Tor hidden service.md b/Ssh server as a Tor hidden service.md index d30e336..36ece03 100644 --- a/Ssh server as a Tor hidden service.md +++ b/Ssh server as a Tor hidden service.md @@ -10,26 +10,24 @@ Install Tor on both client and server: # Configure Tor -In the ssh's server let's edit tor's config file `/etc/tor/torrc`: +1. In the server let's edit tor's config file `/etc/tor/torrc`: - sudo nano /etc/tor/torrc + sudo nano /etc/tor/torrc -At the bottom of that file, add this: +2. At the bottom of that file, add this: - HiddenServiceDir /var/lib/tor/ssh/ - HiddenServicePort 22 + HiddenServiceDir /var/lib/tor/ssh/ + HiddenServicePort 22 -Save and close file. + Ctrl+x to save and close file. -Restart Tor: +3. Restart Tor: - sudo systemctl restart tor + sudo systemctl restart tor -And that's basically it!!! +# Get .onion address -After restarting Tor, it will generate all the necessary files within `/var/lib/tor/ssh`, there you'll find the hostname (.onion address) you need to connect to the server. - -To find out that hostname: +It will be in the file `hostname` in the previously configured folder `/var/lib/tor/ssh` sudo cat /var/lib/tor/ssh/hostname @@ -37,20 +35,27 @@ You should get something like `riludi2kstjwmlzn.onion` # Connect to the Tor hidden ssh server - torify ssh ... +```bash +torify ssh ... # replace the domain/ip with the .onion address +``` For example: torify ssh jack@riludi2kstjwmlzn.onion -You can even make a config entry in `~/.ssh/config`, like this: +## Optional + +You don't need to remember the **.onion** address, you can write an entry to your user's ssh config file `~/.ssh/config`: + + nano ~/.ssh/config + +Set configuration: + + Host serverTor + User jack + HostName riludi2kstjwmlzn.onion + Port 22 -``` -Host serverTor - User jack - HostName riludi2kstjwmlzn.onion - Port 22 -``` Now you can simply connect with: From 583a0ee80a2de9bcff11157f64fd6af2404e229a Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Tue, 14 Jul 2020 19:00:21 -0500 Subject: [PATCH 60/87] Update bitcoin --- Bitcoin Explicacion.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bitcoin Explicacion.es.md b/Bitcoin Explicacion.es.md index 5938062..7ad7e21 100644 --- a/Bitcoin Explicacion.es.md +++ b/Bitcoin Explicacion.es.md @@ -26,7 +26,7 @@ Ya todos los servicios se han adaptado al mas eficiente, asi que asegurate de qu Las wallet descentralizadas modernas al momento de creacion generan un número aleatorio, que es básicamente el alma de tu wallet, de hecho, ese número **es** tu wallet, y quien lo tenga puede gastar tus BTC. Ese número te lo muestran en el formato **seed/semilla**, que es una lista de 12-24 palabras, es simplemente una forma mas presentable de mostrar el numero, ya que es mas facil de memorizar, y de transcribir. Y muchas wallet van un paso mas allá e implementan el estandar **BIP39**, para encriptar esa **seed** con un **password** que tú escojas, y en estos casos para recuperar tu wallet vas a necesitar tanto la seed, como el password. Esta opcion es la que uso yo, porque entonces yo guardo tranquilamente mi **seed** en todos lados, sin preocuparme si alguien la llega a obtener, y solo me preocupo de guardar bien la clave, que es mas corta y aún mas fácil de memorizar y de guardar. (Es importante escoger una buena clave, mas q todo q sea larga, o te le pueden hacer bruteforce) -La necesidad de guardar bien esa clave es la desventaja que tienen las wallet descentralizadas vs las centralizadas/custodeadas, es muy facil cagarla, desde dejar muy a la vista la clave secreta, o por guardarla muy bien se te pierde. O como tengos todos mis ahorros y gran parte de mi familia me toca tambien pensar en tener backups que mi familia pueda recuperar si me llego a morir de coñazo. +La necesidad de guardar bien esa clave es la desventaja que tienen las wallet descentralizadas vs las centralizadas/custodeadas, es muy facil cagarla, desde dejar muy a la vista la clave secreta a guardarla tan bien que se te pierde. O tambien si tienes muchos ahorros, tambien tienes que pensar en tener backups que tu familia pueda recuperar si te llega a pasar algo. # lightning From bd915436e5b53078731803fc19be7e65149e4696 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Wed, 15 Jul 2020 17:37:44 -0500 Subject: [PATCH 61/87] Fix linting, and added a main Header with the title --- Bitcoin Explicacion.es.md | 20 +++-- DB_MYSQL_TRANSACTIONS.es.md | 6 +- Ssh server as a Tor hidden service.es.md | 23 +++--- Ssh server as a Tor hidden service.md | 21 +++--- bash-zsh_TerminalShorcuts.md | 93 +++++++++++++----------- install youtube-dl in android.md | 30 ++++---- ubuntu 18 fresh install.md | 41 +++++++---- 7 files changed, 129 insertions(+), 105 deletions(-) diff --git a/Bitcoin Explicacion.es.md b/Bitcoin Explicacion.es.md index 7ad7e21..326d38f 100644 --- a/Bitcoin Explicacion.es.md +++ b/Bitcoin Explicacion.es.md @@ -1,4 +1,6 @@ -# Como funcionan los fees +# Bitcoin + +## Como funcionan los fees Cada ~10m (varia mucho, muchas veces hasta se tarda mas de 30m) se genera un bloque que como máximo puede pesar hasta 1Mb de informacion. @@ -6,41 +8,43 @@ La transaccion mas común y simple es de 2 entradas y 2 salidas, y esa pesa mas Lo mineros son los encargados de decidir cuales transacciones entran o no en un bloque, y por lo general, ellos le dan prioridad a las que tengan mejor fee (la que tenga la mayor densidad de BTC, osea la mayor **BTC/vbyte**) -En esta pagina https://bitcoinfees.earn.com puedes ver estimaciones de los fees actuales. Ahorita están absurdamente bajos, osea una transaccion normal te puede estar costando menos de 300 satoshis(0.025$) menos de 2,5 centavos de dolar. Con una wallet en la que tu tengas el control, tú decides cuantos fees vas a pagar. Si no pagas comision, corres el riesgo de que ni uno de los mineros meta tu transaccion en la blockchain y nunca se confirme. En la práctica los fees dependen principalmente de 2 cosas: +En esta pagina puedes ver estimaciones de los fees actuales. Ahorita están absurdamente bajos, osea una transaccion normal te puede estar costando menos de 300 satoshis(0.02# Bitcoin5$) menos de 2,5 centavos de dolar. Con una wallet en la que tu tengas el control, tú decides cuantos fees vas a pagar. Si no pagas comision, corres el riesgo de que ni uno de los mineros meta tu transaccion en la blockchain y nunca se confirme. En la práctica los fees dependen principalmente de 2 cosas: + - Congestión de la red, cuantas transacciones tienes haciendote competencia en el valor del fee (BTC/vbyte) - Cuanto estás dispuesto a esperar Fijate en la página, cada fila es un rango de fee/byte medido en **satoshis/byte**, el tamaño de la barra indica cuantas transacciones hay/habido en ese rango, y a la derecha, al final, hay una estimacion de minutos de espera (En la práctica varía) El peso de una transaccion no solo depende de la cantidad de entradas y salidas, tambien depende del tipo de direcciones de las salidas (y quizas tambien de las entradas, not sure). Y existen 3 tipos de direcciones: + - 1... (clásica) - 3... (Segwit envuelto en un script, para hacerlo compatible con la clásica) - bc1... (Segwit nativo) -El primero es el mas ineficiente (el que pesa mas en una transaccion), y el último es el mas eficiente. +El primero es el mas ineficiente (el que pesa mas en una transaccion), # Bitcoiny el último es el mas eficiente. Ya todos los servicios se han adaptado al mas eficiente, asi que asegurate de que la wallet que uses tenga direcciones que empiecen por **bc1...** - -# Wallets centralizadas vs descentralizadas +## Wallets centralizadas vs descentralizadas Las wallet descentralizadas modernas al momento de creacion generan un número aleatorio, que es básicamente el alma de tu wallet, de hecho, ese número **es** tu wallet, y quien lo tenga puede gastar tus BTC. Ese número te lo muestran en el formato **seed/semilla**, que es una lista de 12-24 palabras, es simplemente una forma mas presentable de mostrar el numero, ya que es mas facil de memorizar, y de transcribir. Y muchas wallet van un paso mas allá e implementan el estandar **BIP39**, para encriptar esa **seed** con un **password** que tú escojas, y en estos casos para recuperar tu wallet vas a necesitar tanto la seed, como el password. Esta opcion es la que uso yo, porque entonces yo guardo tranquilamente mi **seed** en todos lados, sin preocuparme si alguien la llega a obtener, y solo me preocupo de guardar bien la clave, que es mas corta y aún mas fácil de memorizar y de guardar. (Es importante escoger una buena clave, mas q todo q sea larga, o te le pueden hacer bruteforce) La necesidad de guardar bien esa clave es la desventaja que tienen las wallet descentralizadas vs las centralizadas/custodeadas, es muy facil cagarla, desde dejar muy a la vista la clave secreta a guardarla tan bien que se te pierde. O tambien si tienes muchos ahorros, tambien tienes que pensar en tener backups que tu familia pueda recuperar si te llega a pasar algo. - -# lightning +## lightning Está construido encima de Bitcoin. Y está basado en una especie de contrato entre 2 partes, y cada parte puede decidir meter X cantidad de BTC para usarlos dentro de ese canal, y mientras ese canal está abierto ambas partes pueden tranzar sin comision alguna, porque no son transacciones que se guardan en la blockchain, son transacciones totalmente privadas. Y aquí es donde entra lightning como tal, porque bajo ciertas condiciones, se pueden conectar los canales entre sí para así poder transferirle a entidades con las que no tengas canales abierto directamente. Ventajas: + - Transacciones son casi instantáneas. - Fees son aún mas bajos. Gratis si con quien abriste el canal de lightning es el mismo a quien le vas a pagar. Desventajas: + - No es suficiente con guardar la **seed** y **password**, tu aplicacion tambien necesita guardar cada cambio que se haga en tus canales abiertos. (La única aplicacion que probé creo que tenia para configurar Google Drive para guardar todos esos cambios). - Tu aplicacion tiene que estar pendiente de la red cada cierto tiempo (dependiendo de cuando tiempo se le configuró al canal, por lo general varios días) - Capacidad limitada de cantidad de Bitcoins que puedes enviar, depende de la capacidad de los canales de la ruta que atraviesa la transacción. -Lightning sigue en desarrollo activo, y algunas de las desventajas son mejorables sacrificando decentralizacion, como hace Phoenix Wallet, que me parece un muy buen tradeoff para noobs. \ No newline at end of file +Lightning sigue en desarrollo activo, y algunas de las desventajas son mejorables sacrificando decentralizacion, como hace Phoenix Wallet, que me parece un muy buen tradeoff para noobs. diff --git a/DB_MYSQL_TRANSACTIONS.es.md b/DB_MYSQL_TRANSACTIONS.es.md index 2ac6e1a..6f45a0c 100644 --- a/DB_MYSQL_TRANSACTIONS.es.md +++ b/DB_MYSQL_TRANSACTIONS.es.md @@ -38,7 +38,7 @@ END Al ejecutar ese procedimiento almacenado, se abre una transacción, se ejecuta la **Consulta 1**, y al intentar la **Consulta 2** falla. -Hay un problema aquí, la transacción no se deshace, sino que queda abierta, osea, tiene cambios hechos de la **Consulta 1**, pero no se han hecho permanentes en la BD (`COMMIT`), ni tampoco se han devuelto los cambios (`ROLLBACK`). Y puede ocurrir cualquiera de los dos escenarios. Por ejemplo si se cierra la conexión, la BD ejecuta un `ROLLBACK` y si se ejecuta cualquiera de estas consultas https://dev.mysql.com/doc/refman/8.0/en/implicit-commit.html se genera un `COMMIT` implicitamente. +Hay un problema aquí, la transacción no se deshace, sino que queda abierta, osea, tiene cambios hechos de la **Consulta 1**, pero no se han hecho permanentes en la BD (`COMMIT`), ni tampoco se han devuelto los cambios (`ROLLBACK`). Y puede ocurrir cualquiera de los dos escenarios. Por ejemplo si se cierra la conexión, la BD ejecuta un `ROLLBACK` y si se ejecuta cualquiera de estas consultas se genera un `COMMIT` implicitamente. Si en este estado de la BD se hace un `SELECT` para verificar si en la BD se hicieron los cambios de la **Consulta 1**, se va a obtener distintas respuestas dependiendo de si el `SELECT` se ejecuta desde la misma conexión/sesión o no. @@ -77,10 +77,10 @@ Esto sirve para que cualquier otra consulta que quiera leer o modificar los elem Los `SELECT` normales no generan ningun bloqueo, para eso existen el `SELECT ... FOR SHARE` y el `SELECT ... FOR UPDATE`. -En términos simples el **FOR SHARE** bloquea los elementos seleccionados para que otra consulta no pueda escribir sobre ellos hasta que se cierre la transacción, y el **FOR UPDATE** adicionalmente impide que tampoco puedan leerlos (igual que los `INSERT`, `UPDATE` o `DELETE`). Mas información https://dev.mysql.com/doc/refman/8.0/en/innodb-locking-reads.html +En términos simples el **FOR SHARE** bloquea los elementos seleccionados para que otra consulta no pueda escribir sobre ellos hasta que se cierre la transacción, y el **FOR UPDATE** adicionalmente impide que tampoco puedan leerlos (igual que los `INSERT`, `UPDATE` o `DELETE`). Mas información ### Recomendaciones Hay que analizar detalladamente todo lo que se mete dentro de una transacción, y reducirlo a lo mas mínimo posible, para evitar [Deadlocks](https://dev.mysql.com/doc/refman/5.7/en/innodb-deadlocks.html) o retrasos debido a bloqueos innecesarios. -Usar índices en todos los `WHERE` de las consultas que bloquean, para que dichos bloqueos sean lo mas óptimos posibles, y se bloquee solo lo que hace falta bloquear. \ No newline at end of file +Usar índices en todos los `WHERE` de las consultas que bloquean, para que dichos bloqueos sean lo mas óptimos posibles, y se bloquee solo lo que hace falta bloquear. diff --git a/Ssh server as a Tor hidden service.es.md b/Ssh server as a Tor hidden service.es.md index 917e525..19ba324 100644 --- a/Ssh server as a Tor hidden service.es.md +++ b/Ssh server as a Tor hidden service.es.md @@ -1,18 +1,19 @@ -*copiado sin verguenza alguna de https://www.techrepublic.com/article/how-to-run-an-ssh-connection-through-tor/* +# Configurar a un servicio onion + +*copiado sin verguenza alguna de * --- -# Instalar Tor +## Instalar Tor Instalar Tor en el cliente y en el servidor: sudo apt-get install tor -y -# Configurar Tor +## Configurar Tor 1. En el servidor vamos a editar el archivo de configuración de tor `/etc/tor/torrc`: - sudo nano /etc/tor/torrc 2. Al final del archivo vamos a agregar esto: @@ -26,7 +27,7 @@ Instalar Tor en el cliente y en el servidor: sudo systemctl restart tor -# Obtener la direccion .onion +## Obtener la direccion .onion Estará en el archivo `hostname` en la carpeta configurada anteriormente `/var/lib/tor/ssh/` @@ -34,18 +35,15 @@ Estará en el archivo `hostname` en la carpeta configurada anteriormente `/var/l Deberia arrojarte algo así: `riludi2kstjwmlzn.onion` -# Conectarse al servidor ssh con la direccion .onion - -```bash -torify ssh ... # reemplazar el dominio/ip por la direccion .onion` -``` +## Conectarse al servidor ssh con la direccion .onion + torify ssh ... # reemplazar el dominio/ip por la direccion .onion` Por ejemplo: torify ssh jack@riludi2kstjwmlzn.onion -## Opcional +### Opcional Para no tener que recordar la direccion **.onion** puedes configurar los parámetros de conexión en el archivo `~/.ssh/config` @@ -58,7 +56,6 @@ Ingresar configuracion: HostName riludi2kstjwmlzn.onion Port 22 - Ahora puedes conectarte así: - torify ssh serverTor \ No newline at end of file + torify ssh serverTor diff --git a/Ssh server as a Tor hidden service.md b/Ssh server as a Tor hidden service.md index 36ece03..d97974f 100644 --- a/Ssh server as a Tor hidden service.md +++ b/Ssh server as a Tor hidden service.md @@ -1,14 +1,16 @@ -*Shamelessly copied from https://www.techrepublic.com/article/how-to-run-an-ssh-connection-through-tor/* +# Configure an onion service + +*Shamelessly copied from * --- -# Install Tor +## Install Tor Install Tor on both client and server: sudo apt-get install tor -y -# Configure Tor +## Configure Tor 1. In the server let's edit tor's config file `/etc/tor/torrc`: @@ -25,7 +27,7 @@ Install Tor on both client and server: sudo systemctl restart tor -# Get .onion address +## Get .onion address It will be in the file `hostname` in the previously configured folder `/var/lib/tor/ssh` @@ -33,17 +35,15 @@ It will be in the file `hostname` in the previously configured folder `/var/lib/ You should get something like `riludi2kstjwmlzn.onion` -# Connect to the Tor hidden ssh server +## Connect to the Tor hidden ssh server -```bash -torify ssh ... # replace the domain/ip with the .onion address -``` + torify ssh ... # replace the domain/ip with the .onion address For example: torify ssh jack@riludi2kstjwmlzn.onion -## Optional +### Optional You don't need to remember the **.onion** address, you can write an entry to your user's ssh config file `~/.ssh/config`: @@ -56,7 +56,6 @@ Set configuration: HostName riludi2kstjwmlzn.onion Port 22 - Now you can simply connect with: - torify ssh serverTor \ No newline at end of file + torify ssh serverTor diff --git a/bash-zsh_TerminalShorcuts.md b/bash-zsh_TerminalShorcuts.md index 125aa3a..f017b42 100644 --- a/bash-zsh_TerminalShorcuts.md +++ b/bash-zsh_TerminalShorcuts.md @@ -1,57 +1,66 @@ -# Shortcuts +# Terminal Shortcuts -*For Ubuntu's default keybinding settings (i.e Emacs keybindings)* +## Default shortcuts -## Insert previous arguments - - Alt+.: insert last argument from last command. - - Alt+number+.: insert #nth last argument from last command. - - Alt+- , number , Alt+., **zsh:** Alt+-+number+.: insert #nth first argument from last command. +For Ubuntu's default keybinding settings (i.e Emacs keybindings) -*In Linux you can repeat commands to go back in history* +### Insert previous arguments -### Example: +- Alt+.: insert last argument from last command. +- Alt+number+.: insert #nth last argument from last command. +- Alt+- , number , Alt+., **zsh:** Alt+-+number+.: insert #nth first argument from last command. + +In Linux you can repeat commands to go back in history + +#### Example Last command is: mv foo bar - - Alt+0+.: insert first argument of last command = `mv` - - Alt+2+.: insert last 2nd argument of last command = `foo` - - up , Ctrl+w: last command without the last word = `mv foo` +- Alt+0+.: insert first argument of last command = `mv` +- Alt+2+.: insert last 2nd argument of last command = `foo` +- up , Ctrl+w: last command without the last word = `mv foo` +### Cut/Paste commands -## Cut/Paste commands -*(relative to cursor's position)* - - Ctrl+w: cuts last word - - Alt+d: cuts next word - - Ctrl+k: cuts everything after - - Ctrl+u, **zsh:** Alt+w: cuts everything before - - **zsh:** Ctrl+u: cuts the entire command *(In bash you can combine Ctrl+u , Ctrl+k)* - - Ctrl+y: paste characters previously cut with any **Cut command**. *In bash you can chain **cut commands**, and Ctrl+y will paste them all.* +(relative to cursor's position) +- Ctrl+w: cuts last word +- Alt+d: cuts next word +- Ctrl+k: cuts everything after +- Ctrl+u, **zsh:** Alt+w: cuts everything before +- **zsh:** Ctrl+u: cuts the entire command *(In bash you can combine Ctrl+u , Ctrl+k)* +- Ctrl+y: paste characters previously cut with any **Cut command**. *In bash you can chain **cut commands**, and Ctrl+y will paste them all.* -## Move cursor - - Ctrl+left: move to last word - - Ctrl+right: move to next word - - home or Ctrl+a: move to start of command - - end or Ctrl+e: move to end of command +### Move cursor +- Ctrl+left: move to last word +- Ctrl+right: move to next word +- home or Ctrl+a: move to start of command +- end or Ctrl+e: move to end of command -## Other - - Ctrl+_: undo last edit *(very useful when exceeding Ctrl+w)* +### Other -## To see all shortcuts available - - **bash:** `bind -lp` - - **zsh:** `bindkey -L` +- Ctrl+_: undo last edit *(very useful when exceeding Ctrl+w)* -# Custom shortcuts -## Iterate through arguments -*only works in zsh, and probably only Linux* +### To see all shortcuts available + +- **bash:** `bind -lp` +- **zsh:** `bindkey -L` + +## Custom shortcuts + +### Iterate through arguments + +only works in zsh, and probably only Linux + +#### Description -### Description Insert any argument of a previous command by iterating one by one until selection -### Setup Instructions +#### Setup Instructions + run this: autoload -Uz copy-earlier-word @@ -62,7 +71,8 @@ run this: Now use Alt+. to go as back as you want, then use Alt+: to iterate through the arguments -### Example: +#### Example + Last command is echo 1 2 3 4 5 @@ -74,12 +84,12 @@ Last command is - Alt+.+:+:+:+:: `1` - Alt+.+:+:+:+:+:: `echo` -source: https://stackoverflow.com/a/34861762/3163120 +source: +## Other examples -# Other examples +### Common usecases -## Common usecases Let's consider the last command to be: mv foo bar @@ -88,7 +98,8 @@ Let's consider the last command to be: Alt+0+.: first argument of last command = `mv` -# Limitations +## Limitations + "words" only includes `a-zA-Z` characters, so any symbol character will stop word-shortcuts. So if last argument was a url and you want to erase it with Ctrl+w it will be a pain. @@ -97,8 +108,6 @@ E.g: `curl -I --header "Connection: Keep-Alive" https://stackoverflow.com/questi To erase that **url** using Ctrl+w, you'd have to repeat it 12 times. - --- - -It would be great to have similar shortcuts that only stops at the **space character** \ No newline at end of file +It would be great to have similar shortcuts that only stops at the **space character** diff --git a/install youtube-dl in android.md b/install youtube-dl in android.md index a46ef05..bdc6fa7 100644 --- a/install youtube-dl in android.md +++ b/install youtube-dl in android.md @@ -1,17 +1,18 @@ [//]: # "Ctrl+K,V o Ctrl+Shift+V - Para ver vista previa en VSCode" -Tutorial to install [youtube-dl](https://github.com/ytdl-org/youtube-dl/) in android via [termux](https://termux.com/), and configure it to download links shared from another app. +# Tutorial to install [youtube-dl](https://github.com/ytdl-org/youtube-dl/) in android -*Based on https://www.reddit.com/r/Piracy/comments/baufql/youtubedl_the_easy_way_on_android/* +Based on -# Usage +## Usage Click **Share**, select **Termux**, choose video or audio, and that's it!, it will be saved to `Downloads/{Provider}/` e.g `Downloads/Youtube/` -# Install Termux -https://termux.com/ +## Install Termux -# Open Termux and run one of these: + + +## Open Termux and run one of these 1. [Youtube-dl + sharing + dialog **(Recommended)**](#youtube-dl--sharing--dialog-recommended) 2. [Youtube-dl + sharing](#youtube-dl--sharing) @@ -19,7 +20,7 @@ https://termux.com/ 4. [Termux extras](#termux-extras) 5. [All-In-One](#all-in-one) -## Youtube-dl + sharing + dialog **(Recommended)** +### Youtube-dl + sharing + dialog **(Recommended)** ```bash # Ask for storage permission @@ -60,13 +61,13 @@ https://termux.com/ - A prompt to enable storage will appear, press y then Enter - That's all!, just wait for it to finish upgrading/installing -### Usage: +#### Usage Share an URL to termux, a dialog will ask you to choose if download **video** or just **audio** -## Youtube-dl + sharing +### Youtube-dl + sharing -### Usage: +#### Usage Share URL to termux, this will automatically download the video. @@ -89,7 +90,7 @@ But if you always want to download just audio, replace `youtube-dl $url` with `y chmod +x ~/bin/termux-url-opener ``` -## Youtube-dl +### Youtube-dl This will only install youtube-dl in termux, sharing a URL to Termux will not work, you'll need to run the command manually from the terminal, e.g `youtube-dl https://youtu.be/blahblahblah` @@ -100,8 +101,7 @@ This will only install youtube-dl in termux, sharing a URL to Termux will not wo apt update && apt upgrade -y && apt install -y python ffmpeg && pip install youtube-dl ``` - -## Termux extras +### Termux extras ```bash # Add special keys to keyboard @@ -115,7 +115,7 @@ This will only install youtube-dl in termux, sharing a URL to Termux will not wo apt install -y nano ``` -## All-In-One +### All-In-One Youtube-dl + sharing + dialog + Termux extras @@ -153,4 +153,4 @@ Youtube-dl + sharing + dialog + Termux extras ['ESC', '/', '|', 'HOME', 'UP', 'END', 'PGUP', '-'], \ ['TAB','CTRL', 'ALT', 'LEFT', 'DOWN', 'RIGHT', 'PGDN', '~'] \ ]" > ~/.termux/termux.properties -``` \ No newline at end of file +``` diff --git a/ubuntu 18 fresh install.md b/ubuntu 18 fresh install.md index 3b24824..8c7b63d 100644 --- a/ubuntu 18 fresh install.md +++ b/ubuntu 18 fresh install.md @@ -1,9 +1,13 @@ +# Ubuntu install guide + ## Update & Upgrade + ```bash sudo apt update && sudo apt upgrade -y ``` ## Install Packages + ```bash sudo apt-get install python3-pip zsh curl wget git sudo apt-get install p7zip-full smplayer cmus speedtest-cli git-gui filezilla pavucontrol ufw servefile nmap fail2ban gimp most colordiff mosh dconf-editor ncdu qcalc jq tor fonts-noto & @@ -14,31 +18,38 @@ pip3 install youtube-dl tldr ## External Repositories ### Antimicro + ```bash sudo add-apt-repository ppa:mdeguzis/libregeek ``` -As of today, a bionic package is still not available, but the artful works!. https://github.com/AntiMicro/antimicro/issues + +As of today, a bionic package is still not available, but the artful works!. `sudo nano /etc/apt/sources.list.d/mdeguzis-ubuntu-libregeek-bionic.list` Replace `bionic` with `artful` + ```bash sudo apt update sudo apt install antimicro ``` -Put config file https://gist.github.com/madacol/19f8c71ba98f484a4294ccfe90e88e6e in `~/.config/antimicro` + +Put config file in `~/.config/antimicro` ### SinkSwitcher -https://github.com/madacol/sinkSwitcher + ## Web installs -- docker: https://download.docker.com -- VSCode: https://code.visualstudio.com/ -- chrome: https://www.chrome.com/ -- syncthing: https://apt.syncthing.net/ -- Zsh-syntax-highlighting: https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/INSTALL.md + +- docker: +- VSCode: +- chrome: +- syncthing: +- Zsh-syntax-highlighting: ## Edit ~/.zshrc + ### Add shortcut "Alt+:" [to iterate through arguments](https://stackoverflow.com/questions/4009412/how-to-use-arguments-from-previous-command/55069846#55069846) + ```bash autoload -Uz copy-earlier-word zle -N copy-earlier-word @@ -46,19 +57,23 @@ bindkey "^[:" copy-earlier-word ``` ### Enable most + ```bash export PAGER=most ``` ## Gnome extensions + - Caffeine -- Dash to dock https://extensions.gnome.org/extension/307/dash-to-dock/ `sudo apt remove gnome-shell-extension-ubuntu-dock` https://github.com/micheleg/dash-to-dock/issues/643 -- suspend button NetSpeed https://extensions.gnome.org/extension/104/netspeed/ -- NetSpeed https://extensions.gnome.org/extension/104/netspeed/ +- Dash to dock `sudo apt remove gnome-shell-extension-ubuntu-dock` +- suspend button NetSpeed +- NetSpeed ## Custom shortcuts + - `systemctl suspend` -- Cmus https://medium.com/@madacol/configure-cmus-music-player-on-the-terminal-in-ubuntu-3c513d2d2cd0 +- Cmus ## StartUp -- Cmus `gnome-terminal -- cmus` \ No newline at end of file + +- Cmus `gnome-terminal -- cmus` From 9ab93dd41d459d0e2ae482ce6157b21d4c879ff1 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Wed, 15 Jul 2020 17:38:17 -0500 Subject: [PATCH 62/87] Onion Service: Added link to official documentation --- Ssh server as a Tor hidden service.es.md | 4 ++++ Ssh server as a Tor hidden service.md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Ssh server as a Tor hidden service.es.md b/Ssh server as a Tor hidden service.es.md index 19ba324..d1fb14f 100644 --- a/Ssh server as a Tor hidden service.es.md +++ b/Ssh server as a Tor hidden service.es.md @@ -59,3 +59,7 @@ Ingresar configuracion: Ahora puedes conectarte así: torify ssh serverTor + +## Mas informacion + + diff --git a/Ssh server as a Tor hidden service.md b/Ssh server as a Tor hidden service.md index d97974f..2e3d2ac 100644 --- a/Ssh server as a Tor hidden service.md +++ b/Ssh server as a Tor hidden service.md @@ -59,3 +59,7 @@ Set configuration: Now you can simply connect with: torify ssh serverTor + +## More info + + From aaf85ce97fb75eb700b98665f7225ca50c4e5a82 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Wed, 15 Jul 2020 17:39:07 -0500 Subject: [PATCH 63/87] Renamed files `Tor hidden service` to `Tor onion service` --- ...idden service.es.md => Ssh server as a Tor onion service.es.md | 0 ... Tor hidden service.md => Ssh server as a Tor onion service.md | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename Ssh server as a Tor hidden service.es.md => Ssh server as a Tor onion service.es.md (100%) rename Ssh server as a Tor hidden service.md => Ssh server as a Tor onion service.md (100%) diff --git a/Ssh server as a Tor hidden service.es.md b/Ssh server as a Tor onion service.es.md similarity index 100% rename from Ssh server as a Tor hidden service.es.md rename to Ssh server as a Tor onion service.es.md diff --git a/Ssh server as a Tor hidden service.md b/Ssh server as a Tor onion service.md similarity index 100% rename from Ssh server as a Tor hidden service.md rename to Ssh server as a Tor onion service.md From 46f0cfc1b42be6fcff546a216f24a2f28e5e1467 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Wed, 15 Jul 2020 18:13:19 -0500 Subject: [PATCH 64/87] Added linting --- .markdownlint.json | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .markdownlint.json diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 0000000..7179949 --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,5 @@ +{ + "MD024": false, + "MD013": false, + "MD033": false +} \ No newline at end of file From 050c1bf97e853a89d207a14f3f030fcd4e900dac Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Thu, 17 Sep 2020 15:55:29 -0500 Subject: [PATCH 65/87] ubuntu: gnome extensions: added caffeine link, removed suspend --- ubuntu 18 fresh install.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ubuntu 18 fresh install.md b/ubuntu 18 fresh install.md index 8c7b63d..b0292c1 100644 --- a/ubuntu 18 fresh install.md +++ b/ubuntu 18 fresh install.md @@ -64,9 +64,8 @@ export PAGER=most ## Gnome extensions -- Caffeine +- Caffeine - Dash to dock `sudo apt remove gnome-shell-extension-ubuntu-dock` -- suspend button NetSpeed - NetSpeed ## Custom shortcuts From 24011d1e6b9b23710eb9dafb242d4804efd18a62 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Thu, 17 Sep 2020 15:56:10 -0500 Subject: [PATCH 66/87] ubuntu: removed 18 from name, bacause now has instructions for the Ubuntu 20 --- ubuntu 18 fresh install.md => ubuntu fresh install.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ubuntu 18 fresh install.md => ubuntu fresh install.md (100%) diff --git a/ubuntu 18 fresh install.md b/ubuntu fresh install.md similarity index 100% rename from ubuntu 18 fresh install.md rename to ubuntu fresh install.md From 86d3dd4a17b1efdeaa1cec46a606c8d0da3b1090 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Thu, 17 Sep 2020 15:59:02 -0500 Subject: [PATCH 67/87] youtube-dl: Added feedback message after selecting video or audio Previously there was no feedback at all after choosing an option. Didn't even know if it was pressed correctly --- install youtube-dl in android.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install youtube-dl in android.md b/install youtube-dl in android.md index bdc6fa7..95dd914 100644 --- a/install youtube-dl in android.md +++ b/install youtube-dl in android.md @@ -48,9 +48,11 @@ Click **Share**, select **Termux**, choose video or audio, and that's it!, it wi case $CHOICE in Video) + echo "Downloading video from $URL" youtube-dl $URL ;; Audio) + echo "Downloading audio from $URL" youtube-dl -x $URL ;; esac' > ~/bin/termux-url-opener && From a400ee4d1032fc541af204b1bb87c694469c2acb Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Thu, 17 Sep 2020 16:23:07 -0500 Subject: [PATCH 68/87] ubuntu: add aliases --- ubuntu fresh install.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ubuntu fresh install.md b/ubuntu fresh install.md index b0292c1..0e24158 100644 --- a/ubuntu fresh install.md +++ b/ubuntu fresh install.md @@ -56,6 +56,16 @@ zle -N copy-earlier-word bindkey "^[:" copy-earlier-word ``` +### Aliases + +```bash +alias lr="ls -hartl" +alias youtube-dl720='youtube-dl -f "bestvideo[height<=720]+bestaudio/best[height<=720]"' +alias python=python3 +alias ipython=ipython3 +function mkcd () { mkdir -p "$@" && cd "$@"; } +``` + ### Enable most ```bash From 1b200a55ae949a6a539ebb95a170928fcf5d1090 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Thu, 17 Sep 2020 16:28:39 -0500 Subject: [PATCH 69/87] ubuntu: added Zsh plugins --- ubuntu fresh install.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ubuntu fresh install.md b/ubuntu fresh install.md index 0e24158..70bbda8 100644 --- a/ubuntu fresh install.md +++ b/ubuntu fresh install.md @@ -72,6 +72,14 @@ function mkcd () { mkdir -p "$@" && cd "$@"; } export PAGER=most ``` +### Enable zsh plugins + +```bash +plugins=(git zsh-syntax-highlighting) +plugins=(autoswitch_virtualenv $plugins) +``` +**Note:** Probably need to install them first + ## Gnome extensions - Caffeine From 4ca6e324ec593bac14d71e1dafd0daf32f04ab81 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Tue, 29 Sep 2020 23:05:59 -0500 Subject: [PATCH 70/87] Bitcoin: fix typo --- Bitcoin Explicacion.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bitcoin Explicacion.es.md b/Bitcoin Explicacion.es.md index 326d38f..0c4eda4 100644 --- a/Bitcoin Explicacion.es.md +++ b/Bitcoin Explicacion.es.md @@ -21,7 +21,7 @@ El peso de una transaccion no solo depende de la cantidad de entradas y salidas, - 3... (Segwit envuelto en un script, para hacerlo compatible con la clásica) - bc1... (Segwit nativo) -El primero es el mas ineficiente (el que pesa mas en una transaccion), # Bitcoiny el último es el mas eficiente. +El primero es el mas ineficiente (el que pesa mas en una transaccion), y el último es el mas eficiente. Ya todos los servicios se han adaptado al mas eficiente, asi que asegurate de que la wallet que uses tenga direcciones que empiecen por **bc1...** ## Wallets centralizadas vs descentralizadas From 9e4e734fb52ac78afe09e92efe7a038cb96f095f Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Mon, 5 Oct 2020 16:43:24 -0500 Subject: [PATCH 71/87] Dash-to-Dock: not needed anymore in Ubuntu 20 --- ubuntu fresh install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ubuntu fresh install.md b/ubuntu fresh install.md index 70bbda8..dbd4ad8 100644 --- a/ubuntu fresh install.md +++ b/ubuntu fresh install.md @@ -83,7 +83,7 @@ plugins=(autoswitch_virtualenv $plugins) ## Gnome extensions - Caffeine -- Dash to dock `sudo apt remove gnome-shell-extension-ubuntu-dock` +- ~~Dash to dock `sudo apt remove gnome-shell-extension-ubuntu-dock` ~~ - NetSpeed ## Custom shortcuts From 391ca9ceb2a886dfd524b0fdeb112d588407d6ca Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Mon, 5 Oct 2020 16:43:57 -0500 Subject: [PATCH 72/87] clean: merged commands into one line --- ubuntu fresh install.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ubuntu fresh install.md b/ubuntu fresh install.md index dbd4ad8..130b774 100644 --- a/ubuntu fresh install.md +++ b/ubuntu fresh install.md @@ -75,8 +75,7 @@ export PAGER=most ### Enable zsh plugins ```bash -plugins=(git zsh-syntax-highlighting) -plugins=(autoswitch_virtualenv $plugins) +plugins=(git zsh-syntax-highlighting autoswitch_virtualenv) ``` **Note:** Probably need to install them first From 5a4356122e36dc89080eff909862d3bb1ca9458f Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Mon, 5 Oct 2020 16:44:33 -0500 Subject: [PATCH 73/87] zshrc: new: lazy-load nvm --- ubuntu fresh install.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ubuntu fresh install.md b/ubuntu fresh install.md index 130b774..0b5636e 100644 --- a/ubuntu fresh install.md +++ b/ubuntu fresh install.md @@ -66,6 +66,21 @@ alias ipython=ipython3 function mkcd () { mkdir -p "$@" && cd "$@"; } ``` +### Lazy-load nvm + +```bash +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && . $NVM_DIR/nvm.sh --no-use; # This loads nvm +[ -s "$NVM_DIR/bash_completion" ] && . $NVM_DIR/bash_completion; # This loads nvm bash_completion +__nvm_load_node () { + unalias node npm npx; + nvm use 2> /dev/null || nvm use default; +} +alias node='__nvm_load_node; node $@' +alias npm='__nvm_load_node; npm $@' +alias npx='__nvm_load_node; npx $@' +``` + ### Enable most ```bash From 3207d1970c0ff29528c0e36ac392d4fbcc777d83 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Tue, 6 Oct 2020 18:02:43 -0500 Subject: [PATCH 74/87] ubuntu: Add fish shell configurations --- ubuntu fresh install.md | 59 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 53 insertions(+), 6 deletions(-) diff --git a/ubuntu fresh install.md b/ubuntu fresh install.md index 0b5636e..1cb92ba 100644 --- a/ubuntu fresh install.md +++ b/ubuntu fresh install.md @@ -46,9 +46,56 @@ Put config file - Zsh-syntax-highlighting: -## Edit ~/.zshrc +## Shells -### Add shortcut "Alt+:" [to iterate through arguments](https://stackoverflow.com/questions/4009412/how-to-use-arguments-from-previous-command/55069846#55069846) +### Fish + +#### Functions + +- nvm + +Install bass, then configure these functions + + - **__nvm_load.fish** + ```fish + function __nvm_load + functions -e __nvm_load node npm npx + bass source ~/.nvm/nvm.sh --no-use ';' nvm use 2> /dev/null '||' nvm use default + end + ``` + - **nvm.fish** + ```fish + function nvm + functions -e __nvm_load node npm npx + bass source ~/.nvm/nvm.sh --no-use ';' source ~/.nvm/bash_completion ';' nvm $argv + end + ``` + - **npx.fish** + ```fish + function npx + __nvm_load + npx $argv + end + ``` + - **npm.fish** + ```fish + function npm + __nvm_load + npm $argv + end + ``` + - **node.fish** + ```fish + function node + __nvm_load + node $argv + end + ``` + + +### Zsh - Edit ~/.zshrc + +#### Add shortcut "Alt+:" [to iterate through arguments](https://stackoverflow.com/questions/4009412/how-to-use-arguments-from-previous-command/55069846#55069846) ```bash autoload -Uz copy-earlier-word @@ -56,7 +103,7 @@ zle -N copy-earlier-word bindkey "^[:" copy-earlier-word ``` -### Aliases +#### Aliases ```bash alias lr="ls -hartl" @@ -66,7 +113,7 @@ alias ipython=ipython3 function mkcd () { mkdir -p "$@" && cd "$@"; } ``` -### Lazy-load nvm +#### Lazy-load nvm ```bash export NVM_DIR="$HOME/.nvm" @@ -81,13 +128,13 @@ alias npm='__nvm_load_node; npm $@' alias npx='__nvm_load_node; npx $@' ``` -### Enable most +#### Enable most ```bash export PAGER=most ``` -### Enable zsh plugins +#### Enable zsh plugins ```bash plugins=(git zsh-syntax-highlighting autoswitch_virtualenv) From 4b1636800cc8360072132139374a04a6ef9e70f8 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Fri, 16 Oct 2020 14:38:04 -0500 Subject: [PATCH 75/87] youtube-dl: Translate dialog question from spanish to english --- install youtube-dl in android.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install youtube-dl in android.md b/install youtube-dl in android.md index 95dd914..4e8966e 100644 --- a/install youtube-dl in android.md +++ b/install youtube-dl in android.md @@ -40,7 +40,7 @@ Click **Share**, select **Termux**, choose video or audio, and that's it!, it wi CHOICE_HEIGHT=4 CHOICE=$(dialog \ - --menu "Que desea descargar?" \ + --menu "What would you like to download?" \ $HEIGHT $WIDTH $CHOICE_HEIGHT \ Video "" \ Audio "" \ From 13b7934a18bda07edd3d52ffd3082809b6e0fce5 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Thu, 5 Nov 2020 16:26:46 -0500 Subject: [PATCH 76/87] ubuntu: install package filemanager-action for nautilus --- ubuntu fresh install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ubuntu fresh install.md b/ubuntu fresh install.md index 1cb92ba..aeca1e6 100644 --- a/ubuntu fresh install.md +++ b/ubuntu fresh install.md @@ -10,7 +10,7 @@ sudo apt update && sudo apt upgrade -y ```bash sudo apt-get install python3-pip zsh curl wget git -sudo apt-get install p7zip-full smplayer cmus speedtest-cli git-gui filezilla pavucontrol ufw servefile nmap fail2ban gimp most colordiff mosh dconf-editor ncdu qcalc jq tor fonts-noto & +sudo apt-get install p7zip-full smplayer cmus speedtest-cli git-gui filezilla pavucontrol ufw servefile nmap fail2ban gimp most colordiff mosh dconf-editor ncdu qcalc jq tor fonts-noto nautilus-actions filemanager-actions & pip3 install youtube-dl tldr ``` From a050f574a9db1add79ee9b88d4f63f7db13650b1 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Thu, 5 Nov 2020 16:27:21 -0500 Subject: [PATCH 77/87] youtube-dl: disable automatic TOC generation of a vscode extension --- install youtube-dl in android.md | 1 + 1 file changed, 1 insertion(+) diff --git a/install youtube-dl in android.md b/install youtube-dl in android.md index 4e8966e..39c8d2a 100644 --- a/install youtube-dl in android.md +++ b/install youtube-dl in android.md @@ -14,6 +14,7 @@ Click **Share**, select **Termux**, choose video or audio, and that's it!, it wi ## Open Termux and run one of these + 1. [Youtube-dl + sharing + dialog **(Recommended)**](#youtube-dl--sharing--dialog-recommended) 2. [Youtube-dl + sharing](#youtube-dl--sharing) 3. [Youtube-dl](#youtube-dl) From b5866e470132d6b0783a053ea5761536d384da37 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Wed, 16 Dec 2020 19:16:51 -0500 Subject: [PATCH 78/87] Update 2020 --- ubuntu fresh install.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ubuntu fresh install.md b/ubuntu fresh install.md index aeca1e6..e77ba16 100644 --- a/ubuntu fresh install.md +++ b/ubuntu fresh install.md @@ -10,7 +10,7 @@ sudo apt update && sudo apt upgrade -y ```bash sudo apt-get install python3-pip zsh curl wget git -sudo apt-get install p7zip-full smplayer cmus speedtest-cli git-gui filezilla pavucontrol ufw servefile nmap fail2ban gimp most colordiff mosh dconf-editor ncdu qcalc jq tor fonts-noto nautilus-actions filemanager-actions & +sudo apt-get install p7zip-full smplayer cmus speedtest-cli git-gui filezilla pavucontrol paprefs ufw servefile nmap fail2ban gimp most colordiff mosh dconf-editor ncdu qcalc jq tor fonts-noto nautilus-actions filemanager-actions thunderbird chrome-gnome-shell gnome-tweaks & pip3 install youtube-dl tldr ``` @@ -95,6 +95,12 @@ Install bass, then configure these functions ### Zsh - Edit ~/.zshrc +#### Add `~/.local/bin` to PATH + +```bash +export PATH=$HOME/.local/bin:$PATH +``` + #### Add shortcut "Alt+:" [to iterate through arguments](https://stackoverflow.com/questions/4009412/how-to-use-arguments-from-previous-command/55069846#55069846) ```bash @@ -137,7 +143,7 @@ export PAGER=most #### Enable zsh plugins ```bash -plugins=(git zsh-syntax-highlighting autoswitch_virtualenv) +plugins=(git zsh-syntax-highlighting zsh-autosuggestions) ``` **Note:** Probably need to install them first From 3c38a5f3de2729c7ed95e93ed9e206068cfb8e10 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Thu, 17 Dec 2020 01:13:14 -0500 Subject: [PATCH 79/87] Removed the need of temporal gnome extension `Dash to Dock` --- ubuntu fresh install.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ubuntu fresh install.md b/ubuntu fresh install.md index e77ba16..f0dd44f 100644 --- a/ubuntu fresh install.md +++ b/ubuntu fresh install.md @@ -150,9 +150,12 @@ plugins=(git zsh-syntax-highlighting zsh-autosuggestions) ## Gnome extensions - Caffeine -- ~~Dash to dock `sudo apt remove gnome-shell-extension-ubuntu-dock` ~~ - NetSpeed +## Dconf + +- `org.gnome.shell.extensions.dash-to-dock` = **`cycle-windows`** # so scroll-wheel cycle through apps in the launcher + ## Custom shortcuts - `systemctl suspend` From 22a5bf1c9caf26ce25f9bf21ec5405e97985a6a7 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Thu, 17 Dec 2020 10:24:14 -0500 Subject: [PATCH 80/87] ubuntu: obey linting rules --- ubuntu fresh install.md | 69 +++++++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 30 deletions(-) diff --git a/ubuntu fresh install.md b/ubuntu fresh install.md index f0dd44f..6a97041 100644 --- a/ubuntu fresh install.md +++ b/ubuntu fresh install.md @@ -54,44 +54,52 @@ Put config file /dev/null '||' nvm use default end ``` - - **nvm.fish** - ```fish - function nvm - functions -e __nvm_load node npm npx - bass source ~/.nvm/nvm.sh --no-use ';' source ~/.nvm/bash_completion ';' nvm $argv - end - ``` - - **npx.fish** - ```fish - function npx - __nvm_load - npx $argv - end - ``` - - **npm.fish** - ```fish - function npm - __nvm_load - npm $argv - end - ``` - - **node.fish** - ```fish - function node - __nvm_load - node $argv - end - ``` + - **nvm.fish** + + ```fish + function nvm + functions -e __nvm_load node npm npx + bass source ~/.nvm/nvm.sh --no-use ';' source ~/.nvm/bash_completion ';' nvm $argv + end + ``` + + - **npx.fish** + + ```fish + function npx + __nvm_load + npx $argv + end + ``` + + - **npm.fish** + + ```fish + function npm + __nvm_load + npm $argv + end + ``` + + - **node.fish** + + ```fish + function node + __nvm_load + node $argv + end + ``` ### Zsh - Edit ~/.zshrc @@ -145,6 +153,7 @@ export PAGER=most ```bash plugins=(git zsh-syntax-highlighting zsh-autosuggestions) ``` + **Note:** Probably need to install them first ## Gnome extensions From 0a5ccb342003e57dbfd8a1ab48196987248cb10e Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Thu, 17 Dec 2020 23:17:25 -0500 Subject: [PATCH 81/87] ubuntu: More accurate title --- ubuntu fresh install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ubuntu fresh install.md b/ubuntu fresh install.md index 6a97041..9b7e712 100644 --- a/ubuntu fresh install.md +++ b/ubuntu fresh install.md @@ -1,4 +1,4 @@ -# Ubuntu install guide +# Ubuntu fresh setup guide ## Update & Upgrade From 93f4c99c6015103c94b7d251697ef9a6838c1cea Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Sun, 20 Dec 2020 22:19:11 -0500 Subject: [PATCH 82/87] ubuntu: add `smartmontools` --- ubuntu fresh install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ubuntu fresh install.md b/ubuntu fresh install.md index 9b7e712..1555312 100644 --- a/ubuntu fresh install.md +++ b/ubuntu fresh install.md @@ -10,7 +10,7 @@ sudo apt update && sudo apt upgrade -y ```bash sudo apt-get install python3-pip zsh curl wget git -sudo apt-get install p7zip-full smplayer cmus speedtest-cli git-gui filezilla pavucontrol paprefs ufw servefile nmap fail2ban gimp most colordiff mosh dconf-editor ncdu qcalc jq tor fonts-noto nautilus-actions filemanager-actions thunderbird chrome-gnome-shell gnome-tweaks & +sudo apt-get install p7zip-full smplayer cmus speedtest-cli git-gui filezilla pavucontrol paprefs ufw servefile nmap fail2ban gimp most colordiff mosh dconf-editor ncdu qcalc jq tor fonts-noto nautilus-actions filemanager-actions thunderbird chrome-gnome-shell gnome-tweaks smartmontools & pip3 install youtube-dl tldr ``` From 9440d09f78403c69489047e9f7b1dfe2ceb00b0d Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Sun, 20 Dec 2020 22:22:04 -0500 Subject: [PATCH 83/87] ubuntu: fix: nvm lazy-loading script --- ubuntu fresh install.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ubuntu fresh install.md b/ubuntu fresh install.md index 1555312..cb5f2e5 100644 --- a/ubuntu fresh install.md +++ b/ubuntu fresh install.md @@ -131,15 +131,18 @@ function mkcd () { mkdir -p "$@" && cd "$@"; } ```bash export NVM_DIR="$HOME/.nvm" -[ -s "$NVM_DIR/nvm.sh" ] && . $NVM_DIR/nvm.sh --no-use; # This loads nvm -[ -s "$NVM_DIR/bash_completion" ] && . $NVM_DIR/bash_completion; # This loads nvm bash_completion -__nvm_load_node () { +[ -s "$NVM_DIR/nvm.sh" ] && . $NVM_DIR/nvm.sh --no-use; +[ -s "$NVM_DIR/bash_completion" ] && . $NVM_DIR/bash_completion; +function __nvm_load_node () { unalias node npm npx; nvm use 2> /dev/null || nvm use default; + command=$1; + shift 1; + $command $@; } -alias node='__nvm_load_node; node $@' -alias npm='__nvm_load_node; npm $@' -alias npx='__nvm_load_node; npx $@' +alias node='__nvm_load_node node $@' +alias npm='__nvm_load_node npm $@' +alias npx='__nvm_load_node npx $@' ``` #### Enable most From eaa5f11fc404904b56e557f8540b309e05d22e25 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Tue, 22 Dec 2020 20:28:40 -0500 Subject: [PATCH 84/87] Added 2 more configs to dash-to-dock built-in extension --- ubuntu fresh install.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ubuntu fresh install.md b/ubuntu fresh install.md index cb5f2e5..8606447 100644 --- a/ubuntu fresh install.md +++ b/ubuntu fresh install.md @@ -166,7 +166,11 @@ plugins=(git zsh-syntax-highlighting zsh-autosuggestions) ## Dconf -- `org.gnome.shell.extensions.dash-to-dock` = **`cycle-windows`** # so scroll-wheel cycle through apps in the launcher +### Built-in dash-to-dock extension + +- `org.gnome.shell.extensions.dash-to-dock.click-action` = **`cycle-windows`** +- `org.gnome.shell.extensions.dash-to-dock.scroll-action` = **`cycle-windows`** +- `org.gnome.shell.extensions.dash-to-dock.show-windows-preview` = **`false`** ## Custom shortcuts From 7b9bb4171c31931260773d77c7b3cb4c8fc469f7 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Wed, 23 Dec 2020 20:34:41 -0500 Subject: [PATCH 85/87] ubuntu: added gnome extension EasyScreencast --- ubuntu fresh install.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ubuntu fresh install.md b/ubuntu fresh install.md index 8606447..fb2db1b 100644 --- a/ubuntu fresh install.md +++ b/ubuntu fresh install.md @@ -163,6 +163,7 @@ plugins=(git zsh-syntax-highlighting zsh-autosuggestions) - Caffeine - NetSpeed +- EasyScreenCast ## Dconf From 7de1ad8d9fa6e194a5a052608dec36705d250446 Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Fri, 1 Jan 2021 19:15:43 -0500 Subject: [PATCH 86/87] ubuntu: Added qalculate-gtk --- ubuntu fresh install.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ubuntu fresh install.md b/ubuntu fresh install.md index fb2db1b..ad1172a 100644 --- a/ubuntu fresh install.md +++ b/ubuntu fresh install.md @@ -9,8 +9,8 @@ sudo apt update && sudo apt upgrade -y ## Install Packages ```bash -sudo apt-get install python3-pip zsh curl wget git -sudo apt-get install p7zip-full smplayer cmus speedtest-cli git-gui filezilla pavucontrol paprefs ufw servefile nmap fail2ban gimp most colordiff mosh dconf-editor ncdu qcalc jq tor fonts-noto nautilus-actions filemanager-actions thunderbird chrome-gnome-shell gnome-tweaks smartmontools & +sudo apt-get install python3-pip zsh curl wget git dconf-editor +sudo apt-get install p7zip-full smplayer cmus speedtest-cli git-gui filezilla pavucontrol paprefs ufw servefile nmap fail2ban gimp most colordiff mosh ncdu qalculate-gtk jq tor fonts-noto nautilus-actions filemanager-actions thunderbird chrome-gnome-shell gnome-tweaks smartmontools & pip3 install youtube-dl tldr ``` @@ -177,6 +177,7 @@ plugins=(git zsh-syntax-highlighting zsh-autosuggestions) - `systemctl suspend` - Cmus +- `qalculate` ## StartUp From 576a697a907043427cd61d80abbb63b23b71abca Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Sun, 21 Feb 2021 13:14:47 +0100 Subject: [PATCH 87/87] youtube-dl: missing `dialog` installation in the All-in-one script --- install youtube-dl in android.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install youtube-dl in android.md b/install youtube-dl in android.md index 39c8d2a..17aa849 100644 --- a/install youtube-dl in android.md +++ b/install youtube-dl in android.md @@ -124,7 +124,7 @@ Youtube-dl + sharing + dialog + Termux extras ```bash termux-setup-storage && - apt update && apt upgrade -y && apt install -y nano python ffmpeg && pip install youtube-dl && + apt update && apt upgrade -y && apt install -y nano python ffmpeg dialog && pip install youtube-dl && mkdir -p ~/.config/youtube-dl && echo "# Default Output Directory and Pattern -o /data/data/com.termux/files/home/storage/downloads/%(extractor_key)s/%(title).150s-%(id)s.%(ext)s" > ~/.config/youtube-dl/config &&