From 5081f099bbde68a69352958bd5b44f98c4941e1f Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 4 Jan 2025 23:02:59 -0500 Subject: [PATCH] updated file copying to symlinks, compiling binaries, etc --- pi/.vimrc | 113 ------------------------------------------------- pi/pi_setup.sh | 87 ++++++++++++++++++++++++++++--------- 2 files changed, 67 insertions(+), 133 deletions(-) delete mode 100644 pi/.vimrc diff --git a/pi/.vimrc b/pi/.vimrc deleted file mode 100644 index 20cfdd0..0000000 --- a/pi/.vimrc +++ /dev/null @@ -1,113 +0,0 @@ -" ==================================================================== -" Auth: Alex Celani -" File: .vimrc -" Revn: 04-17-2023 2.0 -" Func: Define how Vim works, set parameters, define keymaps -" -" TODO: add in Greek keymaps -" make goddamn numpad work on terminal/in vim -" make all comments linewrap/wrap onto new line -" ==================================================================== -" CHANGE LOG -" -------------------------------------------------------------------- -" ??-??-2018: init -" 05-2?-2019: new files of certain filetype autoinsert this opening -" comment header block -" 06-01-2019: fixed autocomplete braces not holding indents -" 08-01-2019: added linewrapping -" 03-27-2020: explicitly set syntax coloring -" set column numbers -" 04-16-2020: changed automatic comment header directory to .vim/* -" 08-30-2020: changed comment#.txt to commentN.txt to avoid errors -" 09-05-2020: changed tapstop and shiftwidth from 3 to 4 -" 10-02-2020: added .txt to files that open commentN.txt -" 10-11-2020: made line numbers green -" changed line wrap from 80 characters to 70 -" 03-02-2022: commented out GoLang channel inoremap ( ,- -> <- ) -" 06-20-2022: commented out GoLang instantiate inoremap ( ;= -> := ) -"*04-17-2023: added txt and book filetypes to commentN.txt -" added laststatus to always display filename -" -" ==================================================================== - -" Explicitly set syntax coloring to on -syntax on - -" Reset highlight color for comments to lightblue -"hi comment ctermfg=lightblue - -" Set line numbering and color of such -set number -hi LineNr ctermfg=Green - -" Set column number -set ruler - -" Set the amount of spaces in a tab -set tabstop=4 - -" NFC -set shiftwidth=4 - -" Replace tab char with spaces -set expandtab - -" Copies indent of last line and adds onto -set autoindent - -" Sets character length of line to 70 characters, linewraps -set tw=70 - -" some way, somehow, this displays the file name at the bottom -set laststatus=2 - -" Remap { with auto close brace and tab in -" THIS COULD BE BETTER, COMBINE WITH AUTOINDENT -inoremap { {f} - -" Close that mf paren -" THIS TAKES TIME, IS IT POSSIBLE TO MAKE IT FASTER -" UPDATE -> this only takes time if you wait for it, -" typing immediately expedites the process -inoremap ( ( ) - -" Skip over closed parens -inoremap () () - -" Auto infer declare/instantiate operator for GoLang -"inoremap ;= := - -" Auto infer channel operator for GoLang -"inoremap ,- <- -" Auto-insert printf -" TODO: -" Make language specific shit -"inoremap Print printf(); - - -" Open new files with comment blocks -" Bash, Julia, Ruby, and Text all use pound signs ( # ) -" also book-types like Providence, ANO, etc -autocmd BufNewFile *.sh :r ~/.vim/commentN.txt -autocmd BufNewFile *.jl :r ~/.vim/commentN.txt -autocmd BufNewFile *.rb :r ~/.vim/commentN.txt -autocmd BufNewFile *.txt :r ~/.vim/commentN.txt -autocmd BufNewFile *.prv :r ~/.vim/commentN.txt - -" Matlab uses percent signs ( % ) -autocmd BufNewFile *.m :r ~/.vim/commentP.txt - -" Python uses triple quotes ( """ -> """ ) -autocmd BufNewFile *.py :r ~/.vim/commentQ.txt - -" C, Go, and Rust use double slashes -autocmd BufNewFile *.c :r ~/.vim/commentS.txt -autocmd BufNewFile *.go :r ~/.vim/commentS.txt -autocmd BufNewFile *.rs :r ~/.vim/commentS.txt - - -" So this is how you fuck around -" When g is pressed, it sets the comment color to black, goes back to Insert -" mode, and then types g -" inoremap g :hi comment ctermfg=blackig - diff --git a/pi/pi_setup.sh b/pi/pi_setup.sh index c725784..a204f85 100755 --- a/pi/pi_setup.sh +++ b/pi/pi_setup.sh @@ -1,11 +1,19 @@ # ======================================================================== # Auth: alex # File: setup.sh -# Revn: 09-23-2023 1.0 +# Revn: 01-04-2025 1.0 # Func: automate pi setup # -# TODO: get addnet/pipe to bash stuff to work -# test? +# TODO +# [X] get link to newer version of go +# [X] make useful directories +# [ ] build TDM +# [ ] build ekho +# [ ] make symlinks to executables to ~/bin +# [ ] make symlinks to source in ~/src +# [X] make symlinks to .bashrc + friends +# [ ] connect to internet +# [ ] test? # ======================================================================== # CHANGE LOG # ------------------------------------------------------------------------ @@ -18,7 +26,15 @@ # empty and refill /etc/motd # enabled ssh? # fixed typo in golang download, had one, wanted L -#*09-23-2023: added command to install nmap +# 10-07-2024: updated git clone commands +# symlink command for bashrc + friends +# added big todo list +# made bin/src directories +# 12-14-2024: updated golang version number +#*01-04-2025: added command to install nmap +# uncommented building TDM and mv'ing binary to ~/bin +# built ekho, moved to ~/bin/ +# copied, built, and moved donut/boot to ~/src/ and ~/bin/ # # ======================================================================== @@ -40,40 +56,71 @@ sudo apt install -y tshark # install nmap sudo apt install -y nmap +# TODO get newer version of Go # install golang -wget https://dl.google.com/go/go1.14.4.linux-armv6l.tar.gz -sudo tar -C /usr/local -xzf go1.14.4.linux-armv6l.tar.gz -rm go1.14.4.linux-armv6l.tar.gz +wget https://dl.google.com/go/go1.21.1.linux-armv6l.tar.gz +sudo tar -C /usr/local -xzf go1.21.1.linux-armv6l.tar.gz +rm go1.21.1.linux-armv6l.tar.gz echo "PATH=$PATH:/usr/local/go/bin" >> ~/.profile echo "GOPATH=$HOME/go" >> ~/.profile # install rust curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh +# create the directory "Documents" if it doesn't exist +# if it does exist, who cares TODO test +cd ~ +mkdir bin +mkdir src +mkdir Documents 2> /dev/null +cd Documents + # github treats # lol good luck, without a PAT, this shit BREAKS # start with my stuff -git clone https://github.com/alexander-the-alright/bash +git clone https://github.com/alexander-the-alright/dotfiles git clone https://github.com/alexander-the-alright/TDM +git clone https://github.com/alexander-the-alright/soary +git clone https://github.com/alexander-the-alright/ekho + +# TODO make go +# build todo manager +go build TDM/tdm.go +mv tdm ~/bin/tdm + +# make ekho +go build ekho/client +mv client ~/bin/client.o + +# TODO symlinks +cd ~ +ln -sf ~/Documents/dotfiles/pi/.vim ~/.vim +ln -sf ~/Documents/dotfiles/.vimrc ~/.vimrc +ln -sf ~/Documents/dotfiles/pi/.bash_profile ~/.bashrc + +# copy and build binaries +cp ~/Documents/dotfiles/pi/donut.c ~/src +cp ~/Documents/dotfiles/pi/boot.go ~/src +gcc -o donut.o src/donut.c +gcc -o boot src/boot.go +mv boot ~/bin/ +mv donut.o ~/bin/ + # elsewhere git clone https://github.com/stianeikeland/go-rpio git clone https://github.com/golemparts/rppal -# enable vim and bash settings -mv ~/bash/.bashrc ~/.bashrc -mv ~/bash/.vimrc ~/.vimrc -mv ~/bash/.vim ~/.vim -# build todo manager -go build TDM/tdm.go +# TODO internet +# XXX this dumb router breaks this # create static local ip address -sudo echo "" >> /etc/dhcpcd.conf -sudo echo "" >> /etc/dhcpcd.conf -sudo echo "interface wlan0" >> /etc/dhcpcd.conf -sudo echo "static ip_address=192.168.1.160/24" >> /etc/dhcpcd.conf -sudo echo "static routers=192.168.1.1" >> /etc/dhcpcd.conf -sudo echo "static domain_name_servers=192.168.1.1" >> /etc/dhcpcd.conf +#sudo echo "" >> /etc/dhcpcd.conf +#sudo echo "" >> /etc/dhcpcd.conf +#sudo echo "interface wlan0" >> /etc/dhcpcd.conf +#sudo echo "static ip_address=192.168.1.160/24" >> /etc/dhcpcd.conf +#sudo echo "static routers=192.168.1.1" >> /etc/dhcpcd.conf +#sudo echo "static domain_name_servers=192.168.1.1" >> /etc/dhcpcd.conf # enable ssh? sudo touch /boot/ssh