Skip to content

Instantly share code, notes, and snippets.

View itsuki-hayashi's full-sized avatar
🎯
Focusing

Itsuki Hayashi itsuki-hayashi

🎯
Focusing
View GitHub Profile
@itsuki-hayashi
itsuki-hayashi / vcredistr.md
Created June 16, 2024 13:02 — forked from ChuckMichael/vcredistr.md
Visual C++ Redistributable Packages
@itsuki-hayashi
itsuki-hayashi / my-job-card-qualifications-2024-05.md
Last active May 26, 2024 07:02
マイジョブ・カード資格一覧 2024年5月
@itsuki-hayashi
itsuki-hayashi / Disable Signin to Microsoft Edge and Google Chrome on Windows.reg
Created February 21, 2024 09:37
Disable Signin to Microsoft Edge and Google Chrome on Windows
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge]
"BrowserSignin"=dword:00000000
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome]
"BrowserSignin"=dword:00000000
@itsuki-hayashi
itsuki-hayashi / ComicInfo.xml
Last active February 5, 2024 13:12
ComicInfo.xml 2.0 example, you have to put it at root level for Komga to recognize, you cannot put it inside a folder.
<?xml version="1.0" encoding="UTF-8"?>
<ComicInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/anansi-project/comicinfo/main/schema/v2.0/ComicInfo.xsd">
<Title>神無月の巫女 (1)</Title>
<Series>神無月の巫女</Series>
<Number>1</Number>
<Count>2</Count>
<Summary>
宿命の巫女として転生した二人の少女と、運命に抗う一人の少年。そして暗黒神=ヤマタノオロチ復活を狙う巨大ロボ軍団! 現代に甦る神々が世界の命運を賭けて、壮絶なロボバトルを繰り広げる衝撃の第1巻!!
</Summary>
@itsuki-hayashi
itsuki-hayashi / manga-cutter.ps1
Created January 1, 2024 13:21
PowerShell 2 panel manga cutter
# Get the list of all .jpg files
$files = Get-ChildItem -LiteralPath . -Filter *.jpg
# Counter for the output file names
$counter = 1
foreach ($file in $files) {
# Determine the dimensions of the image
$imageInfo = magick identify -format "%wx%h" $file.FullName
$dimensions = $imageInfo -split 'x'
@itsuki-hayashi
itsuki-hayashi / avif-to-jpg.ps1
Last active January 1, 2024 12:48
Convert AVIF to JPG in PowerShell with ImageMagick
# Single thread
Get-ChildItem -LiteralPath . -Filter *.avif | ForEach-Object {
$jpgFileName = [System.IO.Path]::ChangeExtension($_.Name, '.jpg')
magick convert $_.FullName $jpgFileName
}
# Or parallel
$scriptBlock = {
param($inputFile)
$outputFile = [System.IO.Path]::ChangeExtension($inputFile, '.jpg')
@itsuki-hayashi
itsuki-hayashi / hello.pl
Created December 30, 2023 08:03
Modern Perl header
#!/usr/bin/env perl
use strict;
use warnings;
use 5.038;
use utf8;
use English;
use FindBin;
use lib "$FindBin::Bin/local/lib/perl5";
@itsuki-hayashi
itsuki-hayashi / hello-gtk4.pl
Last active July 25, 2023 04:24
GTK4 Hello world in Perl
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use v5.38;
use Glib::Object::Introspection;
Glib::Object::Introspection->setup(
basename => 'Gio',
version => '2.0',
package => 'Gio');
@itsuki-hayashi
itsuki-hayashi / ubuntu-systemd-cryptenroll-tpm.sh
Last active March 1, 2024 12:07
Systemd TPM Auto LUKS Unlock for Ubuntu 22.04
# See also: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1969375
# See: https://github.com/wmcelderry/systemd_with_tpm2
# Install dependencies for systemd TPM
sudo apt install libtss2-rc0
# Check if Ubuntu recognize your TPM chip
systemd-cryptenroll --tpm2-device=list
# Check current LUKS info
sudo cryptsetup luksDump /dev/nvme0n1p3
# Enroll TPM as unlocker
sudo systemd-cryptenroll --tpm2-device=auto --tpm2-pcrs=7 /dev/nvme0n1p3
@itsuki-hayashi
itsuki-hayashi / hide-not-mounted-drives-from-ubuntu-dock.sh
Created July 24, 2023 10:04
Hide not mounted drives from Ubuntu Dock
gsettings set org.gnome.shell.extensions.dash-to-dock show-mounts-only-mounted true