Skip to content

Instantly share code, notes, and snippets.

@axzxc1236
axzxc1236 / PKGBUILD
Last active April 4, 2023 00:22
PKGBUILD for oxwu 4.1.0
# Contributor: holishing
# Contributor: axzxc1236
pkgname=oxwu
pkgver=4.1.0
pkgrel=1
pkgdesc="The GUI software using P2P networking to fastly report Earthquakes in Taiwan"
arch=('x86_64')
url="https://eew.earthquake.tw"
source=("oxwu-$pkgver.AppImage::https://eew.earthquake.tw/releases/linux/x64/oxwu-linux-x86_64.AppImage")
sha512sums=('e208dd1a1db22744ff2f7f6edacf8bf93db9b46e38398b028f71ccb52e810e0e5b93b632540f902593c4d7c3a13a2225a164755fc62674630da3c02b72ed6e0a')
@axzxc1236
axzxc1236 / wake-on-lan.py
Created March 30, 2023 10:40
Python single function Wake on LAN
# This file is licensed under MIT lciense, see full license at the buttom of the file.
# Tested on Linux and doesn't require root.
import socket, binascii
#THIS FUNCTION DESN'T DO ANY CHECK ON PARAMETER PASSED TO IT!!!
#mac should be something like aa:bb:cc:dd:ee:ff, a normal mac address
#this function should work with upper case one too
#I didn't test password field, if you need to use please test it, if specified it should be 6 character string
def wake_on_lan(mac, broadcastIP="255.255.255.255", seperator=":", password=None):
@axzxc1236
axzxc1236 / USB_ZFS_auto_mount.MD
Last active May 8, 2024 15:15
How to mount ZFS pools thats on USB drives automatically.

I know there are a lot of tutorials on mounting ZFS automatically already, but that didn't work for me.

My situation:
I have a USB DAS(Direct-Attached Storage) that is connected to my NAS.

Why didn't the tutorials on the internet worked for me:
Systemd service files that comes with ZFS won't wait for USB devices.

Solution:
Create a service that can wait for my DAS to be recognized by Linux and then mount my ZFS pool.

# Written by axzxc1236
pkgname=ripdrag-git
_pkgname=ripdrag
pkgver=0.1.2r23
pkgrel=1
pkgdesc="Drag and Drop files to and from the terminal"
arch=(any) #Not sure if there is architecture limitation or not
url="https://github.com/nik012003/ripdrag"
license=('GPL3')
depends=('libxcb' 'gdk-pixbuf2' 'libxrender' 'libthai' 'libpng' 'fribidi' 'libxi' 'libxext' 'libxcursor' 'libtiff' 'libxrandr' 'libxml2' 'libdatrie' 'xz' 'libxdmcp' 'util-linux-libs' 'libxdamage' 'fontconfig' 'cairo' 'gcc-libs' 'graphite' 'glib2' 'lzo' 'sqlite' 'json-glib' 'icu' 'expat' 'gtk4' 'brotli' 'libepoxy' 'glibc' 'zlib' 'wayland' 'graphene' 'libjpeg-turbo' 'freetype2' 'libffi' 'libcloudproviders' 'pango' 'tracker3' 'libxinerama' 'pixman' 'harfbuzz' 'libxkbcommon' 'libstemmer' 'zstd' 'libxfixes' 'bzip2' 'pcre' 'libxau' 'libx11') # I don't know exact requirement so I just use "ldd ripdrag" and find packages associated with so libraries, this is also why I don't push this PKGBUILD to aur.
@axzxc1236
axzxc1236 / rtpinstallv2.sh
Created February 6, 2021 04:39
RTP install script v2
#! /bin/bash
if ! [ -e "/bin/unar" ]; then
sudo apt install unar
fi
cd /tmp
wget -nc https://tkool.jp/products/rtp/2000rtp.zip https://tkool.jp/products/rtp/2003rtp.zip https://tkool.jp/products/rtp/RTP_patchk_190612.zip https://dl.degica.com/rpgmakerweb/run-time-packages/rpg2000_rtp_installer.exe https://dl.degica.com/rpgmakerweb/run-time-packages/rpg2003_rtp_installer.zip https://dl.degica.com/rpgmakerweb/run-time-packages/xp_rtp104e.exe https://dl.degica.com/rpgmakerweb/run-time-packages/vx_rtp102e.zip https://dl.degica.com/rpgmakerweb/run-time-packages/RPGVXAce_RTP.zip
#JP
@axzxc1236
axzxc1236 / extractiso.sh
Last active February 5, 2021 05:11
Extract fonts from Windows iso into wine folder.
#! /bin/bash
if ! [ -e "/usr/bin/7z" ]; then
sudo apt install p7zip-full -y
fi
ls *.iso 2>/dev/null >/dev/null
if ! [ $? -eq 0 ]; then
echo "There is no .iso file in this folder"
else
7z e *.iso sources/install.wim
7z e install.wim 1/Windows/{Fonts/"*".{ttf,ttc},System32/Licenses/neutral/"*"/"*"/license.rtf} -o"$HOME/.wine/drive_c/windows/Fonts/" -y
@axzxc1236
axzxc1236 / rtp.reg
Last active December 29, 2022 14:13
A script to install rtp programs in wine.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\ASCII]
[HKEY_LOCAL_MACHINE\SOFTWARE\ASCII\RPGツクール2000 ランタイムパッケージ]
[HKEY_LOCAL_MACHINE\SOFTWARE\ASCII\RPGツクール2000 ランタイムパッケージ\1.00.000]
[HKEY_LOCAL_MACHINE\SOFTWARE\Enterbrain]
@axzxc1236
axzxc1236 / fluidsynth.service
Created February 5, 2021 03:07
Fluidsynth server for wine games
[Unit]
Description=Fluidsynth server for wine games
[Service]
ExecStart=fluidsynth -l -s -i -a pulseaudio /usr/share/sounds/sf2/FluidR3_GM.sf2
Restart=always
RestartSec=30
[Install]
WantedBy=default.target
@axzxc1236
axzxc1236 / Line_helper.sh
Last active February 28, 2024 09:41
My mitigation to Wine bug 43030
#! /bin/sh
if [[ $(which xdotool) = "" ]]; then
echo "xdotool is required to run this script."
exit
fi
if [[ $(which xwininfo) = "" ]]; then
echo "xwininfo is required to run this script."
exit
@axzxc1236
axzxc1236 / command line output
Created January 9, 2021 15:13
Firefox debugging 0109
➤ firefox
WINDOW DECORATIONS RELOADED
WINDOW DECORATIONS RELOADED
/usr/lib/firefox/defaults/pref/config-prefs.js:1: prefs parse error: unknown keyword
/usr/lib/firefox/defaults/pref/config-prefs.js:3: prefs parse error: unknown keyword
/usr/lib/firefox/defaults/pref/config-prefs.js:4: prefs parse error: unknown keyword
/usr/lib/firefox/defaults/pref/config-prefs.js:4: prefs parse error: unexpected character
/usr/lib/firefox/defaults/pref/config-prefs.js:6: prefs parse error: unexpected character
/usr/lib/firefox/defaults/pref/config-prefs.js:8: prefs parse error: unknown keyword
/usr/lib/firefox/defaults/pref/config-prefs.js:8: prefs parse error: unknown keyword