Warning: this is an htmlized version!
The original is here, and
the conversion rules are here.
#######
#
# E-scripts on termux.
#
# Note 1: use the eev command (defined in eev.el) and the
# ee alias (in my .zshrc) to execute parts of this file.
# Executing this file as a whole makes no sense.
# An introduction to eev can be found here:
#
#   (find-eev-quick-intro)
#   http://anggtwu.net/eev-intros/find-eev-quick-intro.html
#
# Note 2: be VERY careful and make sure you understand what
# you're doing.
#
# Note 3: If you use a shell other than zsh things like |&
# and the for loops may not work.
#
# Note 4: I always run as root.
#
# Note 5: some parts are too old and don't work anymore. Some
# never worked.
#
# Note 6: the definitions for the find-xxxfile commands are on my
# .emacs.
#
# Note 7: if you see a strange command check my .zshrc -- it may
# be defined there as a function or an alias.
#
# Note 8: the sections without dates are always older than the
# sections with dates.
#
# This file is at <http://anggtwu.net/e/termux.e>
#           or at <http://anggtwu.net/e/termux.e.html>.
#        See also <http://anggtwu.net/emacs.html>,
#                 <http://anggtwu.net/.emacs[.html]>,
#                 <http://anggtwu.net/.zshrc[.html]>,
#                 <http://anggtwu.net/escripts.html>,
#             and <http://anggtwu.net/>.
#
#######



# «.first-connection»		(to "first-connection")
# «.termux-access-storage»	(to "termux-access-storage")
# «.setup»			(to "setup")
# «.rsync-phonecamera»		(to "rsync-phonecamera")
# «.rsync-wpvideos»		(to "rsync-wpvideos")
# «.rsync-wpimages»		(to "rsync-wpimages")
# «.without-password»		(to "without-password")
# «.ifco»			(to "ifco")
# «.ssh-to-laptop»		(to "ssh-to-laptop")


