Lang thang

Tôi lang thang

  • 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…

  • 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…

  • Công nghệ,  Lang thang,  Linux,  Mẹo vặt

    wttr.in | Check weather in terminal

    wttr.in | weather app for the terminal https://github.com/chubin/wttr.in wttr.in — the right way to ~check~ curl the weather! wttr.in is a console-oriented weather forecast service that supports various information representation methods like terminal-oriented ANSI-sequences for console HTTP clients (curl, httpie, or wget), HTML for web browsers, or PNG for graphical viewers. Originally started as a small project, a wrapper for wego, intended to demonstrate the power of the console-oriented services, wttr.in became a popular weather reporting service, handling tens millions of queries daily. You can see it running here: wttr.in. Documentation | Usage | One-line output | Data-rich output format | Map view | Output formats | Moon phases |…

  • Lang thang

    [Infinity hosting] Lỗi không cho request dữ liệu được lưu trên host

    [Infinity hosting] Lỗi không cho request dữ liệu được lưu trên host Nhận dạng lỗi This site requires Javascript to work, please enable Javascript in your browser or use a browser with Javascript support https://forum.infinityfree.net/t/this-site-requires-javascript-to-work-please-enable-javascript-in-your-browser-or-use-a-browser-with-javascript-support/18309 Lý do No hope! Không có hi vọng request data lưu trên này rồi =)) Thông tin thêm Nhưng chức năng bị hạn chế trên hosting free Which features are not supported? Because of this security system, the following things will not work correctly or at all on websites on free hosting. Access through Android or iOS mobile apps (mobile browsers work fine). API access to websites (like WordPress XML-RPC). Access from cURL or other…

  • Lang thang,  Mẹo vặt

    Enable VT-x in your BIOS security settings (refer to documentation for your computer)

    Enable VT-x in your BIOS security settings (refer to documentation for your computer) Tôi gặp lỗi này khi khởi chạy máy ảo Android trên máy tính, lỗi này cũng khiến cho Docker không thể khởi động được Fix lỗi Enable VT-x in your BIOS security settings Vào BIOS => Advanced => CPU Configuration => bật Intel Virtualization Technology

  • Lang thang,  Linux

    [Rclone] Config rclone to support diffie-hellman-group-exchange-sha256 diffie-hellman-group-exchange-sha1

    [Rclone] Config rclone to support diffie-hellman-group-exchange-sha256 diffie-hellman-group-exchange-sha1 Err info haugiang@hg-nn-web:/$ rclone mount backup_sftp:/NongNghiep/ /gdrive2/ --allow-non-empty 2022/05/25 03:09:25 Failed to create file system for "backup_sftp:/NongNghiep/": NewFs: couldn't connect SSH: ssh: handshake failed: ssh: no common algorithm for key exchange; client offered: [curve25519-sha256 curve25519-sha256@libssh.org ecdh-sha2-nistp256 ecdh-sha2-nistp384 ecdh-sha2-nistp521 diffie-hellman-group14-sha256 diffie-hellman-group14-sha1 ext-info-c], server offered: [diffie-hellman-group-exchange-sha1 diffie-hellman-group1-sha1] Fix Config rclone to support diffie-hellman-group-exchange-sha256 diffie-hellman-group-exchange-sha1 We have managed to opt-in those algorithms support and submitted a PR here: https://github.com/ncw/rclone/pull/3341 Note: since those algorithms are considered insecure, your also need to use the exisiting rclone flag --sftp-use-insecure-cipher to make them available for SSH handshake. My Example run Ok rclone mount backup_sftp:/mnt/array1/NongNghiep/ /backup_drive/ --allow-non-empty --sftp-use-insecure-cipher https://stackoverflow.com/questions/56968274/config-rclone-to-support-diffie-hellman-group-exchange-sha256-diffie-hellman-gro

  • Capuchino,  Công nghệ,  Lang thang

    Life before the invention of AutoCAD, 1950-1980

    Life before the invention of AutoCAD, 1950-1980 General Motors Technical Center in Warren Michigan. Before the advent of AutoCAD and other drafting software, engineering drawings were made on sheets of large paper using drawing boards. Many types of equipment were required to complete a given drawing, such as drawing board, different grade pencils, erasers T-squares, set square, etc. The major disadvantage of a paper-based design was that you could not change the drawing after it was committed to paper. This would mean that if changes were required to the design, the engineers would need to create the sketches all over again. Examining the history of engineering drafting and design equivocally…

  • Lang thang,  Mẹo vặt

    [GBA Game] How To Patch IPS and UPS Files to Play a ROM Hack

    [GBA Game] How To Patch IPS and UPS Files to Play a ROM Hack If you ever played a Gameboy Advance emulator, then chances are you will need ROMs. The ROMs will act as the cartridges, which are basically the games. A Gameboy Advance ROM will have a .GBA file format. This means that only a GBA emulator can run this type of file, or there are some NDS emulators that can run it as well. It is like an MP3 player can't play an MP4 file, or at least only the audio will play, but you can't see the video. What you need to do is to know how to apply an IPS…

  • Công nghệ,  Lang thang,  Linux

    Cài Docker Compose trên Ubuntu (Linux)

    Cài Docker Compose trên Ubuntu (Linux) Lỗi Unable to locate package docker-compose-plugin Ban đầu mình cài với lệnh sudo apt install docker-compose-plugin, tuy nhiên bị lỗi sau: Unable to locate package docker-compose-plugin haugiang@hg-nn-web:/nongnghiep/docker/postgresql$ sudo apt-get update Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease Get:2 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB] Get:3 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB] Get:4 http://archive.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB] Get:5 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [2,570 kB] Get:6 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [1,810 kB] Fetched 4,632 kB in 7s (667 kB/s) Reading package lists... Done haugiang@hg-nn-web:/nongnghiep/docker/postgresql$ sudo apt-get install docker-compose-plugin Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package docker-compose-plugin haugiang@hg-nn-web:/nongnghiep/docker/postgresql$ sudo apt install docker-compose-plugin…