Skip to content

Instantly share code, notes, and snippets.

View tbvinh's full-sized avatar
🧑‍🍼
I may be slow to respond.

Vinh Tran tbvinh

🧑‍🍼
I may be slow to respond.
  • Ho Chi Minh - Vietnam
View GitHub Profile
@tbvinh
tbvinh / chatbot.py
Last active July 28, 2025 14:18
the AI chatbot in python
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import tensorflow as tf
import tensorflow_hub as hub
import numpy as np
import re
# Intents and responses
intents = {
@tbvinh
tbvinh / chatbot.html
Created July 19, 2024 15:01
Chatbot html and js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Simple Chatbot</title>
<style>
body {
font-family: Arial, sans-serif;
}
@tbvinh
tbvinh / circle.html
Created July 19, 2024 11:31
AI Chatbot html java script with Circle calculation
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>circle.html</title>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/universal-sentence-encoder@latest"></script>
<style>
body {
@tbvinh
tbvinh / rectangle.html
Created July 19, 2024 11:30
AI Chatbot html java script with Rectangle calculation
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>rectangle.html</title>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/universal-sentence-encoder@latest"></script>
<style>
body {
@tbvinh
tbvinh / hello-2.html
Created July 19, 2024 11:29
The second sample of API chatbot with Threshold = .5
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>hello-02.html</title>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/universal-sentence-encoder@latest"></script>
<style>
body {
@tbvinh
tbvinh / hello.html
Created July 19, 2024 11:28
The simple sample of AI chatbot in HTML and javascript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>hello.html</title>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/universal-sentence-encoder@latest"></script>
<style>
@tbvinh
tbvinh / gist:e6b1c014604d504c58e2bbfa0ddc5bce
Created September 6, 2023 05:06
Install cert for Glassfish
1.java InstallCert
2. keytool -exportcert -alias [domain]-1 -keystore jssecacerts -storepass changeit -file [domain].cer
3. sudo keytool -importcert -alias [domain]-1 -keystore ~/glassfish5/glassfish/domains/domain1/config/cacerts.jks -storepass changeit -file [domain].cer
JAVA: InstallCert.java
==================================================
//https://github.com/escline/InstallCert
@tbvinh
tbvinh / delFromFile.sh
Created June 13, 2023 12:52
del all files in a file
TO_BE_DEL="$1"
IFS=""
while read -r file ; do
rm -rf "$file"
done < "$TO_BE_DEL"
#usage: delFromFile.sh file.txt
#!/bin/sh
# wget -O backup-apache-mysql-wwwfolder.sh https://gist.githubusercontent.com/tbvinh/51bc2b297b1b864546ba42e4b2a92a04/raw/backup-apache-mysql-wwwfolder.sh?rnd=`date +%s`
## 0 ======================
echo 1. Backup apache .conf files
echo 2. Backup www/ folder
echo 3. Backup mysql
## 1 ======================
@tbvinh
tbvinh / backup-server.md
Last active December 15, 2022 11:59
BACKUP MYSQL USER, APACHE FOLDER, WWW/ FOLDER