Browse Source

369-a3 and other fish functions

red-hat-laptop
Kevin Mok 6 years ago
parent
commit
70a2fbf2f3
Signed by: Kevin-Mok GPG Key ID: AEA75288DC135CF5
  1. 22
      aliases/key_aliases
  2. 13
      fish/.config/fish/config.fish
  3. 2
      fish/.config/fish/functions/cd.fish
  4. 3
      fish/.config/fish/functions/copy.fish
  5. 5
      fish/.config/fish/functions/create-fish-function.fish
  6. 6
      fish/.config/fish/functions/gdb-a3.fish
  7. 3
      fish/.config/fish/functions/grep-aliases.fish
  8. 3
      fish/.config/fish/functions/rg-headers.fish
  9. 3
      fish/.config/fish/functions/rgc.fish
  10. 7
      fish/.config/fish/functions/run-a3.fish
  11. 5
      fish/.config/fish/functions/scan-history.fish
  12. 2
      neofetch/.config/neofetch/config.conf
  13. 1
      txt/exclude-dirs-backup.txt
  14. 2
      txt/key_dirs.txt

22
aliases/key_aliases

@ -9,6 +9,8 @@ fi "fish"
ru "xrdb ~/.Xresources" ru "xrdb ~/.Xresources"
# list file sizes in megabytes with depth 1 # list file sizes in megabytes with depth 1
duh "sudo du -d 1 -h" duh "sudo du -d 1 -h"
dum "sudo du -d 1 -m"
m "man"
tl "tldr" tl "tldr"
nvt "nvidia-settings --assign CurrentMetaMode='DVI-I-1: nvidia-auto-select +0+0 {ForceCompositionPipeline=On}, HDMI-0: nvidia-auto-select +3840+0 {ForceCompositionPipeline=On}'" nvt "nvidia-settings --assign CurrentMetaMode='DVI-I-1: nvidia-auto-select +0+0 {ForceCompositionPipeline=On}, HDMI-0: nvidia-auto-select +3840+0 {ForceCompositionPipeline=On}'"
@ -24,7 +26,7 @@ grr "grep -r"
cld "colordiff -y --suppress-common-lines" cld "colordiff -y --suppress-common-lines"
mkpk "makepkg -sri" mkpk "makepkg -sri"
mkex "chmod 777"
ex "chmod 777"
# systemctl {{{ # # systemctl {{{ #
@ -59,6 +61,7 @@ fz "fzf"
fnd "find . -type f -name" fnd "find . -type f -name"
rmr "rm -rf" rmr "rm -rf"
rmd "rm ~/Downloads/*"
md "mkdir -p" md "mkdir -p"
rsy "rsync -Pr" rsy "rsync -Pr"
@ -70,7 +73,7 @@ ds "df -h | head -n 1 && df -h | grep sd"
chownw "sudo chown -R kevin:wheel" chownw "sudo chown -R kevin:wheel"
chwnm "sudo chown -R kevin:wheel /run/media/kevin" chwnm "sudo chown -R kevin:wheel /run/media/kevin"
# cd into backup folder and show backup sizes # cd into backup folder and show backup sizes
nbu "f /run/media/kevin/pc-backup/backups/nzxt && ll | grep gz"
nbu "cd /run/media/kevin/backup-hd/nzxt/tar && lsd -l"
# }}} directory-related # # }}} directory-related #
@ -166,7 +169,7 @@ pse "pass edit"
psi "pass insert -m" psi "pass insert -m"
psg "pass generate -c" psg "pass generate -c"
xclip "xclip -selection clipboard"
xc "xclip -selection clipboard"
yh "echo 'kevin.mok@live.ca' | xclip -selection clipboard" yh "echo 'kevin.mok@live.ca' | xclip -selection clipboard"
yg "xclip -selection clipboard ~/.password-store/social/gmail" yg "xclip -selection clipboard ~/.password-store/social/gmail"
yt "xclip -selection clipboard ~/.password-store/social/trapbot" yt "xclip -selection clipboard ~/.password-store/social/trapbot"
@ -216,6 +219,7 @@ gro "git remote show origin"
ga "git add -A . && git status -u" ga "git add -A . && git status -u"
gac "git add -A . && git commit -S" gac "git add -A . && git commit -S"
gaf "git add -f"
# unsigned commt # unsigned commt
gacu "git add -A . && git commit" gacu "git add -A . && git commit"
@ -357,18 +361,24 @@ ssb "ssh-bandit"
# 369 {{{ # # 369 {{{ #
# a2
m "printf '\033c' && bear make"
ma "printf '\033c' && bear make"
mc "bear make clean" mc "bear make clean"
rms "rm swapfile.*"
# a2 {{{ #
mcr "bear make clean && printf '\033c' && bear make && ./carsim light 1 20" mcr "bear make clean && printf '\033c' && bear make && ./carsim light 1 20"
# mr "printf '\033c' && make && ./carsim stop 10 20" # mr "printf '\033c' && make && ./carsim stop 10 20"
mr "printf '\033c' && bear make && ./carsim light 1 20"
# mr "printf '\033c' && bear make && ./carsim light 1 20"
# "valgrind --tool=helgrind ./carsim stop 10 50 > helgrind.txt 2>&1 && valgrind --tool=helgrind ./carsim light 10 50 >> helgrind.txt 2>&1" # "valgrind --tool=helgrind ./carsim stop 10 50 > helgrind.txt 2>&1 && valgrind --tool=helgrind ./carsim light 10 50 >> helgrind.txt 2>&1"
# lk "valgrind --leak-check=yes ./carsim stop 10 20" # lk "valgrind --leak-check=yes ./carsim stop 10 20"
lk "valgrind --leak-check=yes ./carsim light 1 1" lk "valgrind --leak-check=yes ./carsim light 1 1"
# hl "valgrind --tool=helgrind ./carsim stop 10 20" # hl "valgrind --tool=helgrind ./carsim stop 10 20"
hl "valgrind --tool=helgrind ./carsim light 10 20" hl "valgrind --tool=helgrind ./carsim light 10 20"
# }}} a2 #
# a1 # a1
# sa "ssh k@192.168.0.17" # sa "ssh k@192.168.0.17"
# cpi "scp interceptor.c kevin@192.168.0.17:/home/kevin/a1" # cpi "scp interceptor.c kevin@192.168.0.17:/home/kevin/a1"

