tmux 速查表

========================================== ==========================================
TMUX COMMAND WINDOW (TAB)
========================================== ==========================================
List tmux ls List ^b w
New new -s <session> -n <name> Create ^b c
Attach att -t <session> Rename ^b , <name>
Rename rename-session -t <old> <new> Last ^b l (lower-L)
Kill kill-session -t <session> Close ^b &
========================================== Goto # ^b <0-9>
CONTROLS Next ^b n
========================================== Previous ^b p
Detach ^b d Choose ^b w <name>
List ^b = ==========================================
Buffer ^b <PgUpDn> PANE (SPLIT WINDOW)
Command ^b : <command> ==========================================
Copy ^b [ ... <space> ... <enter> Show # ^b q
Moving vim/emacs key bindings Split Horiz ^b " --------
Start <space> Split Vert ^b % |
Copy <enter> Pane->Window ^b !
Paste ^b ] Kill ^b x
========================================== Reorganize ^b <space>
SESSION (Set of Windows) Expand ^b <alt><arrow>
========================================== Resize ^b ^<arrow>
New ^b :new ^b :new -s <name> Resize x n ^b <n> <arrow>
Rename ^b $ Select ^b <arrow>
List ^b s Previous ^b {
Next ^b ( Next ^b }
Previous ^b ) Switch ^b o other
Swap ^b ^o
Last ^b ;

PowerShell 語法

# LANG
view raw 1.ps1 hosted with ❤ by GitHub

? is an abreviation of Where-Object

Get-ChildItem "C:\" | ? { $_.PsIsContainer} | ft -AutoSize

% is an abreviation of Foreach

Get-ChildItem "C:\" | % { write-host $_.BaseName}

foreach顯示index

$myObjs = @([PSCustomObject] @{Name="Jack"; Age="10";},
            [PSCustomObject] @{Name="Tom"; Age="15";})
$myObjs | foreach-object{$counter = 0}{
    Write-Host $counter - $_.Name is $_.Age years old.
    $counter++
}

This Is a cat

'This', 'Is', 'a', 'cat' | & {"$input"}

This-Is-a-cat

'This', 'Is', 'a', 'cat' | & {$ofs='-';"$input"}

view raw note.md hosted with ❤ by GitHub

ffmpeg cut

ffmpeg -i input.mp4 -ss 00:01:00 -to 00:02:00 -c copy output.mp4

-i: This specifies the input file. In that case, it is (input.mp4).
-ss: Used with -i, this seeks in the input file (input.mp4) to position.
00:01:00: This is the time your trimmed video will start with.
-to: This specifies duration from start (00:01:40) to end (00:02:12).
00:02:00: This is the time your trimmed video will end with.
-c copy: This is an option to trim via stream copy. (NB: Very fast)

linux - Cutting the videos based on start and end time using ffmpeg - Stack Overflow

view raw note.md hosted with ❤ by GitHub

OnePlus 3T啟用DCI-P3模式

view raw howto.md hosted with ❤ by GitHub

Raspberry Pi 3 設定 cron

設定腳本執行權限

chmod +x script1.sh

設定cron

crontab -e
*/3 * * * * /home/pi/MyShellScript/script1.sh

view raw cron.md hosted with ❤ by GitHub

OOS安裝ViPER4Android FX v2.5.0.5

安裝ViPER4Android FX v2.5.0.5

3T OOS 3.5.4/4.5.1 測試OK

先安裝BusyBox

  1. permissive.sh放入/su/su.d

permissive.sh

#!/system/bin/sh
setenforce 0
  1. 設定permissive.sh,權限為755
  2. 重新開機
  3. 檢查SELinux狀態
$ adb shell
shell@OnePlus3T:/ $ getenforce
Permissive
  1. 安裝ViPER4Andriod.apk
  2. 開啟ViPER4Android,安裝驅動程式
  3. 重新開機
  4. 播放音樂,並檢查處理中:是

如果驅動程式安裝正常,但處理中:否
/system/vendor/etc/audio_effects.config更名為audio_effects.config.bak

REF

官方rom安装viper4android(v4a)音效的方法 - 一加手机3T - 一加手机社区官方论坛
折騰無果?先試試禁用 SELinux - 少數派

view raw step.md hosted with ❤ by GitHub

關閉來賓模式

Data vs Internal Storage

Data vs Internal Storage

Data

Data is your user apps (installed from Google Play Store, or with an *.apk) and its app data. It is stored on /data.

