Thursday, March 23, 2023

Jetson Nano and Tensorflow

 

 

https://developer.download.nvidia.com/compute/redist/jp/v44/tensorflow/

tensorflow 1.15.x to 2.3.x 

https://developer.download.nvidia.com/compute/redist/jp/v45/tensorflow/

tensorflow 1.15.x to 2.5.0 

https://developer.download.nvidia.com/compute/redist/jp/v46/tensorflow/

tensorflow 1.15.x to 2.6.2(requires of h5py==3.1.0 and it requires pkconfig)

https://developer.download.nvidia.com/compute/redist/jp/v461/tensorflow/ 
tensorflow 2.7.x
 

Compatibility

tensorflow 2.5.0 requires numpy~=1.19.2

Under Python 3.6.9 (protobuf requires Python '>=3.7' but the running Python is 3.6.9)
 
 
Under Python 3.6.9 (protobuf requires Python '>=3.7' but the running Python is 3.6.9)

 
 
 
Change OS in Jetson
Download image and tool for write img 
https://developer.nvidia.com/embedded/learn/get-started-jetson-nano-devkit#write
 
dd if=/path/to/your/isofile of=/your/usb/disk bs=8M status=progress
  
 
 
 

Tensorflow using virtual environments

Tensorflow 2.6(Current version 2.11 at 2023-03-23)

$ sudo apt-get install python3-venv

$ python3 -m venv envtf26

$ source envtf26/bin/activate

(envtf26) cloud@AsusDesktop:~/Gaia$
 


(envtf26) cloud@AsusDesktop:~/Gaia$ pip list  
Package       Version
------------- -------
pip           20.0.2  
pkg-resources 0.0.0   
setuptools    44.0.0

(envtf26) cloud@AsusDesktop:~/Gaia$ pip install tensorflow==2.6


(envtf26) cloud@AsusDesktop:~/Gaia$ pip install --upgrade protobuf==3.20


(envtf26) cloud@AsusDesktop:~/Gaia$ pip install keras==2.6

(envtf26) cloud@AsusDesktop:~/Gaia$ python3           
Python 3.8.10 (default, Mar 13 2023, 10:26:41)  
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf      
>>> print(tf.keras.__version__)  
2.6.0


(envtf26) cloud@AsusDesktop:~/Gaia$ pip install matplotlib==3.6 #if you install without 3.6 will install 3.7 and it will break tensorflow installation

References:

[1] matplotlib compa https://matplotlib.org/stable/devel/min_dep_policy.html








Wednesday, March 22, 2023

Houdini Repositories

 

 

host: ftp.sidefx.com

Houdini5.5 to Houdini19.5 Installers (Windows.exe/Linux.tar.gz/Macosx.dmg)




Jetson Nano installation

 

Installing cuda11 in Jetson Nano [1]. All instructins works, but doesn't run on it. Better is cuda10.

 

[1] https://jfrog.com/connect/post/installing-cuda-on-nvidia-jetson-nano/

 

 

Errors:

The following packages have unmet dependencies

...
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

Fix:

sudo apt-get -o dpkg::Options::="--force-overwrite" install --fix-broken

 

Tuesday, March 21, 2023

Python and OpenCV issues

Error:

   import cv2, numpy as np,time
 File "/home/fincahuanaco/.local/lib/python3.7/site-packages/cv2/__init__.py", line 3, in <module>
   from .cv2 import *
ImportError: numpy.core.multiarray failed to import

 

Solution:

$ python3 -m pip install opencv-python==4.0.0.21

$ python3 -m pip list  
 

opencv-python          4.0.0.21

numpy                  1.15.0

 

Other combinations

opencv_python==4.4.0.46 and numpy==1.19.3 works.

 

Saturday, March 18, 2023

AWS Python issues

$ curl -O https://bootstrap.pypa.io/get-pip.py
$ python3 get-pip.py --user
 

References:

[1] https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-install-linux.html

 

AWS Common commands

 

Without ifconfig command

public IP

$ curl ifconfig.me

private IP

$ ip addr 

References:

[1] https://opensource.com/article/18/5/how-find-ip-address-linux

Friday, March 17, 2023

Vocal Remover

 

[1] AI Vocal Remover and Isolation https://vocalremover.org/

