Just Sharing Knowledge on Robotics, Electronics and Programming

Saturday, October 24, 2020

Jitsi Command Library


 1. Running Jicofo

systemctl restart jicofo


2. bind-http jitsi

Check : curl http://localhost:5280/http-bind


3. Prosody 

Restart: /etc/init.d/prosody start

status  sudo prosodyctl status

stop prosodyctl stop

 

4. Uninstall Jitsi

sudo apt purge jigasi jitsi-meet jitsi-meet-web-config jitsi-meet-prosody jitsi-meet-turnserver jitsi-meet-web jicofo jitsi-videobridge2 

 

5. Jitsi Nginx

server {
   listen 443;
    server_name vcon.
hano.xyz;
    # set the root
    root /usr/share/jitsi-meet;
    index index.html;
    location ~ ^/([a-zA-Z0-9=\?]+)$ {
        rewrite ^/(.*)$ / break;
    }
    location / {
        ssi on;
    }
    
    location /http-bind {
        proxy_pass      http://localhost:5280/http-bind;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host $http_host;
    }
    
    location /external_api.js {
        alias /usr/share/jitsi-meet/libs/external_api.min.js;
    }
    
    location = /config.js {
    alias /etc/jitsi/meet/vcon.hano.xyz-config.js;
}
  ssl on;
 
  ssl_certificate /etc/letsencrypt/live/vcon.
hano.xyz/cert.pem;
  ssl_certificate_key /etc/letsencrypt/live/vcon.
hano.xyz/privkey.pem;
}

Saturday, June 27, 2020

Java Keystore Problem: Trustore with Subject CN is Not Ca Certificate


Detailed Step by Step instructions I followed to achieve this

 SSource : StackOverflow =>
