Thursday, October 11, 2018

Filtering



References:
[1] http://cattedraledigitale.isti.cnr.it
      2012 Bilateral filters https://onlinelibrary.wiley.com/doi/full/10.1111/j.1467-8659.2011.02078.x

[2] http://files.is.tue.mpg.de/pgehler/assets/publications/jampani16learning/jampani16learning.pdf
[3] https://zapdf.com/fast-high-dimensional-filtering-using-clustering.html


[6] http://www.inf.ufrgs.br/~oliveira/students_dissertations/PhD/Eduardo_Gastal_PhD_Dissertation.pdf
[7] https://is.tuebingen.mpg.de/uploads_file/attachment/attachment/259/0766_cameraready.pdf
[8] http://www.scitepress.org/Papers/2016/57151/57151.pdf
[9] http://vision.ai.illinois.edu/publications/yangijcv2015.pdf
http://openaccess.thecvf.com/content_cvpr_2018/papers/Wu_Fast_End-to-End_Trainable_CVPR_2018_paper.pdf
http://perso.ensta-paristech.fr/~manzaner/Publis/icpr10.pdf
http://www.cs.cityu.edu.hk/~rynson/papers/tcsvt16a.pdf
https://arxiv.org/pdf/1505.00077.pdf
https://fukushima.web.nitech.ac.jp/paper/2016_visapp_fujita.pdf
http://www.riken.jp/brict/Yoshizawa/Papers/cgf09yby.pdf

High-dimensional integration without Markov chains, Alexander gray
https://www.cs.ubc.ca/~nando/nipsfast/slides/high.pdf

Fast edge-preserving/-aware high dimensional filters for image & video processing https://www.slideshare.net/yuhuang/fast-edge-preservingaware-high-dimensional-filters-for-image-video-processing

 

Aditional
[1] Parallel methods for Numeric Analysis http://adl.stanford.edu/cme342/Home.html
[2] Fast Multipole Methods https://www.math.uci.edu/~chenlong/MathPKU/FMMsimple.pdf

Resources
[1] ImageStack https://code.google.com/archive/p/imagestack/
                          https://github.com/abadams/imagestack
[2] RGBD Utils, use ImageStack https://github.com/s-gupta/rgbdutils

[3] Recursive bilateral filtering  https://github.com/ufoym/RecursiveBF
    ./rbf girl_out.bmp girl.bmp 0.1 0.04
    file https://media.macphun.com/img/uploads/uploads/macphun/noiseless/nl_slider_1_b.jpg
[4] Bilateral grid http://groups.csail.mit.edu/graphics/bilagrid/
[5] Bilateral upsampling http://people.csail.mit.edu/jiawen/

Python tools
[1] ndimage 3D convolution https://docs.scipy.org/doc/scipy-0.16.0/reference/ndimage.html


Monday, September 24, 2018

opengl compile error

Compiling Collisions, quadtrees, uniform grid.

https://github.com/MarcusMathiassen/P2D

$g++ Circle.cpp getTime64.cpp Process.cpp Utility.cpp Color.cpp      hwinfo.cpp Inputs.cpp Quadtree.cpp  Vec2.cpp Config.cpp main.cpp Rect.cpp FixedGrid.cpp Node.cpp Render.cpp -I ../include/  -lGL -lglut -lGLU -lGLEW -lpthread -lX11 -lglfw  -o q5


error while loading shared libraries: libGLEW.so.2.1: cannot open shared object file: No such file or directory

$sudo apt-get install libglew-dev
$locate libGLEW.so.2.1
...
/usr/lib64/libGLEW.so.2.1.0
/usr/local/lib/libGLEW.so.2.1
/usr/local/lib/libGLEW.so.2.1.0
...
...

sudo vi /etc/ld.so.conf.d/glew.conf
/usr/local/lib

$sudo ldconfig

Resources:
[1] https://sourceforge.net/projects/glew/files/glew/snapshots/

Friday, September 14, 2018

3D Models & tools


1) Open .obj 3D format

view3dscene
$sudo apt-get install view3dscene

meshlab - System for processing and editing triangular meshes
$sudo apt-get install meshlab

g3dviewer
$sudo apt-get install  g3dviewer

Other tools

  1. glc_player which is said to read-and-show '.3ds', '.obj', '.stl', '.off', '.3dxml', and Collada ('.dae') files
  2. g3dviewer which is said to read-and-show '.3ds', '.lwo', '.obj', '.dxf', '.md2', '.md3', '.wrl', '.vrml', '.dae' (COLLADA), '.ase' (ASCII Scene Exporter), '.ac' (AC3D)
  3. ivview which reads-and-shows '.iv' and VRML1 files
  4. paraview which reads-and-shows '.ply' and '.vt*' files
  5. varicad-view which reads-and-shows '.dwg' (2D), '.dxf' (2D only?), '.igs' (maybe?), '.stp' (3D) files 
  6. wings3d - Nendo-inspired 3D polygon mesh modeller (legacy)
  7. gmsh - Three-dimensional finite element mesh generator
  8. libadmesh-dev - Tool for processing triangulated solid meshes.
  9. libgmsh-dev - Three-dimensional finite element mesh generator.
  10. libmadlib-dev - mesh adaptation library
  11. libnglib-dev - Automatic 3d tetrahedral mesh generator development files
  12. libscotch-dev - programs and libraries for graph, mesh and hypergraph partitioning
  13. netgen - Automatic 3d tetrahedral mesh generator
  14. libtriangle-dev - High-quality 2-D mesh generator development files
Resources
 [1] mview http://mview.sourceforge.net/

Models
  [1] .max, .obj, blender, etc. www.turbosquid.com
  [1] http://tf3dm.com/

Thursday, September 13, 2018

Python extending functions from C/C++



References
[1] https://docs.python.org/3/library/ctypes.html