(find-es "android" "termux-rsync")
(find-angg ".zshrc" "termux")
(find-efunction 'find-rsynccamera-links)




#####
#
# first-connection (via USB tethering)
# 2024jun06
#
#####

# «first-connection»  (to ".first-connection")
# (find-es "android" "termux")

* (eepitch-termux)
* (eepitch-kill)
* (eepitch-termux)
pkg install openssh
ifconfig              ;# rmnet5 -> 10.148.149.192
whoami                ;# u0_a307


** See: (find-termux-links)
* (tm-setenv "TERMUXIP"   "10.148.149.192")
* (tm-setenv "TERMUXUSER" "u0_a037")
* (tm-setenv "TERMUXSSH"  "ssh://[TERMUXUSER]@[TERMUXIP]:8022")
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
echo $TERMUXSSH
ssh  $TERMUXSSH
exit





#####
#
# termux-access-storage
# 2023oct03
#
#####

# «termux-access-storage»  (to ".termux-access-storage")
# https://wiki.termux.com/wiki/Internal_and_external_storage

termux-setup-storage




#####
#
# setup
# 2023oct05
#
#####

# «setup»  (to ".setup")
# (find-termux-links)

whoami
ifconfig
sshd



* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
echo $TERMUXE $TERMUXIP
eval $TERMUXE $TERMUXIP

* (eepitch-termux)
* (eepitch-kill)
* (eepitch-termux)
pwd
ls /data
ls /data/data
ls /data/data/com.termux
ls /data/data/com.termux/files
ls /data/data/com.termux/files/home
ls /data/data/com.termux/files/home/storage
ls -lAF /data/data/com.termux/files/home/storage
ls      /data/data/com.termux/files/home/storage/dcim
ls      /data/data/com.termux/files/home/storage/dcim/Camera
ls -lAF /data/data/com.termux/files/home/storage/dcim/Camera
ls -lAF /data/data/com.termux/files/home/storage/dcim/Camera/20230927_162100.jpg
ls -lAF  /storage/emulated/0/
ls -lAF  /storage/emulated/0/DCIM/
ls -lAF  /storage/emulated/0/DCIM/Camera/
cd       /storage/emulated/0/DCIM/Camera/
ls -lAF  20231004*
ls -lAF  20231004_150854.jpg
ls -lAF  /storage/emulated/0/Android/
ls -lAF  /storage/emulated/0/Android/media/
ls -lAF  /storage/emulated/0/Android/media/com.whatsapp/
ls -lAF  /storage/emulated/0/Android/media/com.whatsapp/Whatsapp/
ls -lAF  /storage/emulated/0/Android/media/com.whatsapp/Whatsapp/Media/
ls      "/storage/emulated/0/Android/media/com.whatsapp/Whatsapp/Media/WhatsApp Images/" | cat
ls      "/storage/emulated/0/Android/media/com.whatsapp/Whatsapp/Media/WhatsApp Video/"  | cat
cd      "/storage/emulated/0/Android/media/com.whatsapp/Whatsapp/Media/WhatsApp Video/"

export TERMUXIP=192.168.0.111
export WHATSAPP=storage/emulated/0/Android/media/com.whatsapp/Whatsapp
export WPIMAGES="$WHATSAPP/Media/WhatsApp Images"
export  WPVIDEO="$WHATSAPP/Media/WhatsApp Video"
cd "/$WPVIDEO/"
  ls     VID-20230929*
  du -ch VID-20230929*

ls -lAF "/$WPVIDEO/VID-20230929-WA0064.mp4"

cd /tmp/


* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
ssh ssh://u0_a037@192.168.0.111:8022

export TERMUXIP=192.168.0.111
export WHATSAPP=storage/emulated/0/Android/media/com.whatsapp/Whatsapp
export WPIMAGES="$WHATSAPP/Media/WhatsApp Images"
export  WPVIDEO="$WHATSAPP/Media/WhatsApp Video"

cd "/$WPIMAGES"
  ls     IMG-202310*
  du -ch IMG-202310*

cd "/$WPVIDEO"
  ls     VID-20230929*
  du -ch VID-20230929*

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-angg ".zshrc" "termux")
exporttermuxvars
exporttermuxvars echo
cd /sda1/home/phone-backup/whatsapp-video/

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd /tmp/
cd /sda1/home/phone-backup/whatsapp-video/
exporttermuxvars
exporttermuxvars echo
     rsync -avv -e "$TERMUXE" "$TERMUXWPVIDEO/VID-2023090*.mp4" .
     rsync -avv -e "$TERMUXE" "$TERMUXWPVIDEO/VID-2023091*.mp4" .
     rsync -avv -e "$TERMUXE" "$TERMUXWPVIDEO/VID-202308*.mp4" .
     rsync -avv -e "$TERMUXE" "$TERMUXWPVIDEO/*" .
echo rsync -avv -e "$TERMUXE" "$TERMUXWPVIDEO/*" .

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd /tmp/
cd /sda1/home/phone-backup/whatsapp-images/
exporttermuxvars
exporttermuxvars echo
     rsync -avv -e "$TERMUXE" "$TERMUXWPIMAGES/VID-202308*" .
     rsync -avv -e "$TERMUXE" "$TERMUXWPIMAGES/*" .
echo rsync -avv -e "$TERMUXE" "$TERMUXWPIMAGES/*" .

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd /tmp/
exporttermuxvars
exporttermuxvars echo
echo rsync -avv -e "$TERMUXE" "$TERMUXCAMERA/20231004*" .
     rsync -avv -e "$TERMUXE" "$TERMUXCAMERA/20231004*" .
     rsync -avv -e "$TERMUXE" "$TERMUXCAMERA/20231004_150854.jpg" .
     rsync -avv -e "$TERMUXE" "$TERMUXCAMERA/*" .

# (find-fline "/sda1/home/phone-backup/whatsapp-video/")

rsync -avv \
  -e "ssh -l u0_a037 -p 8022" \
  "$TERMUXIP:/$WPVIDEO/VID-20230929-WA0064.mp4" .

rsync -avv \
  -e "ssh -l u0_a037 -p 8022" \
  "$TERMUXIP:/$WPVIDEO/VID-20230929-*.mp4" .

rsync -avv \
  -e "ssh -l u0_a037 -p 8022" \
  "$TERMUXIP:/$WPVIDEO/VID-2023092*.mp4" .

ping 192.168.0.111

echo  "$TERMUXIP:/$WPVIDEO/VID-20230929-WA0064.mp4" .

  "$TERMUXIP:/$WPVIDEO/VID-202309*" .
echo  "$TERMUXIP:/$WPVIDEO/VID-202309*" .

