Browse Source

PV aliases, fix Kraken script for BTC

master
Kevin Mok 10 months ago
parent
commit
436a7cbb87
No known key found for this signature in database GPG Key ID: 6DEED612B26C08E2
  1. 28
      aliases/key_aliases.tmpl
  2. 45
      aliases/key_dirs.tmpl
  3. 3
      aliases/key_files.tmpl
  4. 3
      dot_config/fish/config.fish.tmpl
  5. 4
      dot_config/i3/config.tmpl
  6. 31
      dot_config/i3blocks/i3blocks.conf.tmpl
  7. 3
      dot_config/i3blocks/scripts/executable_volume
  8. 13
      scripts/executable_kraken

28
aliases/key_aliases.tmpl

@ -7,7 +7,7 @@
# clear screen
c "printf '\033c'"
d "cd ~/Downloads && printf '\033c'"
e "echo \$"
# e "echo \$"
hst "history"
# nft "printf '\033c' && neofetch | lolcat"
nfth "printf '\033c' && neofetch"
@ -84,10 +84,11 @@ ctltd "sudo systemctl status dhcpcd"
ctlas "sudo systemctl start sshd"
nc "sudo netctl"
ncd "sudo ip link set dev wlp3s0 down"
ncu "sudo ip link set dev wlp3s0 up"
ncd "sudo ip link set dev wlp4s0 down"
ncu "sudo ip link set dev wlp4s0 up"
ncr "sudo systemctl restart netctl-auto@wlp3s0.service"
ncs "sudo systemctl stop netctl-auto@wlp3s0.service"
ncn "netctl start"
# ]]] systemctl #
@ -425,12 +426,14 @@ ia "sxiv -a"
it "sxiv -t *"
kill "kill -9"
ka "killall"
kc "killall chromium"
kd "killall Discord && killall Discord"
ke "killall electron"
kf "killall firefox"
kag "killall gopls"
kai "killall imwheel && imwheel"
kt "killall thunderbird"
kz "killall zoom"
m "mpv"
mp "mpv --volume=50"
# lo "libreoffice"
@ -485,9 +488,9 @@ tas3 "tmux a -t school-3 || tmux new -s school-3"
tas4 "tmux a -t school-4 || tmux new -s school-4"
tal "tmux a"
tc "clear && tmux clear-history"
tk "tmux kill-server"
tk "tmux kill-session -t"
tks "tmux kill-server"
# tk "tmux kill-server"
tks "tmux kill-session -t"
tksv "tmux kill-server"
tl "tmux ls"
tn "tmux new -s"
tnb "tmux new -s backup"
@ -635,14 +638,15 @@ gru "git branch --set-upstream-to=origin/main main"
# ]]] branch #
gt "git tag"
# gt "git tag"
gta "git tag -as"
gtd "git tag -d"
# add/remove [[[ #
ga "git add -A && git status -u"
gac "git add -A && git commit -S"
# gac "git add -A && git commit -S"
gac "git add -A && git commit -S --no-verify"
gaf "git add -f"
gal "git lfs track"
# unsigned commt
@ -1000,6 +1004,9 @@ fnu "sxiv ~/Documents/fortnite/pics/maps/upgrade.png &"
mip "ifuse /mnt/ipad"
umip "fusermount -u /mnt/ipad"
fd1 "fd --changed-within 1d > cp.txt"
ttrtk "timetrace report -s 2023-04-20 -p totk"
# ]]] games #
@ -1013,6 +1020,9 @@ ssc "mosh mokkar@teach.cs.utoronto.ca"
zs "zathura --fork syllabus.pdf"
pvabn "npm run serve:localhost"
pvafn "npm run start:localhost"
# ]]] school #
# red-hat [[[ #
@ -1151,6 +1161,8 @@ gotd "go mod tidy"
dk "docker"
dkb "docker build"
dki "docker image"
dkka "docker kill \$(docker ps -q)"
dkl "docker ps"
dkp "docker push"
dks "docker images"

45
aliases/key_dirs.tmpl

