mirror of
https://github.com/JanJastrow/.dotfiles.git
synced 2024-11-21 10:09:56 +01:00
Compare commits
15 Commits
074d7abd35
...
37dc883e1e
Author | SHA1 | Date | |
---|---|---|---|
|
37dc883e1e | ||
|
ac3c53cda7 | ||
|
d2415d7b5b | ||
|
ecf277ea23 | ||
|
8090d91887 | ||
|
0a290694f2 | ||
|
0da271937b | ||
|
9fd7c99e85 | ||
|
9bd5388862 | ||
|
2571cd4b61 | ||
|
32c65e4964 | ||
|
252617ee15 | ||
|
05d32dcde7 | ||
|
b06d00347c | ||
|
8b73ae1cdc |
14
gitconfig
14
gitconfig
@ -9,14 +9,22 @@
|
|||||||
[init]
|
[init]
|
||||||
defaultBranch = main
|
defaultBranch = main
|
||||||
[alias]
|
[alias]
|
||||||
|
a = add
|
||||||
br = branch
|
br = branch
|
||||||
c = commit
|
c = commit
|
||||||
co = checkout
|
|
||||||
ca = c -a
|
ca = c -a
|
||||||
p = pull
|
co = checkout
|
||||||
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
|
|
||||||
conflict = diff --name-only --diff-filter=U
|
conflict = diff --name-only --diff-filter=U
|
||||||
|
d = diff
|
||||||
hash = !git rev-parse HEAD | cut -c 1-8
|
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
|
undo = !f() { git reset --hard $(git rev-parse --abbrev-ref HEAD)@{${1-1}}; }; f
|
||||||
[branch]
|
[branch]
|
||||||
sort = -committerdate
|
sort = -committerdate
|
||||||
|
[help]
|
||||||
|
autocorrect = 30
|
||||||
|
9
scripts/install-brew-macos.sh
Executable file
9
scripts/install-brew-macos.sh
Executable 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
|
22
scripts/install-docker-debian.sh
Executable file
22
scripts/install-docker-debian.sh
Executable 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
|
3
scripts/install-docker-portainer.sh
Executable file
3
scripts/install-docker-portainer.sh
Executable 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
8
scripts/install-eza-debian.sh
Executable 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
|
12
scripts/install-syncthing-debian.sh
Executable file
12
scripts/install-syncthing-debian.sh
Executable 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
|
26
zsh/alias
26
zsh/alias
@ -2,32 +2,12 @@
|
|||||||
# filename: /zsh/alias
|
# 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
|
# Update tools/OS aliases
|
||||||
if [[ -x $(which brew) ]]; then
|
if [[ -x $(which brew) ]]; then
|
||||||
alias brewupdate='brew update; brew upgrade; brew upgrade --cask; brew cleanup'
|
alias brewupdate='brew update; brew upgrade; brew upgrade --cask; brew cleanup'
|
||||||
fi
|
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'
|
alias aptupdate='sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y && sudo apt clean'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -64,7 +44,7 @@ alias random32='echo $(date +%s | md5sum | head -c 32)'
|
|||||||
alias untargz='tar -xzvf'
|
alias untargz='tar -xzvf'
|
||||||
|
|
||||||
# (macOS) start Firefox Profile manager
|
# (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'
|
alias firefox-pm='/Applications/Firefox.app/Contents/MacOS/firefox-bin -P'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -90,6 +70,6 @@ alias makeitmine='sudo chown -R $(whoami) ./'
|
|||||||
# ---
|
# ---
|
||||||
# .dotfiles
|
# .dotfiles
|
||||||
|
|
||||||
alias dotf='cd ~/.dotfiles'
|
alias dotfiles='cd ~/.dotfiles'
|
||||||
alias dotfu='cd ~/.dotfiles; git pull; cd -; source ~/.zshrc'
|
alias dotfu='cd ~/.dotfiles; git pull; cd -; source ~/.zshrc'
|
||||||
alias reload-zsh='source ~/.zshrc'
|
alias reload-zsh='source ~/.zshrc'
|
||||||
|
27
zsh/env
27
zsh/env
@ -11,19 +11,36 @@ export LC_TYPE=en_US.UTF-8
|
|||||||
# set default editor
|
# set default editor
|
||||||
export EDITOR="nano"
|
export EDITOR="nano"
|
||||||
|
|
||||||
# set `ll` command - b(etter)ls per default
|
# set `ll` alias
|
||||||
|
# eza > lsd > bls
|
||||||
alias ll=bls
|
alias ll=bls
|
||||||
if test -x "$(which eza)"; then
|
|
||||||
alias ll=eza
|
if [[ -x $(which lsd) ]]; then
|
||||||
fi
|
|
||||||
if test -x "$(which lsd)"; then
|
|
||||||
alias ll=lsd
|
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
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
# Path additions
|
# Path additions
|
||||||
#
|
#
|
||||||
|
|
||||||
|
if test -d "$HOME/.dotfiles/scripts"; then
|
||||||
|
export PATH="$HOME/.dotfiles/scripts:$PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
if test -d "/opt/homebrew/"; then
|
if test -d "/opt/homebrew/"; then
|
||||||
export PATH="/opt/homebrew/bin:$PATH"
|
export PATH="/opt/homebrew/bin:$PATH"
|
||||||
eval "$(/opt/homebrew/bin/brew shellenv)"
|
eval "$(/opt/homebrew/bin/brew shellenv)"
|
||||||
|
@ -65,7 +65,7 @@ function png2jpeg() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function jpeg1024() {
|
function jpeg1024() {
|
||||||
magick "$1" -resize '1024x1024\>' -background black -flatten TGA:- | cjpeg -targo -optimize -progressive -quality 90 -outfile "$1".jpg
|
magick "$1" -resize '1024x1024\>' -background black -flatten TGA:- | cjpeg -targo -optimize -progressive -quality 90 -outfile "$1".jpg
|
||||||
}
|
}
|
||||||
|
|
||||||
# Make PDFs look like scanned
|
# Make PDFs look like scanned
|
||||||
@ -104,11 +104,11 @@ function extract () {
|
|||||||
# Download provided url to $HOME/Downloads
|
# Download provided url to $HOME/Downloads
|
||||||
function dl() {
|
function dl() {
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
echo "usage: dl url (directory)"
|
echo "usage: dl url --- downloads to $HOME/Downloads"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
if [[ -x $(which aria2c) ]]; then
|
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
|
else
|
||||||
(cd "$HOME/Downloads" && curl -O "$1")
|
(cd "$HOME/Downloads" && curl -O "$1")
|
||||||
fi
|
fi
|
||||||
|
1
zshrc
1
zshrc
@ -17,6 +17,7 @@ source "$HOME/.dotfiles/zsh/settings"
|
|||||||
#
|
#
|
||||||
if [[ $- =~ i ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_TTY" ]]; then
|
if [[ $- =~ i ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_TTY" ]]; then
|
||||||
tmux attach-session -t default || tmux new-session -s default
|
tmux attach-session -t default || tmux new-session -s default
|
||||||
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Define platform
|
# Define platform
|
||||||
|
Loading…
Reference in New Issue
Block a user