From fd6b3c227d160d79f0fb9995e66d16dc836432ab Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Wed, 4 Mar 2026 13:17:42 +0100 Subject: add .gitignore_global; support debian --- .bashrc | 4 +++- .gitignore_global | 7 +++++++ .profile | 8 +++++--- .vimrc | 1 + bin/vm | 39 ++++++++++++++++++++------------------- 5 files changed, 36 insertions(+), 23 deletions(-) create mode 100644 .gitignore_global diff --git a/.bashrc b/.bashrc index cb5d13e..1c35452 100644 --- a/.bashrc +++ b/.bashrc @@ -28,7 +28,7 @@ OS=${OS:-$(~/bin/os)} # Support different operating system environments case $OS in -(arch|alpine|fedora-asahi-remix) +(arch|alpine|debian|fedora-asahi-remix) alias ls='ls --color=auto -v' ll='ls -AlFhv' [ "$OS" = arch ] || trap 'printf "\e]2;%s\a" "$TERM_TAG ${BASH_COMMAND%ps1}"' DEBUG ;; @@ -129,3 +129,5 @@ type -t command_not_found_handle >/dev/null || command_not_found_handle() { . ~/.bash-powerline.sh . "$HOME/.cargo/env" + +. "$HOME/.local/bin/env" diff --git a/.gitignore_global b/.gitignore_global new file mode 100644 index 0000000..40edd21 --- /dev/null +++ b/.gitignore_global @@ -0,0 +1,7 @@ +CLAUDE.md +.claude/ +*~ +.*.swo +.*.swp +.DS_Store +Thumbs.db diff --git a/.profile b/.profile index 550db7f..98144f5 100644 --- a/.profile +++ b/.profile @@ -1,10 +1,10 @@ # ~/.profile export OS=$(~/bin/os) -export LC_ALL=C +# export LC_ALL=C.UTF-8 case $OS in -(arch|alpine) +(arch|alpine|debian) PATH=~/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:~/go/bin:~/.local/bin export XDG_RUNTIME_DIR=/run/user/$(id -u) ;; @@ -13,7 +13,7 @@ case $OS in export XKB_DEFAULT_LAYOUT=us XKB_DEFAULT_VARIANT=intl ;; (Darwin) - PATH=$PATH:/opt/local/bin:/opt/local/sbin:~/bin:~/go/bin:~/Library/Python/3.9/bin + PATH=$PATH:/opt/local/bin:/opt/local/sbin:~/bin:~/go/bin:~/.local/bin:~/Library/Python/3.9/bin export LANG=en_US.UTF-8 tabs -4 ;; @@ -37,3 +37,5 @@ esac if [ -f "$HOME/.cargo/env" ]; then . "$HOME/.cargo/env" fi + +. "$HOME/.local/bin/env" diff --git a/.vimrc b/.vimrc index 1eae08b..a0a0181 100644 --- a/.vimrc +++ b/.vimrc @@ -194,6 +194,7 @@ command! Blame normal!:let @a=expand('%'):let @b=line('.'):new:set b " edit current word as file noremap ge :e +noremap gE :e " create a tag entry for current filename " noremap gt :!echo "% % 1" >> tags; LC_ALL=C sort -o tags -u tags noremap t :!echo "% % 1" >> tags; LC_ALL=C sort -o tags -u tags diff --git a/bin/vm b/bin/vm index 82bd7cf..455363a 100755 --- a/bin/vm +++ b/bin/vm @@ -5,18 +5,18 @@ vm_version='vm-0.1' # TODO: -# - DONE: fetch, build and install vftool in .vm/vftool -# - DONE: setup a config file per VM -# - DONE: creation of hdd image -# - DONE: delete a VM -# - DONE: import iso, kernel, initrd from existing vm -# - when no vm is specified, apply command to last one -# - script install from CDROM iso: -# - patch alpine setup-disk -# - setup system, including static IP address -# - setup user account from host -# - setup ssh from host -# - time synchronization from host +# - [x] fetch, build and install vftool in .vm/vftool +# - [x] setup a config file per VM +# - [x] creation of hdd image +# - [x] delete a VM +# - [x] import iso, kernel, initrd from existing vm +# - [ ] when no vm is specified, apply command to last one +# - [ ] script install from CDROM iso: +# - [ ] patch alpine setup-disk +# - [ ] setup system, including static IP address +# - [ ] setup user account from host +# - [ ] setup ssh from host +# - [ ] time synchronization from host # unset CDPATH @@ -186,13 +186,14 @@ start() { ! [ "$s" ] || exec ssh "$1" } +# Start a vm. Notice the sub-process pattern here: f() (...) start_vm() ( - [ -f vftool.log ] && cat vftool.log >> vftool.log.old + [ -f vftool.log ] && cat vftool.log >> vftool.log.old exec 1>vftool.log 2>&1 . config || die "vm: could not source $PWD/config" - trap 'rm -f vftool.pid' EXIT + trap 'rm -f vftool.pid' EXIT - "$dir/vftool" \ + "$dir"/vftool \ ${kernel+-k "$kernel"} \ ${initrd+-i "$initrd"} \ ${hda+-d "$hda"} \ @@ -204,10 +205,10 @@ start_vm() ( -a "${arg-console=hvc0}" \ >>vftool.log 2>&1 & sleep 1 - [ -f screenlog.0 ] && mv screenlog.0 screenlog.0.old - echo "$!" >vftool.pid - screen -L -S "${PWD##*/}" -d -m "$(vftool_tty)" - wait + [ -f screenlog.0 ] && mv screenlog.0 screenlog.0.old + echo "$!" >vftool.pid + screen -L -S "${PWD##*/}" -d -m "$(vftool_tty)" + wait ) stop() { -- cgit v1.2.3