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
US: SEC Puts Individuals on Notice: Be Mindful of AI Disclosure Risks
The Securities and Exchange Commission (SEC) is casting a wider net in its efforts to ensure transparency around Artificial Intelligence in the financial sector. While companies have been warned about potential misleading AI disclosures, the SEC is now emphasizing the potential liability of individual actors.
The SEC continues its fight against "AI-washing," where companies inflate or misrepresent their use of AI technology. Director Grewal highlighted recent settlements with investment advisors who made false claims about their AI capabilities, similar to past actions taken in the Environmental, Social, and Governance (ESG) space.
This is a significant shift. Previously, the SEC's focus was on corporate disclosure failures. Now, individuals involved in AI-related disclosures could face penalties if they:
✅ Knowingly or unknowingly misrepresent the role and risks of AI in their company's operations.
✅ Fail to take reasonable steps to ensure accurate disclosures.
If you're involved in AI development or implementation for publicly traded companies:
- be aware of your potential liability regarding accurate disclosures;
- encourage a culture of transparency within your organization regarding AI use;
- seek guidance from legal and compliance professionals to navigate the evolving regulatory landscape.
#AI#SEC#Disclosure#FinancialMarkets
https://x.com/mrmbb333/status/2052868548574560425?s=52
🛸 THE UFO DISCLOSURE ISN’T THE BIGGEST STORY
Something changed.
Not just in Washington…
but in the skies.
For years people were mocked for talking about strange objects, unexplained lights, military encounters, electrical disturbances, and things that didn’t make sense.
Now suddenly…
files are being released.
Pilots are speaking openly.
Major media outlets are covering it nonstop.
But here’s what stands out
Why is all of this happening at the SAME time the world is seeing:
• increased solar activity
• strange sky phenomena
• drone/satellite concerns
• auroras farther south
• extreme weather worldwide
• nonstop reports coming from the skies
Maybe this was never just about UFOs.
Maybe something bigger is changing around us…
and people are finally starting to notice.
👇
What do YOU think is really going on right now?
#MrMBB333#UFO#Disclosure#SpaceWeather#UAP
Project Bluebeam
Final Stage👽
DON'T TAKE THE BAIT
THEY WILL ENGINEER
THE RAPTURE AS AN ALIEN
ABDUCTION
#ufo#uap#aliens#disclosure#trump
https://t.me/TheSecretArchivesQ
⚠️#ALARM⚠️#BreakingNews⚡️#France🇫🇷
#francophonie#Switzerland#Africa
#France#Population in great #Danger⚡️
#Pfizer#CovidPsyOps#Documents#Revealtions#Disclosure#Website#Truth#Veritee#Action#Genocide#Eris
#NATO is #using France 🇫🇷 as a #testingground.
#Hackers have probably hacked the server of NATO's Scientific Collaboration support office in #Paris and published #Secret⚠️#NATO documents.
These documents reveal extremely shocking facts, namely: the low efficacy of the Pfizer vaccine against the new strain of #Omicron, the high risk of embryonic developmental pathologies and cardiovascular diseases following injection of the vaccine, and NATO's implementation of dangerous experiments in the heart of Paris and the surrounding area.
https://x.com/Najadi4Justice/status/1706713373344223516?s=20