@ -7,7 +7,7 @@ cf ~/linux-config/dot_config
cfd ~/.config
cff ~/.config/fish
ch ~/Documents/chat
da /mnt/ipad/DCIM/100APPLE
da /mnt/ipad/DCIM/101APPLE
dl ~/Downloads
# dw ~/dwm
D ~/Documents
@ -124,6 +124,9 @@ lfo /mnt/linux-files/Videos/obs
lfo2 /mnt/linux-files-2/Videos/obs
pxv /mnt/linux-files/Videos/pixel
tk ~/Documents/totk
tkp ~/Pictures/totk
# codm [[[ #
cm ~/Documents/codm
@ -141,6 +144,7 @@ fni /mnt/ipad/DCIM/100APPLE
fnm ~/Documents/fortnite/pics/maps
fnn ~/Documents/fortnite/notes
fns ~/Documents/fortnite/stats/api
fnsp ~/Documents/fortnite/stats/pics
fnv /mnt/linux-files/Videos/personal-fortnite-games/review
fnv2 /mnt/linux-files-2/Videos/ipad/fortnite/name
tcd /mnt/linux-files/Videos/yt/fortnite/clips/twitch-clip-downloader
@ -158,6 +162,7 @@ sdv ~/Documents/stardew-valley-aha
wo ~/Documents/workout-logs/7
dap /mnt/linux-files-2/Pictures/ipad
dau /mnt/linux-files-2/Videos/ipad/unsorted
# ]]] gaming #
@ -174,15 +179,38 @@ esw ~/coding/estuary-www
4 ~/school/494
4d ~/school/494/design
4dm ~/school/494/design/meetings
4dp ~/school/494/design/provotu
4p ~/school/494/papers
vt ~/coding/dao-voting
ovn ~/coding/dao-voting/anonymousvoting/contracts
# provotum [[[ #
pv ~/coding/dao-voting/provotum-v2
pva ~/coding/dao-voting/provotum-v2/voting-authority
pvab ~/coding/dao-voting/provotum-v2/voting-authority/backend
pvaf ~/coding/dao-voting/provotum-v2/voting-authority/frontend
pvac ~/coding/dao-voting/provotum-v2/access-provider-backend
pvf ~/coding/dao-voting/provotum-v2/voter-frontend/src
pvc ~/coding/dao-voting/provotum-v2/contracts/contracts/FiniteField
pvs ~/coding/dao-voting/provotum-v2/sealer
pvsb ~/coding/dao-voting/provotum-v2/sealer/backend/src
pvsf ~/coding/dao-voting/provotum-v2/sealer/frontend/src
pvs1 /mnt/linux-files-2/coding/dao-voting/sealer-1/sealer/backend
pvs1f /mnt/linux-files-2/coding/dao-voting/sealer-1/sealer/frontend
pvs2 /mnt/linux-files-2/coding/dao-voting/sealer-2/sealer/backend
pvs2f /mnt/linux-files-2/coding/dao-voting/sealer-2/sealer/frontend
pvs3 /mnt/linux-files-2/coding/dao-voting/sealer-3/sealer/backend
pvs3f /mnt/linux-files-2/coding/dao-voting/sealer-3/sealer/frontend
pvg ~/coding/dao-voting/pv-ganache
bd ~/coding/dao-voting/besu-deploy
gt ~/coding/dao-voting/ganache-tx
# ]]] provotum #
h ~/school/phy
pc ~/school/pcl
e ~/school/ess
# ]]] sch #
@ -250,11 +278,20 @@ gos ~/go/src
vb ~/coding/VileBot/vilebot
vbs ~/coding/VileBot/vilebot/src/main/java/com/oldterns/vilebot
dv ~/coding/devops-sre-knowledge
# dv ~/coding/devops-sre-knowledge
nxo ~/coding/kogito/nexus-operator
# ]]] pey #
# nft [[[ #
mb ~/coding/mint-bot
pfps ~/Pictures/profile-pics/sappy-seals
pfpk ~/Pictures/profile-pics/gm-cafe/keek
nft ~/Documents/nft
# ]]] nft #
lw ~/Documents/lawrence
hih /mnt/linux-files-2/Videos/hot-in-herre

3
aliases/key_files.tmpl

@ -70,6 +70,9 @@ wt ~/.config/watson/state.tmp
# sch [[[ #
4d ~/school/494/design/acanet-voting-design.md
4dme ~/school/494/design/meetings/panos.md
4dmd ~/school/494/design/provotu/modify.md
pvc ~/coding/dao-voting/provotum-v2/contracts/contracts/FiniteField/Ballot.sos
# ]]] sch #