https://cython.readthedocs.io/en/latest/src/tutorial/cython_tutorial.html
https://opensourceforu.com/2010/05/extending-python-via-shared-libraries/
https://en.wikibooks.org/wiki/Python_Programming/Extending_with_C%2B%2B


Friday, September 07, 2018

Linear Regresion



[1] Regresion linear http://onlinestatbook.com/2/regression/intro.html
[2] https://towardsdatascience.com/linear-regression-with-example-8daf6205bd49


Wednesday, September 05, 2018

pip3 ImportError: cannot import name 'main'


In linux you need to change the file: /usr/bin/pip3 from:
 
from pip import main
if __name__ == '__main__':
    sys.exit(main())

to:

from pip import __main__
if __name__ == '__main__':
    sys.exit(__main__._main())
 
 

Monday, September 03, 2018

c++ realloc references



https://en.cppreference.com/w/c/memory/realloc
https://www.tutorialspoint.com/c_standard_library/c_function_realloc.htm

Thursday, August 30, 2018

Linux: mount folder to different folders

Code:
mount -o bind /media/disk1/pictures /home/user1/pictures
mount -o bind /media/disk1/pictures /home/user2/pictures
for add a fstab entry to auto-mount at startup.


Code:
/media/disk1/pictures /home/add1cker/pictures none defaults,bind 0 0

Sunday, August 26, 2018

Tuesday, August 21, 2018

Raspberry pi 3


1) user and passwords:
Distribution   | Username   | Password
---------------|------------|-------------
Debian Squeeze | pi         | raspberry
Arch           | root       | root
QtonPi         | root       | rootme
Raspbian       | pi         | raspberry
OpenElec       | root       | openelec
Pidora         | root       | raspberrypi
RISC OS        | n/a        | n/a
raspbmc        | pi         | raspberry
 
2) add users

$sudo adduser username
$usermod -aG sudo username
 
3) Ports
 
$lsof -nP -i | grep LISTEN
$netstat -tlpn | grep LISTEN
 
4) vncserver (reinstall, by default sometime doesn't works)
$sudo apt-get install tightvncserver 

5) Firewalls

iptables -I INPUT -p tcp --dport 5900 -j ACCEPT
iptables -I INPUT -p tcp --dport 5901 -j ACCEPT

Resources:
[1] https://www.digitalocean.com/community/tutorials/how-to-create-a-sudo-user-on-ubuntu-quickstart
[2] direct way https://www.shellhacks.com/how-to-grant-root-access-user-root-privileges-linux/
[3] vncserver https://quaintproject.wordpress.com/2013/03/24/establish-a-vnc-connection-to-your-raspberry-pi-from-a-linux-pc/
 
 
 

Thursday, August 16, 2018

Optimize code C/C++

If you are using linux: use getchar_unlocked() and putchar_unlocked() for taking fast single character I/O.
In Windows the equivalent is getchar() and puchar() repectively



Resources:
[1] fast input/output https://ideone.com/BrsDz4


Enteprise solutions:
[1] http://www.fastformat.org/

Thursday, August 09, 2018

Programming online C++ and others

Online programming tools

Resources:
[1] C++, Python  https://repl.it/@melhorum


[2] Multi Language Support https://code.dcoder.tech/

[3] Account for C/C++, C#, Java  http://rextester.com
[4] http://www.onlinegdb.com/


Wednesday, August 01, 2018

Store on EEUU for Buy


Stores:
[1] https://www.shipito.com/pt/shipito-pricing

Python 2.7 pip


Resolving error on python 2.7 using pip: ImportError: No module named _internal



$wget https://pypi.python.org/packages/e7/a8/7556133689add8d1a54c0b14aeff0acb03c64707ce100ecd53934da1aa13/pip-8.1.2.tar.gz
$tar -xzvf pip-8.1.2.tar.gz
$cd pip-8.1.2
$sudo python setup.py install
 
 
 

Tuesday, July 10, 2018

Lectures


https://arxiv.org/pdf/1803.04189.pdf

Friday, June 29, 2018

OpenCV 2.4.9 and 3.4.1 Compiling




2.4.x

CUDA_nppi_LIBRARY  CUDA 7.5 -> 8.0 (was removed)
  -D WITH_CUDA=OFF ..

c++ 6 fatal error: stdlib.h: No such file or directory

 export CC=path_of_gcc/gcc-version
 export CXX=path_of_g++/g++-version
 cmake  path_of_project_contain_CMakeList.txt
 make 
 
OR
 #Current version is 6, but we need to compile using another version (installed for sure)
$CC="gcc-4.9" CXX="g++-4.9" cmake /CMakeLists.txt 
 
OR$cmake -G "Unix Makefiles" -DCMAKE_CXX_COMPILER=/usr/bin/g++ CMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local -DWITH_TBB=ON -DBUILD_NEW_PYTHON_SUPPORT=ON -DWITH_V4L=ON -DINSTALL_C_EXAMPLES=ON -DINSTALL_PYTHON_EXAMPLES=ON -DBUILD_EXAMPLES=ON -DWITH_QT=ON -DWITH_OPENGL=ON -DBUILD_FAT_JAVA_LIB=ON -DINSTALL_TO_MANGLED_PATHS=ON -DINSTALL_CREATE_DISTRIB=ON -DINSTALL_TESTS=ON -DENABLE_FAST_MATH=ON -DWITH_IMAGEIO=ON -DBUILD_SHARED_LIBS=OFF -DWITH_GSTREAMER=ON -DWITH_OPENMP=OFF -DWITH_CUDA=OFF -DBUILD_opencv_gpu=OFF ..

3.4.x

Unknown CMake command "ocv_append_source_files_cxx_compiler_options".

This happened when the opencv_contrib version is no compatible with your current version.

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules/ ..


$make
$sudo make install
$sudo ldconfig

After installation, if doesn't compile, check the files opencv.conf and opencv.pc:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#/etc/ld.so.conf.d/opencv.conf
/usr/local/lib
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#/usr/local/lib/pkgconfig/opencv.pc

prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir_old=${prefix}/include/opencv
includedir_new=${prefix}/include

Name: OpenCV
Description: Open Source Computer Vision Library
Version: 2.4.13.6
Libs: -L${exec_prefix}/lib -lopencv_contrib -lopencv_legacy -lopencv_stitching -lopencv_nonfree -lopencv_superres -lopencv_ocl -lopencv_objdetect -lopencv_ml -lopencv_ts -lopencv_videostab -lopencv_video -lopencv_photo -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_imgproc -lopencv_flann -lopencv_core -L/usr/lib/x86_64-linux-gnu -lIlmThread -lHalf -lIex -lIlmImf -lImath -ljasper -ltiff -lpng -ljpeg -lavutil -lswscale -lswresample -lavcodec -lz -llzma -lxcb-shape -lxcb-render -lxcb-xfixes -lxcb-shm -lxcb -lavformat -lv4l2 -lv4l1 -ldc1394 -lGL -lGLU -latomic -ltbb -lrt -lpthread -lm -ldl -lstdc++
Cflags: -I${includedir_old} -I${includedir_new}

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


Resources:

[1] opencv github (choice right branch) https://github.com/opencv/opencv

[1] opencv_contrib is just from 3.0 .. https://github.com/opencv/opencv_contrib/releases
[2] Steps for install () http://karytech.blogspot.com/2012/05/opencv-24-on-ubuntu-1204.html
[3] Script for install under ubuntu16 https://gist.github.com/fortunto2/20a9696c7fc23ef18f8cfc50e371fe5f
[4] Some variables http://daveaubin.com/index.php/how-to-build-and-install-opencv-2-4-9-on-raspberry-pi/


Friday, June 08, 2018

Fluid Simulation: Lectures and Resources



CAELinux LiveDVD in your computer to turn it into a free and open engineering development workstation with CAD, CAM, CAE / FEA / CFD, electronic design and 3D printing  features: no licence and even no installation is required ! [2]


Resources:
[1] Laboratory http://lgg.epfl.ch/research_physicsbased_animation.php
[2] CFD Linux distro https://caelinux.com/CMS3/

Courses:
[1] Khan https://pt.khanacademy.org/partner-content/pixar/effects/particle/p/water-simulation

Wednesday, June 06, 2018

Compiling tris2indicator on Linux Ubuntu 16

change code from MapViewOfFile (Windows) to mmap (Linux) on read_obj.cpp and write_grid.cpp.

$g++ read_obj.cpp vect.cpp global.cpp insert_poly.cpp write_grid.cpp timer.cpp main.cpp -lpthread -lm -o tris2indicator



source code:
[1] http://josiahmanson.com/research/wavelet_rasterization/

Tuesday, June 05, 2018

Mapping files into memory


  • CreateFile(); or OpenFile();
  • CreateFileMapping();
  • MapViewOfFile();

mmap() combines the functions of CreateFileMapping() and MapViewOfFile()

References
[1] https://stackoverflow.com/questions/8391094/equivalent-win-api-in-nix
[2] http://pubs.opengroup.org/onlinepubs/9699919799/functions/mmap.html
[3] mmap example https://gist.github.com/marcetcheverry/991042

Friday, May 18, 2018

Qt Project to MakeFile








qmake -spec macx-g++ x.pro on Mac OS X to generate Makefile
qmake x.pro on linux to generate Makefile (default behaviour)
qmake -spec win32-g++ x.pro on Windows to generate Makefile

References:
[1] https://stackoverflow.com/questions/8571687/how-to-get-a-makefile-from-qmake

Wednesday, May 16, 2018

Fluid SImulaton Source codes


Compile OceanSurface under Ubuntu 16 [2]
* Install dependences
libglm-dev
libglfw3-dev
libsoil-dev

$g++ -o OceanSurface main.cpp wave.cpp Record.cpp -lGL -lglfw -lGLEW -lfftw3 -lfftw3f -lSOIL


Resources:
[1] splishsplash http://melhorum.blogspot.com.br/2018/05/compile-splishsplash.html
[2] https://github.com/JiashuoLi/OceanSurface
[3] https://ttnghia.github.io/



Sunday, May 06, 2018

Ubuntu 16 Setting Screen Samsung SyncMaster T240M



$cvt 1600 1000 #get right values for this resolution

$gtf 1600 1000 60 #alternative


# 1600x1000 59.87 Hz (CVT 1.60MA) hsync: 62.15 kHz; pclk: 132.25 MHz
Modeline "1600x1000_60.00" 132.25 1600 1696 1864 2128 1000 1003 1009 1038 -hsync +vsync
 

$ sudo xrandr --newmode "1600x1000" 132.25 1600 1696 1864 2128 1000 1003 1009 1038 -hsync +vsync  #define

$ sudo xrandr --addmode DVI-I-1 "1600x1000" #register on system


$ xrandr
Screen 0: minimum 320 x 200, current 1600 x 900, maximum 16384 x 16384
DVI-I-1 connected primary 1600x900+0+0 (normal left inverted right x axis y axis) 518mm x 324mm
1920x1200 59.95 +
1600x1200 60.00
1280x1024 75.02 60.02
1280x960 60.00
1152x864 75.00
1024x768 75.08 70.07 60.00
832x624 74.55
800x600 72.19 75.00 60.32 56.25
640x480 75.00 72.81 66.67 60.00
720x400 70.08
1600x900 59.95*
1600x1000 59.87
DVI-I-2 disconnected (normal left inverted right x axis y axis)
HDMI-1 disconnected (normal left inverted right x axis y axis)
1600x900_60.00 (0x58e) 118.250MHz -HSync +VSync
h: width 1600 start 1696 end 1856 total 2112 skew 0 clock 55.99KHz
v: height 900 start 903 end 908 total 934 clock 59.95Hz


