2026-04-28 20:14:33 -04:00
|
|
|
# delete server bin
|
|
|
|
|
[private]
|
|
|
|
|
server_clean:
|
|
|
|
|
rm server
|
|
|
|
|
|
|
|
|
|
# delete client bin
|
|
|
|
|
[private]
|
|
|
|
|
client_clean:
|
|
|
|
|
rm client
|
|
|
|
|
|
|
|
|
|
# delete binaries
|
|
|
|
|
clean: server_clean client_clean
|
|
|
|
|
|
|
|
|
|
# build server bin
|
|
|
|
|
server:
|
|
|
|
|
go build server.go
|
|
|
|
|
|
|
|
|
|
# build client bin
|
|
|
|
|
client:
|
|
|
|
|
go build client.go
|
|
|
|
|
|
|
|
|
|
# build both bins
|
|
|
|
|
build: client server
|
|
|
|
|
|
|
|
|
|
# delete binaries and make them again
|
|
|
|
|
rebuild: clean build
|
|
|
|
|
|
|
|
|
|
# install server
|
|
|
|
|
ins_server:
|
|
|
|
|
#!/usr/bin/bash
|
|
|
|
|
echo "enter port of server or leave blank to use default (1300)"
|
|
|
|
|
read PORT
|
|
|
|
|
if [[ $PORT -ne "" ]]; then
|
|
|
|
|
sed -i -e "s/1300/$PORT/" server.go
|
|
|
|
|
fi
|
|
|
|
|
echo "go build -o ekho_server server.go"
|
|
|
|
|
go build -o ekho_server server.go
|
|
|
|
|
echo "mv ekho_server /usr/local/bin/"
|
|
|
|
|
mv ekho_server /usr/local/bin/
|
|
|
|
|
USER=($(users))
|
|
|
|
|
sed -i -e "s/USER/${USER[0]}/" ekho.service
|
|
|
|
|
echo "cp ekho.service /etc/systemd/system/"
|
|
|
|
|
cp ekho.service /etc/systemd/system/
|
|
|
|
|
mkdir -p ~/.config/ekho
|
|
|
|
|
echo "ln -s -r ./list.q ~/.config/ekho/list.q"
|
|
|
|
|
ln -s -r ./list.q ~/.config/ekho/list.q
|
|
|
|
|
echo "systemctl daemon-reload"
|
|
|
|
|
systemctl daemon-reload
|
|
|
|
|
echo "systemctl enable ekho"
|
|
|
|
|
systemctl enable ekho
|
|
|
|
|
echo "systemctl start ekho"
|
|
|
|
|
systemctl start ekho
|
|
|
|
|
echo "systemctl status ekho"
|
|
|
|
|
systemctl status ekho
|
|
|
|
|
|
|
|
|
|
# install client
|
|
|
|
|
ins_client:
|
|
|
|
|
#!/usr/bin/bash
|
|
|
|
|
echo "enter url or ip and port of server, 'aaa.bbb.ccc.ddd:port"
|
|
|
|
|
read IP_PORT
|
|
|
|
|
sed -i -e "s/:1300/$IP_PORT/" client.go
|
|
|
|
|
echo "go build -o ekho client.go"
|
|
|
|
|
go build -o ekho client.go
|
|
|
|
|
sed -i -e "s/$IP_PORT/:1300/" client.go
|
|
|
|
|
echo "mv ekho /usr/local/bin/"
|
|
|
|
|
mv ekho /usr/local/bin/
|
|
|
|
|
echo "add 'ekho' to shell config (config.fish, .bashrc, etc)"
|
|
|
|
|
|
2026-09-16 22:34:58 -04:00
|
|
|
# test server
|
|
|
|
|
stest:
|
|
|
|
|
@echo "creating server test session"
|
|
|
|
|
@tmux new-session -Ad -s "server test"
|
|
|
|
|
@tmux split-window -h -t "server test:1" -l 10%
|
|
|
|
|
@tmux split-window -v -t "server test:1.2"
|
|
|
|
|
@tmux send-keys -t "server test:1.1" "clear" Enter
|
|
|
|
|
@tmux send-keys -t "server test:1.2" "clear" Enter
|
|
|
|
|
@tmux send-keys -t "server test:1.3" "clear" Enter
|
|
|
|
|
@tmux rename-window "server test"
|
|
|
|
|
@tmux send-keys -t "server test:1.1" "vim server.go" Enter
|
|
|
|
|
@tmux send-keys -t "server test:1.2" "./server"
|
|
|
|
|
@tmux send-keys -t "server test:1.3" "./client"
|
|
|
|
|
@tmux attach -t "server test"
|
|
|
|
|
|
|
|
|
|
# test client
|
|
|
|
|
ctest:
|
|
|
|
|
@echo "creating client test session"
|
|
|
|
|
@tmux new-session -Ad -s "client test"
|
|
|
|
|
@tmux split-window -h -t "client test:1" -l 10%
|
|
|
|
|
@tmux split-window -v -t "client test:1.2"
|
|
|
|
|
@tmux send-keys -t "client test:1.1" "clear" Enter
|
|
|
|
|
@tmux send-keys -t "client test:1.2" "clear" Enter
|
|
|
|
|
@tmux send-keys -t "client test:1.3" "clear" Enter
|
|
|
|
|
@tmux rename-window "client test"
|
|
|
|
|
@tmux send-keys -t "client test:1.1" "vim client.go" Enter
|
|
|
|
|
@tmux send-keys -t "client test:1.2" "./server" Enter
|
|
|
|
|
@tmux send-keys -t "client test:1.3" "./client"
|
|
|
|
|
@tmux attach -t "client test"
|
|
|
|
|
|
|
|
|
|
# dev work
|
|
|
|
|
dev:
|
|
|
|
|
#!/usr/bin/bash
|
|
|
|
|
REPO=$(basename $(git rev-parse --show-toplevel))
|
|
|
|
|
BRANCH=$(git branch --show-current)
|
|
|
|
|
tmux has-session -t "$REPO->$BRANCH"
|
|
|
|
|
if [[ $? -eq 0 ]]; then
|
|
|
|
|
tmux attach-session -t "$REPO->$BRANCH"
|
|
|
|
|
else
|
|
|
|
|
tmux new-session -Ad -s "$REPO->$BRANCH"
|
|
|
|
|
tmux rename-window "write"
|
|
|
|
|
tmux new-window -a -t 1 -n "test"
|
|
|
|
|
tmux new-window -a -t 2 -n "git" lazygit
|
|
|
|
|
tmux new-window -a -t 3 -n "man"
|
|
|
|
|
tmux select-window -t 2
|
|
|
|
|
tmux select-window -t 1
|
|
|
|
|
tmux attach -t "$REPO->$BRANCH"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# prep repo to be committed
|
|
|
|
|
prep:
|
|
|
|
|
mv justfile test_justfile
|
|
|
|
|
mv prod_justfile justfile
|
|
|
|
|
|