This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # File name | |
| readonly PROGNAME=$(basename $0) | |
| # File name, without the extension | |
| readonly PROGBASENAME=${PROGNAME%.*} | |
| # File directory | |
| readonly PROGDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) | |
| # Arguments | |
| readonly ARGS="$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Bash `getopts` template | |
| - [Example](#example) | |
| - [Reference](#reference) | |
| ```sh | |
| #!/bin/bash -e | |
| function usage { | |
| cat <<EOF >&2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # Example using getopt (vs builtin getopts) that can also handle long options. | |
| # Another clean example can be found at: | |
| # http://www.bahmanm.com/blogs/command-line-options-how-to-parse-in-bash-using-getopt | |
| # | |
| aflag=n | |
| bflag=n |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ### | |
| # This is a code example showing how to use getops to parse short options and a | |
| # subcommand with short options of it's own. Based on Kevin Sookocheff's post: | |
| # https://sookocheff.com/post/bash/parsing-bash-script-arguments-with-shopts/ | |
| # | |
| # Please feel free to use it and modify it as you see fit. Any questions and/or | |
| # recommendations are more than welcome. | |
| ### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # Example of how to parse short/long options with 'getopt' | |
| # | |
| OPTS=`getopt -o vhns: --long verbose,dry-run,help,stack-size: -n 'parse-options' -- "$@"` | |
| if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi | |
| echo "$OPTS" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # インストールのやり方はこちらのサイトを参考にしました。 | |
| # http://blog.csdn.net/shile/article/details/54602768 | |
| ### まずはbashdbのインストール | |
| # osのバージョンを確認 | |
| [vagrant@daily bashdb-code]$ cat /etc/redhat-release | |
| CentOS release 6.7 (Final) | |
| # アーキテクチャ(OSが32bit, 64bitどちらなのか)を確認 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # copy of https://github.com/ZoeyVid/nginx-quic/blob/latest/Dockerfile | |
| # syntax=docker/dockerfile:labs | |
| FROM alpine:3.20.3 AS build | |
| SHELL ["/bin/ash", "-eo", "pipefail", "-c"] | |
| ARG LUAJIT_INC=/usr/include/luajit-2.1 | |
| ARG LUAJIT_LIB=/usr/lib | |
| ARG NGINX_VER=release-1.27.4 | |
| ARG OPENSSL_VER=openssl-3.1.7+quic |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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}" | tr -d '\r')" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Pixiv trial history recovery | |
| // @namespace http://tampermonkey.net/ | |
| // @version 2023-12-24 | |
| // @description Try to recover Pixiv trial unlinked history items. | |
| // @author aachyee | |
| // @match https://www.pixiv.net/history.php | |
| // @icon https://www.google.com/s2/favicons?sz=64&domain=pixiv.net | |
| // @grant none | |
| // ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // eval_worker.ts | |
| // General eval worker with timeout in deno. | |
| /// <reference lib="deno.worker" /> | |
| /* | |
| Usage: | |
| import {waitForEvalWorkerResponse} from "./eval_worker.ts" | |
| // await waitForEvalWorkerResponse ( 'javascript code...', 3000 ) | |
| try { | |
| const source1 = 'await fetch("https://api.github.com/users/octocat").then((response)=>{return response.json()}).catch(err=>{return err})'; | |
| const result1 = await waitForEvalWorkerResponse(source1, 3000); |