Compare commits

...

15 Commits

Author SHA1 Message Date
Jan Jastrow
37dc883e1e End ssh session on tmux detach 2024-08-11 01:37:12 +02:00
Jan Jastrow
ac3c53cda7 Upgrade gitconfig 2024-08-11 01:27:15 +02:00
Jan Jastrow
d2415d7b5b update dl() details 2024-08-11 01:00:44 +02:00
Jan Jastrow
ecf277ea23 update dotfiles folder alias 2024-08-11 00:48:40 +02:00
Jan Jastrow
8090d91887 if rewrite 2024-08-11 00:48:12 +02:00
Jan Jastrow
0a290694f2 detect apt instead of OS 2024-08-11 00:47:26 +02:00
Jan Jastrow
0da271937b match bls output to eza/lsd 2024-08-11 00:36:17 +02:00
Jan Jastrow
9fd7c99e85 add local scripts to $PATH 2024-08-11 00:26:27 +02:00
Jan Jastrow
9bd5388862 install syncthing debian/ubuntu 2024-08-11 00:19:55 +02:00
Jan Jastrow
2571cd4b61 Make executable 2024-08-10 23:39:42 +02:00
Jan Jastrow
32c65e4964 Add docker install scripts 2024-08-10 23:29:37 +02:00
Jan Jastrow
252617ee15 add shebang to script 2024-08-10 23:22:29 +02:00
Jan Jastrow
05d32dcde7 Add macos homebrew script 2024-08-10 23:22:18 +02:00
Jan Jastrow
b06d00347c Add first install script 2024-08-10 23:01:51 +02:00
Jan Jastrow
8b73ae1cdc Reorganize ll handling. eza also now preferred 2024-08-10 22:56:58 +02:00
10 changed files with 94 additions and 34 deletions

View File

@ -9,14 +9,22 @@
[init]
defaultBranch = main
[alias]
a = add
br = branch
c = commit
co = checkout
ca = c -a
p = pull
l = log --all --color --graph --pretty=format:'%Cred%h%Creset %G?%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit # Colorful and easy to read log
co = checkout
conflict = diff --name-only --diff-filter=U
d = diff
hash = !git rev-parse HEAD | cut -c 1-8
l = log --all --color --graph --pretty=format:'%Cred%h%Creset %G?%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit # Colorful and easy to read log
last = log -1 HEAD --stat
p = pull
rv = remote -v
se = !git rev-list --all | xargs git grep -F
st = status -sb
undo = !f() { git reset --hard $(git rev-parse --abbrev-ref HEAD)@{${1-1}}; }; f
[branch]
sort = -committerdate
[help]
autocorrect = 30

9
scripts/install-brew-macos.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/zsh
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew doctor
# Install some default tools
brew update
brew install tmux mosh eza lsd ffmpeg aria2 bat dog f3 gping btop imagemagick iperf3 ncdu p7zip pigz rclone rsync screen thefuck tldr unzip yt-dlp zstd
brew install --cask balenaetcher cryptomator iina handbrake imageoptim libreoffice losslesscut mgba mkvtoolnix nextcloud obs rar retroarch-metal secretive ultimaker-cura vlc vscodium zed signal transmission

View File

@ -0,0 +1,22 @@
#!/bin/sh
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
# Install docker from source
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# Run test command
sudo docker run hello-world

View File

@ -0,0 +1,3 @@
#!/bin/sh
docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest

8
scripts/install-eza-debian.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
sudo mkdir -p /etc/apt/keyrings
wget -qO- https://raw.githubusercontent.com/eza-community/eza/main/deb.asc | sudo gpg --dearmor -o /etc/apt/keyrings/gierens.gpg
echo "deb [signed-by=/etc/apt/keyrings/gierens.gpg] http://deb.gierens.de stable main" | sudo tee /etc/apt/sources.list.d/gierens.list
sudo chmod 644 /etc/apt/keyrings/gierens.gpg /etc/apt/sources.list.d/gierens.list
sudo apt update
sudo apt install -y eza

View File

@ -0,0 +1,12 @@
#!/bin/sh
# Add the release PGP keys:
sudo mkdir -p /etc/apt/keyrings
sudo curl -L -o /etc/apt/keyrings/syncthing-archive-keyring.gpg https://syncthing.net/release-key.gpg
# Add the "stable" channel to your APT sources:
echo "deb [signed-by=/etc/apt/keyrings/syncthing-archive-keyring.gpg] https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list
# Update and install syncthing:
sudo apt-get update
sudo apt-get install syncthing