Your user apps is stored on /data/app.
Your apps' data is stored on /data/data.

NOTE: You must be rooted to see the contents on /data/ ...

Internal Storage

On the other hand, Internal Storage is actually the storage where your other data are saved, such as music, photos, videos, other app data, downloads, etc., and is usually stored on /storage or /sdcard.

NOTE: /sdcard is different from your external SD Card.

Music is saved on /sdcard/Music.
Photos are saved on /sdcard/DCIM.
Videos are saved on /sdcard/Videos.
Other app data are saved on /sdcard/ (App Folder).
Other apps choose to store their app data on /sdcard/ ..., such as Minecraft: /sdcard/games.
Downloads are saved on /sdcard/Downloads, and can be easily found if you have the Downloads app.

REF

rom flashing - What's the difference between Data and Internal Storage? - Android Enthusiasts Stack Exchange

view raw note.md hosted with ❤ by GitHub

For Loop 比較 sequence(序列) vs parallel(平行)

function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
};
async function sequence() {
let chkJobs = [];
for (let i = 1, max = 10; i < max; i++) {
let intRand = Math.floor((Math.random() * 5) + 1) * 1000;
await sleep(intRand);
console.log('[sequence] %s,delay %sms', i, intRand);
}
console.log('AllDone');
}
sequence();
// === Result ===
// [sequence] 1,delay 4000ms
// [sequence] 2,delay 1000ms
// [sequence] 3,delay 5000ms
// [sequence] 4,delay 5000ms
// [sequence] 5,delay 3000ms
// [sequence] 6,delay 3000ms
// [sequence] 7,delay 4000ms
// [sequence] 8,delay 4000ms
// [sequence] 9,delay 5000ms
// AllDone
// [Finished in 34.3s]
// === Result ===
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
};
function parallel() {
let chkJobs = [];
for (let i = 1, max = 10; i < max; i++) {
let intRand = Math.floor((Math.random() * 10) + 1) * 1000;
chkJobs.push(new Promise(async(resolve, reject) => {
await sleep(intRand);
console.log('[parallel] %s,delay %sms', i, intRand);
resolve(i);
}));
}
Promise.all(chkJobs).then(values => {
console.log('[parallel] AllDone');
});
}
parallel();
// === Result ===
// [parallel] 2,delay 1000ms
// [parallel] 6,delay 2000ms
// [parallel] 4,delay 3000ms
// [parallel] 1,delay 4000ms
// [parallel] 7,delay 5000ms
// [parallel] 8,delay 7000ms
// [parallel] 3,delay 8000ms
// [parallel] 5,delay 8000ms
// [parallel] 9,delay 8000ms
// [parallel] AllDone
// [Finished in 8.2s]
// === Result ===

OnePlus 3T OOS 3.5.4 刪除Debloater

OnePlus 3T OOS 3.5.4 刪除Debloater

system app

  • /system/app/AndroidPay
  • /system/app/BasicDreams
  • /system/app/BookmarkProvider
  • /system/app/Galaxy4
  • /system/app/GoogleTTS
  • /system/app/HoloSpiralWallpaper
  • /system/app/LogKitSdService
  • /system/app/Music2
  • /system/app/NoiseField
  • /system/app/OemAutoTestServer
  • /system/app/OEMLogKit
  • /system/app/OPBugReport
  • /system/app/OpenWnn
  • /system/app/PartnerBookmarksProvider
  • /system/app/PhaseBeam
  • /system/app/Photos
  • /system/app/Stk
  • /system/app/SwiftKey
  • /system/app/SwiftKeyFactorySettings
  • /system/app/talkback
  • /system/app/Videos
  • /system/app/YuloreFramework

priv-app

  • /system/priv-app/OPDeviceManager
  • /system/priv-app/OPDeviceManagerProvider

ELSE

  • /system/bin/oemlogkit
  • /system/bin/fmfactorytest
  • /system/bin/fmfactorytestserver
  • /system/bin/WifiLogger_app
  • /system/bin/bugreport
  • /system/bin/logcat
  • /system/tts
  • /system/com.touchtype
  • /system/recovery-from-boot.bak
  • /system/etc/recovery-resource.dat
  • /system/etc/usb_drivers.iso
  • /system/etc/oneplus_ftm_test.wav
  • /system/vendor/etc/in_apps