ls -lAF "/$WPVIDEO/VID-20230929-WA0064.mp4"


  $TERMUXIP:/$TERMUXWPIMAGES

  "192.168.0.111:/data/data/com.termux/files/home/storage/dcim/Camera/20230927_*.jpg" .




find /data/data/com.termux -type d

# (find-sh "df -h")
# (find-fline "/sda1/home/phone-backup/")
# (find-fline "/sda1/home/phone-backup/whatsapp-images/")
# (find-fline "/sda1/home/phone-backup/whatsapp-video/")


# (find-fline "/ssh:u0_a037@192.168.0.111#8022")

(find-es "cvs" "rsync_over_ssh")

* (eepitch-shell2)
* (eepitch-kill)
* (eepitch-shell2)
cd /tmp/
rsync -e "ssh -l u0_a037 -p 8022" 192.168.0.111:/data/data/com.termux/files/home/storage/dcim/Camera/20230927_162100.jpg .

rsync -avv \
  -e "ssh -l u0_a037 -p 8022" \
  "192.168.0.111:/data/data/com.termux/files/home/storage/dcim/Camera/20230927_*.jpg" .

cd /sda1/home/phone-backup/whatsapp-images/
export TERMUXIP=192.168.0.111
export WHATSAPP=storage/emulated/0/Android/media/com.whatsapp/Whatsapp
export WPIMAGES="$WHATSAPP/Media/WhatsApp Images"
rsync -avv \
  -e "ssh -l u0_a037 -p 8022" \
  TERMUXWPIMAGES

  "192.168.0.111:/data/data/com.termux/files/home/storage/dcim/Camera/20230927_*.jpg" .

"/storage/emulated/0/Android/media/com.whatsapp/Whatsapp/Media/WhatsApp Images/"

rsync -e "ssh -l u0_a037 -p 8022"



8022



#####
#
# rsync-phonecamera
# 2023oct15
#
#####

# «rsync-phonecamera»  (to ".rsync-phonecamera")
# (find-copy-quadros-links)
# (find-rsynccamera-links)
# (find-efunction 'find-rsynccamera-links)
# (find-efunction 'find-copy-quadros-links)

(code-c-d "dcimcamera"     "/ftp:ftp@192.168.1.2#2121:/DCIM/Camera/")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-fline "/tmp/phone-camera/")
mkdir -p /tmp/phone-camera/
cd       /tmp/phone-camera/
exporttermuxvars
exporttermuxvars echo
echo rsync -avv -e "$TERMUXE" "$TERMUXCAMERA/20231015*.jpg" .

rsync -avv -e ssh -l u0_a037 -p 8022 192.168.1.2:/storage/emulated/0/DCIM/Camera/20231015*.jpg .

(find-fline "/scp:u0_a037@192.168.1.2#8022:storage/emulated/0/DCIM/Camera/")
(find-fline "/scp:u0_a037@192.168.1.2#8022:/storage/emulated/0/DCIM/Camera/")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-fline "/tmp/phone-camera/")
mkdir -p /tmp/phone-camera/
cd       /tmp/phone-camera/
exporttermuxvars
exporttermuxvars echo

# (find-fline "/scp:u0_a037@192.168.1.2#8022:/storage/emulated/0/Android/media/com.whatsapp/Whatsapp/Media/WhatsApp Images")
# (find-fline "/scp:u0_a037@192.168.1.2#8022:/storage/emulated/0/Android/media/com.whatsapp/Whatsapp/Media/WhatsApp Video")
# (find-fline "/scp:u0_a037@192.168.1.2#8022:/storage/emulated/0/DCIM/Camera")





#####
#
# rsync-wpvideos
# 2023oct15
#
#####

# «rsync-wpvideos»  (to ".rsync-wpvideos")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd /tmp/
# (find-fline "/sda1/home/phone-backup/")
# (find-fline "/sda1/home/phone-backup/whatsapp-video/")
cd /sda1/home/phone-backup/whatsapp-video/
exporttermuxvars
exporttermuxvars echo
echo rsync -avv -e "$TERMUXE" "$TERMUXWPVIDEO/VID-202308*" .
     rsync -avv -e "$TERMUXE" "$TERMUXWPVIDEO/VID-202308*" .
     rsync -avv -e "$TERMUXE" "$TERMUXWPVIDEO/VID-202309*" .
     rsync -avv -e "$TERMUXE" "$TERMUXWPVIDEO/VID-202310*" .
     rsync -avv -e "$TERMUXE" "$TERMUXWPVIDEO/VID-202311*" .
     rsync -avv -e "$TERMUXE" "$TERMUXWPVIDEO/VID-202402*" .
     rsync -avv -e "$TERMUXE" "$TERMUXWPVIDEO/*" .
