TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

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

Резултати

Пронајдени 1,454 слични објави

Глобално пребарување

Linuxgram 🐧

@linuxgram · Post #18148 · 23.03.2026 г., 11:00

📰 AMD Posts Latest "pghot" Code For Overhauling Linux Hot Page Tracking & Promotion One of the core Linux infrastructure improvements that AMD engineers have been working on recently is pghot as a hot-page tracking and promotion subsystem. This proposed addition to the Linux kernel could be quite beneficial especially for those using modern AMD EPYC servers with CXL and multiple memory tiers... 🔗 Source: https://www.phoronix.com/news/AMD-pghot-RFC-Latest-Linux #kernel#linux#amd

Linuxgram 🐧

@linuxgram · Post #18132 · 21.03.2026 г., 13:58

📰 Linux 7.0 Lands Fix For Years Old Bug Affecting AMD Hainan GPUs Merged overnight for Linux 7.0 and set to be back-ported to existing Linux stable kernel versions is a fix for aging AMD GCN 1.0 "Hainan" GPU models. This closes a 2021 bug report that was long neglected and ended up being just a small tweak to fix the issue reported of GPU hangs... 🔗 Source: https://www.phoronix.com/news/AMD-Hainan-Fix-Linux-7.0 #kernel#amd#linux

Linuxgram 🐧

@linuxgram · Post #18118 · 19.03.2026 г., 23:26

📰AMD Preps More GFX12.1 Enablement For Linux 7.1, Initial VCN 5.0.2 & JPEG 5.0.2 IP AMD today sent out another batch of AMDGPU kernel graphics driver and AMDKFD kernel compute driver changes to DRM-Next ahead of next month's Linux 7.1 merge window... 🔗 Source: https://www.phoronix.com/news/AMD-More-GFX12.1-Linux-7.1 #kernel#linux#amd

Linuxgram 🐧

@linuxgram · Post #18073 · 16.03.2026 г., 12:43

📰 AMD Preps More Graphics Driver Code For Linux 7.1 Last week yet more AMDGPU kernel graphics driver updates were submitted to DRM-Next ahead of the Linux 7.1 merge window happening in April... 🔗 Source: https://www.phoronix.com/news/More-AMDGPU-For-Linux-7.1 #linux#kernel#amd

Linuxgram 🐧

@linuxgram · Post #18032 · 11.03.2026 г., 18:47

📰AMD Ryzen AI NPUs Are Finally Useful Under Linux For Running LLMs Over the past two years AMD has developed the AMDXDNA accelerator driver in the mainline Linux kernel for supporting the AMD Ryzen AI NPUs. But when it comes to user-space software on Linux actually able to leave the Ryzen AI NPUs it's been... extremely limited with nothing really useful besides some niche bits of code. Even AMD's own software like their GAIA on Linux has used Vulkan with their iGPUs rather than any NPU support. 🔗 Source: https://www.phoronix.com/news/AMD-Ryzen-AI-NPUs-Linux-LLMs #kernel#linux#amd

Linuxgram 🐧

@linuxgram · Post #17964 · 04.03.2026 г., 14:56

📰Linux Preps IBPB-On-Entry Feature For AMD SEV-SNP Guest VMs Heading toward the Linux 7.0 kernel and marked for back-porting to current stable Linux kernel versions is employing a new SEV-SNP security feature found on AMD Zen 5 processors for enhancing security of guest virtual machines... 🔗 Source: https://www.phoronix.com/news/AMD-IBPB-On-Entry-SNP-VMs #linux#amd#kernel

Linuxgram 🐧

@linuxgram · Post #17958 · 04.03.2026 г., 07:05

📰 AMD DPTCi Driver Posted For Linux To Better Enhance Ryzen Gaming Handhelds A request for comments (RFC) patch series was posted today to the Linux kernel mailing list to introduce the AMD Dynamic Power and Thermal Configuration Interface "DPTCi" driver. With this driver it would provide better upstream Linux kernel support for tuning the power / performance / thermals of modern Ryzen-powered gaming handheld devices. 🔗 Source: https://www.phoronix.com/news/AMD-DPTCi-Linux-Driver #linux#amd#kernel

Linuxgram 🐧

@linuxgram · Post #17931 · 28.02.2026 г., 19:01

📰AMD Prepares Linux For Instruction-Based Sampling Improvements With Zen 6 A set of patches recently posted to the Linux kernel mailing list have now been queued up to a tip/tip.git branch for planned introduction in Linux 7.1. These patches are for enhancing the Linux perf subsystem support for AMD Instruction-Based Sampling (IBS) improvements with next-gen Zen 6 processors... 🔗 Source: https://www.phoronix.com/news/Linux-Perf-AMD-IBS-Zen-6 #amd#linux#kernel

Linuxgram 🐧

@linuxgram · Post #17893 · 25.02.2026 г., 09:18

📰 AMD Posts Linux Patches For SEV-SNP BTB Isolation It's quite a mouthful but today AMD posted Linux kernel patches for preparing SEV-SNP BTB isolation support for further enhancing the security of virtual machines (VMs) for confidential computing... 🔗 Source: https://www.phoronix.com/news/AMD-SEV-SNP-BTB-Isolation #amd#linux#kernel

Linuxgram 🐧

@linuxgram · Post #17817 · 17.02.2026 г., 21:46

📰 AMD Preparing Linux Kernel For "RMPOPT" To Help Reduce Overhead On SEV-SNP Servers AMD sent out a set of Linux kernel patches today for enabling use of a new instruction dubbed RMPOPT. Given the timing of these patches, RMPOPT is presumably a feature coming with next-gen AMD EPYC Zen 6 "Venice" processors... 🔗 Source: https://www.phoronix.com/news/AMD-RMPOPT-Linux #linux#kernel#amd

AIGC

@aigcrubbish · Post #287 · 31.03.2026 г., 15:51

[$] The role of LLMs in patch review Linux 内核补丁审查中引入 LLM 工具 Sashiko 引发争议。内存管理维护者 Andrew Morton 提议修改审查流程,要求补丁作者必须回应 Sashiko 的反馈,但遭到其他子维护者的反对。讨论焦点在于如何及何时采用此类 AI 工具,其影响可能波及内核其他部分。 原文链接:https://lwn.net/Articles/1064830/ #Linux#内核开发#AI工具#代码审查 #AIGC Read more

12•••8788899091•••100•••121122
ПретходнаСтраница 89 од 122Следна