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

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #183 · 23 ное.

Python + bash Если вам часто требуется запускать shell команды из Python-кода, какой способ вы используете? Самый низкоуровневый это функция os.system(), либо os.popen(). Рекомендованный способ это subprocess.call(). Но это всё еще достаточно неудобно. Советую обратить своё внимание на очень крутую библиотеку sh. Что она умеет? 🔸 удобный синтаксис вызова команд как функций # os import os os.system("tar cvf demo.tar ~/") # subprocess import subprocess subprocess.call(['tar', 'cvf', 'demo.tar', '~/']) # sh import sh sh.tar('cvf', 'demo.tar', "~/") 🔸 простое создание функции-алиаса для длинной команды fn = sh.lsof.bake('-i', '-P', '-n') output = sh.grep(fn(), 'LISTEN') в этом примере также задействован пайпинг 🔸 удобный вызов команд от sudo with sh.contrib.sudo: print(ls("/root")) Такой запрос спросит пароль. Чтобы это работало нужно соответствующим способом настроить юзера. А вот вариант с вводом пароля через код. password = "secret" sudo = sh.sudo.bake("-S", _in=password+"\n") print(sudo.ls("/root")) Это не все фишки. Больше интересных примеров смотрите в документации. Специально для Windows💀 юзеров #libs#linux

Hashtags

Резултати

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

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

Linuxgram 🐧

@linuxgram · Post #18661 · 03.05.2026 г., 10:28

📰 CISA Adds Actively Exploited Linux Root Access Bug CVE-2026-31431 to KEV The U.S. Cybersecurity and Infrastructure Security Agency (CISA) on Friday added a recently disclosed security flaw impacting various Linux distributions to its Known Exploited Vulnerabilities (KEV) catalog, citing evidence of active exploitation in the wild.The vulnerability, tracked as CVE-2026-31431 (CVSS score: 7.8), is a case of local privilege escalation (LPE) flaw that could allow an. 🔗 Source: https://thehackernews.com/2026/05/cisa-adds-actively-exploited-linux-root.html #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18658 · 02.05.2026 г., 19:10

📰 I always tweak my Proxmox host's settings before spinning up a single VM or LXC Over the last couple of years, I’ve installed Proxmox on PCs of all shapes and sizes, including enterprise-grade servers, dinosaur machines, single-board computers, and gaming laptops. After all, Proxmox’s lightweight nature lets me run this killer platform on anything with an x86 CPU, and since it supports Linux containers and KVM-based virtual machines, I can use my PVE-powered systems as hybrid project-building workstations and self-hosting... 🔗 Source: https://www.xda-developers.com/i-always-tweak-my-proxmox-hosts-settings/ #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18655 · 02.05.2026 г., 17:55

📰 NVIDIA Ships Fixes For Descriptor Heaps, More Vulkan Performance Optimizations NVIDIA on Friday released the 595.44.06 beta driver build as their newest Vulkan developer beta for Linux. This was joined by the NVIDIA 595.46 Windows Vulkan beta and there are performance improvements in tow and more work on their descriptor heaps support... 🔗 Source: https://www.phoronix.com/news/NVIDIA-595.44.06-Vulkan-Beta #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18642 · 01.05.2026 г., 12:09

📰 The most severe Linux threat to surface in years catches the world flat-footed CopyFail threatens multi-tenant servers, CI/CD work flows, Kubernetes containers, and more. 🔗 Source: https://arstechnica.com/security/2026/04/as-the-most-severe-linux-threat-in-years-surfaces-the-world-scrambles/ #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18632 · 30.04.2026 г., 19:12

📰 New Linux ‘Copy Fail’ flaw gives hackers root on major distros An exploit has been published for a local privilege escalation vulnerability dubbed "Copy Fail" that impacts Linux kernels released since 2017, allowing an unprivileged local attacker to gain root permissions. 🔗 Source: https://www.bleepingcomputer.com/news/security/new-linux-copy-fail-flaw-gives-hackers-root-on-major-distros/ #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18628 · 30.04.2026 г., 11:44

📰 CPPC v4 Support Being Worked On NVIDIA For The Linux ACPI Driver Last year with the ACPI 6.6 specification release came revised Collaborative Processor Performance Control (CPPC) support for enhancing the capabilities around this standard for OS management of the performance of CPU cores using an abstract performance scale. That CPPC v4 support is now being worked on for the acpi_cppc Linux driver by NVIDIA engineers... 🔗 Source: https://www.phoronix.com/news/ACPI-CPPC-v4-Linux #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18625 · 30.04.2026 г., 09:33

📰 New Linux 'Copy Fail' Vulnerability Enables Root Access on Major Distributions Cybersecurity researchers have disclosed details of a Linux local privilege escalation (LPE) flaw that could allow an unprivileged local user to obtain root.The high-severity vulnerability tracked as CVE-2026-31431 (CVSS score: 7.8) has been codenamed Copy Fail by Xint.io and Theori."An unprivileged local user can write four controlled bytes into the page cache of any readable file on a Linux. 🔗 Source: https://thehackernews.com/2026/04/new-linux-copy-fail-vulnerability.html #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18621 · 30.04.2026 г., 06:22

📰 Linux cryptographic code flaw offers fast route to root Patches land for authencesn flaw enabling local privilege escalation Developers of major Linux distributions have begun shipping patches to address a local privilege escalation (LPE) vulnerability arising from a logic flaw.… 🔗 Source: https://go.theregister.com/feed/www.theregister.com/2026/04/30/linux_cryptographic_code_flaw/ #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18615 · 29.04.2026 г., 14:35

📰 I moved my entire Linux home directory to a second drive, and nothing broke Once you separate the roles of OS and personal data, the whole system starts to feel more deliberate. 🔗 Source: https://www.xda-developers.com/moved-linux-home-directory-second-drive-nothing-broke/ #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18607 · 28.04.2026 г., 19:37

📰 GTK2 Gets an Unofficial Revival Fork for Legacy Linux Apps A Devuan community developer has launched GTK2-NG, a fork designed to maintain compatibility for legacy GTK2 software on current Linux systems. 🔗 Source: https://linuxiac.com/gtk2-gets-an-unofficial-revival-fork-for-legacy-linux-apps/ #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18604 · 28.04.2026 г., 17:30

📰 NVIDIA 595.71.05 stable driver released for Linux A tiny Recommended Driver update arrived for NVIDIA GPU owners on Linux, with version 595.71.05 now available.Read the full article on GamingOnLinux. 🔗 Source: https://www.gamingonlinux.com/2026/04/nvidia-595-71-05-stable-driver-released-for-linux/ #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18597 · 28.04.2026 г., 10:30

📰7-Zip 26.01 Now Allows Making Use Of Huge Pages On Linux For Faster Compression 7-Zip 26.01 was released on Monday and making this release significant are huge pages support on Linux and some users may be interested in the new options around the path generation mode for the output directory when extracting archives... 🔗 Source: https://www.phoronix.com/news/7-Zip-26.01 #linux

Hashtags

12345•••100•••121122
ПретходнаСтраница 3 од 122Следна