Compare commits
4 Commits
Author | SHA1 | Date |
---|---|---|
Kebler Network System Administrator | d3e19cd9d2 | |
Kebler Network System Administrator | d33faa9ab1 | |
Kebler Network System Administrator | 7eaba2ceac | |
Kebler Network System Administrator | a402e75060 |
|
@ -10,13 +10,13 @@ use_pyenv() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# TODO make alias generating function for versions of python
|
# TODO make alias generating function for versions of python
|
||||||
alias python3x="sudo -H python3 -m"
|
alias python3x="sudo -H python3.8 -m"
|
||||||
alias spip="sudo -H python3 -m pip"
|
alias spip="sudo -H python3.8 -m pip"
|
||||||
alias spipi="sudo -H python3 -m pip install"
|
alias spipi="sudo -H python3.8 -m pip install"
|
||||||
alias spipiu="sudo -H python3 -m pip install -U"
|
alias spipiu="sudo -H python3.8 -m pip install -U"
|
||||||
alias spipl="sudo -H python3 -m pip list"
|
alias spipl="sudo -H python3.8 -m pip list"
|
||||||
alias spiplo="sudo -H python3 -m pip list --outdated"
|
alias spiplo="sudo -H python3.8 -m pip list --outdated"
|
||||||
alias pip3="sudo -H python3 -m pip"
|
alias pip3="sudo -H python3.8 -m pip"
|
||||||
alias pipu="pipx upgrade"
|
alias pipu="pipx upgrade"
|
||||||
alias pipua="pipx upgrade-all"
|
alias pipua="pipx upgrade-all"
|
||||||
alias pipupip="pipx upgrade pipx"
|
alias pipupip="pipx upgrade pipx"
|
||||||
|
|
|
@ -8,10 +8,7 @@ chromium_() {
|
||||||
# local DEFAULT="$HOME/.local/share/chromium"
|
# local DEFAULT="$HOME/.local/share/chromium"
|
||||||
local exe="/usr/bin/chromium"
|
local exe="/usr/bin/chromium"
|
||||||
|
|
||||||
if [[ $1 == "-version" ]]; then
|
[[ $1 == "-version" ]] && $exe -version && return
|
||||||
$exe -version
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
[[ $1 == -g ]] && exe=$(command -v google-chrome) && shift
|
[[ $1 == -g ]] && exe=$(command -v google-chrome) && shift
|
||||||
echo execuatble to be used: $exe
|
echo execuatble to be used: $exe
|
||||||
|
@ -19,8 +16,7 @@ chromium_() {
|
||||||
echo chromium/chrome not installed, checking for flatpak version
|
echo chromium/chrome not installed, checking for flatpak version
|
||||||
flatpak=$(flatpak info com.github.Eloston.UngoogledChromium | grep error:)
|
flatpak=$(flatpak info com.github.Eloston.UngoogledChromium | grep error:)
|
||||||
if [[ $flatpak ]]; then
|
if [[ $flatpak ]]; then
|
||||||
echo no flatpak version either - exiting
|
echo no flatpak version either - exiting && return 1
|
||||||
return 1
|
|
||||||
else
|
else
|
||||||
flatpak=true
|
flatpak=true
|
||||||
exe="/usr/bin/flatpak run --branch=stable --arch=x86_64 --filesystem=<dir> --command=/app/bin/chromium --file-forwarding com.github.Eloston.UngoogledChromium @@u"
|
exe="/usr/bin/flatpak run --branch=stable --arch=x86_64 --filesystem=<dir> --command=/app/bin/chromium --file-forwarding com.github.Eloston.UngoogledChromium @@u"
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
[Seat:*]
|
[Seat:*]
|
||||||
session-setup-script=/opt/session/lightdm-setup.sh
|
session-cleanup-script=/opt/scripts/lightdm-cleanup.sh
|
||||||
session-cleanup-script=/opt/session/lightdm-cleanup.sh
|
session-setup-script=/opt/scripts/lightdm-setup.sh
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/bash
|
||||||
|
echo "cleanup for ${USER}:${HOME} $(date)" >> /opt/scripts/lightdm.log
|
||||||
|
log=${HOME}/.session.log
|
||||||
|
if [[ -e $HOME/.session_logout ]]; then su -c "/bin/bash $HOME/.session_logout 1>>${log} 2>>${log} || true" $USER; fi
|
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/bash
|
||||||
|
echo "setup for ${USER}:${HOME} $(date)" >> /opt/scripts/lightdm.log
|
||||||
|
log=${HOME}/.session.log
|
||||||
|
if [[ -e $HOME/.session_login ]]; then su -c "/bin/bash $HOME/.session_login 1>>${log} 2>>${log} || true" $USER; fi
|
|
@ -14,20 +14,15 @@ loginout_install() {
|
||||||
echo copying 50-setup-cleanup.conf to /etc/lightdm/lightdm.conf.d
|
echo copying 50-setup-cleanup.conf to /etc/lightdm/lightdm.conf.d
|
||||||
sudo cp -f 50-setup-cleanup.conf /etc/lightdm/lightdm.conf.d
|
sudo cp -f 50-setup-cleanup.conf /etc/lightdm/lightdm.conf.d
|
||||||
|
|
||||||
if [[ ! -d /opt/session ]]; then
|
if [[ ! -d /opt/scripts ]]; then
|
||||||
if [[ ! $(mkdir -p /opt/session) ]]; then
|
if [[ ! $(mkdir -p /opt/scripts) ]]; then
|
||||||
echo unable to make /opt/session with user $USER, elevating to sudo
|
|
||||||
_sudo="sudo"
|
_sudo="sudo"
|
||||||
[[ $($_sudo mkdir -p /opt/session) ]] && echo can not make /opt/session, aborting && return
|
[[ $($_sudo mkdir -p /opt/scripts) ]] && echo can not make /opt/scripts, aborting && return
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo copying lightdm-cleanup.sh and lightdm-setup.sh to /opt/scripts
|
||||||
echo copying lightdm-cleanup.sh and lightdm-setup.sh to /opt/session
|
$_sudo cp -f lightdm-*.sh /opt/scripts
|
||||||
$_sudo cp -f scripts/* /opt/session
|
|
||||||
echo setting execute permissions
|
|
||||||
$_sudo chmod -R +x /opt/session/*.sh
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
_udir=${HOME}/.session
|
|
||||||
_uscript=${_udir}/session_logout
|
|
||||||
_log=${_udir}/session.log
|
|
||||||
_sdir=$(dirname "${BASH_SOURCE[0]}")
|
|
||||||
echo "${UID:-$(id -u)}:$(whoami) is running CLEANUP script in $_sdir for ${USER} sourcing ${_uscript}::$(date)" >> ${_sdir}/lightdm.log
|
|
||||||
if [[ -e ${_uscript} ]]; then
|
|
||||||
/bin/bash ${_uscript} 1>>${_log} 2>>${_log} || true
|
|
||||||
fi
|
|
|
@ -1,9 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
_udir=${HOME}/.session
|
|
||||||
_uscript=${_udir}/session_login
|
|
||||||
_log=${_udir}/session.log
|
|
||||||
_sdir=$(dirname "${BASH_SOURCE[0]}")
|
|
||||||
echo "${UID:-$(id -u)}:$(whoami) is running SETUP script in $_sdir for ${USER} sourcing ${_uscript}::$(date)" >> ${_sdir}/lightdm.log
|
|
||||||
if [[ -e ${_uscript} ]]; then
|
|
||||||
/bin/bash ${_uscript} 1>>${_log} 2>>${_log} || true
|
|
||||||
fi
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
export VBOX_MACHINE_FOLDER=/mnt/docker-vm-opt/vm
|
||||||
|
VBoxManage setproperty machinefolder $VBOX_MACHINE_FOLDER
|
||||||
|
# VBoxManage list systemproperties | grep "Default machine folder"
|
|
@ -0,0 +1,5 @@
|
||||||
|
backup_trantor () {
|
||||||
|
backup -s -o '\-v5' /data /backup/trantor/snapshots/data
|
||||||
|
backup -s -o '\-v5' /opt /backup/trantor/snapshots/opt
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
echo $USER logged into $(hostname)
|
Reference in New Issue