[2] AI Vocal remover, it split in to tracks https://multimedia.easeus.com/vocal-remover/    #2024

[3] Split Music and Vocal https://studio.mikrotakt.app/  #2024

 

Tuesday, February 28, 2023

ffmpeg: Extract audio and reinsert a new for use in whatsapp

 

#Extract audio

ffmpeg -i mad-pi.mp4 -map 0:a:0 mad-pi_audio.wav 

 

#Extract reinsert new audio

ffmpeg -i mad-pi.mp4 -i mad-pi_audiohd.mp3 -c:v copy -map 0:v:0 -map 1:a:0 new.mp4
 

#reencode for whatsapp

ffmpeg -i new.mp4 -c:v libx264 -profile:v baseline -level 3.0 -pix_fmt yuv420p working.mp4

 

Friday, February 17, 2023

Python tools for Web Developers

 

[1] FastAPI https://fastapi.tiangolo.com/

[2] Dash Python https://dash.plotly.com/background-callbacks

 

Wednesday, February 15, 2023

Ringtones: Download mp3

 

 

Resources:

[1] Easy download https://mp3-ringtone.com/

[2] Play and using FireBug download https://www.zedge.net/find/ringtones/2023


Monday, February 13, 2023

ffmpeg: Extract mp3 from video

 

 ffmpeg -i mad-principio_peter.mp4 -vn -y out1.mp3 #9M

 

ffmpeg -i mad-principio_peter.mp4 -f mp3 -ab 192000 -vn out2.mp3 #14M

ffmpeg -i mad-principio_peter.mp4 -f mp3 -ab 128000 -vn out3.mp3 #9M
ffmpeg -i mad-principio_peter.mp4 -vn -acodec libmp3lame out4.mp3 #9M

ffmpeg -i mad-principio_peter.mp4 -acodec libmp3lame -ab 128k out5.mp3 #9M

ffmpeg -i gym.mp4 -f webm -c:v libvpx -b:v 1M -acodec libvorbis gym.webm -hide_banner

Second