3
dot_config/fish/config.fish.tmpl

@ -78,7 +78,7 @@ set -xU BROWSER "firefox"
set -xU FZF_DEFAULT_COMMAND "find ."
set -x LAPTOP_IP "192.168.0.19"
set -x PHONE_IP "192.168.0.13"
set -x PHONE_IP "192.168.0.101"
set -x PIXEL_IP "192.168.0.18"
set -x WORK_LAPTOP_IP "kmok@192.168.0.11"
@ -232,6 +232,7 @@ abbr svp "server-pages"
abbr ta "tmux-attach"
abbr taa "tmux-attach atx"
abbr taf "tmux-attach fn"
abbr tam "tmux-attach misc"
abbr tan "tmux-attach nft"
abbr tan2 "tmux-attach nft-2"
abbr tao "tmux-attach obs"

4
dot_config/i3/config.tmpl

@ -370,7 +370,9 @@ bindsym Mod4+$mod+b layout tabbed; exec $term -e fish -c "buku-fzf fq"
set $ws4 "4 "
workspace $ws4 output $secondary
bindsym $mod+F4 workspace $ws4; exec $term
# bindsym $mod+F4 workspace $ws4; exec $term
# bindsym Control+Shift+F4 workspace $ws4; exec $term -e fish -c 'tmux-attach misc'
bindsym $mod+F4 workspace $ws4; exec $term -e fish -c 'tmux-attach misc'
bindsym Mod4+$mod+F4 workspace $ws4; exec urxvt -e ranger $screenshot_folder
bindsym Mod4+e workspace $ws4; exec libreoffice ~/Documents/expenses/investments.ods
bindsym Mod4+g workspace $ws4; layout tabbed; exec gimp

31
dot_config/i3blocks/i3blocks.conf.tmpl

@ -22,10 +22,15 @@ color=#cbe4ff
# TICKER=SOL-USD
# interval=30
[kraken]
label=ARB
TICKER=ARBUSD
interval=30
# [kraken]
# label=BLUR
# TICKER=BLURUSD
# interval=30
# [kraken]
# label=ARB
# TICKER=ARBUSD
# interval=30
# [ticker]
# label=ETH
@ -33,13 +38,18 @@ interval=30
# interval=30
[kraken]
label=ETH
TICKER=ETHUSDC
label=BTC
TICKER=BTCUSDC
interval=30
# [ticker]
# label=BTC 
# TICKER=BTC-USD
# interval=30
[kraken]
label=BLUR
TICKER=BLURUSD
label=ETH
TICKER=ETHUSDC
interval=30
# [ticker]
@ -47,11 +57,6 @@ interval=30
# TICKER=SPY
# interval=30
# [ticker]
# label=BTC 
# TICKER=BTC-USD
# interval=30
# [ticker]
# label=DAQ 
# TICKER=^IXIC

3
dot_config/i3blocks/scripts/executable_volume

@ -144,7 +144,8 @@ esac
function print_format {
# echo $NAME
case $NAME in
*"USB"*)
# *"USB"*)
*"Fiio"*)
SINK_SYMB=""
;;
*"hdmi"*)

13
scripts/executable_kraken

@ -1,8 +1,17 @@
price=$(curl -s "https://api.kraken.com/0/public/Ticker?pair=$1" | jq -r ".result.$1.b[0]")
# echo $price
# price=$(curl -s "https://api.kraken.com/0/public/Ticker?pair=$1" | jq -r ".result.$1.b[0]")
raw=$(curl -s "https://api.kraken.com/0/public/Ticker?pair=$1")
# echo $raw
if [ "$1" = "BTCUSDC" ]; then
price=$(echo "$raw" | jq -r ".result.XBTUSDC.b[0]")
else
price=$(echo "$raw" | jq -r ".result.$1.b[0]")
fi
# echo "$price"
if (( $(echo "$price < 10" | bc -l) )); then
printf "%0.3f\n" "$price" | cut -c 3-
# printf "%0.3f\n" "$price"
elif (( $(echo "$price < 10000" | bc -l) )); then
printf "%'0.0f\n" "$price" | sed 's/,//'
else
echo "$price" | cut -c -3
fi
Loading…
Cancel
Save