* Set permanent settings using ~/.xprofile (for example)
$vi ~/.xprofile
#
xrandr --newmode "1600x1000" 132.25 1600 1696 1864 2128 1000 1003 1009 1038 -hsync +vsync 
xrandr --addmode DVI-I-1 "1600x1000"



* Problem: After nvidia drivers installation this doesn't works (crap)



$xrandr --fb 1600x1000 #show
xrandr: specified screen 1900x1000 not large enough for output DVI-I-3 (1920x1200+0+0)
xrandr: Configure crtc 0 failed
X Error of failed request:  BadValue (integer parameter out of range for operation)

#or
X Error of failed request:  BadMatch (invalid parameter attributes)

$xrandr --output DVI-I-3 --scale 1x0.85  #this solve  after nvidia drivers installation



References:

http://ubuntuhandbook.org/index.php/2017/04/custom-screen-resolution-ubuntu-desktop/



Friday, May 04, 2018

ARM Virtual Machine resources



[1] https://www.red-lang.org/2012/03/setting-up-arm-virtual-machine.html

Nvidia and Opengl doesn't works


libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast


Prepare removing
  • sudo apt-get purge nvidia* #This will remove your current nVidia drivers
  • sudo apt-get install --reinstall xserver-xorg-video-intel libgl1-mesa-glx libgl1-mesa-dri xserver-xorg-core
  • sudo dpkg-reconfigure xserver-xorg #This should fix Xorg
  • sudo update-alternatives --remove gl_conf /usr/lib/nvidia-current/ld.so.conf
After this reĆÆnstall nVidia software
  • sudo apt-add-repository ppa:xorg-edgers/ppa #provides the necessary repository
  • sudo apt-get update
  • sudo apt-get install bumblebee-nvidia nvidia-319 nvidia-settings-319

Thursday, April 26, 2018

My favorite Music



Ludwig Van Beethoven
   Symphony No. 5 in C minor ("Fate") (composed 1804–08, premiĆØred 1808)
   Sonata N° 14 'moonlight'
   Fur Elisa
   Himno de la alegria
   Turkish March  (Adapted by Chavo del 8 program, in intro)


Wolfgang Amadeus Mozart
  Turkish March
  RĆ©quiem

Antonio Vivaldi
  Storm
  La Stravaganza  Four Season:Spring

Johan Sebastian Bach
 Toccata and Fugue Ave maria
  Passacaglia
FrƩdƩric Chopin
  Waltz rain
  Spring waltz (Mariage d'Amour)


AntonĆ­n DvoÅ™Ć”k
  Symphony no. 9 - 4th movement - Allegro con fuoco

Wednesday, April 25, 2018

C++ equivalent to getch() and getche() from conio.h



#include <iostream>
#include <termios.h> //TCSANOW, ICANON, ..
#include <unistd.h>  //STDIN_FILENO ..
#include <stdio.h>  //getchar

using namespace std;

char getch(void)
{
  struct termios oldattr, newattr;
  char ch;
  tcgetattr( STDIN_FILENO, &oldattr );
  newattr = oldattr;
  newattr.c_lflag &= ~( ICANON | ECHO );
  tcsetattr( STDIN_FILENO, TCSANOW, &newattr );
  ch = getchar();
  tcsetattr( STDIN_FILENO, TCSANOW, &oldattr );
  return ch;
}

char getche(void) //with ECHO
{
  struct termios oldattr, newattr;
  int ch;
  tcgetattr( STDIN_FILENO, &oldattr );
  newattr = oldattr;
  newattr.c_lflag &= ~( ICANON );
  tcsetattr( STDIN_FILENO, TCSANOW, &newattr );
  ch = getchar();
  tcsetattr( STDIN_FILENO, TCSANOW, &oldattr );
  return ch;
}

int main(int argc,char *argv[])
{
  char ch1=getch();
  char ch2=getche();
  cout << "\nFirst : " << ch1
       << "\nSecond: " << ch2 << endl;
  return 0;
}
//g++ getchx.cpp -o getchx

References
[1] https://www.daniweb.com/programming/software-development/threads/410155/gcc-equivalent-for-getch

Sunday, April 22, 2018

Monday, April 09, 2018

Linux Microphone doesn't working


Try to reload drivers
$sudo alsa force-reload
restart device and check if sound is workin? if it doesnt do this:
$sudo apt-get remove --purge alsa-base pulseaudio
$sudo apt-get install alsa-base pulseaudio 
 
References:
[1] https://askubuntu.com/questions/508221/sound-input-device-microphone-not-working

Saturday, April 07, 2018

Fedora/CentOS Change ports of Apache Web Server (httpd)


1) In file /etc/httpd/conf/httpd.conf

Listen 80
Listen 8079

This till your server to listen to the port 8079

2) virtual host file  /etc/httpd/conf.d/vhost.conf

<VirtualHost *:8079>
 DocumentRoot /var/www/html/api_folder
 ServerName example.com
 ServerAlias www.example.com
 ServerAdmin root@example.com 
 ErrorLog logs/www.example.com-error_log
 CustomLog logs/www.example.com-access_log common
</VirtualHost>

This mean when you go to your www.example.com:8079 redirect to
/var/www/html/api_folder

3) Restart the service

$sudo service httpd restart
$systemctl restart httpd.service
references:
[1] https://httpd.apache.org/docs/2.4/bind.html


Wednesday, April 04, 2018

Call using Internet (Brasil - PerĆŗ)


https://www.poptox.com/Peru
https://www.spytox.com/whose-number-is-calling-me

Thursday, March 29, 2018

Ubuntu 16 OpenCV 2.4.x disable ffmpeg and jpeg



cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D WITH_FFMPEG=OFF -D WITH_JPEG=OFF ..


Ubuntu webm to mp4

ffmpeg -i video.webm -movflags faststart -profile:v high -level 4.2 video.mp4

