~armaan/dotfiles

dotfiles/.kshrc -rw-r--r-- 1.3 KiB
bac3f4edArmaan Bhojwani Migrate to OpenBSD 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
date
apm | head -n 1
set -o vi

alias pman='man -M /usr/local/share/doc/posix/man'
alias papropos='apropos -M /usr/local/share/doc/posix/man'
alias pwhatis='whatis -M /usr/local/share/doc/posix/man'


_uprint() {
    echo "https://l.armaanb.net/$(basename "$1")" | xsel && xsel -o
}

_uup() {
    rsync "$1" "armaa@armaanb.net:/srv/ftp/pub/$2" --chmod 644 --progress
}

ufile() {
    _uup "$1" "$2"
    _uprint "$1"
}

uclip() {
    tmp=$(mktemp)
    xclip -sel c -o >> "$tmp"
    basetmp=$(echo "$tmp" | tail -c +5)
    _uup "$tmp" "$basetmp"
    _uprint "$basetmp"
    rm -f "$tmp"
}

alias plan='T=$(mktemp) && \
        rsync armaanb.net:/home/armaa/plan.txt "$T" && \
        TT=$(mktemp) && \
        head -n -2 $T > $TT && \
        vi $TT && \
        echo >> "$TT" && \
        echo "Last updated: $(date -R)" >> "$TT" && \
        fold -sw 72 "$TT" > "$T"| \
        rsync "$T" armaanb.net:/home/armaa/plan.txt && \
        rm -f "$T"'

export GPG_TTY="$(tty)"
export CDPATH=:~

alias ls="LC_COLLATE=C ls -lh"
alias df="df -h"
alias du="du -h"
alias cp="cp -riv"
alias rm='rm -iv'
alias mv='mv -iv'
alias ln='ln -v'
alias grep='grep -in'
alias mkdir='mkdir -pv'
alias nl='nl -b all'

alias dotgit="git --git-dir=$HOME/.local/share/dotfile-repo --work-tree=$HOME"
alias etcgit="git --git-dir=$HOME/.local/share/etc-repo --work-tree=/"

alias ping='ping -c 10'