Disabled App

  • 天氣
  • 檔案管理
  • 錄音機
  • ANT HAL Service
  • Exchange 服務
  • NVBackupUI
  • 列印多工緩衝處理器
  • 區域廣播
  • 系統更新
view raw note.md hosted with ❤ by GitHub

OnePlus 3T (A3010陸版) 128GB 初見面

OnePlus 3T (A3010陸版) 128GB 初見面

安裝驅動

手機連接至電腦後,會新增一台光碟機
裡面有驅動程式,OnePlus_USB_Drivers_Setup.exe

開始刷機

開啟『開發人員選項』

  • 開啟OEM 解鎖
  • 開啟進階重新啟動
  • 開啟USB 偵錯

驅動測試

  • 開機狀態, 輸入adb devices
  • Bootloader mode, 輸入fastboot devices (Android Bootloader Interface)
  • TWRP Sideload, 輸入adb devices

OEM解鎖

  1. 進入Bootloader mode
  2. fastboot oem unlock

刷入TWRP

  1. 進入Bootloader mode
  2. fastboot flash recovery Z:\twrp-3.0.4-1-oneplus3.img
  3. 使用音量鍵選擇Recovery Mode,按電源鍵確定
  4. 進入TWRP,向右滑動(允許系統修改,會觸發dm-verity)
  5. 備份EFS

解除加密

  1. 進入TWRP
  2. adb sideload no-verity-opt-encrypt-5.1.zip
  3. Reboot → Recovery
  4. Wipe → Format Data

    如果Failed,請至Bootloader mode,使用fastboot format userdata

Root

  1. 進入TWRP
  2. adb sideload SR3-SuperSU-v2.79-SR3-20170114223742.zip
  3. Reboot → System

dm_verity

  1. 進入Bootloader mode
  2. fastboot oem disable_dm_verity
  3. fastboot oem enable_dm_verity
view raw step.md hosted with ❤ by GitHub

OnePlus 3T (A3010陸版) 使用adb備份EFS

OnePlus 3T (A3010陸版) 使用adb備份EFS

指令

adb shell
su
dd if=/dev/block/sdf1 of=/sdcard/modemst1.bin bs=512
dd if=/dev/block/sdf2 of=/sdcard/modemst2.bin bs=512
exit
exit
adb pull /sdcard/modemst1.bin ./
adb pull /sdcard/modemst2.bin ./

REF

[OnePlus 3T]OnePlusの作法をお勉強 – BOOLEE STREET.net

view raw .md hosted with ❤ by GitHub

OnePlus 3T (A3010陸版) 氫刷氧OS

OnePlus 3T (A3010陸版) 氫刷氧OS

Bootloader Lock

  1. OnePlus 3T | Downloads - OnePlus.net下載氧os安裝包
  2. 將安裝包放到手機根目錄(/sdcard)
  3. 設定 → 系統更新 → 右上角選單 → 本地更新
  4. 選定下載的氧os安裝包並確認更新
  5. 更新完後系統會自動重開機,此時不做仍任何設定直接手動關機
  6. 按下電源鍵並同時按下音量鍵(-)進入recovery模式
  7. 進入recovery模式後,選擇:清除數據和緩存\清除系統數據和緩存
  8. 重開機後即完成

Bootloader Unlock (使用TWRP)

  1. 進入TWRP
  2. Install
  3. 選取OnePlus3TOxygen_28_OTA_029_all_1612131737_17e7161d2b234949.zip

Promise.all

let tmp = [0, 1, 2, 3, 4, 5, 6],
chkJobs = [];
for (let i = 0, max = tmp.length; i < max; i++) {
chkJobs.push(new Promise((resolve, reject) => {
let intRndSec = 1000 * Math.floor((Math.random() * 9) + 1);
setTimeout(function() {
console.log('Done => index:%s, timeout:%sms', i, intRndSec);
resolve(i);
}, intRndSec);
}));
}
console.log('Hello');
Promise.all(chkJobs).then(values => {
console.log(values);
});
// === Result ===
// Hello
// Done => index:2, timeout:1000ms
// Done => index:4, timeout:2000ms
// Done => index:5, timeout:2000ms
// Done => index:0, timeout:4000ms
// Done => index:6, timeout:5000ms
// Done => index:3, timeout:6000ms
// Done => index:1, timeout:8000ms
// [ 0, 1, 2, 3, 4, 5, 6 ]
// === Result ===
view raw Promise.all.js hosted with ❤ by GitHub