Ubuntu 16 VMWare Player



$wget -c https://download3.vmware.com/software/player/file/VMware-Player-12.5.0-4352439.x86_64.bundle
$sudo chmod u+x VMware-Player-12.5.0-4352439.x86_64.bundle
$sudo ./VMware-Player-12.5.0-4352439.x86_64.bundle

Monday, March 26, 2018

Ubuntu how to get interval time for run Application



howmuchdelay.sh

T="$(date +%s%N)"
# Do some work here
$1 $2 $3 $4 $5 #sleep 2

# Time interval in nanoseconds
T="$(($(date +%s%N)-T))"

# Seconds
S="$((T/1000000000))"

# Milliseconds
M="$((T/1000000))"

printf "Take: %02d:%02d:%02d:%02d.%03d\n" "$((S/86400))" "$((S/3600%24))" "$((S/60%60))" "$((S%60))" "${M}"

Tuesday, March 20, 2018

Ubuntu 16: Arcade games


$sudo apt-get install zsnes  #super nintendo
$sudo apt-get install mupen64plus  #nintendo 64


Friday, March 16, 2018

Ubuntu CPU-G

Ubuntu 16

$sudo add-apt-repository ppa:atareao/atareao
$sudo apt-get update
$sudo apt-get install cpu-g


Ubuntu 14

sudo add-apt-repository ppa:cpug-devs/ppa
sudo apt-get update
sudo apt-get install cpu-g

Tuesday, March 13, 2018

Ubuntu 16 Using QEmu

Basic Commands:


*create drives 
$qemu-img create name.img size|M|G
$qemu-img create win98hda.img 400M 
*resize driver
$qemu-img resize filename [+|-]size[K|M|G|T]
$qemu-img resize win98hda.img +600M
$gparted win98hda.img #for expand physically 
 
 
$qemu [-boot ] -cdrom .iso [-m size]|128M -hda disk-name.img
$qemu -boot d -cdrom win98se.iso -m 512 -hda win98hda.img
 
other examples:
[1] install win98 using boot iso and installer iso (two disks)
$qemu-system-i386 -hda win98s2018.img -boot d -cdrom win98boot.iso -drive file=win98se.iso,index=3,media=cdrom
$qemu-system-i386 -hda win98s2018.img -boot c -cdrom win98boot.iso -drive file=win98se.iso,index=3,media=cdrom 
$qemu-system-i386 -drive file=win98s2018.img,format=raw -m 512 #other way to run
  
 

$qemu-system-x86_64 -hda driveubuntu.img -cdrom ubuntu-x86-14.1-r1.iso -boot d -m 1024   -usbdevice mouse



Images:
[1] Windows XP https://mega.nz/#!B4ZEiRyD!tIS4NFNqcShJtTvNcheujIfSVS8H3ejlU2VLJdN9C3o
[2] 95 https://mega.nz/#!tw4m2Z6K!XsrXdAODy0HGjNVzvpSNviDQfvQP0ULVI7UGbhFdJh0

References:
[1] https://www.unixmen.com/how-to-install-and-configure-qemu-in-ubuntu/
[2] http://www.helenos.org/wiki/UsersGuide/RunningInQEMU



Thursday, March 01, 2018

Raspberry PI 3 qemu



apt-get install libglib2.0-dev zlib1g-dev
$./configure --target-list=i386-softmmu  #for reduce time > 5hrs (normally)
$make
$sudo make install

https://b3n7s.github.io/update/2016/06/08/windows-xp-on-qemu.html
https://wiki.gentoo.org/wiki/QEMU/Windows_guest

Tuesday, February 20, 2018

Ubuntu Dark Wallpaper



http://www.misucell.com/group/best-ubuntu-backgrounds/

Ubuntu - Deploy Mono ASP.NET MVC




$vi /etc/apache2/apache2.conf  #verify includes external config files
...
# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf

..
$sudo vi /etc/apache2/mods-enabled/mod_mono.conf  #add/verify content

<IfModule !mod_mono.c>
     LoadModule mono_module /usr/lib/apache2/modules/mod_mono.so</IfModule>
<IfModule mod_headers.c>
    Header set X-Powered-By "Mono"

</IfModule>

AddType application/x-asp-net .aspx
AddType application/x-asp-net .asmx
AddType application/x-asp-net .ashx
AddType application/x-asp-net .asax
AddType application/x-asp-net .ascx
AddType application/x-asp-net .soap
AddType application/x-asp-net .rem
AddType application/x-asp-net .axd
AddType application/x-asp-net .cs
AddType application/x-asp-net .vb
AddType application/x-asp-net .master
AddType application/x-asp-net .sitemap
AddType application/x-asp-net .resources
AddType application/x-asp-net .skin
AddType application/x-asp-net .browser
AddType application/x-asp-net .webinfo
AddType application/x-asp-net .resx
AddType application/x-asp-net .licx
AddType application/x-asp-net .csproj
AddType application/x-asp-net .vbproj
AddType application/x-asp-net .config
AddType application/x-asp-net .Config
AddType application/x-asp-net .dll
DirectoryIndex index.aspx
DirectoryIndex Default.aspx
DirectoryIndex default.aspx



May be you will get apache2: Syntax error on line 141 of /etc/apache2/apache2.conf: Syntax error on line 8 of /etc/apache2/mods-enabled/mod_mono.conf, then reinstall mono module for apache.


verify path, using :


$locate mod_mono.so

or reinstall module 

$sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
$echo "deb http://download.mono-project.com/repo/ubuntu stable-xenial main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
$sudo apt-get update
 
$sudo apt-get install mono-devel
$sudo apt install libapache2-mod-mono 

 




References:

https://github.com/edgarrc/MonoUbuntu/blob/master/install.sh
[2] mod_mono.conf https://github.com/mono/mod_mono/blob/master/mod_mono.conf.in
[3] for update mono module repository http://www.mono-project.com/download/stable/


