Thursday, November 28, 2019

PYQT5 kullanımı

KURULUM
sudo apt-get install python3-qt5
sudo apt install python3-pyqt5.qtsql
sudo apt-get install qttools5-dev-tools

/usr/lib/x86_64-linux-gnu/qt5/bin/designer 


ARAYUZ DOSYASINI PY ye çevirmek

python3 -m PyQt5.uic.pyuic -x arayuz.ui -o arayuz.py


Monday, November 25, 2019

Python ile Yerel Ağda Dosya Paylaşımı

Merhaba arkadaşlar bugün çok kullanışlı bir özellik olan lan ağında dosya paylaşımını kolay bir şekilde göreceksiniz.
Python ile http server kuruyoruz ve bizim ip adresimiz ve tanımladığımız port üzerinden insanlar bizim sunucumuza bağlanıyor python kodunu çalıştırdığımız dizindeki dosyalara erişebiliyor.
Terminale(Windows kullanıyorsanız cmd veya powershell) aşağıdaki komutlardan bir tanesini yazıyoruz X.X.X.X yazdığım kısma kendi ip adresinizi yazarak kullanabilirsiniz. İki kodun hiç bir farkı yoktur. Sadece adres çubuğuna yazmanız gereken ip adresi değişecektir.


python3 -m  http.server --bind X.X.X.X 8000
python3 -m  http.server 8000
Bu yöntemi alternatif olarak telefonunuzun hotspot özelliğini açıp mobil verinizi kapatıp istediğiniz cihazları bağlayarak kullanabilirsiniz.
İyi günler…

Ubuntu 18.04 NVIDIA, CUDA 10.1 ve cuDNN kurulumu

NVIDIA için:
sudo apt-get update
sudo apt-get upgrade




Kendimize ait olan driver versiyonunu indiriyoruz.
Terminale gelip indirdiğimiz yerde aşağıda kodu yazarak executable yapıyoruz.
sudo chmod +x NVIDIA-Linux-x86_64-418.88.run
Sırada gcc ve make yüklemekte;
sudo apt-get install gcc
sudo apt-get install make
sudo bash -c "echo blacklist nouveau > /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
sudo bash -c "echo options nouveau modeset=0 >> /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
Aşağıdaki kod ile kontrol edin. Çıktı şu şekilde olmalı:
blacklist nouveau
options nouceau modeset=0
cat /etc/modprobe.d/blacklist-nvidia-nouveau.conf
Kernal initramfs güncelleme
sudo update-initramfs -u
32-bit mimarisinin kurulumu
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install libc6:i386
Yeniden başlat
sudo reboot
Şimdi konsol moda giriyoruz
ctrl + alt + F2
Kullanıcı adı ve şifre giriyoruz. Terminalde nvidia drive ı indirdiğimiz yere giriyoruz ve gerekli kodları yazıyoruz.
sudo telinit 3
sudo bash NVIDIA-Linux-x86_64-410.73.run
Kurulumumuz tamamlanmıştır. Aşağıdaki kod ile kontrol edebilirsiniz.
nvidia-smi
CUDA KURULUMU
Aşağıda linke gidiyoruz.




sudo apt-get install g++ freeglut3-dev build-essential libx11-dev \
    libxmu-dev libxi-dev libglu1-mesa libglu1-mesa-dev
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin

sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600

wget http://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda-repo-ubuntu1804-10-1-local-10.1.243-418.87.00_1.0-1_amd64.deb

sudo dpkg -i cuda-repo-ubuntu1804-10-1-local-10.1.243-418.87.00_1.0-1_amd64.deb

sudo apt-key add /var/cuda-repo-10-1-local-10.1.243-418.87.00/7fa2af80.pub

sudo apt-get update

sudo apt-get -y install cuda


sudo vim ~/.bashrc
Insert tuşuna basarak aşağıdaki yazıları ekliyoruz.
export PATH=/usr/local/cuda-10.1/bin:/usr/local/cuda-10.1/NsightCompute-2019.1${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
ESC tuşuna bastıktan sonra “:wq” yazıp enter a basarak çıkıyoruz.
cuDNN KURULUMU
Linkten 3 dosyayı indiriyoruz.




Runtime Library, Developer Library, Code Samples and User Guide
sudo dpkg -i libcudnn7_7.0.3.11-1+cuda9.0_amd64.deb
sudo dpkg -i libcudnn7-devel_7.0.3.11-1+cuda9.0_amd64.deb
sudo dpkg -i libcudnn7-doc_7.0.3.11-1+cuda9.0_amd64.deb
Çalışmasını şu şekilde test ediyoruz:
cp -r /usr/src/cudnn_samples_v7/ $HOME
cd  $HOME/cudnn_samples_v7/mnistCUDNN
make clean && make
./mnistCUDNN
Test passed!
Eğer bu çıktıyı alıyorsanız başarılı bir şekilde bitti. İyi günlerde kullanın 🙂

Friday, November 8, 2019

Ubuntu 18.04 Opera video problem


Terminalde bu konuma gidiyorsunuz:
cd /usr/lib/x86_64-linux-gnu/opera

Bu kodu yapıştırınca sorunuz çözülüyor.
sudo ln -sf /usr/lib/chromium-browser/libffmpeg.so libffmpeg.so

Friday, November 1, 2019

python3 vırtualenv

python3 -m venv venv

çalıştırma(run)
. venv/bin/activate

UBUNTU 18.04 pip3 upgrade

Installation with sudo

With regard to installing pip, using curl (instead of wget) avoids writing the file to disk.
curl https://bootstrap.pypa.io/get-pip.py | sudo -H python3.6
The -H flag is evidently necessary with sudo in order to prevent errors such as the following when installing pip for an updated python interpreter:
The directory '/home/someuser/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/someuser/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

Installation without sudo

curl https://bootstrap.pypa.io/get-pip.py | python3.6 - --user
This may sometimes give a warning such as:
WARNING: The script wheel is installed in '/home/ubuntu/.local/bin' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

file tree for nodejs project

 find . \( -path "*/node_modules" -o -path "*/.git" \) -prune -o -print | tree -a -I 'node_modules|.git'