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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #303 · 27 дек.

Наверняка вы замечали, что в Python есть удобная функция для получения переменной окружения os.getenv(NAME) И её "сестра" для создания или изменения переменных окружения os.putenv(NAME, VALUE) Но почему-то putenv() не работает как должно. Энвайромент не обновляется! os.putenv('MYVAR', '1') print(os.getenv('MYVAR')) ... и ничего 😴 Почему так? На самом деле энвайромент обновляется, но это значение не добавляется в словарь os.environ. Откройте исходник функции os.getenv(). Это просто шорткат для os.environ.get() В то время как putenv() это built-in С-функция. Словарь os.environ (или точней класс из MutableMapping) создаётся из энвайромента в момент инициализации. Функция putenv() самостоятельно его не изменяет. В тоже время, когда вы создаёте или изменяете ключ в os.environ, автоматически вызывается putenv() в методе __setitem__(). То есть, технически putenv() всё делает верно, но в os.environ это не отражается. Можно проверить так: >>> os.putenv('MYVAR', '123') >>> os.system('python -c "import os;print(os.getenv(\'MYVAR\'))"') 123 Я объявил переменную в текущем процессе и вызвал дочерний процесс, который её унаследовал и получил в составе os.environ. Аналогично при удалении переменной вызывается еще одна built-in функция unsetenv(), удаляющая переменную из системы. Итого ▫️ Удобней всего явно обновлять переменные через os.environ ▫️ Есть способ неявно создать/удалить переменную через putenv/unsetenv, что не повлияет на os.environ но изменит энвайромент и передаст изменения сабпроцессам. Но так лучше не делать! ▫️os.environ это просто обертка для built-in функций putenv() и unsetenv(). #basic

Hashtags

Резултати

Пронајдени 3 слични објави

Пребарај: #cti

当前筛选 #cti清除筛选
GitHub Trends

@githubtrending · Post #15234 · 18.10.2025 г., 11:30

#other#cti#cyberhunter#darkweb#deepweb#threat_intelligence deepdarkCTI is a free project that collects and shares cyber threat intelligence (CTI) from the deep and dark web, helping you stay aware of hidden cyber threats like stolen data, ransomware, and hacker activities. It gathers information from places like Telegram, Discord, hacker forums, and ransomware sites to provide useful indicators and patterns of cyber attacks. You can join their Telegram group to discuss and suggest new sources or support the project with donations. Using deepdarkCTI helps you detect threats early, improve your cybersecurity decisions, and protect your organization from cyber attacks more effectively. https://github.com/fastfire/deepdarkCTI

GitHub Trends

@githubtrending · Post #14721 · 19.05.2025 г., 12:01

#python#cli#cti#cybersecurity#forensics#hacktoberfest#information_gathering#infosec#linux#osint#pentesting#python#python3#reconnaissance#redteam#sherlock#tools Sherlock is a powerful tool that helps you find social media accounts by username across over 400 networks. It's easy to use and works on many operating systems like macOS, Linux, and Windows. You can install it using methods like `pipx` or Docker, and then simply type the username you want to search for. Sherlock will show you where that username is used on different social media platforms. This tool is useful for gathering information quickly and can be run locally or even online through services like Apify. It saves time and effort in finding accounts across many platforms. https://github.com/sherlock-project/sherlock

GitHub Trends

@githubtrending · Post #15601 · 05.04.2026 г., 11:30

#yara#awesome_list#blueteam#blueteam_tools#cti#detection#detection_engineering#dfir#hacktools#incident_response#ioc#iocs#ir#ransomware#redteam#rmm#security#siem#soc#threat_hunting#threat_intelligence You can access comprehensive security detection lists and threat hunting resources that help identify malicious activity across your infrastructure. These curated collections include indicators like suspicious file hashes, domain names, IP addresses, and behavioral patterns organized by threat type—from ransomware and phishing to command-and-control servers and vulnerable drivers. By integrating these lists into your security tools like SIEM platforms and endpoint detection systems, you gain immediate visibility into known threats while learning detection methodologies through guides and YARA rules. This accelerates your ability to hunt for compromises, validate security controls, and stay current with emerging attack techniques without building detection logic from scratch. https://github.com/mthcht/awesome-lists