Mẹo vặt

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

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

    [Install SSL Certificate into Linux] Installing Certificate PFX into Unbuntu Linux

    [Install SSL Certificate into Linux] Installing Certificate PFX into Unbuntu Linux Export Private Key and Certificate from PFX file Export the Private Key openssl pkcs12 -in domain.com.pfx -nocerts -out domain.com.pem -nodes Export the Certificate openssl pkcs12 -in domain.com.pfx -nokeys -out domain.com.crt -nodes Update the certificate update-ca-certificates Config Vhost SSL <VirtualHost *:443> DocumentRoot "/abc/xyzdir/" ServerName domain.com ErrorLog "logs/domain.com-error.log" CustomLog "logs/domain.com-access.log" combined SSLEngine On SSLCertificateFile "/usr/local/share/ca-certificates/domain.com.crt" SSLCertificateKeyFile "/usr/local/share/ca-certificates/domain.com.pem" # SSLCertificateFile "/opt/lampp/etc/ssl.crt/server.crt" # SSLCertificateKeyFile "/opt/lampp/etc/ssl.key/server.key" <Directory "/abc/xyzdir/"> AllowOverride All # Order Allow,Deny Allow from all # --New way of doing it Require all granted </Directory> </VirtualHost> References https://helloitsliam.com/2016/03/30/installing-certificate-pfx-into-debian-linux/

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

    rclone – Fatal error: failed to mount FUSE fs

    rclone - Fatal error: failed to mount FUSE fs Error info 2022/05/10 04:07:15 mount helper error: fusermount: option allow_other only allowed if 'user_allow_other' is set in /etc/fuse.conf 2022/05/10 04:07:15 Fatal error: failed to mount FUSE fs: fusermount: exit status 1 Fix rclone - Fatal error: failed to mount FUSE fs Remove --allow-other option # Origin rclone mount ssh_dcsrv:/work/DEV/longdt/Server_Backup/ /gdrive/ --allow-other --allow-non-empty # Become rclone mount ssh_dcsrv:/work/DEV/longdt/Server_Backup/ /gdrive/ --allow-non-empty References https://forum.rclone.org/t/any-way-around-fusermount-option-allow-other-only-allowed-if-user-allow-other-is-set-in-etc-fuse-conf/20625

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

    rclone – couldn’t connect ssh: ssh: must specify HostKeyCallback

    rclone - couldn't connect ssh: ssh: must specify HostKeyCallback Error info Fix rclone - couldn't connect ssh: ssh: must specify HostKeyCallback https://github.com/rclone/rclone/issues/3557#issuecomment-533618145 sudo curl https://rclone.org/install.sh | sudo bash References https://rclone.org/downloads/ https://github.com/rclone/rclone/issues/3557#issuecomment-533618145

  • Lang thang,  Mẹo vặt

    [Linux Screen] Cannot make directory ‘/var/run/screen’: Permission denied

    [Linux Screen] Cannot make directory '/var/run/screen': Permission denied Error info Sometime, usually after a crash or sudden shutdown, screen refuses to start. Commands like screen screen -ls screen -r screen -d result in the following output Cannot make directory '/var/run/screen': Permission denied Fix Cannot make directory '/var/run/screen': Permission denied The directory /var/run/screen/ is the socket directory for screen. Fortunately, screen reads a environment variable SCREENDIR to get an alternative socket directory. So to work around it, you can create a directory, such as ~/.screen: mkdir ~/.screen && chmod 700 ~/.screen and export the SCREENDIR to point to that directory: export SCREENDIR=$HOME/.screen You can also put this line into you ~/.bashrc so that it will also take effect afterwards. Result References https://superuser.com/questions/1195962/cannot-make-directory-var-run-screen-permission-denied