Skip to content

Instantly share code, notes, and snippets.

View kuanyui's full-sized avatar
❄️
なんでそんなに慣れてんだよ!

クエン酸 kuanyui

❄️
なんでそんなに慣れてんだよ!
View GitHub Profile
@kuanyui
kuanyui / Dockerfile
Last active May 15, 2024 12:31
(NOTE: Please place all the files under ./container)
# ===== USAGE =====
# clear; export BUILDAH_LAYERS=false; podman build --tag resume ./container
#
# podman run --name resume --detach --tty \
# --publish 58000:8000/tcp \
# --userns=keep-id:uid=1000,gid=1000 \
# --volume /home/${USER}/${HOST_PROJ_DIR}:/home/user/MY_PROJECT \
# localhost/resume
#
# podman exec --interactive --tty --workdir /home/user/MY_PROJECT --user user resume /bin/bash

Important

Important

Note

NOTE

Warning

WARNING

@kuanyui
kuanyui / ..podman_notes.md
Last active February 21, 2024 07:44
Podman run Debian Bookworm

Beginner's note for Podman

@kuanyui
kuanyui / Dockerfile
Last active January 5, 2024 10:02
Some notes for debian inside container
FROM debian:bookworm
LABEL maintainer="[email protected]"
SHELL ["/bin/bash", "-c"]
RUN useradd --create-home --shell /bin/bash user
RUN apt update && apt install --no-install-recommends --yes \
iputils-ping \
less \
@kuanyui
kuanyui / crop-image.sh
Last active October 8, 2023 10:55
(Perl + ImageMagick) Crop image into right/left side inside bash directly.
perl -e '
use strict;
use warnings;
use File::Basename;
my $SRCDIR = "ori02/";
my $OUTDIR = "out02/";
my $w = 1506;
my $h = 2160;
my $firstPageInCenter = 1;
my $leftPageX = 405;
@kuanyui
kuanyui / tree-style-tab.css
Last active October 6, 2023 03:28
Firefox のツリー型タブ(WebExtension の TreeStyleTab)のユーザースタイルシートのため。フォントを少し小さくする。
:root.sidebar * {
font-size: 12px;
}
:root {
--favicon-size: 14px;
}
@kuanyui
kuanyui / enhanced_array.ts
Last active July 7, 2023 02:46
Use via `import './enhanced_array'`
export { }
declare global {
interface Array<T> {
last (): T | undefined
delete (elem: T): boolean
pushIfNotExist (elem: T): boolean
}
}
Array.prototype.last = function () {
@kuanyui
kuanyui / Makefile
Last active June 2, 2023 03:19
Makefile for gvm + $GOPATH + git checkout
.ONESHELL:
REPO_DIR="${PWD}"
define my_git_checkout
(git checkout $(1) || git checkout --track origin/$(1)) && git pull
endef
define GVM_USE
echo "========================================================================================="
@kuanyui
kuanyui / rsync.sh
Last active March 3, 2023 06:14
my alias for rsync
function init_rsync() {
# --archive, -a archive mode is -rlptgoD (no -A,-X,-U,-N,-H)
# --recursive, -r recurse into directories
# --links, -l copy symlinks as symlinks
# --perms, -p preserve permissions
# --times, -t preserve modification times
# --group, -g preserve group
# --owner, -o preserve owner (super-user only)
# -D same as --devices --specials
# --devices preserve device files (super-user only)
function cliPrompt<T = string>(promptMsg: string): Promise<T> {
return new Promise((resolve, reject) => {
process.stdin.on("data", function(data: any) {
resolve(data.toString())
process.stdin.end()
})
process.stdout.write(promptMsg);
})
}