echo rsync -avv -e "$TERMUXE" "$TERMUXWPVIDEO/*" .

# (find-fline "/sda1/home/phone-backup/whatsapp-videos/IMG-20230907-WA0011.jpg")
# (find-fline "/sda1/home/phone-backup/whatsapp-videos/IMG-20230913-WA0032.jpg")



#####
#
# rsync-wpimages
# 2023oct06
#
#####

# «rsync-wpimages»  (to ".rsync-wpimages")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd /tmp/
# (find-fline "/sda1/home/phone-backup/whatsapp-images/")
cd /sda1/home/phone-backup/whatsapp-images/
exporttermuxvars
exporttermuxvars echo
echo rsync -avv -e "$TERMUXE" "$TERMUXWPIMAGES/IMG-202308*" .
     rsync -avv -e "$TERMUXE" "$TERMUXWPIMAGES/IMG-202308*" .
     rsync -avv -e "$TERMUXE" "$TERMUXWPIMAGES/IMG-202309*" .
     rsync -avv -e "$TERMUXE" "$TERMUXWPIMAGES/IMG-202310*" .
     rsync -avv -e "$TERMUXE" "$TERMUXWPIMAGES/IMG-202311*" .
     rsync -avv -e "$TERMUXE" "$TERMUXWPIMAGES/*" .
echo rsync -avv -e "$TERMUXE" "$TERMUXWPIMAGES/*" .

# (find-fline "/sda1/home/phone-backup/whatsapp-images/IMG-20230907-WA0011.jpg")
# (find-fline "/sda1/home/phone-backup/whatsapp-images/IMG-20230913-WA0032.jpg")



#####
#
# without-password
# 2024jun05
#
#####

# «without-password»  (to ".without-password")
# (find-tmtramphomefile ".ssh/authorized_keys")

(find-2a
 ' (find-fline "~/.ssh/id_rsa.pub")
 ' (find-tmtramphomefile ".ssh/authorized_keys")
 )



#####
#
# ifco
# 2024jun06
#
#####

# «ifco»  (to ".ifco")
# (find-tmtramphomefile ".ssh/authorized_keys")
# (find-tmtramphomefile ".bashrc")
** (ee-copy-rest-3 nil "**--end" '(find-tmtramphomefile ".bashrc"))

# This file: (find-tmtramphomefile ".bahsrc")

function ifco () {
  ifconfig 2> /dev/null | grep inet | awk '{print $2}'
}
function ifco1 () { ifco | awk 'NR==1'; }
function ifco2 () { ifco | awk 'NR==2'; }
function ifco3 () { ifco | awk 'NR==3'; }
function ifco4 () { ifco | awk 'NR==4'; }

**--end

* (eepitch-termux)
* (eepitch-kill)
* (eepitch-termux)
cd
ifco
ifco | awk 'NR==2'
ifco2



#####
#
# ssh-to-laptop
# 2024jun06
#
#####

# «ssh-to-laptop»  (to ".ssh-to-laptop")
# (find-es "ssh" "StrictHostKeyChecking")
# (find-google-links "ssh permission denied (publickey)")
# (find-sh "sudo ifconfig")
# (find-sh "sudo ifconfig | tr ' ' '\\n' | sort -u")
# (find-sh "sudo ifconfig | tr ' ' '\\n' | sort -u | grep '^[0-9.]*$'")
# (find-sh "sudo ifconfig | tr ' ' '\\n' | sort -u | grep '^[0-9.]*$' | grep '\\.'")

* (eepitch-termux)
* (eepitch-kill)
* (eepitch-termux)
ssh edrx@192.168.42.118
ssh -o StrictHostKeyChecking=off edrx@192.168.42.118
ssh -o StrictHostKeyChecking=off edrx@192.168.42.118 echo Ok






#  Local Variables:
#  coding:               utf-8-unix
#  End: