I hereby claim:
- I am janlay on github.
- I am janlay (https://keybase.io/janlay) on keybase.
- I have a public key ASAdsgFM0gJM4sbu3Jm2dr4rysHJIdVt4leRb1UI_JGX3wo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#!/bin/bash | |
set -e | |
# Backup db and certs in $BITWARDEN_DIR into $TARGET_DIR/$FILENAME_PREFIX$DATE.tar.gz | |
BITWARDEN_DIR='/volume1/docker/Bitwarden' | |
TARGET_DIR='/var/services/dropbox/Backup/Bitwarden' | |
FILENAME_PREFIX='bw-backup_' | |
FILENAME_DATE_PATTERN='%m-%d' |
Windows Registry Editor Version 5.00 | |
[HKEY_CLASSES_ROOT\MSEdgePDF\shell\open\command] | |
@="\"C:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe\" --disk-cache-dir=R:\\MSEdge -- \"%1\"" | |
[HKEY_CLASSES_ROOT\MSEdgeHTM\shell\open\command] | |
@="\"C:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe\" --disk-cache-dir=R:\\MSEdge -- \"%1\"" | |
[HKEY_CLASSES_ROOT\http\shell\open\command] | |
@="\"C:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe\" --disk-cache-dir=R:\\MSEdge -- \"%1\"" |
#!/bin/bash | |
# author: janlay@gmail.com | |
set -e | |
cols=$(bc <<< "$(tput cols) / 3 - 2") | |
char=✾ | |
echo -n ' ' | |
for col in $(seq 0 $cols); do |
#!/bin/bash | |
# author: janlay@gmail.com | |
set -e | |
SERVICE_URL="https://officecdn.microsoft.com/pr/C1297A47-86C4-4C1F-97FA-950631F94777/MacAutoupdate" | |
USER_AGENT='Microsoft%20AU%20Daemon/4.13.19071800 CFNetwork/1098 Darwin/19.0.0 (x86_64)' | |
MS_APPS=( | |
"Microsoft AutoUpdate:0409MSau04" |
#!/bin/bash | |
FILE=/etc/chinadns_chnroute.txt | |
TEMP_FILE="$FILE.tmp" | |
TELEGRAM_BOT=/root/scripts/telegram-bot | |
SOURCE="https://raw.githubusercontent.com/ym/chnroutes2/master/chnroutes.txt" | |
LOGFILE=/root/scripts/chinadns-updater.log | |
echo -e "\nChinaDNS Updater started at `date`." >> $LOGFILE | |
echo "Current routes: `wc -l "$FILE" | cut -d' ' -f1`." >> $LOGFILE |
#!/bin/bash | |
# author: janlay@gmail.com | |
WORKDING_DIR="${1-$HOME/.vim/bundle}" | |
GIT_DIR_ROOT="$HOME/Workspace/.gitrepo" | |
echo "Working on $WORKDING_DIR" | |
for i in `find "$WORKDING_DIR" -mindepth 1 -maxdepth 1 -type d`; do | |
REPO_NAME="${i##*/}" | |
export GIT_WORK_TREE="$WORKDING_DIR/$REPO_NAME" |
#!/bin/bash | |
# author: janlay@gmail.com | |
# How to use this script: | |
# 1. To backup your dotfiles, move them to the WORKING_DIR. | |
# 2. To Restore the dotfiles you previously backed up, run this script. | |
WORKDING_DIR="$HOME/Dropbox/dotfiles" | |
echo "Working on $WORKDING_DIR" |
filename=`basename "$1"` | |
[[ "$filename" == "Archive" ]] && exit 1 | |
target=`stat -f '%Sc' -t '%Y-%m' "$1"` | |
fullpath="$HOME/Desktop/Archive/$target" | |
mkdir -p "$fullpath" | |
mv "$1" "$fullpath/" | |
script="display notification \"$filename -> Archive/$target\" with title \"Desktop file archived\"" | |
osascript -e "$script" |
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
func Sqrt(x float64) float64 { | |
z := 1.0 | |
for i := 1; i <= 100; i++ { |