Sublime Text İçine Wsl Bash Ekleme
Sublime Text İçine Wsl Bash Ekleme Buradaki adımlarla Sublime Text'e Terminus Package ile bash eklenebilir. Öncelikle Termin...
Print Linux Path Without Duplicates on different lines
If you want to print the path and seeing so many duplicates or seeing everything nn the same line, you can use this solution.
Normally the solution to print path on different lines is:
echo "$PATH" | tr : "\n"
but only this wouldn't remove the duplicates.
To remove the duplicates, open ~/.bashrc and paste this to the end of file:
PATH="$(perl -e 'print join(":", grep { not $seen{$_}++ } split(/:/, $ENV{PATH}))')"
export PATH
alias listpath='echo "$PATH" | tr : "\n"'
This command makes sure that it will remove the duplicates and keep the correct order.
It also creates an alias so using `listpath` command would easily print as we want.
Case Converter
Case Converter
Paste text, then choose one of the case options.
Linux'ta Global uv Base Ortamı Kurulumu
uv kullanarak varsayılan python base environment (ortam) oluşturma (Conda base ortamına benzer şekilde)
1. uv Kurulumu
curl -LsSf https://astral.sh/uv/install.sh | sh
Shell'i yeniden yükleyin:
source ~/.bashrc
Kurulumun tamamlandığını kontrol edin:
uv --version
2. Base Ortamını Oluşturma
Base ortamını uv'nin dosyalarının bulunduğu yerde oluşturma:
uv venv ~/.local/share/uv/environments/base
Aktifleştirin:
source ~/.local/share/uv/environments/base/bin/activate
Pip pakedini ekleyin:
uv pip install --upgrade pip
Genel paketleri kurun (örnek):
uv pip install ipython fastapi
3. Base Ortamını Otomatik Aktifleştirme (ve Proje .venv Önceliği)
~/.bashrc dosyasına ekleyin:
# Eğer proje'de .venv varsa onu, yoksa uv base ortamını aktifleştir
if [ -x "$PWD/.venv/bin/python" ]; then
source "$PWD/.venv/bin/activate"
else
source ~/.local/share/uv/environments/base/bin/activate
fi
# Kısayol ekleme
alias ac-base='source ~/.local/share/uv/environments/base/bin/activate'
Terminal'i tekrardan yenileyin:
source ~/.bashrc
4. Kullanım
Yeni bir terminal açtığınızda:
.venv/bulunan bir projedeyseniz → proje ortamı otomatik aktifleştirilir.Proje dışındaysanız → uv base ortamı otomatik aktifleştirilir.
Python'ı kontrol edin:
which python
Devre dışı bırakmak isterseniz:
deactivate