使用 Linux 需要很多自适应技巧,这里是我的一些日常脚本
修复 KDE 桌面在切换内置和外置显示器的时候应用缩放错误的问题
其实就是随便改一下缩放再改回来
使用 Linux 需要很多自适应技巧,这里是我的一些日常脚本
修复 KDE 桌面在切换内置和外置显示器的时候应用缩放错误的问题
其实就是随便改一下缩放再改回来
#!/bin/sh | |
SWAPSIZE=3 # IN GB | |
SYSTEM_NAME=aerozine # Hostname and used in ZFS structure (zroot/sys/${SYSTEM_NAME}/ROOT/default) | |
USER=xunil # Initial admin user for the system | |
# Archlinux on ZFS Root on LUKS setup script (v1.0) | |
# | |
# USAGE: ./ArchLinux_ZFS_LUKS_Setup.sh /dev/sda | |
# |
#!/bin/bash | |
for FILE in "$@" | |
do | |
echo $FILE | |
NAME=$(basename "$FILE" | cut -d . -f1) | |
PAGES=`pdfinfo "$FILE" | grep Pages | grep -P '\d+' -o` | |
mkdir -p "$NAME" | |
seq 1 $PAGES | parallel pdftoppm -f {} -l {} -aa yes -r 400 -png "$(printf "%q" "$FILE")" "$(printf "%q/img" "$NAME")" | |
find $NAME -type f -name "*.png" | parallel optipng -o4 {} |
/** | |
* Full documentation for the "identitytoolkit" API can be found here: | |
* https://cloud.google.com/identity-platform/docs/reference/rest/v1/accounts | |
*/ | |
/** | |
* Settings object for an IDP(Identity Provider). | |
* @typedef {Object} ProviderOptions | |
* @property {string} options.name The name of the provider in lowercase. | |
* @property {string} [options.scope] The scopes for the IDP, this is optional and defaults to "openid email". |
(async () => { | |
let u = new URL(location.href); | |
let mc = u.pathname.match(/detail\/mc(\d+)/); | |
if (mc.length != 2) { | |
return | |
} | |
let mcid = mc[1]; | |
let r = await fetch("https://manga.bilibili.com/twirp/comic.v1.Comic/ComicDetail?device=pc&platform=web", { | |
"headers": { |
// ==UserScript== | |
// @name Exhentai Preview Image | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://exhentai.org/* | |
// @grant none | |
// ==/UserScript== |
#!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby | |
# This script installs to /usr/local only. To install elsewhere you can just | |
# untar https://github.com/Homebrew/brew/tarball/master anywhere you like or | |
# change the value of HOMEBREW_PREFIX. | |
HOMEBREW_PREFIX = "/usr/local".freeze | |
HOMEBREW_REPOSITORY = "/usr/local/Homebrew".freeze | |
HOMEBREW_CACHE = "#{ENV["HOME"]}/Library/Caches/Homebrew".freeze | |
HOMEBREW_OLD_CACHE = "/Library/Caches/Homebrew".freeze | |
BREW_REPO = "https://mirrors.ustc.edu.cn/brew".freeze | |
CORE_TAP_REPO = "https://mirrors.ustc.edu.cn/homebrew-core".freeze |
#!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby | |
# This script installs to /usr/local only. To install elsewhere you can just | |
# untar https://github.com/Homebrew/brew/tarball/master anywhere you like or | |
# change the value of HOMEBREW_PREFIX. | |
HOMEBREW_PREFIX = "/usr/local".freeze | |
HOMEBREW_REPOSITORY = "/usr/local/Homebrew".freeze | |
HOMEBREW_CACHE = "#{ENV["HOME"]}/Library/Caches/Homebrew".freeze | |
HOMEBREW_OLD_CACHE = "/Library/Caches/Homebrew".freeze | |
BREW_REPO = "https://mirrors.ustc.edu.cn/brew".freeze | |
CORE_TAP_REPO = "https://mirrors.ustc.edu.cn/homebrew-core".freeze |