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
# kt | |
## Source file | |
cat hello.kt <<EOF | |
fun main() { | |
println("Hello, Kotlin!") | |
} | |
EOF | |
## Compile |
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
[user] | |
name = FATESAIKOU | |
email = [email protected] | |
[core] | |
editor = vim | |
pager = delta | |
[interactive] | |
diffFilter = delta --color-only | |
[delta] | |
navigate = true |
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
# install mitmproxy | |
$ pipx install mitmproxy | |
# edit iptable | |
$ sudo iptables -t nat -A OUTPUT -p tcp --dport 11434 -j REDIRECT --to-port <mitmproxy listen port> | |
# launch mitmproxy | |
$ mitmproxy --mode reverse:http://127.0.0.1:<ollama port> --listen-port <mitmproxy listen port> | |
# change ollama default port |
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
set -g terminal-overrides 'xterm*:smcup@:rmcup@' | |
set -g default-terminal "screen-256color" | |
# General configuration. | |
# $ tmux show-options -g | |
set -g history-limit 5000 | |
set -g base-index 1 | |
set -g display-time 5000 | |
set -g repeat-time 1000 | |
set -g status-keys vi | |
#set -g status-utf8 on |
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 | |
# Usage: nohup bash -c "cd /home/fatesaikou/testSH && ./selfCheckSwitchableSshTunnel.sh localhost 2223 localhost 2222 sshproxy fws.csie.io 22" 1>>/home/fatesaikou/testSH/selfCheckSwitchableSshTunnel.log 2>&1 & | |
REVERSE_REMOTE_HOST=$1 | |
REVERSE_REMOTE_PORT=$2 | |
REVERSE_LOCAL_HOST=$3 | |
REVERSE_LOCAL_PORT=$4 | |
USER=$5 | |
HOST=$6 |
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 | |
WINDOW_SIZE=$(tput cols) | |
PREFIX_SIZE=$(echo -n -e "[$(date)]: $RANDOM\t" | expand | wc -m) | |
SUFFIX_SIZE=$(echo -n -e "|" | wc -c) | |
BAR_SIZE=$(( (WINDOW_SIZE - PREFIX_SIZE - SUFFIX_SIZE) / 2 )) | |
while true; | |
do | |
randnum=$RANDOM; |
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 | |
conn_fail_threshold=5 | |
conn_fail_cnt=0 | |
while true; | |
do | |
curl -m1 'https://www.google.com' 1>/dev/null 2>&1 | |
if [ $? -ne 0 ]; | |
then |
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 | |
PASSWORD=$1 | |
# encryption | |
echo "Hello, world!" | openssl enc -aes-256-cbc -pbkdf2 -iter 10000 -a -salt -pass pass:"$PASSWORD" > helloWorld.crypted | |
# decryption | |
cat helloWorld.crypted | openssl enc -d -aes-256-cbc -pbkdf2 -iter 10000 -a -pass pass:"$PASSWORD" # Output "Hello, world!" here |
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 | |
PORT=$1 | |
AUTOSSH_CMD="ssh -Nf -D$PORT [email protected]" | |
# SSH clean up function | |
function stopNfSSHs() { | |
pids=( $(ps -ef | grep '[s]sh -Nf' | awk '{print $2}') ) | |
if [ "${#pids[@]}" -gt 0 ]; then | |
echo "Tunnel stop ${pids[@]}" |
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 | |
TUTORID=$1 | |
START=$2 | |
curl 'https://www.cambly.com/api/reservations' \ | |
-H 'authority: www.cambly.com' \ | |
-H 'accept: application/json, text/javascript, */*; q=0.01' \ | |
-H 'accept-language: zh-TW,zh;q=0.9,ja-JP;q=0.8,ja;q=0.7,en-US;q=0.6,en;q=0.5' \ | |
-H 'cache-control: no-cache' \ |
NewerOlder