@CodeXBotz · Post #1351 · 01.06.2022 г., 17:21
#TechUpdate 1 Minute Instagram Stories Instagram started to roll out 1minute stories https://instagram.com/stories/_u.n__k.n.o.w.n_/2851147491154648451?igshid=MDJmNzVkMjY=
Hashtags
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #411 · 9 фев.
reload_flag="" if [[ -n "${DEBUG}" ]]; then reload_flag="--reload" fi if [[ -n "${WORKER_COUNT}" ]]; then workers=${WORKER_COUNT} else workers=2 fi gunicorn --workers ${workers} \ --bind 0.0.0.0:8000 \ ${reload_flag} main.wsgi Писали такие конструкции чтобы проверить наличие флага и сформировать команду правильно? На самом деле можно сделать тоже самое проще. Для этого используются операторы условной подстановки, доступные в оболочках семейства POSIX. :- для установки значений по умолчанию ${WORKER_COUNT:-2} Если переменная не объявлена, то будет дефолтное значение 2. :+ подставляет указанный текст, если переменная не пуста ${DEBUG:+--reload} Если что-то есть в переменной то распечатается текст после символа +, в противном случае - ничего. Удобно для опциональных флагов, как в нашем примере. Итого наш скрипт может выглядеть так: gunicorn --workers ${WORKER_COUNT:-2} \ --bind 0.0.0.0:8000 \ ${DEBUG:+--reload} main.wsgi Есть еще два оператора. := не только подставить дефолтное значение, но и присвоить его переменной, если она пуста # никаких переменных еще нет VAL1=${VAL2:=hello} # теперь доступны обе echo $VAL1 $VAL2 # hello hello :? остановить выполнение с ошибкой, если переменной нет. echo ${MISS:?is required} bash: MISS: is required Код выхода будет 1. #tricks#linux
Пребарај: #techupdate
@CodeXBotz · Post #1351 · 01.06.2022 г., 17:21
#TechUpdate 1 Minute Instagram Stories Instagram started to roll out 1minute stories https://instagram.com/stories/_u.n__k.n.o.w.n_/2851147491154648451?igshid=MDJmNzVkMjY=
Hashtags
@CryptoM · Post #64676 · 09.04.2026 г., 13:44
🚀 Etherscan Enhances Contract Page with New Features Etherscan has announced a revamp of its contract page, introducing an IDE-style code browser. According to Foresight News, the update includes features such as file tree navigation, multi-file tabs, contract outline jumping, and cross-file keyword search. The redesign also improves the interaction interface for reading and writing contract pages, aiming to enhance the user experience in reading and operating smart contracts. Users can now switch to full-screen mode and open matching contract codes directly in Blockscan and Ethereum Remix for editing. #Etherscan#SmartContracts#Blockchain#Ethereum#CodeBrowser#DeveloperTools#Crypto#IDE#BlockchainDevelopment#TechUpdate#ETH
@CryptoM · Post #65162 · 11.04.2026 г., 14:05
🚀 Hermes Agent Integrates Native Support for Personal WeChat Use Hermes Agent now offers native support for personal WeChat accounts, allowing users to connect easily via QR code for use in private and group chats. According to Foresight News, the adapter utilizes Tencent's official iLink Bot API, enabling comprehensive coverage of images, videos, files, and voice messages, ensuring convenient long-polling direct connections without the need for a public IP. Users can experience this by running 'hermes update'. The adapter employs Tencent's official iLink Bot API rather than reverse engineering protocols or unofficial clients. For users concerned about account bans, it is recommended to test using secondary accounts. #HermesAgent#WeChat#Tencent#iLinkBotAPI#QRcode#GroupChats#PrivateChats#LongPolling#UserExperience#TechUpdate