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/

Firefox open multiple private window

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