uweb1075: global redirection works for AI sites and login
[uweb.git] / en / cmds / index.html
blob02ac3147d0402a3b4d90a7857c0ce0508c237ded
1 <!doctype html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1" />
7 <link rel="stylesheet" href="../style.css#" type="text/css" />
8 <title>Commands</title>
9 <script type="text/javascript">
10 function findLang(){
11 let href = location.href;
12 for(let i=href.length-1;i>0;i--){
13 if('/'==href.charAt(i) && '/'==href.charAt(i-3))
14 return i;
16 return 0;
18 function nav2(page){
19 let i = findLang();
20 location.href = location.href.substring(0,i+1)+page;
22 function nav2Lang(lang){
23 let i = findLang();
24 let href = location.href;
25 location.href = location.href.substring(0,i-2)+lang+location.href.substring(i);
27 </script>
28 </head>
29 <body>
30 <header class='header'>
31 <a class="logo" href="javascript:void(0)" onclick="return nav2('index.html#')">Home</a> <a class="logo" href="javascript:void(0)" onclick="return nav2('tags/index.html#')">Tags</a>
34 <a class="logo" href="javascript:void(0)" onclick="return nav2Lang('zh')">简体中文</a>
37 <nav>
38 </nav>
39 </header>
40 <br />
42 <div class="container">
43 <h1 class="title">Commands
44 <br>
45 <span class="subtitle"></span>
46 </h1>
47 <ul class="tags">
49 </ul>
50 <p>Click the following links to install commands with <a href="../index.html#">uweb browser</a>. <b>Force exit and re-launch the app</b>, then long press the button with clock icon to popup the command menu.</p>
51 <p>Configuration file &quot;default.cmds&quot; examples:</p>
52 <p><a href="i:03Quit & clear data:q:toybox find /data/data/info.torapp.uweb/app_webview ! -name 'Cookies' ! -name '*.cjar' -type f -delete">Quit &amp; clear data:q:toybox find /data/data/info.torapp.uweb/app_webview ! -name 'Cookies' ! -name '*.cjar' -type f -delete</a></p>
53 <p><a href="i:03Clipboard2input:clip:cat>>default.input">Clipboard2input:clip:cat&gt;&gt;default.input</a></p>
54 <p><a href="i:03Clear database::rm -rf /data/data/info.torapp.uweb/databases/*">Clear database::rm -rf /data/data/info.torapp.uweb/databases/*</a></p>
55 <p><a href="i:03Append query to autocomplete:uweb:cd /data/data/info.torapp.uweb/files;cat default.autoc query.log|toybox sort|toybox uniq -i>a.tmp;mv a.tmp default.autoc;>query.log;echo file:///data/data/info.torapp.uweb/files/default.autoc">Append query to autocomplete:uweb:cd /data/data/info.torapp.uweb/files;cat default.autoc query.log|toybox sort|toybox uniq -i&gt;a.tmp;mv a.tmp default.autoc;&gt;query.log;echo file:///data/data/info.torapp.uweb/files/default.autoc</a></p>
56 <p><a href="i:03Clear cache::toybox rm -rf /data/data/info.torapp.uweb/cache">Clear cache::toybox rm -rf /data/data/info.torapp.uweb/cache</a></p>
57 <p><a href="i:03Clear logcat::logcat -c">Clear logcat::logcat -c</a></p>
58 <p><a href="i:03logcat.log::logcat -d > logcat.log">logcat.log::logcat -d &gt; logcat.log</a></p>
59 <p><a href="i:03copy cookie:/clip:printf '%c'">copy cookie:/clip:printf '%c'</a></p>
60 <p><a href="i:03config in Download::cd /data/data/info.torapp.uweb;toybox rm -rf files;toybox mkdir -p /sdcard/Download/uweb;toybox ln -s /sdcard/Download/uweb files">config in Download::cd /data/data/info.torapp.uweb;toybox rm -rf files;toybox mkdir -p /sdcard/Download/uweb;toybox ln -s /sdcard/Download/uweb files</a></p>
61 <p><a href="i:03html5 in Download::cd /data/data/info.torapp.uweb/files;toybox rm -rf app;toybox mkdir -p /sdcard/Download/app;toybox ln -s /sdcard/Download/app">html5 in Download::cd /data/data/info.torapp.uweb/files;toybox rm -rf app;toybox mkdir -p /sdcard/Download/app;toybox ln -s /sdcard/Download/app</a></p>
62 <p><a href="i:03tgz install::toybox tar -xzf %f -C /">tgz install::toybox tar -xzf %f -C /</a></p>
63 <p>Users should change the IP addresses in the following menus accordingly. In all cases, TV side needs to execute &quot;<a href="../links/index.html#">wait for network msg</a>&quot; first. Send message to network (ex. for android TVs):<br>
64 <a href="i:03Send clipboard:clip/uweb:printf 'i:5ji:5b';cat">Send clipboard:clip/uweb:printf 'i:5ji:5b';cat</a></p>
65 <p><a href="i:03Send url::printf '%u'|/system/bin/toybox nc 192.168.2.155 1500">Send url::printf '%u'|/system/bin/toybox nc 192.168.2.155 1500</a></p>
66 <p><a href="i:03Sendurl(bookmark)::printf 'i:51../home5:i:0mc16:%u'|/system/bin/toybox nc 192.168.2.155 1500">Sendurl(bookmark)::printf 'i:51../home5:i:0mc16:%u'|/system/bin/toybox nc 192.168.2.155 1500</a></p>
67 <p><a href="i:03Send url(fullscreen)::printf 'i:5f%u'|/system/bin/toybox nc 192.168.2.155 1500">Send url(fullscreen)::printf 'i:5f%u'|/system/bin/toybox nc 192.168.2.155 1500</a></p>
68 <p><a href="i:03Send url(video)::printf 'i:0mc16:%u'|/system/bin/toybox nc 192.168.2.155 1500">Send url(video)::printf 'i:0mc16:%u'|/system/bin/toybox nc 192.168.2.155 1500</a></p>
69 <p><a href="i:03Send url(clipboard):clip:(printf 'i:5b';cat)|/system/bin/toybox nc 192.168.2.155 1500">Send url(clipboard):clip:(printf 'i:5b';cat)|/system/bin/toybox nc 192.168.2.155 1500</a></p>
70 <p>Modify with your own info:<br>
71 <a href="i:03dynv6_sim1:uweb:print 'http://dynv6.com/api/update?hostname=&token=&ipv6=';ip addr|grep 'inet6 [^f]'|grep global|grep -v temporary|head -n 1|sed 's/^.*inet6 //'|sed 's/\/.*$//'">Refresh dynv6 ddns for sim card 1</a></p>
72 <p><a href="i:03dynv6_wifi:uweb:print 'http://dynv6.com/api/update?hostname=&token=&ipv6=';ip addr|grep 'inet6 [^f]'|grep global|grep -v temporary|tail -n 1|sed 's/^.*inet6 //'|sed 's/\/.*$//'">Refresh dynv6 ddns for wifi</a></p>
73 <p>Need root permissions:</p>
74 <p>Need termux:<br>
75 <a href="i:03VPN::am start -a android.net.vpn.SETTINGS">VPN::am start -a android.net.vpn.SETTINGS</a></p>
76 <p><a href="i:03wireless::am start -a android.settings.WIRELESS_SETTINGS">wireless::am start -a android.settings.WIRELESS_SETTINGS</a></p>
77 <p><a href="i:03cd:termux/*:cd %f;exit 1">cd:termux/*:cd %f;exit 1</a></p>
78 <p><a href="i:03vim:termux/*:vim %f">vim:termux/*:vim %f</a></p>
79 <p><a href="i:03deduplicate history::awk -F'\t' '!s[\$2]++' /data/data/info.torapp.uweb/files/history.rec>/sdcard/a.tmp;mv /sdcard/Download/a.tmp /data/data/info.torapp.uweb/files/history.rec">deduplicate history::awk -F'\t' '!s[$2]++' /data/data/info.torapp.uweb/files/history.rec&gt;/sdcard/a.tmp;mv /sdcard/Download/a.tmp /data/data/info.torapp.uweb/files/history.rec</a></p>
80 <p><a href="i:03deduplicate bookmarks::awk '!s[\$0]++' /data/data/info.torapp.uweb/files/bookmark.html>/sdcard/Download/a.tmp;mv /sdcard/Download/a.tmp /data/data/info.torapp.uweb/files/bookmark.html">deduplicate bookmarks::awk '!s[$0]++' /data/data/info.torapp.uweb/files/bookmark.html&gt;/sdcard/Download/a.tmp;mv /sdcard/Download/a.tmp /data/data/info.torapp.uweb/files/bookmark.html</a></p>
81 <p><a href="i:03deduplicate hosts::toybox tac /data/data/info.torapp.uweb/files/default.hosts|awk -F' ' '!s[\$1]++' |toybox tac>/sdcard/Download/a.tmp;mv /sdcard/Download/a.tmp /data/data/info.torapp.uweb/files/default.hosts">deduplicate hosts::toybox tac /data/data/info.torapp.uweb/files/default.hosts|awk -F' ' '!s[$1]++' |toybox tac&gt;/sdcard/Download/a.tmp;mv /sdcard/Download/a.tmp /data/data/info.torapp.uweb/files/default.hosts</a></p>
82 <p><a href="i:03deduplicate siteconf::toybox tac /data/data/info.torapp.uweb/files/default.siteconf|awk -F':' '!s[\$1]++' |toybox tac>/sdcard/Download/a.tmp;mv /sdcard/Download/a.tmp /data/data/info.torapp.uweb/files/default.siteconf">deduplicate siteconf::toybox tac /data/data/info.torapp.uweb/files/default.siteconf|awk -F':' '!s[$1]++' |toybox tac&gt;/sdcard/Download/a.tmp;mv /sdcard/Download/a.tmp /data/data/info.torapp.uweb/files/default.siteconf</a></p>
83 <p><a href="i:03Clipboard2PC:clip:ssh fengcao@192.168.1.120 'DISPLAY=:0 xsel -i'">Clipboard2PC:clip:ssh fengcao@192.168.1.120 'DISPLAY=:0 xsel -i'</a></p>
84 <p><a href="i:03ClipboardFromPC:/clip:ssh fengcao@192.168.1.120 'DISPLAY=:0 xsel -o'">ClipboardFromPC:/clip:ssh fengcao@192.168.1.120 'DISPLAY=:0 xsel -o'</a></p>
85 <p><a href="i:03Clipboard broadcast:clip:socat - UDP-DATAGRAM:255.255.255.255:1500,broadcast">Clipboard broadcast:clip:socat - UDP-DATAGRAM:255.255.255.255:1500,broadcast</a></p>
86 <p><a href="i:03Clipboard from broadcast:/clip:socat -u udp-recvfrom:1500 SYSTEM:'cat;exit'">Clipboard from broadcast:/clip:socat -u udp-recvfrom:1500 SYSTEM:'cat;exit'</a></p>
87 <p><a href="i:03Clipboard2QR:clip/uweb:qrencode -o /sdcard/Download/a.png;echo file:///sdcard/Download/a.png">Clipboard2QR:clip/uweb:qrencode -o /sdcard/Download/a.png;echo file:///sdcard/Download/a.png</a></p>
88 <p>Clipboard2PC needs to modify username, PC needs xsel. ssh needs to be installed inside termux (apt install openssh).<br>
89 Clipboard broadcast needs socat(apt install socat)。<br>
90 Clipboard2QR needs libqrencode.</p>
91 <h4 id="more-commands-click-to-install">More commands (click to install)</h4>
92 <p><a href="i:0gdefault.cmds::mdme:text/html:echo %22<script src=https://fastly.jsdelivr.net/npm/mdme></script><textarea>%22;cat %25f%0A">mdme: Show local markdown file</a></p>
93 <p><a href="i:0gdefault.cmds::texme:text/html:echo %22<script src=https://fastly.jsdelivr.net/npm/texme></script><textarea>%22;cat %25f%0A">texme: Show local tex+markdown file</a></p>
94 <p><a href="i:0gdefault.cmds::markdeep:text/html:cat %25f;echo %22<style class=fallback>body{visibility:hidden;white-space:pre;font-family:monospace}</style><script src=https://casual-effects.com/markdeep/latest/markdeep.min.js charset=utf-8></script><script>window.alreadyProcessedMarkdeep||(document.body.style.visibility=visible)</script>%22%0A">markdeep: Show local markdown+tex+diagrams file</a></p>
95 <p><a href="i:0gdefault.cmds::markdeep slide:text/html:cat %25f;echo %22<link rel='stylesheet' href='https://casual-effects.com/markdeep/latest/slides.css?'><script>markdeepOptions={tocStyle:'none'}</script><script src=https://casual-effects.com/markdeep/latest/markdeep.min.js charset=utf-8></script>%22%0A">markdeep slide: markdown+tex+diagrams</a></p>
96 <p><a href="i:0gdefault.cmds::remark slide:text/html:echo %22<script src=https://remarkjs.com/downloads/remark-latest.min.js></script><script>window.onload=function(){var slideshow=remark.create({navigation:{click:true,},});}</script><textarea id=%27source%27>class:middle%22;cat %25f%0A">remark slide: slide show for local markdown file</a></p>
97 <p><a href="i:0gdefault.cmds:https://cdn.jsdelivr.net/gh/torappinfo/uweb/en/searchurl/txt/cmds.cfg">Code editor, open url in clipboard etc.</a></p>
98 <h4 id="cmds-file-format">&quot;.cmds&quot; file format</h4>
99 <p>Each line has the following format:<br>
100 [Name]:[mimetype]:[command line]</p>
101 <p>[command line] can have &quot;%c&quot; (cookie), &quot;%s&quot; (address bar text), &quot;%u&quot; (url), &quot;%t&quot; (title).<br>
102 [mimetype] have the following formats:</p>
103 <ul>
104 <li>regular mimetype such as &quot;text/html&quot; to indicate the content type of the command output. Ex. &quot;text/javascript&quot; makes browser to evaluate the js code.</li>
105 <li>&quot;clip/clip&quot; to indicate &quot;clipboard&quot; as input and the command output is copied to clipboard.</li>
106 <li>&quot;/clip&quot;: copy the command output to clipboard.</li>
107 <li>&quot;clip/text/html&quot; : clipboard as input, and the command output is processed as &quot;text/html&quot;.</li>
108 <li>&quot;termux/*&quot;: command line is executed under termux.</li>
109 <li>&quot;/uweb&quot;: the command output is processed as <a href="../links/index.html#">links</a>.</li>
110 <li>&quot;q&quot;: quit the app and then execute the command. It is useful for complete cleanup operations.</li>
111 <li>empty:
112 <ul>
113 <li>if the first or second character of [command line] is ':', then the [command line] executes as <a href="../links/index.html#">internal link</a>.</li>
114 </ul>
115 </li>
116 </ul>
118 </div>
119 <p>Last Modified: 3 October 2024<br>
120 uweb version 1060<br>
121 <pre></pre>
122 </p>
124 <script id='jsgiscus'
125 src='https://giscus.app/client.js'
126 data-repo="torappinfo/uweb"
127 data-repo-id="MDEwOlJlcG9zaXRvcnkzMDIyMDU3MjE="
128 data-category="Announcements"
129 data-category-id="DIC_kwDOEgNLGc4CQjsh"
130 data-mapping="title"
131 data-strict="0"
132 data-reactions-enabled="1"
133 data-emit-metadata="0"
134 data-input-position="top"
135 data-theme="light"
136 data-lang="en"
137 data-loading="lazy"
138 crossorigin="anonymous" async>
139 </script>
141 <footer class="site-footer">
142 <div class="container">
143 &copy; 2018-2024 Richard H. Cao
144 </div>
145 </footer>
146 <!-- This document is licensed under the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is available at <https://www.gnu.org/licenses/>. -->
149 </body>
150 </html>