Skip to content

Instantly share code, notes, and snippets.

View apacheservices68's full-sized avatar
🌴
On vacation

Vinh Banh apacheservices68

🌴
On vacation
View GitHub Profile
@apacheservices68
apacheservices68 / Logitech URLs
Created August 16, 2024 07:42 — forked from trungbtran/Logitech URLs
List of Logitech URLs
https://www.logitech.com/tr-tr/product/multimedia-speakers-z333
https://www.logitech.com/cs-cz/product/multimedia-speakers-z333
https://www.logitech.com/en-au/product/z333-speaker-system-subwoofer.html
https://www.logitech.com/en-nz/product/z333-speaker-system-subwoofer.html
https://www.logitech.com/ru-ru/product/multimedia-speakers-z333
https://www.logitech.com/da-dk/product/multimedia-speakers-z333
https://www.logitech.com/sv-se/product/multimedia-speakers-z333
https://www.logitech.com/no-no/product/multimedia-speakers-z333
https://www.logitech.com/es-es/product/multimedia-speakers-z333
https://www.logitech.com/en-gb/product/z333-speaker-system-subwoofer.html
@apacheservices68
apacheservices68 / Logitech URLs
Created August 16, 2024 07:42 — forked from trungbtran/Logitech URLs
List of Logitech URLs
https://www.logitech.com/tr-tr/product/multimedia-speakers-z333
https://www.logitech.com/cs-cz/product/multimedia-speakers-z333
https://www.logitech.com/en-au/product/z333-speaker-system-subwoofer.html
https://www.logitech.com/en-nz/product/z333-speaker-system-subwoofer.html
https://www.logitech.com/ru-ru/product/multimedia-speakers-z333
https://www.logitech.com/da-dk/product/multimedia-speakers-z333
https://www.logitech.com/sv-se/product/multimedia-speakers-z333
https://www.logitech.com/no-no/product/multimedia-speakers-z333
https://www.logitech.com/es-es/product/multimedia-speakers-z333
https://www.logitech.com/en-gb/product/z333-speaker-system-subwoofer.html
@apacheservices68
apacheservices68 / ffmpeg -h decoder=h264_cuvid
Created February 20, 2024 04:19 — forked from nakov/ffmpeg -h decoder=h264_cuvid
ffmpeg: NVidia hardware encoder `h264_nvenc` and hardware decoder `h264_cuvid` - Documentation (Nov 2020)
ffmpeg version 2020-11-29-git-f194cedfe6-full_build-www.gyan.dev Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 10.2.0 (Rev5, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan --enable
@apacheservices68
apacheservices68 / ec2.go
Last active November 1, 2023 03:08
ec2 api get info script
package main
import (
"encoding/json"
"fmt"
"io"
"log"
"net/http"
"time"
)

Sometimes you want to retrieve EC2 insntances' region information.

You can query that information through instance metadata(169.254.169.254).

$ curl --silent http://169.254.169.254/latest/dynamic/instance-identity/document
{
  "privateIp" : "172.31.2.15",
  "instanceId" : "i-12341ee8",
  "billingProducts" : null,
 "instanceType" : "t2.small",
@apacheservices68
apacheservices68 / readme.md
Created October 30, 2023 08:36
Create htpasswd

echo $(htpasswd -nbB "") | sed -e s/\$/\$\$/g

@apacheservices68
apacheservices68 / asymmetric_encryption.md
Last active September 26, 2023 04:05
asymmetric encryption (mã hóa bất đối xứng dùng RSA)
  1. Tạo chữ ký số certificate authority (CA) và yêu cầu ký:

openssl req -x509 -newkey rsa:4096 -days 365 -nodes -keyout ca-key.pem -out ca-cert.pem -subj "/C=VN/ST=BINHTAN/L=HCM/O=FREELANCER/OU=Education/CN=localhost/emailAddress=localhost@gmail.com"

-> -subj có thể thay đổi theo từng environment. 2. Tự ký vào chứng chỉ của chữ ký (self-signed certificate)

openssl x509 -in ca-cert.pem -noout -text 3. Tạo server private key cho server đồng thời yêu cầu ký chứng chỉ cho key này(certificate signing request CSR):

@apacheservices68
apacheservices68 / Lambda_crud_RDS(Pgsql).md
Last active September 29, 2023 03:32
Describle my first lambda serverless service implementation
  • The first step is to create Role for aws lambda with RDS permission: (ớ bước đầu tiên , tạo 1 vai trò cho func lambda với quyền truy cập vào RDS service)

    1. Go to IAM console , click /Role and then create role for lambda . (Truy cập vào IAM console , click tạo role, chọn mục lambda)
    2. For permission tab , search RDSFullAccess and select it. (Ở tab quyền , search RDSFullPermission và chọn nó)
    3. As end tab , we give role name and click save role. (Ở tab cuối, ta điền tên vai trò và lưu)
  • The second step is create two new security group in your existing VPC: (Ở bước thứ hai , tạo 2 security group trong default VPC đã tồn tại)

    1. Give the name "LambdaSecurityGroup" and save.
    2. Give the name "DatabaseSecurityGroup" and save.
    3. Now , we go to the inbound rules of "DatabaseSecurityGroup" and click edit rule and add new rule with Postgres [port 5432] and set source id is "DatabaseSecurityGroup" , click save rule.
@apacheservices68
apacheservices68 / awscli_v2_ubuntu.md
Created September 7, 2023 10:42 — forked from ruanbekker/awscli_v2_ubuntu.md
Install AWS CLI Version 2 on Ubuntu 20
$ apt update
$ apt search awscli
$ apt install curl wget unzip -y
$ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
$ unzip awscliv2.zip
$ ./aws/install
$ aws --version
aws-cli/2.1.28 Python/3.8.8 Linux/4.19.121-linuxkit exe/x86_64.ubuntu.20 prompt/off
@apacheservices68
apacheservices68 / main.go
Created February 19, 2023 15:56 — forked from ayoisaiah/main.go
Multipart requests in Go (feat Google Drive API)
package main
import (
"bytes"
"fmt"
"io"
"io/ioutil"
"mime/multipart"
"net/http"
"net/textproto"