13
fish/.config/fish/config.fish

@ -19,6 +19,8 @@ bind \ce edit_command_buffer
bind \cr forward-word bind \cr forward-word
# fish-specific # fish-specific
set -U fish_fxn_dir "/home/kevin/linux-config/fish/.config/fish/functions"
abbr ff "cd $fish_fxn_dir"
source /home/kevin/.config/fish/key_abbr.fish source /home/kevin/.config/fish/key_abbr.fish
abbr xf "fish_config" abbr xf "fish_config"
abbr f. "cd .." abbr f. "cd .."
@ -27,7 +29,6 @@ abbr f.. "cd ../.."
# spv # spv
set -U spv_dir "/home/kevin/coding/spotify-lib-vis" set -U spv_dir "/home/kevin/coding/spotify-lib-vis"
set -U mfs_dir "/home/kevin/coding/mf-site" set -U mfs_dir "/home/kevin/coding/mf-site"
source $spv_dir/src/api-keys.sh
# set -U PATH /usr/local/sbin /usr/local/bin /usr/bin /usr/bin/site_perl /usr/bin/vendor_perl /usr/bin/core_perl /home/kevin/linux-config/scripts # set -U PATH /usr/local/sbin /usr/local/bin /usr/bin /usr/bin/site_perl /usr/bin/vendor_perl /usr/bin/core_perl /home/kevin/linux-config/scripts
# (ruby -e 'print Gem.user_dir')/bin # (ruby -e 'print Gem.user_dir')/bin
@ -42,6 +43,7 @@ set -xU XSET_DELAY 200
# fxn abbr's # fxn abbr's
abbr ag "grep-aliases" abbr ag "grep-aliases"
abbr bq "benq-brightness" abbr bq "benq-brightness"
abbr cf "create-fish-function"
abbr ev "evince-silent" abbr ev "evince-silent"
# git {{{ # # git {{{ #
@ -60,7 +62,12 @@ abbr z "zathura-silent"
set -U BROWSER "chromium" set -U BROWSER "chromium"
abbr hm "cd $mfs_dir && hugo serve -D --disableFastRender" abbr hm "cd $mfs_dir && hugo serve -D --disableFastRender"
abbr ga2 "gdb-a2"
# 369
abbr grc "grep-c" abbr grc "grep-c"
abbr grh "grep-headers" abbr grh "grep-headers"
abbr cs "carsim"
abbr rgh "rg-headers"
abbr r6 "run-a3"
# abbr cs "carsim"
# abbr ga2 "gdb-a2"

