Что делать если нужно поставить какую-то Python-библиотеку а root-прав нет? То есть в систему библиотеку никак и ничего не поставить.
Есть как минимум два способа это решить правильно!
🔸 Сделать виртуальное окружение и ставить там что угодно.
Это позволит создать полностью независимое исполняемое окружение для ваших приложений.
Все библиотеки будут храниться в домашней директории юзера а значит доступ на запись имеется.
Создать очень просто:
python3 -m venv ~/venvs/myenvname
Теперь активируем окружение
# Linux
source ~/venvs/myenvname/bin/activate
# Windows
%userprofile%\venvs\myenvname\Scripts\activate.bat
Можно ставить любые библиотеки и запускать приложение.
Это стандартный метод работы с любым проектом. Если еще не используете его, то пора начинать. Даже при наличии root доступа!
🔸 Бывает, что нет возможности запустить приложение из своего виртуального окружения. Например, его запускает какой-то сервис от вашего юзера и вставить активацию окружения вы не можете.
В этом случае можно установить библиотеки для Python не глобально в систему, а только для юзера.
Выполните этот код в консоли:
python3 -m site
Вы получите что-то такое:
sys.path = [
'/home/user',
'/usr/lib/python37.zip',
'/usr/lib/python3.7',
'/usr/lib/python3.7/lib-dynload',
'/home/user/.local/lib/python3.7/site-packages',
...
]
USER_BASE: '/home/user/.local'
USER_SITE: '/home/user/.local/lib/python3.7/site-packages'
ENABLE_USER_SITE: True
Нас интересует параметр USER_SITE. Это путь к пользовательским библиотекам, которые доступны по умолчанию, если они есть.
Именно сюда будут устанавливаться модули если добавить флаг --user при установке чего-либо через pip
pip install --user requests
Для этой команды не нужны root-права.
После неё можно запускать системный интерпретатор без виртуальных окружений и установленная библиотека будет доступна для текущего юзера.
Параметр USER_BASE показывает корневую директорию для хранения user-библиотек. Её можно изменить с помощью переменной окружения PYTHONUSERBASE
export PYTHONUSERBASE=~/pylibs
python3 -m site
...
USER_BASE: '/home/user/pylibs'
USER_SITE: '/home/user/pylibs/lib/python3.7/site-packages'
Получается некоторое подобие виртуального окружения для бедных 😁 которое можно менять через эту переменную (не делайте так!Лучше venv!)
🔸 Дописывание пути в PYTHONPATH
Этот способ не входит в список "двух правильных", но тоже рабочий. Здесь придётся сделать всё несколько сложней.
Сначала ставим библиотеку в любое место указывая путь установки
pip3 install -t ~/mylibs modulename
Библиотека установится без привязки к какому-либо интерпретатору. То есть по умолчанию не будет видна. Теперь в нужный момент добавляем этот путь в sys.path или в PYTHONPATH.
Не буду советовать так делать. Единственный раз когда этот способ мне пригодился и решил поставленную задачу, это при создании общей библиотеки для кластера компьютеров.
Модули лежат в сети и подгружаются для всех из одного и того же места. То есть обновлять файлы требуется только один раз а не на всех хосты отдельно.
Минусы такого подхода:
▫️Нужно всем хостам пробить нужный путь в .bashrc или ещё куда-то чтобы он сетапился на старте.
▫️Чем больше хостов тем больше нагрузка на сеть. Иногда такой способ не подходит именно по этой причине. Тогда Ansible вам в помощь.
▫️Не очень подходит если хосты с разными операционками. Некоторые библиотеки различаются для Linux и Windows (там, где есть бинарники) и приходится мудрить более сложные схемы.
#tricks#basic
As we continue to live under increasingly dystopian regimes, the need for secure communications is more vital than ever. Telegram has been a great resource and platform for disseminating information and content, but it certainly isn't perfect either.
Some research was done into which digital communication protocols are most ideal for our purposes:
https://telegra.ph/WEbHqRllMIfQa5YzpTSJBrNxfo6tu9-Digital-Communication-Protocols-09-08
The top picks are as follows and are in no particular order:
XMPP
NextCloud
Jami
Briar
Tox
Kontalk
Delta Chat
Bitmessage
Ricochet
Status
Scuttlebot
Session has not had an E2E audit completed yet, but not a bad choice
ȱ
Protocol for SYnchronous Conferencing (PSYC)
Matrix is not recommended: https://www.hackea.org/notas/matrix.html
CAUTION: peer-to-peer communications reveal one's IP address to each other, so using a reliable VPN, proxy, or TOR is advised. Briar is an exception to this rule, as it uses either Bluetooth range or the local network it's connected to; else all traffic goes through TOR. Ones without servers are ideal, such as: Jami, Tox, Ricochet, Status, Scuttlebot, ȱ, and PSYC-2. Some are still in development and may be prone to bugs.
Keep these options in mind when communicating with your clique. Many of us belong to private groups on Telegram which are presumably free from moderator surveillance (or at least interference), but ultimately we should transition to a more durable platform that will be unable to censor our messages. Try a few out and see what works for you and your crew.
#im
#review
#im the editor of this. This is not my own work, made by a friend. Please review
I know you're tired.I know you live with demons ,ones that are loved and close. I know how relentless they are in their pursuit of u...I know you spend your days trying to silence them and your nights trying to hide from them-and the hell they put you through. Most of all, I know how hard u work to hide it all, to pretend you're fine, to paint a convincing smile upon ur face, and to act as if all is well with ur battered soul.
I know that all of this has left you exhausted—that you've numbered yourself and hurt yourself and starved urself in the hope that their voices will become silent and their fists will be lifted and you can finally breathe again. I know that right now it doesn't seems like moment will ever come. I know right now you'd rather leave than live. And even though I'm not standing in your shoes right now, and even though I don't know you, and even though I have no right at all—I'm asking you to stay ...to endure your incredibly painful, totally senseless now because I can see your glorious, blindingly beautiful then, if you do.
If u stick around, u will reach a spot that the sadness won't let right now- You'll reach tomorrow. And that is filled with possibility. It's a day you have been to. It's not this terrible day. There, you will not feel exactly What you are feeling right now...You may be stronger, or see things differently, or find a clearing, and life may look a way it hasn't in a long time. It may look like worth staying for...Tomorrow is the place where hope lives, and I want you to give yourself a chance to share space with that hope- to dance with it, to rest in it, to dream within it because you deserve it...
Dissapointments and regrets are mistakes...And you know there'll be moments of despair and painful seasons and dark nights of the soul you'll need to endure. You'll screw things up and be let down. You'll hurt, and you'll wonder how you'll ever make it through! But it's okay. Giving up is never the solution. Tomorrow will make you better
Instant messaging apps review
I tested a lot & mulled on this for a while.
Our goal was something less centralized, more private & harder to take down or block.
BRIAR is good & with p2p modes to be censorship resistant if internet is cut, but you have to invite each user separately to a group which is a pain
XMPP is archaic & behaves like a traditional one to one messenger. Yes, groups are there but are more like texting groups & you can't tag or reply to anyone directly.
MATRIX is better but ends up being 3rd party centralized because hosting yourself is a hog, which means you're bound by that hosted server & all those rules, giving up your email credentials, getting possibly kicked off, etc. Matrix.org server started requiring email verification for instance.
Matrix doesn't encrypt metadata, your IP is visible to others in chats.
The last 2 require a hosted server somewhere for large groups to function properly, and so does SESSION since it too has no servers of it's own. But its way lighter than Matrix & can be hosted on a mediocre VPS (which I've done, I can pay, its cheap its fine). The added benefit of Session is everything is onion routed automatically, and there's zero identifying factors when creating an ID. No phone numbers, no emails, nothing. Restore that ID on a new device using a cryptic passphrase, or start a new one if you want.
Check out @Nogoolag room with SESSION:
http://chat.nogoolag.com/nogoolag?public_key=53b45de08520eb3af97933e9a4991e74e26972ee91cc94e6a05da03d956d4313
#im#session
kMeet
Free and secure videoconferencing solution
kMeet is a videoconferencing solution that respects your privacy for all your discussions.No e-mail address, no advertising and no registration are required. Your discussions are not analysed and are only transmitted through Infomaniak servers in Switzerland.
Features :
- Create online (audio and video) meetings with multiple people
- Excellent audio quality
- Unlimited number of participants (subject to resources)
- No apps required for desktop computers
- Join meetings hosted by Infomaniak Meet or Jitsi
- Protect access to your meetings with a password
- Discuss and share resources via the integrated chat function
- Invite your participants via a URL
Download - https://play.google.com/store/apps/details?id=com.infomaniak.meet
https://github.com/Infomaniak/android-infomaniak-meet
#im#Videocall
@foss_Android
AURA
=> https://github.com/Oxule/Aura
AURA is a decentralized messenger leveraging Nearby Connections technology to create robust mesh networks. It thrives where the internet fails, bypassing censorship and eliminating central points of failure.
✨ Key Features
🌐 Offline Mesh: Powered by Bluetooth and Wi-Fi Direct. Messages hop from device to device seamlessly.
🎭 The Aura: A unique digital identity concept. Your specific color, icon, and behavior patterns form your "Aura" within the network.
🔐 Total Privacy: End-to-End (E2E) encryption for all data. Complete anonymity: messages are injected into a shared distributed ledger without sender or recipient metadata.
🛡 Flood Protection: Smart architecture designed to mitigate "Blackhole" and flood-based attacks.
🎨 Modern UI/UX: A smooth, intuitive interface that bridges the gap between high security and everyday usability.
#Mesh#p2p#im
@dcntr