Monday, February 19, 2018

html css menu



References:
[1] http://css-snippets.com/drop-down-navigation/
[2] http://inspirationalpixels.com/tutorials/creating-a-dropdown-menu-with-html-css
[3] simple https://www.w3schools.com/howto/howto_css_dropdown.asp


Ubuntu 16, enable ASP.NET templates on MonoDevelop



$sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF  
$echo "deb http://download.mono-project.com/repo/debian alpha main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list  
$sudo apt-get update 
 
$sudo apt-get install mono-devel mono-complete ca-certificates-mono mono-xsp4 #take time
 
$sudo apt-get install monodevelop=5.10.0.871-0xamarin2 #[1]
 

May be you will get this message at create project:Access to the path “/etc/mono/registry” is denied, then 
 
$sudo mkdir /etc/mono/registry

$sudo chmod uog+rw /etc/mono/registry
  



References:
[1] https://askubuntu.com/questions/770299/monodevelop-on-xubuntu-missing-asp-net

Ubuntu Radio


I) Install application
$sudo apt install radiotray python-xdg

II) Setting radio
1) PerĆŗ - Radio Planeta
https://17953.live.streamtheworld.com/CRP_PLAAAC.aac?csegid=1010&tdsdk=js-2.9&lat=-16.4&long=-71.5&pname=TDSdk&pversion=2.9&banners=300x250%2C728x90&sbmid=d3f8db5f-71cf-4c05-8764-bfbdf3857e4e
III) Radio PerĆ³ (online) http://www.emisoraperuana.com


References:
[1] http://www.webupd8.org/2017/02/5-cool-internet-radio-players-for-linux.html

Sunday, February 18, 2018

Ubuntu VB6 Application + mySQL


 
$winetricks corefonts eufonts lucida opensymbol tahoma cjkfonts 
$winetricks vb6run
$winetricks mdac28
$winetricks msxml4 mfc42 jet40 native_oleaut32
 
$winecfg #set libraries for overwrite

odbccp32
odbc32
oleaut32







 
$wine msiexec /i mysql-connector-odbc-5.1.13-win32.msi #choice best driver
$wine control 

references:

http://www.sanitarium.co.za/how-to-get-wine-windows-mysql-connectorodbc-and-ubuntu-13-10-to-all-be-friends/

[2]  Launch icon https://askubuntu.com/questions/21823/how-to-create-a-shortcut-to-start-a-windows-application-with-wine

Wednesday, February 14, 2018

Ubuntu moodle pre-requisites

$sudo ufw app list

$sudo apt-get install libapache2-mod-php
$sudo apt-get install php7.0-curl 
$sudo apt-get install php7.0-zip

$sudo chmod 777 /var/www/ -R

$sudo apt-get install php7.0-mysql
$sudo apt-get install php7.0-xml



$sudo apt-get install php7.0-gd


$sudo apt-get install php7.0-intl

$sudo apt-get install php7.0-xmlrpc
$sudo apt-get install php7.0-mbstring






Ubuntu Hard Drive Health Monitor

HDD Verification tool

$sudo apt-get install smartmontools
$sudo apt-get install gsmartcontrol

$sudo smartctl --all /dev/sda

Friday, February 02, 2018

Ubuntu 14 Lamp


https://www.godaddy.com/help/build-a-lamp-stack-linux-apache-mysql-php-ubuntu-14-17341
https://www.howtoforge.com/ubuntu-lamp-server-with-apache2-php5-mysql-on-14.04-lts
https://styde.net/como-instalar-lamp-en-ubuntu-linux/
https://www.digitalocean.com/community/tutorials/como-instalar-linux-apache-mysql-php-lamp-en-ubuntu-14-04-es
https://www.digitalocean.com/community/tutorials/how-to-install-lamp-on-ubuntu-14-04-quickstart

Update kernel to the latest mainline version without any Distro-upgrade?

To find out which kernel you have type uname -rin terminal.Now type this command to get list of available kernels.
apt-cache search linux-image
this will give you a very big output.Now chose one of them that you want to install and install it by following commands(Don't type these commands like this,replace the word kernal_version with the kernel version which you wish to install)
sudo apt-get install linux-image-kernal_version
sudo apt-get install linux-image-extra-kernal_version
sudo apt-get install linux-headers-kernal_version
Now in my case i choose linux-image-4.10.0-22-generic so my command will look like this
sudo apt-get install linux-image-4.10.0-22-generic 
sudo apt-get install linux-image-extra-4.10.0-22-generic
sudo apt-get install linux-headers-4.10.0-22-generic
now in the end remove old kernel by command
sudo apt-get autoremove
sudo reboot
 

Thursday, February 01, 2018

Related to Certificates


Generate a CSR
https://www.digitalocean.com/community/questions/how-do-i-generate-a-csr-key

Create the self-signed certificate
https://help.ubuntu.com/lts/serverguide/certificates-and-security.html

Create thrid certificate using CSR
https://ssl.comodo.com/free-ssl-certificate.php
https://support.comodo.com/index.php?/comodo/Knowledgebase/Article/View/637/66/

Aditional information
https://www.ssl2buy.com/ssl-certificate-google-rankings
https://www.elegantthemes.com/blog/tips-tricks/how-to-get-a-free-ssl-certificate-and-why-google-is-forcing-you-to

Tuesday, January 30, 2018

Ubuntu 14 install sSMTP

Ubuntu
1.1) Install sSMTP

$sudo apt-get install ssmtp
$sudo vi /etc/ssmtp/ssmtp.conf  #add or set

root=username@gmail.com
mailhub=smtp.gmail.com:587
rewriteDomain=
hostname=fileserver.local
UseSTARTTLS=YES
AuthUser=username
AuthPass=password
FromLineOverride=YES
sudo vi /etc/ssmtp/revaliases
root:username@gmail.com:smtp.gmail.com:587
youruser:username@gmail.com:smtp.gmail.com:587

