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 слични објави

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

GitHub Trends

@githubtrending · Post #15247 · 25.10.2025 г., 12:30

#cmake#audio#ios#linux#macos#plugins#sdk#vst3#win32 VST 3 is an improved version of the VST audio plug-in interface. It offers several benefits, including better performance by only processing audio when needed, dynamic input/output configurations, and precise automation. Users can also enjoy a more organized interface and support for advanced audio features like 3D sound. These improvements make it easier for developers to create plugins and for users to work with them in digital audio workstations (DAWs), enhancing overall audio production efficiency. https://github.com/steinbergmedia/vst3sdk

Linuxgram 🐧

@linuxgram · Post #18422 · 13.04.2026 г., 20:08

📰 user.* xattrs On Sockets Merged For Linux 7.1 As Sought By GNOME & systemd Developers On this first day of the Linux 7.1 merge window, among the early pull requests merged were beginning to land the various VFS pull requests submitted by Christian Brauner. Among that code merged is enabling support for user.* extended attributes on sockets... 🔗 Source: https://www.phoronix.com/news/Linux-7.1-User-xattrs-Sockets #gnome#linux#systemd

Linuxgram 🐧

@linuxgram · Post #17913 · 27.02.2026 г., 07:38

📰 I replaced Android with a full Linux desktop on my old phone, and it's shockingly usable Pocketblue, based on Fedora Atomic, is great on the OnePlus 6. 🔗 Source: https://www.xda-developers.com/replaced-android-full-linux-desktop-old-phone/ #linux#fedora#android

Linuxgram 🐧

@linuxgram · Post #18581 · 27.04.2026 г., 08:04

📰The gaming Linux distro everyone's switching to just made sudo way more secure with your fingerprint 2026 has been a great year for CachyOS, and we're only a quarter of the way in. Earlier in the year, we saw CachyOS dethrone Arch Linux as the top distro for reports in ProtonDB, which ended a year-long reign and showed a pattern of people checking out CachyOS for their gaming needs. 🔗 Source: https://www.xda-developers.com/the-gaming-linux-distro-everyones-switching-to-just-made-sudo-way-more-secure-with-your-fingerprint/ #arch#distro#linux

Nahida🍃 Bookmarks

@NahidaBookmarks · Post #28 · 24.09.2022 г., 22:59

#cross_platform#mobile#desktop#win#mac#ios#android#linux#electron#software#mind_map#xmind#paid#productivity 数一数二的思维导图工具。公司总部在深圳,国产软件。(虽然原来的时候很多人没了解过)跟Typora一样在细分领域做到了世界领先 免费使用带导出水印,但是绝大部分功能没有限制。 收费单用户(5桌面端+5移动端)¥388/$59.99 一年似乎涨价了,教育优惠打折中 ¥99/年 https://xmind.cn/

Linuxgram 🐧

@linuxgram · Post #17825 · 18.02.2026 г., 17:09

📰 Pocketblue Brings Fedora Atomic Linux to Mobile Devices Pocketblue brings Fedora Atomic to select ARM-powered devices, providing users with an immutable Linux system on their phones and tablets. 🔗 Source: https://linuxiac.com/pocketblue-brings-fedora-atomic-linux-to-mobile-devices/ #linux#fedora#arm

Linuxgram 🐧

@linuxgram · Post #18304 · 03.04.2026 г., 20:34

📰 Arch-Based Omarchy 3.5 Brings Full Intel Panther Lake Support Arch-based Omarchy 3.5 adds Intel Panther Lake support with a patched Linux kernel 6.19, Dell XPS 2026 fixes, and new features. 🔗 Source: https://linuxiac.com/arch-based-omarchy-3-5-brings-full-intel-panther-lake-support/ #linux#arch#kernel#intel

Linuxgram 🐧

@linuxgram · Post #18293 · 03.04.2026 г., 11:00

📰 Arch-Based Artix Linux 2026.04 Released With XLibre as Default X Server Arch-based systemd-free Artix Linux 2026.04 is out with XLibre by default and PipeWire replacing PulseAudio in ISOs. 🔗 Source: https://linuxiac.com/artix-linux-2026-04-released-with-xlibre-as-default-x-serve/ #linux#systemd#arch

GitHub Trends

@githubtrending · Post #14667 · 03.05.2025 г., 12:30

#rust#bsd#gpu#linux#macos#opengl#rust#terminal#terminal_emulators#vte#windows Alacritty is a fast, cross-platform terminal emulator that uses OpenGL for smooth performance, works on BSD, Linux, macOS, and Windows, and offers customizable settings while keeping things simple. It’s lightweight, integrates well with tools like window managers or terminal multiplexers, and is already reliable enough for daily use despite being in beta, making it ideal for users who want speed and flexibility without unnecessary features. https://github.com/alacritty/alacritty

Linuxgram 🐧

@linuxgram · Post #18129 · 20.03.2026 г., 23:06

📰Emmabuntüs Debian Edition 6 1.01 Is Out with More Accessibility Improvements Emmabuntüs Debian Edition 6 1.01 distribution is now available for download based on the Debian GNU/Linux 13.4 “Trixie” operating system. Here’s what’s new! 🔗 Source: https://9to5linux.com/emmabuntus-debian-edition-6-1-01-is-out-with-more-accessibility-improvements #debian#linux#gnu

GitHub Trends

@githubtrending · Post #14965 · 16.07.2025 г., 13:00

#rust#agent#ai#amazon_q#cli#linux#llm#macos#mcp#open_source#productivity#rust#shell#terminal#typescript Amazon Q CLI is a powerful tool that lets you interact with AWS and your development environment using natural language right from your terminal. It helps you write code, run commands, and manage AWS resources faster by understanding your context and providing smart suggestions, autocompletion, and even translating plain English into shell commands. It supports multi-turn conversations, so you can ask follow-up questions and get real-time help without leaving the command line. This boosts your productivity by simplifying complex tasks, reducing errors, and speeding up development workflows, making it easier to manage projects and infrastructure efficiently[1][2][3]. https://github.com/aws/amazon-q-developer-cli

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