Skip to content

Instantly share code, notes, and snippets.

View Hayao0819's full-sized avatar

Yamada Hayao Hayao0819

View GitHub Profile
@Hayao0819
Hayao0819 / gist:a075cdce7f1a1c0386e1604a8f5e2a19
Created June 2, 2021 10:30
crshini (シェルで書かれたiniファイルを解析する関数)
#!/usr/bin/env bash
set -eu
_crshini_msg_err(){ echo "[libcrshini] Error ${*}" >&2; }
_crshini_msg_inf(){ echo "[libcrshini] Info ${*}" >&1; }
_crshini_msg_wrn(){ echo "[libcrshini] Warn ${*}" >&2; }
_crshini_msg_dbg(){
if [[ "${_crshini_debug-false}" = true ]]; then
echo "[libcrshini] Debug ${*}" >&2
#!/usr/bin/env bash
set -eu
script_path="$( cd -P "$( dirname "$(readlink -f "${0}")" )" && pwd )"
pacman_dbpath="$(pacman-conf "DBPath")"
debug=false
work_dir="/tmp/expac"
expac_version="0.1"
msg_error(){ echo "[expac] Error ${*}" 1>&2; }
@Hayao0819
Hayao0819 / AppList.sh
Created April 22, 2021 12:06
Linuxにインストールされてるアプリの一覧をJsonで出力するスクリプト
#!/usr/bin/env bash
set -eu
AppDir="/usr/share/applications"
DesktopFileExt="desktop"
function getDesktopFile(){
#grep -E "^${2}" "${1}" | cut -d "=" -f 2 | tr -d "\n"
_Result="$(crudini --get "${1}" "Desktop Entry" "${2}")"
_Result="$(echo ${_Result} | tr -d "\"")"
if echo "${_Result}" | grep -q "^[0-9]\+$" || [[ "${_Result}" = true ]] || [[ "${_Result}" = false ]]; then
echo -n "${_Result}"

Keybase proof

I hereby claim:

  • I am hayao0819 on github.
  • I am hayao0819 (https://keybase.io/hayao0819) on keybase.
  • I have a public key ASBRhVBbzG1ORCQ7itn-9D0PAvQJKDVlR4z3Hx7_mdWaugo

To claim this, I am signing this object:

@Hayao0819
Hayao0819 / install_nvidia.sh
Created March 22, 2021 00:33
Archの古いパッケージを取得するシェルスクリプト
#!/usr/bin/env bash
set -eu
version="${1}"
packages=(
"lib32-nvidia-utils"
"lib32-opencl-nvidia"
"nvidia-dkms"
@Hayao0819
Hayao0819 / vpngate_api
Last active February 12, 2024 22:06
VPN Gateのサーバリストを取得してBashの配列にするスクリプト
#!/usr/bin/env bash
# 設定
API="http://www.vpngate.net/api/iphone/"
msg_info(){ echo -e "${*}"; }
# APIで取得したリストを読み込み
#msg_info "Loading the list of server ..."
CSV="$(curl -sL "${API}")"
#!/usr/bin/env bash
base=""
answer=""
line="5"
column="5"
show_answer=false
_help() {
echo "usage ${0} [オプション] [埋め尽くす文字] [見つける文字]"
echo
echo "「見つけられたらリツイート」作成コマンド"
@Hayao0819
Hayao0819 / PKGBUILD
Created January 24, 2021 13:44
かな入力を最初にしないIbus
# Contributer: ponsfoot <cabezon dot hashimoto at gmail dot com>
## If you will be using mozc.el on Emacs, uncomment below.
#_emacs_mozc="yes"
## If you will not be using ibus (only use uim), comment out below.
_ibus_mozc="yes"
## If you do not want to add Japanese zip code into dictionary,
## comment out below.
diff -ura mozc.orig/src/prediction/zero_query_dict.h mozc/src/prediction/zero_query_dict.h
--- mozc.orig/src/prediction/zero_query_dict.h 2018-05-27 12:14:39.000000000 +0200
+++ mozc/src/prediction/zero_query_dict.h 2018-05-27 12:16:53.158743824 +0200
@@ -132,6 +132,17 @@
return tmp;
}
+ iterator &operator--() {
+ ptr_ -= kTokenByteSize;
+ return *this;
@Hayao0819
Hayao0819 / mirrorlist-alter
Created January 10, 2021 05:55
修正版のミラーリスト
#
# Alter Linux repository mirrorlist
#
# (c) 2019-2021 Fascode Network.
#
# OSDN-AlterLinux
Server = https://osdn.dl.osdn.net/storage/g/a/al/alterlinux/repo/$repo/$arch
# OSDN-SereneLinux