Skip to content

Instantly share code, notes, and snippets.

View hr3lxphr6j's full-sized avatar
😅

Chigusa hr3lxphr6j

😅
  • Hangzhou, China
View GitHub Profile
#!/bin/bash
set -o errexit
set -o nounset
set -o pipefail
_main() {
path=$1
for file in $(find $path -name '*.flv' -cmin +1); do
if [[ $(wc -c "${file}" | awk '{print $1}') -lt $(expr 10 '*' 1024 '*' 1024) ]]; then
#!/bin/bash
set -o errexit
set -o pipefail
set -o nounset
_date() {
LANG=us_EN.UTF-8 TZ=GMT date '+%a, %d %b %Y %H:%M:%S %Z'
}
#!/usr/bin/env python
import os
import zipfile
from argparse import ArgumentParser
class ZipFile(zipfile.ZipFile):
def __init__(self, *args, charset=None, **kwargs):
super().__init__(*args, **kwargs)
self.from_charset = 'cp437'
#!/bin/bash
PYTHON=python.exe
SCRIPT=${1:-'C:\Users\chigusa\AppData\Local\Programs\VapourSynth\vsrepo\vsrepo.py'}
WIN_PACKAGE_JSON="$($PYTHON "$SCRIPT" paths | grep Definitions | awk '{print $2}' | tr -d '\r\n')"
PACKAGE_JSON="$(wslpath "$WIN_PACKAGE_JSON" | awk '{$1=$1;print}')"
oldifs=$IFS
IFS=$'\n'
@hr3lxphr6j
hr3lxphr6j / install-archlinux.sh
Created March 14, 2020 05:32
install archlinux on XPS 13
# install archlinux on XPS 13
# change root password in archiso
passwd
# enable wifi if need
wifi-menu
# get ip address
ip addr
@hr3lxphr6j
hr3lxphr6j / enc-helper.sh
Last active April 2, 2021 07:32
A script that can help you encrypt strings in the shell.
#!/bin/bash
set -o errexit
set -o pipefail
set -o nounset
OPENSSL=${OPENSSL:-$(which openssl)}
help() {
printf "$0 -h\n\tShow help.\n"
@hr3lxphr6j
hr3lxphr6j / convert2alac.sh
Created July 24, 2021 04:12
convert2alac.sh
#!/usr/bin/env bash
set -ueo pipefail
get_cover_index() {
input_file="${1}"
ffprobe -i "${input_file}" \
-loglevel -8 \
-show_streams \
-of json | jq '.streams[] | select(.disposition.attached_pic==1) | .index'
}
--------------------------------------------------------
newflasher.exe v49 by Munjeni @ 2017/2020
--------------------------------------------------------
Determining available free space by GetDiskFreeSpaceEx:
Available space to caller = 40092 MB
Total space on current drive = 102401 MB
Free space on drive = 40092 MB
from argparse import ArgumentParser, Namespace
from functools import partial
from inspect import Parameter, signature
from typing import Callable
class Cli:
class Arg:
def __init__(self, *args, **kwargs) -> None:
self.args = args
#!/bin/sh
set -uex
readonly GEO_DATA_PATH=/usr/local/share/v2ray
if [ -z ${GITHUB_TOKEN:-} ]; then
echo "env: GITHUB_TOKEN is empty." >&2
exit 1
fi