1.2) How to use

$ssmtp recipient_email@example.com  #sSMTP will then wait for:
To: recipient_email@example.com
From: myemailaddress@gmail.com
Subject: test email

hello world!
#press Ctrl-D for send the message before closing.

$ssmtp myemailaddress@gmail.com < msg.txt

To: myemailaddress@gmail.com
From: myemailaddress@gmail.com
Subject: alert

The server is down!

1.3) Alternative to use

$sudo apt-get install heirloom-mailx -y
$echo testing|mail -s 'Test Mail' Insert email address to send to here


References:
[1]  http://tombuntu.com/index.php/2008/10/21/sending-email-from-your-system-with-ssmtp/

Fedora/CentOs
[2.1] postfix https://kifarunix.com/configure-postfix-as-send-only-smtp-server-on-fedora-29/
[2.2] sendmail https://tecadmin.net/install-sendmail-on-fedora/


Mono Develop on Ubuntu 14

#monodevelop 4
sudo apt-get install monodevelop
 
#upgrade to monodevelop 5
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
sudo apt-get update
sudo apt-get install monodevelop
 
 
 

 
References:
[1] Monodevelop versions https://download.mono-project.com/archive/

Friday, January 26, 2018

Ubuntu 14 virtualize

Virtual box

$uname -a
$apt-get upgrade #for update kernel
$apt-get install virtualbox

Dependences
[1] https://www.virtualbox.org/wiki/Download_Old_Builds_4_3

Sunday, January 07, 2018

Bajaj Avenger 220 Especificaciones

Motor

Desplazamiento (cc)
219.89
A Partir
ElƩctrica
Max. De alimentaciĆ³n (PS rpm)
19,03 @ 8400
Max. Torque (Nm @ rpm)
17.5 @ 7000
Tipo
4 tiempos, monocilĆ­ndrico, DTS-i, refrigerado por aire con el refrigerador de aceite

Frenos

Frente
Disco, Dia. 260 mm
Trasero
Tambor, Dia. 130 mm

SuspensiĆ³n

Frente
TelescĆ³pico
Trasero
Amortiguador hidrƔulico

ElectrĆ³nica

Cabeza de la lƔmpara
60 / 55W
Cuerno
12V, 30W
BaterĆ­a
12V, 9Ah

Tiro

Frente
Con cƔmara unidireccional - 90 / 90 x 17 "
Trasero
Con cƔmara unidireccional - 130/90 x 15 "

DepĆ³sito de combustible

Total de litros (reserva, utilizable)
14 litros completo (3.4 litros de reserva)

Dimensiones

SeparaciĆ³n de tierra
169 mm
Peso en orden de marcha
154,5 kg
Distancia entre ejes
1475 mm

Tuesday, November 21, 2017

Display Setting is not showing



For show unity setting

$unity-control-center

Setting in command line
$xrandr
...
DVI-I-2 connected primary 1920x1200+0+0 (normal left inverted right x axis y axis) 518mm x 324mm
   1920x1200     59.95*+
   1600x1200     60.00 
   1280x1024     75.02    60.02 
   1280x960      60.00 
   1152x864      75.00 
   1024x768      75.03    70.07    60.00 
   800x600       75.00    72.19    60.32    56.25 
   640x480       75.00    72.81    59.94 
...
$xrandr --output DVI-I-2 1600x1200 #for choice
$xrandr --fb 1152x768 #another way
For problems in aspect ratio (wide mode), for us the better choice is:
$xrandr --output DVI-I-2 --scale 1.0x0.85


Other alternative is related to create new entry, using next commands

$cvt 1600 1200 60
 # 1600x1200 59.87 Hz (CVT 1.92M3) hsync: 74.54 kHz; pclk: 161.00 MHz
Modeline "1600x1200_60.00"  161.00  1600 1712 1880 2160  1200 1203 1207 1245 -hsync +vsync

$xrand --newmode "1600x1200_60.00"  161.00  1600 1712 1880 2160  1200 1203 1207 1245 -hsync +vsync

$xrand --addmode "1600x1200_60.00"  #but doesn't works for us


Friday, November 17, 2017

How to create war file for tomcat without eclipse



references:
[1] https://stackoverflow.com/questions/1001714/how-to-create-war-files

Wednesday, November 01, 2017

Linux Drive Series/C210

Auxiliary Commands
$ journalctl
$ systemctl
$ alsactl

$ lsof | grep pcm  #still using
$ lsmod | grep snd #modules

$ sudo apt-get remove pulseaudio
$ sudo apt-get remove alsa
$ sudo apt-get install alsa


$ lspci 
Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller

$ lspci -v | grep Audio
$ sudo modprobe snd-hda-intel
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.10.0-37-generic/modules.dep.bin'
modprobe: FATAL: Module snd-hda-intel not found in directory /lib/modules/4.10.0-37-generic

$ vi /etc/modprobe.d/alsa-base.conf  #for verify



*When is right installed
$ cat /proc/asound/card0/codec* | grep Codec
Codec: Realtek ALC887

$ cat /proc/asound/cards
 0 [Intel                ]: HDA-Intel - HDA Intel
 1 [NVidia            ]: HDA-Intel - HDA NVidia
 2 [U0x46d0x825 ]: USB-Audio - USB Device 0x46d:0x825

Upgrade
[*] https://wiki.ubuntu.com/Audio/UpgradingAlsa/DKMS
$ rm -r ~/.config/pulse;
$ pulseaudio -k



Note: try to select previous  version on grub

References
 [1] https://help.ubuntu.com/community/HdaIntelSoundHowto
 [2] https://askubuntu.com/questions/508692/intel-corporation-7-series-c210-series-isnt-being-detected-by-any-module
 






Tuesday, October 31, 2017

Lecture about SoundScape


Acoustic scenes, Acoustic events and Feature aggregation

