• Lang thang,  Mẹo vặt

    IONIC Capacitor build Android Debug APK

    IONIC Capacitor build Android Debug APK Install Capacitor npm install @capacitor/core @capacitor/cli npx cap init Add Android platform to Capacitor project ionic build npm install @capacitor/android ionic cap add android Build Android Debug APK with IONIC Capacitor ionic cap copy ionic cap sync ionic capacitor copy android && cd android && ./gradlew assembleDebug && cd .. Then your apk will be at: android/app/build/outputs/apk/debug/app-debug.apk If you want to run on device directly from command line: ionic capacitor copy android && cd android && ./gradlew assembleDebug && ./gradlew installDebug && cd .. Note: It doesn't work without entering the android directory Build Production APK cd android && ./gradlew assembleRelease && cd app/build/outputs/apk/release…

  • Lang thang,  Linux,  Mẹo vặt

    Backing up your docker volumes

    Backing up your docker volumes https://github.com/soiqualang/docker-backup-volume How to backup your volume backup-volume.sh will create a new running docker container and mount the volume to the container. A docker cp will be run and the contents of the volume will be saved into a location determined by: $prefix/$volume/<timestamp>_$volume.tar.gz An example to run the command is the following: backup-volume.sh -v <volume_name> -p <prefix> backup-volume.sh ```bash #!/usr/bin/env bash # creates a backup of the docker volume while [ $# -gt 0 ]; do case "$1" in -v|-volume|--volume) volume="$2" ;; -p|-prefix|--prefix) prefix="$2" ;; -h|-help|--help) printf "--volume the name of the volume\n" printf "--mount the mount point of the volume\n" exit 1 ;; *) printf "***************************\n" printf "*…

  • Lang thang,  Linux,  Mẹo vặt

    Awesome Docker Compose

    Awesome Docker Compose Danh sách các Docker Compose phổ biến Just pull and run =)) https://github.com/docker/awesome-compose Awesome Compose  A curated list of Docker Compose samples. These samples provide a starting point for how to integrate different services using a Compose file and to manage their deployment with Docker Compose. Note: The following samples are intended for use in local development environments such as project setups, tinkering with software stacks, etc. These samples must not be deployed in production environments. Contents Samples of Docker Compose applications with multiple integrated services. Single service samples. Basic setups for different platforms (not production ready - useful for personal use). Samples of Docker Compose applications…

  • Mẹo vặt,  Web

    WordPress fix lỗi This request has been blocked; the content must be served over HTTPS.

    WordPress fix lỗi This request has been blocked; the content must be served over HTTPS. Thông tin lỗi Mixed Content: The page at 'https://abc.com/uio' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://abc.com/uio/wp/v2/'. This request has been blocked; the content must be served over HTTPS. À, như vậy là do có những link nó nhận là http, trong khi domain mình đang dùng là https, thế là bị trình duyệt chặn, do vậy mình cài plugin Really Simple SSL giúp tự động chuyển các link http sang https hết. Vậy là ok Fix lỗi This request has been blocked; the content must be served over HTTPS. Install plugin…

  • Lang thang,  Mẹo vặt

    Giới thiệu về GitHub Profile Achievements và cách đạt được các huy hiệu này

    GitHub Profile Achievements 🏆 Giới thiệu về GitHub Profile Achievements và cách đạt được các huy hiệu này Đợt vừa rồi, GitHub vừa ra chương trình sưu tập các huy hiệu, khá là cool, thông tin chi tiết bên dưới: A collection listing all Achievements available on the GitHub profile. Following the launch of the first Mars Helicopter, Ingenuity, GitHub announced the new Achievements section: We are also using this opportunity to introduce a new Achievements section to the GitHub profile. Right now, Achievements include the Mars 2020 Helicopter Mission badge, the Arctic Code Vault badge, and a badge for sponsoring open source work via GitHub Sponsors. This repository attempts to list them all. 2022-06-09: GitHub announced more Achievements,…

  • Lang thang,  Mẹo vặt

    [Backup Docker] Saving Images and Containers as Tar Files for Sharing

    [Backup Docker] Saving Images and Containers as Tar Files for Sharing Saving Images and Containers as Tar Files for Sharing Imagine a scenario where you have built Docker images and containers that you would be interested to keep and share it with your other collaborators or colleagues. The below methods shall help you achieve it. Four basic Docker CLI comes into action: The docker export - Export a container's filesystem as a tar archive The docker import - Import the contents from a tarball to create a filesystem image The docker save - Save one or more images to a tar archive (streamed to STDOUT by default) The docker load - Load an image from a tar archive…

  • Lang thang,  Mẹo vặt

    IONIC Angular deployment – 404 on page Refresh

    This will work on following servers. Apache Server Add .htaccess on root to your project <IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews -Indexes </IfModule> RewriteEngine On # Handle Authorization Header RewriteCond %{HTTP:Authorization} . RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] # Redirect Trailing Slashes If Not A Folder... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} (.+)/$ RewriteRule ^ %1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.html [L] </IfModule> IIS Server Add web.config <configuration> <system.webServer> <rewrite> <rules> <rule name="Imported Rule 1" stopProcessing="true"> <match url="^(.*)/$" ignoreCase="false" /> <conditions> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" /> </conditions> <action type="Redirect" redirectType="Permanent" url="/{R:1}" /> </rule> <rule name="Imported Rule 2" stopProcessing="true"> <match url="^" ignoreCase="false" /> <conditions>…

  • Công nghệ,  Lang thang

    [Sưu tầm] gRPC là gì? Vũ khí tối thượng tăng tải Microservices

    [Sưu tầm] gRPC là gì? Vũ khí tối thượng tăng tải Microservices https://200lab.io/blog/grpc-la-gi-vu-khi-tang-tai-microservices/ 1. gRPC là gì? gRPC là một framework RPC mã nguồn mở, hiện đại và hiệu năng cao mà có thể chạy trên bất kỳ môi trường nào. Framework này được Google khởi công phát triển vào năm 2015, đến 08/2016 thì được phát hành chính thức. Đây được cho là một thế hệ tiếp theo của RPC (Remote Procedure Calls) đặc biệt là trong mô hình Microservices. Gần đây các backend developer phải đứng trước lựa chọn dùng REST API hay dùng gRPC. Tại sao đã có REST API rồi còn phải thêm gRPC chi vậy? Vậy thì bài viết này mình sẽ làm rõ các khác biệt của chúng. REST API…

  • Công nghệ,  Lang thang,  Mẹo vặt,  Sói's Tutorials

    Python concatenate multi video

    Python concatenate multi videos Hôm nay tình cờ mình cần ghép nhiều video lại với nhau, chợt suy nghĩ hôm trước mình đã dùng python để convert video sang mp4 rồi, giờ thì thử dùng python ghép video luôn xem sao Thế là bắt đầu thôi! Today by chance I need to merge many videos together, I suddenly thought that I used python to convert videos to mp4, now try using python to combine videos So that's the start! Run python concatenate_video.py -c intro.mp4 video.mp4 endtro.mp4 -o output.mp4 concatenate_video.py from moviepy.editor import concatenate_videoclips, VideoFileClip def concatenate(video_clip_paths, output_path, method="compose"): """Concatenates several video files into one video file and save it to…