View File

@ -2,32 +2,12 @@
# filename: /zsh/alias
#--------------------------------
# Better LS
if [[ $platform == 'Linux' ]]; then
alias bls='pwd; ls -lahp --color=auto --group-directories-first'
elif [[ $platform == 'macOS' && -x $(which gls) ]]; then
alias bls='pwd; gls -lahpG --group-directories-first'
elif [[ $platform == 'macOS' ]]; then
alias bls='/bin/ls -lahG'
fi
# Better eza
if [[ -x $(which eza) ]]; then
alias eza='pwd; eza --long --all --all --group-directories-first --git --group'
# --all (2x) to show `.` and `..` directories as well
fi
# Better lsd
if [[ -x $(which lsd) ]]; then
alias lsd='pwd; lsd -laF --group-dirs=first --icon=never'
fi
# Update tools/OS aliases
if [[ -x $(which brew) ]]; then
alias brewupdate='brew update; brew upgrade; brew upgrade --cask; brew cleanup'
fi
if [[ $platform == 'Linux' ]]; then
if [[ -x $(which apt) ]]; then
alias aptupdate='sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y && sudo apt clean'
fi
@ -64,7 +44,7 @@ alias random32='echo $(date +%s | md5sum | head -c 32)'
alias untargz='tar -xzvf'
# (macOS) start Firefox Profile manager
if test -x '/Applications/Firefox.app/Contents/MacOS/firefox-bin'; then
if [[ -x '/Applications/Firefox.app/Contents/MacOS/firefox-bin' ]]; then
alias firefox-pm='/Applications/Firefox.app/Contents/MacOS/firefox-bin -P'
fi
@ -90,6 +70,6 @@ alias makeitmine='sudo chown -R $(whoami) ./'
# ---
# .dotfiles
alias dotf='cd ~/.dotfiles'
alias dotfiles='cd ~/.dotfiles'
alias dotfu='cd ~/.dotfiles; git pull; cd -; source ~/.zshrc'
alias reload-zsh='source ~/.zshrc'

27
zsh/env
View File

@ -11,19 +11,36 @@ export LC_TYPE=en_US.UTF-8
# set default editor
export EDITOR="nano"
# set `ll` command - b(etter)ls per default
# set `ll` alias
# eza > lsd > bls
alias ll=bls
if test -x "$(which eza)"; then
alias ll=eza
fi
if test -x "$(which lsd)"; then
if [[ -x $(which lsd) ]]; then
alias ll=lsd
alias lsd='pwd; lsd -laF --group-dirs=first --icon=never'
fi
if [[ -x $(which eza) ]]; then
alias ll=eza
alias eza='pwd; eza --long --all --all --group-directories-first --git --group'
fi
## Better LS
if [[ $platform == 'Linux' ]]; then
alias bls='pwd; ls -lahp --color=auto --group-directories-first'
elif [[ $platform == 'macOS' && -x $(which gls) ]]; then
alias bls='pwd; gls -lahpG --group-directories-first'
elif [[ $platform == 'macOS' ]]; then
alias bls='pwd; /bin/ls -lahGp'
fi
#
# Path additions
#
if test -d "$HOME/.dotfiles/scripts"; then
export PATH="$HOME/.dotfiles/scripts:$PATH"
fi
if test -d "/opt/homebrew/"; then
export PATH="/opt/homebrew/bin:$PATH"
eval "$(/opt/homebrew/bin/brew shellenv)"

View File

@ -104,11 +104,11 @@ function extract () {
# Download provided url to $HOME/Downloads
function dl() {
if [ -z "$1" ]; then
echo "usage: dl url (directory)"
echo "usage: dl url --- downloads to $HOME/Downloads"
return
fi
if [[ -x $(which aria2c) ]]; then
aria2c --dir="$HOME/Downloads" --continue=true --max-connection-per-server=5 "$1"
aria2c --dir="$HOME/Downloads" --continue=true --max-connection-per-server=4 "$1"
else
(cd "$HOME/Downloads" && curl -O "$1")
fi

1
zshrc
View File

@ -17,6 +17,7 @@ source "$HOME/.dotfiles/zsh/settings"
#
if [[ $- =~ i ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_TTY" ]]; then
tmux attach-session -t default || tmux new-session -s default
exit
fi
# Define platform