Vipul
  • Download bouncycastle JAR from http://repo2.maven.org/maven2/org/bouncycastle/bcprov-ext-jdk15on/1.46/bcprov-ext-jdk15on-1.46.jar or take it from the "doc" folder.
  • Configure BouncyCastle for PC using one of the below methods.
    • Adding the BC Provider Statically (Recommended)
      • Copy the bcprov-ext-jdk15on-1.46.jar to each
        • D:\tools\jdk1.5.0_09\jre\lib\ext (JDK (bundled JRE)
        • D:\tools\jre1.5.0_09\lib\ext (JRE)
        • C:\ (location to be used in env variable)
      • Modify the java.security file under
        • D:\tools\jdk1.5.0_09\jre\lib\security
        • D:\tools\jre1.5.0_09\lib\security
        • and add the following entry
          • security.provider.7=org.bouncycastle.jce.provider.BouncyCastleProvider
      • Add the following environment variable in "User Variables" section
        • CLASSPATH=%CLASSPATH%;c:\bcprov-ext-jdk15on-1.46.jar
    • Add bcprov-ext-jdk15on-1.46.jar to CLASSPATH of your project and Add the following line in your code
      • Security.addProvider(new BouncyCastleProvider());
  • Generate the Keystore using Bouncy Castle
    • Run the following command
      • keytool -genkey -alias myproject -keystore C:/myproject.keystore -storepass myproject -storetype BKS -provider org.bouncycastle.jce.provider.BouncyCastleProvider
    • This generates the file C:\myproject.keystore
    • Run the following command to check if it is properly generated or not
      • keytool -list -keystore C:\myproject.keystore -storetype BKS
  • Configure BouncyCastle for TOMCAT
    • Open D:\tools\apache-tomcat-6.0.35\conf\server.xml and add the following entry
      • <Connector port="8443" keystorePass="myproject" alias="myproject" keystore="c:/myproject.keystore" keystoreType="BKS" SSLEnabled="true" clientAuth="false" protocol="HTTP/1.1" scheme="https" secure="true" sslProtocol="TLS" sslImplementationName="org.bouncycastle.jce.provider.BouncyCastleProvider"/>
    • Restart the server after these changes.
  • Configure BouncyCastle for Android Client
    • No need to configure since Android supports Bouncy Castle Version 1.46 internally in the provided "android.jar".
    • Just implement your version of HTTP Client (MyHttpClient.java can be found below) and set the following in code
      • SSLSocketFactory.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
    • If you don't do this, it gives an exception as below
      • javax.net.ssl.SSLException: hostname in certificate didn't match: <192.168.104.66> !=
    • In production mode, change the above code to
      • SSLSocketFactory.setHostnameVerifier(SSLSocketFactory.STRICT_HOSTNAME_VERIFIER);

Saturday, March 7, 2020

Instalation and Configuration Minio Storage Server in Linux Ubuntu 18.04




1. Download minio
wget https://dl.min.io/server/minio/release/linux-amd64/minio
2. Install Minio
 chmod +x minio
./minio server /data
3. Change Credential
export MINIO_ACCESS_KEY=YQWERTYU12RHJW2YJASD
export MINIO_SECRET_KEY= xH+Qwerty+ASDF+HDd7DRNOFvl7sL8ASDFjwZXCg
4. Run server
./minio server /data
5. Monit Configuration

  check process minio
        matching minio
        start program = "/bin/bash -c '/root/minio.py start'"
        stop program = "/bin/bash -c '/root/minio.py stop'"
        if cpu usage > 95% for 10 cycles then restart 
6.  Python minio.py
#!/usr/bin/python2
import sys
import os
action = sys.argv[1]
if action == 'start':
    os.system("export MINIO_ACCESS_KEY=YQWERTYU12RHJW2YJASD \n export MINIO_SECRET_KEY=xH+Qwerty+ASDF+HDd7DRNOFvl7sL8ASDFjwZXCg \n /root/minio server /data")
if action == 'stop':
    os.system("kill -9 $(pgrep minio)")


7. Change permision of minio.py file
chmod +x minio.py

8. Restart Monit
 systemctl restart monit

9. Status Monit Check
 systemctl status monit

Install Java 13 Oracle


1.
sudo apt-get update
sudo apt-get install oracle-java13-installer
Check the result via command: java --version 
 
 

Wednesday, September 11, 2019

How to using ARM Bluepill STM32F103C8 on Arduino Ide



1. Download STM32 Driver from this site https://github.com/rogerclarkmelbourne/Arduino_STM32
2. Extract and Install Arduino_STM32-master\drivers\win\install_drivers.bat or install_STM_COM_drivers.bat
3. This driver is must be installed correctly. if you are still found your driver as Usb serial device, it will show the errror " Couldn't find the DFU device: [1EAF:0003] "
4. the following Configurations is needed.

Thursday, August 22, 2019

How to Copy Colored Script Code in Arduino IDE to Word or other formated text


if you want to write arduino tutorial on a book, and you want to coloring your script like arduino script. there are two ways to do this

1. using snipping tools to screenshot your code
2. using the following ways
  •  Visit  https://codebeautify.org/htmlviewer/
  •  on arduino ide, ctrl+a (select all) your script and Right Click, Copy as html
  •  Paste on HTML input
  • and copy your script on Result : HTML Output to your microsoft word

  

Saturday, May 11, 2019

Multiple SSL sub Domain LetsEncrypt


If you want to install ssl on all subdomain you can use the following

sudo certbot-auto certonly  -d *.example.com --server https://acme-v02.api.letsencrypt.org/directory --preferred-challenges dns  --manual

Tuesday, April 23, 2019

Android Keystore From Letsencrypt


Here

Download: https://bouncycastle.org/download/bcprov-jdk15on-161.jar
place the file above in the same folder of certtificate


export CLASSPATH=bcprov-jdk15on-161.jar
CERTSTORE=whisper.store
if [ -a $CERTSTORE ]; then
    rm $CERTSTORE || exit 1
fi
keytool \
      -import \
      -v \
      -trustcacerts \
      -alias 0 \
      -file <(openssl x509 -in cert.pem) \
      -keystore $CERTSTORE \
      -storetype BKS \
      -provider org.bouncycastle.jce.provider.BouncyCastleProvider \
      -providerpath /usr/share/java/bcprov.jar \
      -storepass whisper

How To Install Let’s Encrypt on Ubuntu and Export Jetty Keystore


Step 1 Install Letencryptt:
sudo apt-get install letsencrypt

step 2. download Certbot

sudo wget https://dl.eff.org/certbot-auto -O /usr/sbin/certbot-auto sudo chmod a+x /usr/sbin/certbot-auto

step 3. SSL certificate

sudo certbot-auto certonly --standalone -d example.com  -d www.example.com
 
 
# the "auth" aka "certonly" subcommand
# convert certificate chain + private key to the PKCS#12 file format
openssl pkcs12 -export -out keystore.pkcs12 -in fullchain.pem -inkey privkey.pem
# convert PKCS#12 file into Java keystore format
keytool -importkeystore -srckeystore keystore.pkcs12 -srcstoretype PKCS12 -destkeystore keystore.jks
# don't need the PKCS#12 file anymore
rm keystore.pkcs12
# Now use "keystore.jks" as keystore in jetty with the keystore password you specfied when you ran
# the "keytool" command
# input: fullchain.pem and privkey.pem as generated by the "letsencrypt-auto" script when run with
 

Saturday, April 20, 2019

Maven error :Perhaps you are running on a JRE rather than a JDK?



I've been facing the same issue with java 8 (ubuntu 16.04), trying to compile using mvn command line.
I verified my $JAVA_HOME, java -version and mvn -version. Everything seems to be okay pointing to /usr/lib/jvm/java-8-openjdk-amd64.
It appears that java-8-openjdk-amd64 is not completly installed by default and only contains the JRE (despite its name "jdk").
Re-installing the JDK did the trick.
sudo apt-get install openjdk-8-jdk

Sunday, December 23, 2018

Edit XY Graph Window Simulink Plot


if you want to edit the simulink xy graph, you can follow th intructions below:

xy graph simulink plot
xy graph simulink plot   
1. Run your simulink program, then the XY dialog will show up
2.  Type the following command :

set(0,'ShowHiddenHandles','on')
set(gcf,'menubar','figure')
These commands will enable the toolbar in X-Y graph figure window. You can add axes names from Insert >> X Label and Insert >> Y Label.

Sunday, August 26, 2018

[SOLVED] Xamarin Studio Android SDK Not Found ... Searched Windows Registry


If you use Xamarin Studio For the first time, i suggest you to create a very simple apps that is two click. then test your project. if you face the following error :

SetUp : System.Exception : Android SDK not found. Please install it and if it is still not located, please set the ANDROID_HOME environment variable to point to the directory.
Searched locations:
Windows Registry
(No path) - Not set. [ Source: ANDROID_HOME ]


or

SetUp : System.Exception : Java Development Kit (JDK) not found. Please make sure that it is installed and if it's still not located, please set the JAVA_HOME environment variable to point to the directory.

Searched locations:Windows Registry
 [ Source: JAVA_HOME ]


then use the following solutions (see the picture),
1. Go to this pc and Right -click then click properties


Friday, August 24, 2018

[SOLUTION] Select Database The N numbers Last or First Rows in Codeigniter


 
If you want to select the N last rows or N first rows, in codeigniter you can use the following script


$n = 100;
$this->db->limit(n); 
$this->db->order_by("id", "desc"); // N last rows 
$query = $this->db->get('my_table');
$myRow = $query->row();
 
 
$n = 100; 
$this->db->limit(n); 
$this->db->order_by("id", "asc"); // N first rows 
$query = $this->db->get('my_table');
$myRow = $query->row(); 
 

Friday, August 17, 2018

[ Research ] Autonomous Land Vehicle In Progress


We are currently research the Automomous Land Vehicle in Institut Teknologi Sumatera, Indonesia. The Autonomous system is using GPS to obtain location of vehicle and using PID control in steering system and position tracking system.

Vehicle

The progress of research is still 40% complete. we are still researching in control and web based control station.

Tuesday, August 14, 2018

[SOLVED] HMC5883L not working ( i2c adress:0x0D instead of 0x1E )


 
do you buy HMC5883L but the device not working?
if yes, you should check the i2c adress by using i2c scanner. --link--


if in i2c scanner you found device address is  0x0D then your trouble is wrong library, but if terminal say i2c not found, the problem is on hardware connection.

if address is 0x0D this is different with hmc5883L because this module is using qmc5883L ic. so the library is different with hmc5883L library.

To solve this issue, you can use the following library to work with your compass module.

Download Qmc5883L library

Wednesday, June 13, 2018

[SOLVED] How to move Application Folder to the Basepath (root) in Codeigniter



Codeigniter Application folder is where our job begin, the default structure of codeigniter is

basepath/aplication
basepath/system

now you want to move your application content to the site, you can use the following way

in index.php :

on line 117 change value to empty then

$application_folder = '';

and in line 239 change from

if (is_dir($application_folder))

to 

if ($application_folder=='')

Done.

Tuesday, June 12, 2018

How to Start Learn PLC (Programmable Logic Controller)


PLC is a device that is used in most industries in the world to control of system in industry. For electrical engineering that focus on control system PLC is a device that has to be learned. Then how to start to learn PLC? if you have device, you can start by programming the device. but what if you didnt have the PLC? you can start by simulation. 

PLC Fx Trainer

What is the best simulator that can be used? there are many PLC Simulators that can be used, and also there is Online PLC simulator. but i recommended to use Mitsubishi PLC Fx-Trainner, this software has great simulation tools and 3D simulation of industry devices. You can download PLC Fx Trainer by searching on google and start the learning

Solve Mathematical Problem Using Web App



Have you ever found a math problem that is need to be solved quickly? sometime, we need to know how math problems is solved for example when you in college or in school, but in another case, you only need to know the answer quickly without knowing how it done. There is some tools which can help you to solve math quickly. 

1. Matlab
Matlab is premium software that that have a great ability in Math problem, for example in Control system simulation, matrix , laplace, fourier, bode plot and etc. this application is available in Windows, Linux and Mac OS. 

2. Wolfram Alpha - Link
This is the recommended for you who need quickly solution of math problem, because wolfram alpha is web based app that free to use. you can get the Math Solution such as :
a. Laplace
b. Integral
c. Elementary Math 
d. Plotting Graph
e. Trigonometri
f. and so much more 

Wednesday, June 6, 2018

How to Delete your gitHub Repositories



If you have github account and trying to delete your gitHub repositories you can use the following way:

1. Login to your github Account
2. Go to your repositories that you want to deleted, for example
https://github.com/name/repoName/
3. Go to setting Menu
4. Scroll to the bottom of the page (go to danger zone) and Delete this repository

5. type your repository name to confirm the delete action

How to add Images in Readme.md gitHub




I just already joined github and trying to share project on github. and in the github there is feature to explain our project by writing on readme.md, and maybe you would to place any picture on your tutorial. you can use the following script to do that

![alt text](http://url/to/img.png)
  
For example

![alt text](http://1.bp.blogspot.com//bottom.png)