А знаете ли вы, что в Bash есть особая переменная "$_" ? Из описания можно узнать, что в переменную "$_" помещается последний аргумент последней команды.
Что-то знакомое? Конечно, в Python есть примерно тоже самое.
Мы знаем, что дата первого релиза Bash (8 июня 1989) несколько раньше чем первый релиз Python (20 февраля 1991). Если учесть, что по задумке автора Python это агрегация самых успешных практик отовсюду, можно ли сказать что именно эта фишка к нему пришла из Bash? Ни подтверждения ни опровержения я пока не нашел.
Давайте просто считать это совпадением 😉
А как это может быть полезно в Bash?
Приведу простой пример, который оценят те, кто часто работает в терминале.
Допустим, нам надо создать директорию и зайти в неё. Что обычно делаем?
:~$ mkdir foldername
:~$ cd foldername
:~/foldername$
Как это сделать в одну команду?
:~$ mkdir foldername && cd foldername
:~/foldername$
Уже лучше, но хочется короче, без повторов. Вот тут и пригодится наша переменная. Напомню, что в неё сохраняется последний аргумент предыдущей команды.
:~$ mkdir foldername && cd $_
:~/foldername$
_________________
PS.
Символы "&&"" разделяют команды и означают, что требуется выполнить вторую команду только если первая завершилась успешно.
#linux#tricks
📰 Nginx 1.31 Released with HTTP Forward Proxy Support
Nginx 1.31 introduces HTTP forward proxy support and addresses security vulnerabilities in HTTP/2, HTTP/3, OCSP, and core modules.
🔗 Source: https://linuxiac.com/nginx-1-31-released-with-http-forward-proxy-support/
#nginx
📰 Kubernetes sets a new standard for release notes, also kills Ingress NGINX
Release team explains links between Version 1.36 and classic print The Great Wave off Kanagawa Kubernetes issued a new release called “Haru” on Wednesday, and the release notes and logo might be more interesting than the software.…
🔗 Source: https://go.theregister.com/feed/www.theregister.com/2026/04/23/kubernetes_1_36_haru/
#nginx
📰 I don't use Tailscale or Nginx to access my home lab remotely, here's what I use instead
One of the most useful services to any home labber is a VPN, so that you can access your home network from anywhere and browse as if you're at home. That not only lets you use any self-hosted services you have on your NAS without having to open ports to the wider internet, but it also circumvents any geo-blocked services and nicely encrypts your data, so nobody can snoop in.
🔗 Source: https://www.xda-developers.com/i-dont-use-tailscale-or-nginx-to-access-my-home-lab-remotely-heres-what-i-use-instead/
#nginx
📰 Nginx 1.30 Released With Multipath TCP, ECH & More
Nginx 1.30 was just released as the newest stable version of this popular web server. Nginx 1.30 incorporates all of the changes from the Nginx 1.29.x mainline branch to provide a lot of new functionality like Multipath TCP (MPTCP)...
🔗 Source: https://www.phoronix.com/news/Nginx-1.30-Released
#nginx
📰 Nginx 1.29.7 Delivers Multipath TCP Support
Released this week was Nginx 1.29.7 as the newest mainline version of this HTTP(S) web server. Releasing alongside Nginx 1.28.3 stable, it fixed buffer overflow vulnerabilities and some other vulnerabilities. Making Nginx 1.29.7 more exciting though is that it landed Multipath TCP support...
🔗 Source: https://www.phoronix.com/news/Nginx-1.29.7-Multipath-TCP
#nginx
http://blog.povilasb.com/posts/python-asyncio-vs-nginx-performance/
While I was playing with Python #asyncio I got interested in how well it performs serving data over TLS compared to #Nginx. So I implemented a small HTTPS server with asyncio:
👩💻 Nginx Path Configuration Pitfalls.
• Nginx — это веб-сервер, на котором работает треть всех сайтов в мире. Но если забыть или проигнорировать некоторые ошибки в настройках, можно стать отличной мишенью для атакующих. Благодаря этому материалу, можно понять какие ошибки в конфигурациях встречаются чаще всего и как их исправить.
Attacks:
• Nginx Configuration Vulnerability;
• Exploiting Trailing Slash Misconfiguration;
• Exploiting Parent Directory Access;
• Impact Without Trailing Slash on Alias;
• Combined Impact.
Defend Against Attacks:
• Update Nginx;
• Configuration Check;
• Use Configuration Management;
• Security Headers;
• Access Control;
• Directory Listing;
• Alias Traversal Protection;
• HTTP to HTTPS Redirect;
• SSL Configuration;
• Rate Limiting;
• Connection Limits;
• Custom Error Pages;
• Gzip Compression;
• Client-Side Caching;
• HTTP2 Protocol;
• Secure File Permissions;
• Web Application Firewall (WAF);
• Monitoring and Logging;
• SSH Hardening;
• Firewall Configuration;
• Two-Factor Authentication;
• Regular Backups;
• Deny Hidden Files;
• IP Whitelisting;
• Disable Unused Modules;
• Use Trailing Slash in Alias Directives;
• Regular Expression Matching;
• Implement Strict Location Paths.
#Nginx#devsecops