mirror of
https://gitea.blesmrt.net/mikaela/shell-things.git
synced 2024-11-25 20:59:23 +01:00
Compare commits
16 Commits
ac6c0addf1
...
391ec83b38
Author | SHA1 | Date | |
---|---|---|---|
391ec83b38 | |||
8ce36b9c9e | |||
2d26f20efd | |||
e54f4f1689 | |||
4eedcf49a7 | |||
838b486251 | |||
76b088e0ce | |||
b4c7de8ab2 | |||
5aa7f8ec1f | |||
81e8ef2754 | |||
c4b20f481d | |||
15a8d5f9eb | |||
286694a0c0 | |||
c30057a344 | |||
21e36c11ba | |||
f9fefeeba7 |
@ -81,3 +81,7 @@
|
|||||||
# see also .mikaela/2src-gitconfig within the same shell-things repo
|
# see also .mikaela/2src-gitconfig within the same shell-things repo
|
||||||
[includeIf "gitdir:~/2src/"]
|
[includeIf "gitdir:~/2src/"]
|
||||||
path = ~/2src/gitconfig
|
path = ~/2src/gitconfig
|
||||||
|
|
||||||
|
# Don't complain about this path
|
||||||
|
[safe]
|
||||||
|
directory = /home/linuxbrew/.linuxbrew
|
||||||
|
27
etc/profile.d/50-xdg-screenshots.sh
Normal file
27
etc/profile.d/50-xdg-screenshots.sh
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# OK, so this could be a lot more pretty, but it works for ensuring users have
|
||||||
|
# a screenshot directory (even if I still don't know does anything else than
|
||||||
|
# grimshot care about that).
|
||||||
|
|
||||||
|
# root is neither taking screenshots nor using gui
|
||||||
|
if [[ "$(id -u)" != "0" ]]; then
|
||||||
|
# if the configuration file exists, that is good enough indication for me
|
||||||
|
# that the tools are supported.
|
||||||
|
if [[ -f "$(xdg-user-dir)/.config/user-dirs.locale)" ]]; then
|
||||||
|
# If the output differs, the path is set and there is no need to
|
||||||
|
# continue.
|
||||||
|
if [[ $(xdg-user-dir SCREENSHOTS) != $(xdg-user-dir) ]]; then
|
||||||
|
# If we are continuing anyway, ensure existence of locale file and see if it's something I support.
|
||||||
|
touch "$(cat $(xdg-user-dir)/.config/user-dirs.locale)"
|
||||||
|
XDGLOCALE="$(cat $(xdg-user-dir)/.config/user-dirs.locale)"
|
||||||
|
if [[ "$XDGLOCALE" == "fi" || "$XDGLOCALE" == "fi_FI" ]]; then
|
||||||
|
# I would say Kuvankaappaukset, but for some reason KDE Plasma says Kuvakaappaukset, and I don't care enough.
|
||||||
|
xdg-user-dirs-update --set SCREENSHOTS $(xdg-user-dir PICTURES)/Kuvakaappaukset
|
||||||
|
else
|
||||||
|
# Generic English fallack, like I think upstream does.
|
||||||
|
xdg-user-dirs-update --set SCREENSHOTS $(xdg-user-dir PICTURES)/Screenshots
|
||||||
|
fi
|
||||||
|
# Ensure the directory exists.
|
||||||
|
mkdir -p "$(xdg-user-dir SCREENSHOTS)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
15
etc/profile.d/99-brew.sh
Normal file
15
etc/profile.d/99-brew.sh
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# https://github.com/Homebrew/brew
|
||||||
|
if [ -d /home/linuxbrew/.linuxbrew/bin ]; then
|
||||||
|
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# https://github.com/nvm-sh/nvm
|
||||||
|
if [ -d ~/.nvm ]; then
|
||||||
|
. ~/.nvm/nvm.sh
|
||||||
|
. ~/.nvm/bash_completion
|
||||||
|
elif [ -d /home/linuxbrew/.linuxbrew/opt/nvm ]; then
|
||||||
|
mkdir -p /home/linuxbrew/.nvm
|
||||||
|
export NVM_DIR=/home/linuxbrew/.nvm
|
||||||
|
. /home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh
|
||||||
|
# . /home/linuxbrew/.linuxbrew/opt/nvm/etc/bash_completion.d/nvm
|
||||||
|
fi
|
@ -5,6 +5,7 @@ Wants=sysctl-p--system.service
|
|||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
TimeoutStartSec=infinity
|
TimeoutStartSec=infinity
|
||||||
|
Environment=LINUXBREWGROUP=wheel
|
||||||
# - means it can fail, without failing those after it.
|
# - means it can fail, without failing those after it.
|
||||||
# These aren't given --now as THEY WOULD INFINITE LOOP.
|
# These aren't given --now as THEY WOULD INFINITE LOOP.
|
||||||
ExecStartPre=-/usr/bin/systemctl enable aminda-nocron-rebootish.service
|
ExecStartPre=-/usr/bin/systemctl enable aminda-nocron-rebootish.service
|
||||||
@ -37,6 +38,8 @@ ExecStart=-/usr/bin/systemctl enable --now sshguard.service
|
|||||||
ExecStart=-/usr/bin/systemctl enable --now unbound.service
|
ExecStart=-/usr/bin/systemctl enable --now unbound.service
|
||||||
ExecStart=-/usr/bin/systemctl enable --now chrony.service
|
ExecStart=-/usr/bin/systemctl enable --now chrony.service
|
||||||
ExecStart=-/usr/bin/systemctl enable --now chronyd.service
|
ExecStart=-/usr/bin/systemctl enable --now chronyd.service
|
||||||
|
ExecStart=-/bin/chown -R root:$LINUXBREWGROUP /home/linuxbrew -R
|
||||||
|
ExecStart=-/bin/setfacl -R -m g:$LINUXBREWGROUP:rwx,o:rx /home/linuxbrew
|
||||||
User=root
|
User=root
|
||||||
StandardOutput=journal
|
StandardOutput=journal
|
||||||
StandardError=journal
|
StandardError=journal
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
# in case linuxbrew users have a group separate from wheel, this is the place
|
||||||
|
# to specify it.
|
||||||
|
[Service]
|
||||||
|
Environment=LINUXBREWGROUP=
|
||||||
|
Environment=LINUXBREWGROUP=linuxbrew
|
44
rc/bashrc
44
rc/bashrc
@ -144,9 +144,9 @@ if hash lsb_release 2> /dev/null; then
|
|||||||
printf "$(uptime --pretty)\t$(uptime)\n"
|
printf "$(uptime --pretty)\t$(uptime)\n"
|
||||||
printf "\nPresent:\n"
|
printf "\nPresent:\n"
|
||||||
if hash who 2> /dev/null; then
|
if hash who 2> /dev/null; then
|
||||||
who --heading --lookup --mesg --users
|
who --heading --mesg --users
|
||||||
elif hash last 2> /dev/null; then
|
elif hash last 2> /dev/null; then
|
||||||
last --hostlast --dns --present $(date +%R) --fullnames --system --time-format notime
|
last --hostlast --present $(date +%R) --fullnames --system --time-format notime
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "\n"
|
printf "\n"
|
||||||
@ -270,8 +270,13 @@ export RES_OPTIONS="timeout:2 attempts:2 rotate edns0 trust-ad"
|
|||||||
# https://github.com/go-nv/goenv
|
# https://github.com/go-nv/goenv
|
||||||
if [ -d ~/.goenv/bin ]; then
|
if [ -d ~/.goenv/bin ]; then
|
||||||
export GOENV_ROOT="$HOME/.goenv"
|
export GOENV_ROOT="$HOME/.goenv"
|
||||||
PATH="$HOME/.goenv/bin:$PATH"
|
PATH="$GOENV_ROOT/bin:$PATH"
|
||||||
#goenv init > /dev/null 2>&1
|
eval "$(goenv init -)"
|
||||||
|
PATH="$GOROOT/bin:$PATH"
|
||||||
|
PATH="$PATH:$GOPATH/bin"
|
||||||
|
elif [ -d /home/linuxbrew/.linuxbrew/opt/goenv ]; then
|
||||||
|
export GOENV_ROOT="$/home/linuxbrew/.linuxbrew/opt/goenv"
|
||||||
|
PATH="$GOENV_ROOT/bin:$PATH"
|
||||||
eval "$(goenv init -)"
|
eval "$(goenv init -)"
|
||||||
PATH="$GOROOT/bin:$PATH"
|
PATH="$GOROOT/bin:$PATH"
|
||||||
PATH="$PATH:$GOPATH/bin"
|
PATH="$PATH:$GOPATH/bin"
|
||||||
@ -281,14 +286,22 @@ fi
|
|||||||
if [ -d ~/.nvm ]; then
|
if [ -d ~/.nvm ]; then
|
||||||
. ~/.nvm/nvm.sh
|
. ~/.nvm/nvm.sh
|
||||||
. ~/.nvm/bash_completion
|
. ~/.nvm/bash_completion
|
||||||
|
elif [ -d /home/linuxbrew/.linuxbrew/opt/nvm ]; then
|
||||||
|
mkdir -p /home/linuxbrew/.nvm
|
||||||
|
export NVM_DIR=/home/linuxbrew/.nvm
|
||||||
|
. /home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh
|
||||||
|
#. /home/linuxbrew/.linuxbrew/opt/nvm/etc/bash_completion.d/nvm
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# https://github.com/rbenv/rbenv
|
# https://github.com/rbenv/rbenv
|
||||||
if [ -d ~/.rbenv/bin ]; then
|
if [ -d ~/.rbenv/bin ]; then
|
||||||
PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"
|
PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"
|
||||||
rbenv init > /dev/null 2>&1
|
eval "$(rbenv init -)"
|
||||||
# Remember! And verify it before running!
|
# Remember! And verify it before running!
|
||||||
# git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
|
# git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
|
||||||
|
elif [ -d /home/linuxbrew/.linuxbrew/opt/rbenv/bin ]; then
|
||||||
|
PATH="/home/linuxbrew/.linuxbrew/opt/rbenv/bin:/home/linuxbrew/.linuxbrew/opt/rbenv/bin/shims:$PATH"
|
||||||
|
eval "$(rbenv init -)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Add RubyGems to PATH
|
# Add RubyGems to PATH
|
||||||
@ -299,18 +312,29 @@ fi
|
|||||||
# https://github.com/pyenv/pyenv
|
# https://github.com/pyenv/pyenv
|
||||||
if [ -d ~/.pyenv/bin ]; then
|
if [ -d ~/.pyenv/bin ]; then
|
||||||
PATH="$HOME/.pyenv/bin:$HOME/.pyenv/shims:$PATH"
|
PATH="$HOME/.pyenv/bin:$HOME/.pyenv/shims:$PATH"
|
||||||
pyenv init > /dev/null 2>&1
|
eval "$(pyenv init -)"
|
||||||
# Worth considering (and verifying before running)
|
# Worth considering (and verifying before running)
|
||||||
# git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv
|
# git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv
|
||||||
# git clone https://github.com/pyenv/pyenv-virtualenvwrapper.git $(pyenv root)/plugins/pyenv-virtualenvwrapper
|
# git clone https://github.com/pyenv/pyenv-virtualenvwrapper.git $(pyenv root)/plugins/pyenv-virtualenvwrapper
|
||||||
|
elif [ -d /home/linuxbrew/.linuxbrew/opt/pyenv/bin ]; then
|
||||||
|
PATH="/home/linuxbrew/.linuxbrew/opt/pyenv/bin:/home/linuxbrew/.linuxbrew/opt/pyenv/shims:$PATH"
|
||||||
|
eval "$(pyenv init -)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# https://github.com/nodenv/nodenv
|
# https://github.com/nodenv/nodenv
|
||||||
if [ -d ~/.nodenv/bin ]; then
|
if [ -d ~/.nodenv/bin ]; then
|
||||||
PATH="$HOME/.nodenv/bin:$PATH"
|
PATH="$HOME/.nodenv/bin:$PATH"
|
||||||
eval "$(nodenv init - bash)"
|
eval "$(nodenv init -)"
|
||||||
# Remember! And verify it before running!
|
# Remember! And verify it before running!
|
||||||
# git clone https://github.com/nodenv/node-build.git "$(nodenv root)"/plugins/node-build
|
# git clone https://github.com/nodenv/node-build.git "$(nodenv root)"/plugins/node-build
|
||||||
|
elif [ -d /home/linuxbrew/.linuxbrew/opt/nodenv/bin ]; then
|
||||||
|
PATH="/home/linuxbrew/.linuxbrew/opt/nodenv/bin:$PATH"
|
||||||
|
eval "$(nodenv init -)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# https://github.com/Homebrew/brew
|
||||||
|
if [ -d /home/linuxbrew/.linuxbrew/bin ]; then
|
||||||
|
eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Removes duplicates from $PATH. Copied from https://unix.stackexchange.com/a/14896
|
# Removes duplicates from $PATH. Copied from https://unix.stackexchange.com/a/14896
|
||||||
@ -905,6 +929,12 @@ else
|
|||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# In Debian there is "sudo adduser whoever whatever", but I keep forgetting
|
||||||
|
# that the more common way is usermod -aG whatever,whereever whoever
|
||||||
|
adduser-to-group() {
|
||||||
|
usermod -aG "$2" "$1"
|
||||||
|
}
|
||||||
|
|
||||||
# Source files for miscannellious modifications.
|
# Source files for miscannellious modifications.
|
||||||
|
|
||||||
# acme.sh
|
# acme.sh
|
||||||
|
2
rc/vimrc
2
rc/vimrc
@ -23,7 +23,7 @@ set number " Show line numbers.
|
|||||||
set ruler " Show the line and column number of the cursor position,
|
set ruler " Show the line and column number of the cursor position,
|
||||||
" separated by a comma.
|
" separated by a comma.
|
||||||
|
|
||||||
"set background=dark
|
set background=dark
|
||||||
|
|
||||||
"Use modelines!
|
"Use modelines!
|
||||||
set modeline
|
set modeline
|
||||||
|
44
rc/zshrc
44
rc/zshrc
@ -37,9 +37,9 @@ if hash lsb_release 2> /dev/null; then
|
|||||||
printf "$(uptime --pretty)\t$(uptime)\n"
|
printf "$(uptime --pretty)\t$(uptime)\n"
|
||||||
printf "\nPresent:\n"
|
printf "\nPresent:\n"
|
||||||
if hash who 2> /dev/null; then
|
if hash who 2> /dev/null; then
|
||||||
who --heading --lookup --mesg --users
|
who --heading --mesg --users
|
||||||
elif hash last 2> /dev/null; then
|
elif hash last 2> /dev/null; then
|
||||||
last --hostlast --dns --present $(date +%R) --fullnames --system --time-format notime
|
last --hostlast --present $(date +%R) --fullnames --system --time-format notime
|
||||||
fi
|
fi
|
||||||
printf "\n"
|
printf "\n"
|
||||||
df / $HOME --human-readable --output=source,fstype,size,used,avail,pcent | uniq
|
df / $HOME --human-readable --output=source,fstype,size,used,avail,pcent | uniq
|
||||||
@ -224,8 +224,13 @@ export RES_OPTIONS="timeout:2 attempts:2 rotate edns0 trust-ad"
|
|||||||
# https://github.com/go-nv/goenv
|
# https://github.com/go-nv/goenv
|
||||||
if [ -d ~/.goenv/bin ]; then
|
if [ -d ~/.goenv/bin ]; then
|
||||||
export GOENV_ROOT="$HOME/.goenv"
|
export GOENV_ROOT="$HOME/.goenv"
|
||||||
PATH="$HOME/.goenv/bin:$PATH"
|
PATH="$GOENV_ROOT/bin:$PATH"
|
||||||
#goenv init > /dev/null 2>&1
|
eval "$(goenv init -)"
|
||||||
|
PATH="$GOROOT/bin:$PATH"
|
||||||
|
PATH="$PATH:$GOPATH/bin"
|
||||||
|
elif [ -d /home/linuxbrew/.linuxbrew/opt/goenv ]; then
|
||||||
|
export GOENV_ROOT="$/home/linuxbrew/.linuxbrew/opt/goenv"
|
||||||
|
PATH="$GOENV_ROOT/bin:$PATH"
|
||||||
eval "$(goenv init -)"
|
eval "$(goenv init -)"
|
||||||
PATH="$GOROOT/bin:$PATH"
|
PATH="$GOROOT/bin:$PATH"
|
||||||
PATH="$PATH:$GOPATH/bin"
|
PATH="$PATH:$GOPATH/bin"
|
||||||
@ -235,14 +240,22 @@ fi
|
|||||||
if [ -d ~/.nvm ]; then
|
if [ -d ~/.nvm ]; then
|
||||||
. ~/.nvm/nvm.sh
|
. ~/.nvm/nvm.sh
|
||||||
. ~/.nvm/bash_completion
|
. ~/.nvm/bash_completion
|
||||||
|
elif [ -d /home/linuxbrew/.linuxbrew/opt/nvm ]; then
|
||||||
|
mkdir -p /home/linuxbrew/.nvm
|
||||||
|
export NVM_DIR=/home/linuxbrew/.nvm
|
||||||
|
. /home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh
|
||||||
|
#. /home/linuxbrew/.linuxbrew/opt/nvm/etc/bash_completion.d/nvm
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# https://github.com/rbenv/rbenv
|
# https://github.com/rbenv/rbenv
|
||||||
if [ -d ~/.rbenv/bin ]; then
|
if [ -d ~/.rbenv/bin ]; then
|
||||||
PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"
|
PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"
|
||||||
rbenv init > /dev/null 2>&1
|
eval "$(rbenv init -)"
|
||||||
# Remember! And verify it before running!
|
# Remember! And verify it before running!
|
||||||
# git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
|
# git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
|
||||||
|
elif [ -d /home/linuxbrew/.linuxbrew/opt/rbenv/bin ]; then
|
||||||
|
PATH="/home/linuxbrew/.linuxbrew/opt/rbenv/bin:/home/linuxbrew/.linuxbrew/opt/rbenv/bin/shims:$PATH"
|
||||||
|
eval "$(rbenv init -)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Add RubyGems to PATH
|
# Add RubyGems to PATH
|
||||||
@ -253,18 +266,29 @@ fi
|
|||||||
# https://github.com/pyenv/pyenv
|
# https://github.com/pyenv/pyenv
|
||||||
if [ -d ~/.pyenv/bin ]; then
|
if [ -d ~/.pyenv/bin ]; then
|
||||||
PATH="$HOME/.pyenv/bin:$HOME/.pyenv/shims:$PATH"
|
PATH="$HOME/.pyenv/bin:$HOME/.pyenv/shims:$PATH"
|
||||||
pyenv init > /dev/null 2>&1
|
eval "$(pyenv init -)"
|
||||||
# Worth considering (and verifying before running)
|
# Worth considering (and verifying before running)
|
||||||
# git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv
|
# git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv
|
||||||
# git clone https://github.com/pyenv/pyenv-virtualenvwrapper.git $(pyenv root)/plugins/pyenv-virtualenvwrapper
|
# git clone https://github.com/pyenv/pyenv-virtualenvwrapper.git $(pyenv root)/plugins/pyenv-virtualenvwrapper
|
||||||
|
elif [ -d /home/linuxbrew/.linuxbrew/opt/pyenv/bin ]; then
|
||||||
|
PATH="/home/linuxbrew/.linuxbrew/opt/pyenv/bin:/home/linuxbrew/.linuxbrew/opt/pyenv/shims:$PATH"
|
||||||
|
eval "$(pyenv init -)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# https://github.com/nodenv/nodenv
|
# https://github.com/nodenv/nodenv
|
||||||
if [ -d ~/.nodenv/bin ]; then
|
if [ -d ~/.nodenv/bin ]; then
|
||||||
PATH="$HOME/.nodenv/bin:$PATH"
|
PATH="$HOME/.nodenv/bin:$PATH"
|
||||||
eval "$(nodenv init - zsh)"
|
eval "$(nodenv init -)"
|
||||||
# Remember! And verify it before running!
|
# Remember! And verify it before running!
|
||||||
# git clone https://github.com/nodenv/node-build.git "$(nodenv root)"/plugins/node-build
|
# git clone https://github.com/nodenv/node-build.git "$(nodenv root)"/plugins/node-build
|
||||||
|
elif [ -d /home/linuxbrew/.linuxbrew/opt/nodenv/bin ]; then
|
||||||
|
PATH="/home/linuxbrew/.linuxbrew/opt/nodenv/bin:$PATH"
|
||||||
|
eval "$(nodenv init -)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# https://github.com/Homebrew/brew
|
||||||
|
if [ -d /home/linuxbrew/.linuxbrew/bin ]; then
|
||||||
|
eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Removes duplicates from $PATH. Copied from https://unix.stackexchange.com/a/14896
|
# Removes duplicates from $PATH. Copied from https://unix.stackexchange.com/a/14896
|
||||||
@ -883,6 +907,12 @@ else
|
|||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# In Debian there is "sudo adduser whoever whatever", but I keep forgetting
|
||||||
|
# that the more common way is usermod -aG whatever,whereever whoever
|
||||||
|
adduser-to-group() {
|
||||||
|
usermod -aG "$2" "$1"
|
||||||
|
}
|
||||||
|
|
||||||
# Source files for miscannellious modifications.
|
# Source files for miscannellious modifications.
|
||||||
|
|
||||||
# acme.sh
|
# acme.sh
|
||||||
|
Loading…
Reference in New Issue
Block a user