ffmpeg -i sample.avi -q:a 0 -map a sample.mp3  #complete
ffmpeg -i sample.avi -ss 00:03:05 -t 00:00:45.0 -q:a 0 -map a sample.mp3 #fraction
Parameters :
-q:a 0 for variable bit rate
-ss starting timestamp
-t  the encoding time (If you don't specify, it will go to the end)
-map 0:a:3 selects audio stream #4 (ffmpeg starts counting from 0) 
** specific the timestamps in HH:MM:SS.xxx format.

 

References:

[1] https://json2video.com/how-to/ffmpeg-course/ffmpeg-extract-audio.html

Friday, December 23, 2022

Download zip file from Google Drive

 First

Share your file in GD (with anybody access by link) and get FILEID

Second

Execute next code(replace FILEID and choose FILENAME):

wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=FILEID" -O FILENAME && rm -rf /tmp/cookies.txt

 

Note:

Previous methods doesn't work, because now GD needs confirmation, then using cookies it's possible.

Monday, December 12, 2022

Ubuntu NFS Installation

On Server (10.10.7.229):

$ sudo apt install nfs-kernel-server  #install server

$ sudo mkdir -p /mnt/nfs_drive  #create share point

$ sudo chown -R nobody:nogroup /mnt/nfs_drive  #no owner

$ sudo chmod 777 /mnt/nfs_drive  #set r/w permission

$ sudo vi /etc/exports  #define clients grants
 

/mnt/nfs_drive 10.10.7.218(rw,sync,no_subtree_check) #mine
/mnt/nfs_drive 10.10.7.235(rw,sync,no_subtree_check) #houdini

$ sudo exportfs -a

$ sudo systemctl restart nfs-kernel-server
 

On Client: 

$ sudo apt install nfs-common 

$ sudo mkdir -p /mnt/nfs_drive_client   #mirror

$ sudo mount 10.10.7.229:/mnt/nfs_drive /mnt/nfs_drive_client

Notes: 

$ sudo ufw status  #verify the firewall, more details in reference[0]


References: 

[0] Working https://linuxhint.com/install-and-configure-nfs-server-ubuntu-22-04/

[1] https://www.tecmint.com/install-nfs-server-on-ubuntu/

Wednesday, November 23, 2022

qemu bridge to enable network during simulation

 Install brctl

 sudo apt install bridge-utils

Add new virtual bridge

sudo brctl addbr virbr0
sudo brctl addif virbr0 eth0 

Check

/etc/qemu-ifup and /etc/qemu-ifdown  #files
 

 

 

 

Monday, November 21, 2022

Candide Model Applications

 

[0] Model and code https://github.com/wobushizhanghua/candide3-face/blob/master/src/main.cpp

[1] Landmark 3D https://webspace.science.uu.nl/~veltk101/publications/art/wss06.pdf 

[2] https://github.com/MarekKowalski/FaceSwap

[3] https://github.com/jorticus/face-replace/blob/master/README.md

 

Friday, November 18, 2022

Gimp Python-Fu

 

[0] https://www.gimp.org/docs/python/index.html#PREGION-OBJECT-MEMBERS

[1] https://www.gimp.org/docs/python/index.html#DRAWABLE-OBJECT-METHODS

[2] http://myvirtualbrain.blogspot.com/2012/06/gimp-python-fu-very-basics.html 

[3] Samples https://github.com/jfmdev/PythonFuSamples

[4] https://github.com/gummyCowboy/GIMP-python-fu

[5] https://gist.github.com/garystafford/5259576a7e9299d5b80284489aa25fc3


Tuesday, May 31, 2022

OnLine Animation

[0] gif editor crop, mp4 to gif https://ezgif.com

[1] https://www.powtoon.com/?locale=en

[2] https://www.animaker.com/

[3] https://biteable.com/

 

 

Tuesday, May 10, 2022

Houdini Trying to use textures

 

[1] How to use textures on Houdini

http://wordpress.discretization.de/houdini/home/advanced-2/textures/

[2] Repository of textures with normals

https://opengameart.org/content/50-free-textures-4-normalmaps

[3] Textures for Blender

https://polyhaven.com/textures/brick/outdoor/wall

[4] HDRs (Environment Ilumination patterns) https://polyhaven.com/hdris

Thursday, May 05, 2022

NVIDIA tools

 

 

[1] https://github.com/NVIDIA/warp

https://media.githubusercontent.com/media/NVIDIA/warp/main/docs/img/gifs/nanovdb.gif

Tuesday, May 03, 2022

Ubuntu upgrade cmake

 

1. Download https://cmake.org/download/

2. Unpack and enter to folder to execute commands

./bootstrap
make -j$(nproc)
sudo make install
 

 References

[1] https://askubuntu.com/questions/355565/how-do-i-install-the-latest-version-of-cmake-from-the-command-line

 

Wednesday, April 27, 2022

Monday, April 25, 2022

Python tools

#Force to install a version Python-3.7.4

 wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz

tar xvf Python-3.7.4.tgz
cd Python-3.7.4
./configure --enable-optimizations --with-ensurepip=install
make -j 8
sudo make altinstall



#Install pip module into any version of Python

curl -o get-pip.py https://bootstrap.pypa.io/pip/get-pip.py
python3.8 get-pip.py  #or
python3.9 get-pip.py

Wednesday, March 23, 2022

Stock Price Prediction - data source

 

[1] Nasdaq API https://data.nasdaq.com/sign-up 

[2] API https://data.nasdaq.com/tools/python (API is in setting option)


Sunday, March 20, 2022

Monday, March 14, 2022

Convert webp to png

 

Any file to PNG

$ sudo apt install webp
$ for i in *.webp; do name=`echo "$i" | cut -d'.' -f1`; echo "$name"; dwebp "$i"
-o "${name}.png"; done

Add to Nautilus Script
fincahuanaco@pisces:~/.local/share/nautilus/scripts$ cat toPNG   
dwebp $1 -o "$1.png"
rm $1

$chmod +x toPNG 
 
Updated to Selection to PNG (2023)
#!/bin/bash
count=0
success=0

# Transform command line arguments (if provided)
[[ -z "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" ]] &&
NAUTILUS_SCRIPT_SELECTED_FILE_PATHS=$(printf "%s\n" "$@")

# Process each file in turn
while IFS= read -r src
do
if [[ -f "$src" ]]
then
# Target
dst="${src}.png"

# Primary conversion to PNG
step=0

dwebp $src -o $dst && ((step++))

# Remove src
if [[ step -eq 1 ]]
then
rm $src && ((step++))
fi

# Update
if [[ step -eq 2 ]]
then
((success++))
fi

# Count it
((count++))
fi

done <<<"$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS"

[[ count -gt 1 ]] &&
notify-send "Conversion finished ($success files of $count)"

exit $((count - success)) 
 
AVIF format support
[1] libavif https://github.com/AOMediaCodec/libavif/ 
 
References:

[1] https://unix.stackexchange.com/questions/710013/making-a-bash-script-apply-to-only-selected-files-nautilus 








Saturday, March 12, 2022

Linux Libraries path

#Cuda 8.0 Settings
export CUDA_HOME=/usr/local/cuda-8.0
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64  
PATH=${CUDA_HOME}/bin:${PATH}


#Cuda 9.1 Settings
export CUDA_HOME=/usr/local/cuda-9.1
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64  
PATH=${CUDA_HOME}/bin:${PATH}


#Cuda 9.2 Settings
export CUDA_HOME=/usr/local/cuda-9.2
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64  
PATH=${CUDA_HOME}/bin:${PATH}

 

$ LD_LIBRARY_PATH=. ./programtest  #direct execution
 

$ echo $LD_LIBRARY_PATH  
/usr/local/cuda-8.0/lib64
 

$ ls /etc/ld.so.conf.d
cuda-8-0.conf                   opencv.conf
fakeroot-x86_64-linux-gnu.conf  x86_64-linux-gnu.conf
glew.conf                       x86_64-linux-gnu_EGL.conf
i386-linux-gnu.conf             x86_64-linux-gnu_GL.conf
libc.conf                       zz_i386-biarch-compat.conf

$ldconfig -p  #list libraries

$sudo ldconfig #update paths

 

 


 

C/C++ Tools

 

[1] BIC Interactive C tracer https://github.com/hexagonal-sun/bic


Friday, March 11, 2022

Miner cryptocurrency

 

[0] Card power https://whattomine.com

[1] Linux Dodge https://www.youtube.com/watch?v=Ng-OU38-RjY

     Tool for mine Dodge https://xmrig.com/download

[2] Linux bittorrent https://www.youtube.com/watch?v=y5EWimXPOD0 

[3] Linux Minero(Alternative to xmrig) https://www.youtube.com/watch?v=NMMiT_eMd-s

[1] Windows tool https://unmineable.com/coins/MATIC

[2] How to mine Matic ESP https://www.youtube.com/watch?v=m_qLQQSWRW0

 

Wednesday, February 23, 2022

Cryptomarket Trading and bots

Bots

[1] Master disseration about bots https://repositorio.ufpe.br/bitstream/123456789/30495/1/DISSERTA%C3%87%C3%83O%20Severino%20Mizael%20da%20Silva.pdf

[2] Api info https://www.mercadobitcoin.com.br/trade-api/

[3] Documentation https://www.mercadobitcoin.com.br/docv4#section/Overview 

[3] Documentation v5.3 https://api.mercadobitcoin.net/api/v4/docs

[3] Glossary https://www.mercadobitcoin.com.br/trade-api/#glossario-trade-api

[4]  Api Wrapper MB

       https://github.com/mbampi/mercado-bitcoin 

       https://github.com/samuelfac/mb-api-client-python

[5] Api Wrapper Binance https://python-binance.readthedocs.io/en/latest/

 

Other Strategies

[1] https://zignaly.com/

[2] Free option/triggers https://www.cryptohopper.com/pricing 

[3] Copy trading https://www.napbots.com

[4] Bots $15 / month  https://tradesanta.com/en/pricing 

[5] 1 free Bot https://3commas.io/pricing

[6] AI powered https://signalboa.com

[7] Bots https://bitsgap.com/pricing/



 


Thursday, February 17, 2022

Paraview Convert VTK file to PLY using Paraview script

 

1. vtk2ply 


from paraview.simple import *

import sys

pFrame30vtk = LegacyVTKReader(FileNames=[sys.argv[1]])

SaveData(sys.argv[2], proxy=pFrame30vtk)

Odoo 17 - Custom adds

    [1] Diario/Seq https://apps.odoo.com/apps/modules/17.0/sequence_for_journal