Skip to content

Instantly share code, notes, and snippets.

View ngohuunhut's full-sized avatar
🎯
Focusing

Ngô Hữu Nhựt ngohuunhut

🎯
Focusing
View GitHub Profile
@ngohuunhut
ngohuunhut / image_to_text.js
Created September 12, 2024 00:32 — forked from NoCtrlZ1110/image_to_text.js
Extract text from image using Google Lens API
const fs = require('fs');
const axios = require('axios');
const FormData = require('form-data');
// Function to read the image file as a buffer
const readImageFile = (filePath) => {
return new Promise((resolve, reject) => {
fs.readFile(filePath, (err, data) => {
if (err) {
reject(err);
@ngohuunhut
ngohuunhut / termbin-encrypted-data.md
Created April 19, 2024 04:47 — forked from schmich/termbin-encrypted-data.md
Sharing encrypted data via termbin.com with only netcat and OpenSSL

Single file

Source

  • cat /foo/bar/file.txt | openssl enc -aes-256-cbc -base64 | nc termbin.com 9999
  • Enter password twice (quickly), note termbin.com URL

Destination

  • curl -s http://termbin.com/{id} | openssl enc -aes-256-cbc -base64 -d > file.txt
@ngohuunhut
ngohuunhut / SoChiTieu.gs
Created February 6, 2024 03:53 — forked from NoCtrlZ1110/SoChiTieu.gs
Telegram to Google Sheet: Subscribe to my channel: https://bit.ly/van-huy-dev-youtube
// Constants
const TOKEN = `<YourTokenHere>`;
const BASE_URL = `https://api.telegram.org/bot${TOKEN}`;
const CHAT_ID = '<ChatId>';
const DEPLOYED_URL = '<YourScriptDeployedURL>';
const SUM_CELL = 'G2';
const METHODS = {
SEND_MESSAGE: 'sendMessage',
SET_WEBHOOK: 'setWebhook',
@ngohuunhut
ngohuunhut / readme.md
Created February 6, 2024 03:20 — forked from TomHumphries/readme.md
Saving RTSP Camera Streams with FFmpeg

Saving RTSP Streams from Tapo C310 Cameras with FFmpeg

The full FFmpeg command to copy-paste:

ffmpeg -hide_banner -y -loglevel error -rtsp_transport tcp -use_wallclock_as_timestamps 1 -i rtsp://username:[email protected]:554/stream1 -vcodec copy -acodec copy -f segment -reset_timestamps 1 -segment_time 900 -segment_format mkv -segment_atclocktime 1 -strftime 1 %Y%m%dT%H%M%S.mkv

The input stream URL is for a Tapo C310 camera with the RTSP username and password "username" and "password".

I've put a fair bit of experimentation into the settings in this command. I've included the what and whys below, as well as a camera recommendation for RTSP.