Skip to content

Instantly share code, notes, and snippets.

View ivon852's full-sized avatar

Ivon Huang ivon852

View GitHub Profile
@ivon852
ivon852 / AddExifDatatoPhoto.py
Last active April 12, 2025 10:19
Termux Android手機照片批次加上EXIF日期Python程式
""""
如何使用這個程式:
1. 安裝Termux APP https://f-droid.org/zh_Hant/packages/com.termux/
2. 允許存取手機內部儲存空間:termux-setup-storage
3. 安裝Python套件:pkg install python3 python-pip
4. 安裝Pillow:pkg install python-pillow
5. 將照片放在手機內部儲存空間/DCIM/Camera/,然後處理後的照片會輸出到手機內部儲存空間/DCIM/output/
6. 執行:python3 main.py
"""
@ivon852
ivon852 / compile-qemu-in-docker.sh
Created July 14, 2023 16:22
Compile QEMU binaries in Docker
mkdir ~/qemubuilder && cd qemubuilder
cat <<EOT >> Dockerfile
FROM debian:bookworm
RUN apt update
RUN apt install build-essential zlib1g-dev pkg-config libglib2.0-dev binutils-dev libboost-all-dev autoconf libtool libssl-dev libpixman-1-dev python3-capstone virtualenv ninja-build wget -y
EOT
docker build -t qemubuilder .
sudo docker run -it -v $(realpath ./build):/mnt/build --name qemubuilder "qemubuilder"
cd ~
wget https://download.qemu.org/qemu-6.2.0.tar.xz

Wayland桌面工作階段會帶來許多問題,其中最常見的就是瀏覽器效能下降的問題。因為有些瀏覽器預設跑在XWayland模式,所以看起來會卡卡的。所以要手動啟用Wayland模式。但是有的瀏覽器啟用Wayland模式反而出現了其他問題,下面就要來討論如何解決這些問題。

下列操作適用Ubuntu 24.04 LTS以上版本的系統。

1. 如何確認自己是使用Wayland工作階段

使用echo $XDG_SESSION_TYPE指令即可得知是目前桌面工作階段x11還是wayland

GNOME 42以上版本預設使用Wayland,登入畫面GDM右下角齒輪會有GNOMEGNOME on Xorg的選項。

@ivon852
ivon852 / markdownsorttable.sh
Created September 28, 2022 17:58
Markdown sort tableby numbers 表格數字排序
# Reference: https://christiantietze.de/posts/2017/05/sort-markdown-tables-shell/
# Example input file:
# |Name|Year|Pictures|Description|
# |---|---|---|---|
# |A |2022|foo|bar|
# |B |2012|bar|boo|
# |C |2009|boo|bar|
# Sort by column 2 (year), latest first:
@ivon852
ivon852 / removetx3g.bash
Created August 12, 2022 18:09
ffmpeg remove tx3g from a video
ffmpeg -i "input.mp4" -map 0 -map_chapters -1 -sn -dn -c copy output.mp4
<style>
.form-name-popup{
color: white;
text-align: center;
position:fixed;
z-index: 9;
top: 0%;
left: 0%;
width: 100%;
height: 100%;

GCompris是一套自由免費軟體,支援Linux/Windows/Android/MacOS等多個平台,可用電腦或觸控螢幕玩。

內建百款小遊戲電玩,富有教育意義,適合2~10歲的小朋友玩。

官網下載:https://gcompris.net/downloads-zh_TW.html

GCompris支援多國語言和語音提示。不過在玩的時候可以刻意選擇給有一定程度的小孩聽英文版說明。

遊戲內容主要分為電腦探索、數學運算、科學、遊戲、英語閱讀等。

先備知識:

  • 熟悉Java語法
  • 會安裝forge模組
  • 有英文google的能力

步驟目錄

  1. 安裝JDK
  2. 安裝IntelliJ IDE
@ivon852
ivon852 / Main.php
Last active September 10, 2021 16:19
<?php
//命名空間即src/下的路徑
namespace examplePlugin;
//會用到的PocketMine類別
use pocketmine\plugin\PluginBase;
use pocketmine\event\Listener;
use pocketmine\event\player\PlayerJoinEvent;
use pocketmine\utils\TextFormat;
@ivon852
ivon852 / main.java
Last active September 10, 2021 08:03
package com.example;
import cn.nukkit.plugin.PluginBase;
import cn.nukkit.utils.TextFormat;
import cn.nukkit.command.Command;
import cn.nukkit.command.CommandSender;
import cn.nukkit.event.EventHandler;
import cn.nukkit.event.Listener;
import cn.nukkit.event.player.PlayerJoinEvent;