А знаете ли вы, что в Bash есть особая переменная "$_" ? Из описания можно узнать, что в переменную "$_" помещается последний аргумент последней команды.
Что-то знакомое? Конечно, в Python есть примерно тоже самое.
Мы знаем, что дата первого релиза Bash (8 июня 1989) несколько раньше чем первый релиз Python (20 февраля 1991). Если учесть, что по задумке автора Python это агрегация самых успешных практик отовсюду, можно ли сказать что именно эта фишка к нему пришла из Bash? Ни подтверждения ни опровержения я пока не нашел.
Давайте просто считать это совпадением 😉
А как это может быть полезно в Bash?
Приведу простой пример, который оценят те, кто часто работает в терминале.
Допустим, нам надо создать директорию и зайти в неё. Что обычно делаем?
:~$ mkdir foldername
:~$ cd foldername
:~/foldername$
Как это сделать в одну команду?
:~$ mkdir foldername && cd foldername
:~/foldername$
Уже лучше, но хочется короче, без повторов. Вот тут и пригодится наша переменная. Напомню, что в неё сохраняется последний аргумент предыдущей команды.
:~$ mkdir foldername && cd $_
:~/foldername$
_________________
PS.
Символы "&&"" разделяют команды и означают, что требуется выполнить вторую команду только если первая завершилась успешно.
#linux#tricks
#bootloader unlock wall of shame
https://github.com/melontini/bootloader-unlock-wall-of-shame
updated guide, check it before buying a #phone
Over the past few years, a suspicious number of companies have started to "take care of your data", aka block/strictly limit your ability to unlock the bootloader on your own devices.
While this may not affect you directly, it sets a bad precedent. You never know what will get the axe next: Shizuku? ADB? Sideloading? I thought it might be a good idea to keep track of bad companies and workarounds.
#android
#Xiaomi#Bootloader#Unlock without PC (Phone-To-Phone)
Note: We are not responsible for any data loss or corrupt devices. Proceed at your own risk. This procedure requires the use of 2 Android phones and an OTG cable for ADB debugging. If this is your first time unlocking the bootloader or your device is using a new MIUI account, proceed with Step 2 after 7 days
Step 1 [Configuring Settings] [Primary Phone]:
» Go to Settings > About Phone: Click on MIUI Version multiple times until developer options are enabled
» Go to Settings Homepage > Additional Settings > Developer Options: Enable OEM Unlocking and USB Debugging
» Then go to Mi Unlock Status: Click on Add account and device
Step 2 [Installing Flash scripts] [Secondary Phone]:
» Download and install these 3 APKs on your secondary phone:
https://github.com/RohitVerma882/termux-miunlock/ (outdated?)
https://github.com/termux/termux-app/releases/
https://github.com/termux/termux-api/releases/
» Connect the primary phone to the secondary phone via OTG
» Boot the primary phone into fastboot mode
» Open the Termux app: Follow and run these commands one by one according to the instructions
👤Credits
Techbuzznet (Video instructions for Indians)
RohitVerma888
@WildWaze ( thx for help and banner)
https://t.me/popMODS/3621
#Unlock#bootloader#xiaomi#Android
HyperSploit
Bypass HyperOS restrictions on bootloader unlocking
https://github.com/TheAirBlow/HyperSploit/
https://xdaforums.com/t/hypersploit-bypass-hyperos-bootloader-unlocking-restrictions.4668775/
MiUnlockTool
Retrieve encryptData (token) for Xiaomi devices to unlock bootloader, it is compatible with all platforms.
https://github.com/offici5l/MiUnlockTool
termux-miunlock
A program that can be used to retrieve the bootloader unlock token for Xiaomi devices (and unlock the bootloader) using Termux
https://github.com/RohitVerma882/termux-miunlock/