This file contains 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
#NoEnv | |
#NoTrayIcon | |
#SingleInstance force | |
SendMode Input | |
SetWorkingDir %A_ScriptDir% | |
SetCapsLockState, AlwaysOff | |
CapsLock::Send, {CtrlDown}{Space}{CtrlUp} |
This file contains 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 | |
[[ -z $1 ]] && echo "flv2mp4 <flv name>" | |
src=$1 | |
if [[ -d $src ]] && command -v fzf > /dev/null 2>&1; then | |
src="$(fd . -e flv "$src" | fzf -e -m)" | |
fi |
This file contains 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 | |
set -e | |
[[ -z $1 ]] && echo "$(basename $0) <image>" && exit 1 | |
image=$1 | |
[[ ! -e $image ]] && echo "Invalid image file" && exit 1 | |
sudo losetup -o 1048576 -f $image |
This file contains 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
let s:rc_path = fnamemodify(expand('<sfile>'), ':h') | |
let s:vimplug = expand(s:rc_path . '/autoload') | |
if empty(glob(s:vimplug . '/plug.vim')) | |
execute '!git clone --depth=1 https://github.com/junegunn/vim-plug' s:vimplug | |
augroup vimrc | |
autocmd VimEnter * PlugInstall | |
augroup END | |
endif |
This file contains 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
powershell Set-ExecutionPolicy unrestricted -Scope CurrentUser |
This file contains 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
// Package main provides ... | |
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
) | |
func HelloServer(w http.ResponseWriter, req *http.Request) { |
This file contains 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 | |
avail=$(df / | tail -n 1 | awk '{print $4}') | |
threshold="" | |
message="硬盘要满啦" | |
token="" | |
if [[ ${avail:?} -lt ${threshold:?} ]]; then | |
curl "https://sc.ftqq.com/${token:?}.send?text=${message:?}" | |
fi |
This file contains 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 | |
hwmon_sysfs="/sys/class/hwmon" | |
list=$(find "$hwmon_sysfs"/*) | |
for i in $list; do | |
if [ -e "$i/name" ]; then | |
sensor="$i" | |
else |
This file contains 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 | |
# Configure by yourself | |
procname="cagent" | |
duration=10 | |
usage() | |
{ | |
echo "$0 {process name} {duration}" | |
echo "By default:" |
This file contains 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 | |
MOUNTPOINT="$HOME/Nutstore" | |
sudo mount -t davfs https://dav.jianguoyun.com/dav/ "$MOUNTPOINT" |
NewerOlder