D-CASE2013

Environment sound recognition using short-time feature aggregation
https://link.springer.com/article/10.1007/s10844-017-0481-4

Task of segmentation
  Speech recognition
  Musical information retrieval(MIR)
  Environment sound
  Survillance
  Index of video content
Task of acoustic events classification
  Statistic large set of features and K-NN
  Feature agregation (Bag of feaures)
  HMM/GMM(better for segementation and annotation for small scales)
  Deep learning
  Blind segmentation and SVM


Recurrence quantification analysis(RQA), RQA Features
Short Time Fourier Transform (STFT)

Lectures Neural Networks


Colour and Texture, but fail for shape.

Generative Adversarial Networks
https://arxiv.org/pdf/1406.2661.pdf

Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networks https://junyanz.github.io/CycleGAN/


Thursday, October 26, 2017

PDF Tools & Editors

PDF Annotator

[1] online/free/for signatures https://www.pdfescape.com/

PDF Tools 

$sudo apt-get install pdftk
$pdftk A.pdf cat 1-9 26-end output B.pdf # keep pages 1-9 and 26-end of the original file
 
$pdftk file1.pdf file2.pdf file3.pdf cat output newfile.pdf #join
 
$convert file1.pdf file2.pdf file3.pdf output.pdf #reduce resolution
 
$sudo apt-get install pdfmod #remove pages, works with A4
$sudo apt-get install pdfshuffler #remove pages, works with beamer too
  

PDF Editors

[1] Master PDF Editor http://code-industry.net/
[2] Fonst http://linuxg.net/how-to-install-master-pdf-editor-1-9-on-ubuntu-linux-mint-debian-fedora-opensuse-and-many-other-linux-systems/

[3] xournal, is possible add notes and free text, and [3] have other edition tools.
http://kuboosoft.blogspot.com/2012/07/5-editores-de-pdf-para-linux.html  
 
[4] Extract images from PDF online
http://pdfaid.com/ExtractImages.aspx

[5] How to extract part https://askubuntu.com/questions/221962/how-can-i-extract-a-page-range-a-part-of-a-pdf

Wednesday, October 25, 2017

OpenCV2 in Python for Windows



1.   Below Python packages are to be downloaded and installed to their default locations.
  Python-2.7.x.
  Numpy.
  Matplotlib (Optional).
2.    Install all packages into their default locations. Python will be installed to C:/Python27/.
3.    After installation, open Python IDLE. Enter import numpy and make sure Numpy is working fine.
4.    Download latest OpenCV release from sourceforge site and double-click to extract it.
5.    Goto opencv/build/python/2.7
       Copy cv2.pyd to C:/Python27/lib/site-packages.
6.  Test
>>> import cv2
>>> print cv2.__version__







Tuesday, October 24, 2017

Compiling Windows C++ Project in Linux (wavelet rasterization)

Josiah Manson Codes translate to GNU

Source code:
[*] Windows http://josiahmanson.com/research/wavelet_rasterization/supplemental/wavelet_raster.zip



g++ vect.cpp timer.cpp raster_poly.cpp get_font.cpp global.cpp insert_bez2.cpp insert_line.cpp vect.cpp save.cpp write_grid.cpp main.cpp -Wall -Wextra  -I/usr/include/freetype2 -lfreetype -lpthread -lm -o gnurasterize

_aligned_malloc

void *aligned_alloc(size_t alignment, size_t size);
//Since the question was asked, a new function was standardized by C11
[*] http://en.cppreference.com/w/cpp/memory/c/aligned_alloc
mkdir

#include <sys/types.h>
#include <sys/stat.h>
int result = mkdir("/home/me/test.txt", 0777);

__forceline
[*] https://stackoverflow.com/questions/8897791/how-to-define-forceinline-inline



__declspec

[*] http://gcc.gnu.org/wiki/Visibility
[*] https://stackoverflow.com/questions/2164827/explicitly-exporting-shared-library-functions-in-linux


Time
[*] https://stackoverflow.com/questions/2418157/ubuntu-linux-c-error-undefined-reference-to-clock-gettime-and-clock-settim

Freetype
$ sudo apt-get install libfreetype6-dev
$ g++ ... -I/usr/include/freetype2 -lfreetype

Change FreeImage by PPM
[*] pngwriter https://github.com/pngwriter/pngwriter

[1] PPM Specification http://paulbourke.net/dataformats/ppm/
[2] C/C++ Create PPM File https://rosettacode.org/wiki/Bitmap/Write_a_PPM_file

Related
[1] https://stackoverflow.com/questions/2033997/how-to-compile-for-windows-on-linux-with-gcc-g

Saturday, October 14, 2017

Love Equations



https://www.wolframalpha.com

1) plot x^2 + ( 5y/4 - sqrt(abs(x)))^2 = 1
2) plot x^2 + ( y - sqrt(abs(x)))^2 = 2
3) plot x^2 + ( y - (abs(x))^(1/3) )^2 = 1
4) plot (x^2 + y^2 -1)^3 -x^2y^3 = 0


Tuesday, October 10, 2017

Installing Tensor Flow (Problems)


Main guide
https://www.tensorflow.org/install/install_sources

Cannot find bazel. Please install bazel.
Solution https://docs.bazel.build/versions/master/install-ubuntu.html

Monitoring Nvidia card

$watch -n 1 nvidia-smi #to obtain continuous updates without filling the terminal with output

$sudo pip install gpustat
$gpustat
 
$sudo pip install glances
$sudo pip install glances[gpu]
$glances

Resources:
[1] Cuda 7.5 http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda_7.5.18_linux.run
[2] Install Cuda 7.5 http://www.r-tutor.com/gpu-computing/cuda-installation/cuda7.5-ubuntu


Friday, October 06, 2017

Firefox open multiple private window

    /opt/firefox/firefox-bin --profile $(mktemp -d) --private-window www.google.com www.bing.com