2
fish/.config/fish/functions/cd.fish

@ -46,7 +46,7 @@ function cd --description "Change directory"
set -g __fish_cd_direction prev set -g __fish_cd_direction prev
set -U last_dir $PWD set -U last_dir $PWD
ls -a
lsd -a
end end
return $cd_status return $cd_status

3
fish/.config/fish/functions/copy.fish

@ -0,0 +1,3 @@
function copy
$argv[1] $argv[2] | xclip -selection clipboard
end

5
fish/.config/fish/functions/create-fish-function.fish

@ -0,0 +1,5 @@
function create-fish-function
printf 'function %s\n \nend' $argv[1] > $fish_fxn_dir/$argv[1].fish
and cd $fish_fxn_dir
and $EDITOR $argv[1].fish
end

6
fish/.config/fish/functions/gdb-a3.fish

@ -0,0 +1,6 @@
function gdb-a3
# gdb -ex "b safeStopSign.c:96" -ex "run" \
gdb -ex "run" -ex "bt" \
# gdb -ex "run" \
--args ./sim -f /home/kevin/school/369/a3/a3/traceprogs/tr-simpleloop.ref -m 50 -s 3000 -a rand
end

3
fish/.config/fish/functions/grep-aliases.fish

@ -1,4 +1,5 @@
function grep-aliases function grep-aliases
set key_aliases /home/kevin/linux-config/aliases/key_aliases set key_aliases /home/kevin/linux-config/aliases/key_aliases
grep $argv[1] $key_aliases
# grep $argv[1] $key_aliases
rg "^$argv[1]" $key_aliases
end end

3
fish/.config/fish/functions/rg-headers.fish

@ -0,0 +1,3 @@
function rg-headers
rg $argv[1] *.h
end

3
fish/.config/fish/functions/rgc.fish

@ -0,0 +1,3 @@
function rgc
rg $argv[1] *.c
end

7
fish/.config/fish/functions/run-a3.fish

@ -0,0 +1,7 @@
function run-a3
printf '\033c'
and bear make
and ./sim -f /home/kevin/school/369/a3/a3/traceprogs/tr-simpleloop.ref -m 50 -s 3000 -a rand
rm swapfile.*
end

5
fish/.config/fish/functions/scan-history.fish

@ -1,6 +1,7 @@
function scan-history function scan-history
sudo systemctl start postgresql.service sudo systemctl start postgresql.service
and systemctl status postgresql.service
and $spv_dir/src/update-history.sh
# and systemctl status postgresql.service
and source $spv_dir/src/api-keys.sh
and $spv_dir/src/scripts/update-history.sh
and cat $spv_dir/src/api/management/commands/update-history.log | tail -n 1 and cat $spv_dir/src/api/management/commands/update-history.log | tail -n 1
end end

2
neofetch/.config/neofetch/config.conf

@ -336,7 +336,7 @@ public_ip_host="http://ident.me"
# disk_show=('/'): # disk_show=('/'):
# 'Disk (/): 74G / 118G (66%)' # 'Disk (/): 74G / 118G (66%)'
# #
disk_show=('/' '/home' )
disk_show=('/' '/home' '/mnt/linux-files' )
# Disk subtitle. # Disk subtitle.
# What to append to the Disk subtitle. # What to append to the Disk subtitle.

1
txt/exclude-dirs-backup.txt

@ -7,4 +7,5 @@
/proc /proc
/run /run
/sys /sys
/var/cache/pacman
/var/lib/systemd/coredump /var/lib/systemd/coredump

2
txt/key_dirs.txt

@ -3,10 +3,10 @@
bg /home/kevin/Pictures/Backgrounds bg /home/kevin/Pictures/Backgrounds
cf /home/kevin/.config cf /home/kevin/.config
lc /home/kevin/linux-config/ lc /home/kevin/linux-config/
lf /mnt/linux-files
d /home/kevin/Downloads d /home/kevin/Downloads
D /home/kevin/Documents D /home/kevin/Documents
fo /home/kevin/.config/fish fo /home/kevin/.config/fish
ff /home/kevin/linux-config/fish/.config/fish/functions
fs /home/kevin/linux-config/fish/.config/fish fs /home/kevin/linux-config/fish/.config/fish
k /home/kevin/ k /home/kevin/
lc /home/kevin/linux-config/ lc /home/kevin/linux-config/

Loading…
Cancel
Save