61 Commits
main ... dev

Author SHA1 Message Date
ed2535b802 Disable the notifications on Wellbeing more properly. 2026-04-30 19:42:51 -07:00
fb140bea72 Disable breaks from Wellbeing, still seems to be in development, activates when laptop is locked, pop-ups do not always do their action buttons properly, and generally just annoying at this point. 2026-04-30 13:54:25 -07:00
33ef2544dc Increment Debian version for Lutris. 2026-04-30 06:49:07 -07:00
4b8f122376 Deprecate trash related code. 2026-04-25 10:33:31 -07:00
df6dc122f2 Remove uninstall of packages also listed in additional section at every run. 2026-04-25 08:55:34 -07:00
b765c5cdae Rather than overwrite the Android SDKs every run, only do them if they are not listed. update-sdk function can update these manually rather than wasting bandwidth through Ansible. 2026-04-25 08:53:12 -07:00
3629d24b1b Remove the countdown since it blocks screen real estate and does not allow starting the break early. 2026-04-25 08:30:33 -07:00
9339b24808 Add flatpak for Organic Maps. 2026-04-24 08:50:17 -07:00
5e8d188871 Add exporting of all functions, same as done in env-shared. 2026-04-13 19:28:41 -07:00
4fd3e43e0d Add unofficial flatpak for Anki Desktop. 2026-04-11 18:37:59 -07:00
d8bc4a66cf Move log functions to shared. 2026-04-10 13:11:23 -07:00
30f9aff49e Stop killing bluetooth service. 2026-04-06 19:23:34 -07:00
190b3d921b Change settings to all be true since did not get any reminders after these changes. 2026-04-06 18:58:30 -07:00
11632e72d7 Tweak the Wellbeing settings a bit more. 2026-04-06 15:38:27 -07:00
fa0ea0098e Only do the metasploit activities if it is not already installed. 2026-04-06 15:24:33 -07:00
579764ca76 Add a TBD for not reinstalling metasploit every run (will save time and bandwidth). 2026-04-06 15:16:57 -07:00
51b3161124 Add the cron jobs to shutdown automatically at night, but debating whether it's a good idea. 2026-04-01 20:20:35 -07:00
18a1defd65 Add Brave Browser for using WDP. Session seems to have worked itself out, remove TBD. 2026-03-31 16:47:41 -07:00
f7ac9cc7e7 Add gnome-boxes for development systems. 2026-03-30 11:01:48 -07:00
c40019a72d Use the vimrc from env-shared. 2026-03-28 16:25:37 -07:00
2d1f720578 Move now and today t shared env. 2026-03-28 14:24:21 -07:00
119b8aa669 Move scan to be in shared env. 2026-03-28 14:18:54 -07:00
2b7447ba26 Move clone and ls aliases to shared. 2026-03-28 13:34:31 -07:00
e0bb2b3c66 Add missing section of PROD variables to RC file. 2026-03-28 13:29:19 -07:00
e70fdaabd5 Use source keyword to be more explicit. 2026-03-28 13:24:33 -07:00
4522811da1 Allow banners to pop up, such as Wellbeing and USB prompts. 2026-03-28 12:53:12 -07:00
ec22eacbdb Move the import of shared RC up so that variables are available. 2026-03-28 12:23:49 -07:00
4031be218c Remove colors since they are now shared. 2026-03-28 12:08:51 -07:00
e280bd7a49 Change the break time to only be 3 minutes. 2026-03-28 11:09:11 -07:00
2954ce5af9 Add screen time limits and break reminders in GNOME Wellbeing. 2026-03-28 11:07:57 -07:00
cd7a290d61 Use the same branch as env-ansible, so that servers do not use dev branch unless requested. 2026-03-27 18:32:55 -07:00
89982bae39 Add branch to env-shared download. Remove the bin script copy and add it to PATH instead. 2026-03-27 18:29:39 -07:00
9327ed23ac Add location of env-shared bin. 2026-03-27 18:29:03 -07:00
79a2c832b4 Also install all the bin scripts. Split the permissions command so that .rc_shared is allowed to fail. 2026-03-27 18:22:27 -07:00
6a36811590 Add tasks to download and install env-shared project's bashrc addition. 2026-03-27 18:16:54 -07:00
2e0dd78f68 Add location to pull env-shared project. 2026-03-27 18:16:07 -07:00
861a9c6257 Add all the production server information to environment variables so that env-shared can access them. 2026-03-27 18:07:29 -07:00
210e409428 Add env setup to get the data server information. 2026-03-27 18:06:52 -07:00
44039bbd1b Add an explicit bye since goodbye does not seem to be working still. 2026-03-27 17:13:39 -07:00
a1bbcdc804 Add sourcing of the shared RC file if it exists. 2026-03-23 12:14:58 -07:00
22a74506fd Add a TBD for getting Session to work properly. 2026-02-01 15:41:15 -07:00
5d7318ec32 Add note for which bitrate is used by default. 2026-01-18 07:03:42 -07:00
cf676808c9 Fix header comment. 2026-01-18 07:01:59 -07:00
66ca4dcb98 Add the Session messenger to faves for now. 2025-12-20 21:42:42 -07:00
ea1716957b Add the messenger "Session". 2025-12-20 20:41:49 -07:00
2e560c9f2b Ignore files which are ignored by clone alias. 2025-12-20 20:05:25 -07:00
c21d7415f5 Add a gap in output and timing between the two backup files. 2025-12-20 20:01:52 -07:00
e3c61c5bcd Add a backup of data directories. 2025-12-20 19:59:32 -07:00
af3c665a43 Do not fail if no functions exist yet. 2025-12-20 19:50:51 -07:00
8b52914683 Edit the show facts parameter to exit after it runs. Also fix its spacing in the usage. 2025-12-18 10:46:26 -07:00
b3e9f7584f Also add boolean check for swap_block. 2025-12-18 10:37:56 -07:00
1a2572870f Ensure that the editing variable is interpreted as a boolean if it is true or false. 2025-12-18 10:36:45 -07:00
d32c913a40 Add music tagger for audio editing machines. 2025-12-18 10:03:07 -07:00
b8fa688e52 Add a parameter to image compressing which does not use a big fancy tag. 2025-12-08 15:15:11 -07:00
ea3ce8d023 Change the t parameter to do what the e parameter does, and finish what the e parameter is supposed to do. 2025-12-08 14:54:08 -07:00
dd7325da39 Prevent date formatting if the time flag is not set. 2025-12-08 14:48:32 -07:00
195c315714 Add shortcut for running a command in a loop. 2025-12-02 16:38:57 -07:00
b91b43b56d Add wireless-tools package for workstations. 2025-12-02 16:29:35 -07:00
a64f2253b6 Add colors to PS2. 2025-12-01 19:19:06 -07:00
7f21a0fc7b Refactor the prompt colors. 2025-12-01 19:14:04 -07:00
87aca38811 Add time and colors to PS1. 2025-12-01 19:11:24 -07:00
15 changed files with 345 additions and 94 deletions

View File

@@ -1,7 +1,7 @@
---
# Define file, folder, and other facts per OS.
- name: General | Facts | System | Global
- name: General | Facts | System | Global [1/2]
set_fact:
lynis_install_dir: /usr/local/src/lynis
dwm_install_dir: /usr/local/src/dwm
@@ -10,7 +10,11 @@
x_desktops: /usr/share/xsessions
git_repo_http: https://{{ git_host }}/{{ git_user }}/{{ git_project }}
git_repo_ssh: ssh://git@{{ git_host }}:{{ git_ssh_port }}/{{ git_user }}/{{ git_project }}
shared_rc_install_dir: /usr/local/src/env-shared
- name: General | Facts | System | Global [2/2]
set_fact:
shared_rc_bin: "{{ shared_rc_install_dir }}/bin-shared"
- name: General | Facts | System | Linux
set_fact:

View File

@@ -12,12 +12,16 @@ if [[ -z "$HOSTNAME" ]]; then
fi
EXTRA="$1"
TAG="System"
DATE="`date "+%Y%m%d-%H%M%S"`"
BACKUP_DIR="/srv/backup"
BASENAME="Backup"
TAG="System"
BACKUP="$BACKUP_DIR/$BASENAME.$DATE.$HOSTNAME.$TAG.zip"
TAG2="Data"
BACKUP2="${BACKUP//$TAG/$TAG2}"
## Initialization ##
echo "*** Creating Backup Directory ***"
@@ -31,15 +35,19 @@ sudo chown -Rv root:root "$BACKUP_DIR"
echo "*** Removing Old Backups ***"
cd "$BACKUP_DIR"
sudo mv -v "$BASENAME"*"$TAG"* TRASH/
sudo mv -v "$BASENAME"*"$TAG2"* TRASH/
sudo rm -v TRASH/*
## Main
# System Backup
echo "*** Creating backup at '$BACKUP' ***"
sudo zip -rv "$BACKUP" \
/etc /var/{log,mail,spool} /srv /boot \
/usr/local/etc $EXTRA \
-x "/srv/backup/*" -x "/srv/sftp/*"
-x "/srv/backup/*" -x "/srv/sftp/*" \
-x "*/.gradle/" -x "*/app/build/*"
status="$?"
if [[ "$status" != 0 ]]; then
@@ -54,4 +62,27 @@ else
exit 1
fi
echo -e "\n\n"
sleep 5
# Data Backup
echo "*** Creating backup at '$BACKUP2' ***"
sudo zip -rv "$BACKUP2" \
/root /home /srv/sftp \
-x "*/.gradle/" -x "*/app/build/*"
status="$?"
if [[ "$status" != 0 ]]; then
echo "*** ERROR: Failed to create '$BACKUP2', file may be incorrect. ***"
fi
if [[ -e "$BACKUP2" ]]; then
ls -alh "$BACKUP2"
echo "*** '$BACKUP2' created successfully! ***"
else
echo "*** '$BACKUP2' not found! ***"
exit 1
fi
exit 0

View File

@@ -1,6 +1,6 @@
#!/bin/bash
# 2023-12-04 Hyperling
# Lower resolution of audio and convert to mp3. Also
# Lower the resolution of audio and convert to mp3.
# Also see: compress-video.sh
## Setup ##
@@ -36,7 +36,8 @@ function usage() {
Compress audio to mp3. Can handle folders and work recursively.
Parameters:
-q QUALITY : Integer for the maximum length of either media dimension.
-q QUALITY : Integer for audio bitrate to transcode to.
Defaults to 256k. No lower than 192k suggested.
-l LOCATION : The specific media or folder which needs compressed.
-r : Recursively shrink media based on the location passed.
-f : Force the media to be shrunk even if a file already exists for it.

View File

@@ -15,6 +15,7 @@ size=2000
# Strings
tag="shrunk"
use_tag="Y"
date_YYYYMMDD="`date "+%Y%m%d"`"
location="."
search="ls"
@@ -28,7 +29,7 @@ function usage() {
# Parameters:
# 1) The exit status to use.
status=$1
echo "Usage: $PROG [-s SIZE] [-l LOCATION] [-A | [-r] [-f] [-d] [-c]] [-h] [-x] [-t]" >&2
echo "Usage: $PROG [-s SIZE] [-l LOCATION] [-A | [-r] [-f] [-d] [-c] [-e | -t] [-h] [-x] [-n]" >&2
cat <<- EOF
Compress JPG or PNG image(s). Can handle folders and work recursively.
@@ -42,17 +43,18 @@ function usage() {
-F : FORCE the image to be shrunk even if the file is already shrunk.
-d : Delete the original image if the compressed image is smaller.
-c : Clean the filename of underscores, dashes, 'IMG', etc.
-e | -t : Format timestamp to the expanded model.
-A : Resursively Force, Delete, and Clean.
-h : Display this usage text.
-x : Enable BASH debugging.
-t : Format timestamp.
-n : No file extension.
EOF
exit $status
}
## Parameters ##
while getopts ":s:l:rfFdcAhxt" opt; do
while getopts ":s:l:rfFdcetAhxn" opt; do
case $opt in
s) in_size="$OPTARG" && size="$in_size" ;;
l) location="$OPTARG" ;;
@@ -62,10 +64,11 @@ while getopts ":s:l:rfFdcAhxt" opt; do
d) delete="Y" ;;
c) clean="Y" ;;
e) expand="Y" ;;
A) recurse="Y" && search="find" && force="Y" && delete="Y" && expand="Y" ;;
t) expand="Y" ;;
A) recurse="Y" && search="find" && force="Y" && delete="Y" ;;
h) usage 0 ;;
x) set -x ;;
t) format_time="Y" ;;
n) use_tag="N" ;;
*) echo "ERROR: Option $OPTARG not recognized." >&2 && usage 1 ;;
esac
done
@@ -114,6 +117,12 @@ $search "$location" | sort | while read image; do
fi
new_image="${image//.$extension/}.$tag-$date_YYYYMMDD.$size.$extension"
if [[ "$use_tag" == "N" ]]; then
new_image="$image"
new_image="${new_image//.$extension/}"
new_image="${new_image//.$tag/}"
new_image="$new_image.$tag.$extension"
fi
## Clean Filename ##
# Prevent directory from having its name cleaned too.
@@ -132,9 +141,7 @@ $search "$location" | sort | while read image; do
# Date Data
new_image_exp="${TEMP:0:4}-${TEMP:4:2}-${TEMP:6:2}"
# Time Data
if [[ "$format_time" == "Y" ]]; then
new_image_exp="${new_image_exp}_${TEMP:8:2}-${TEMP:10:2}-${TEMP:12:2}"
fi
new_image_exp="${new_image_exp}_${TEMP:8:2}-${TEMP:10:2}-${TEMP:12:2}"
# Remainder Data
if [[ "${TEMP:14:1}" == "." ]]; then
SEP=""
@@ -156,7 +163,7 @@ $search "$location" | sort | while read image; do
fi
# Skip if a compressed image was already created today.
if [[ -e "$new_image" || -e $new_image_clean ]]; then
if [[ (-e "$new_image" || -e $new_image_clean) && $use_tag == "Y" ]]; then
echo " SKIP: Image has already been shrunk previously, moving on."
continue
fi

View File

@@ -32,7 +32,7 @@ function usage {
-g : Enable the General config with test contents.
-w : Enable the Workstation config with test contents.
-s : Enable the Server config with test contents.
-f : Display this system's facts.
-f : Display this system's facts.
-h : Display this help text.
EOF
@@ -130,6 +130,7 @@ echo "Installed!"
if [[ "$show_facts" == "Y" ]]; then
echo "Showing Ansible Facts"
ansible localhost -m setup --connection=local
exit 0
fi
#echo "Adding Ansible Collections..."

View File

@@ -101,22 +101,48 @@
; Slows down the rate of services such as telegraf and cron.
; Default: false
;
;;;;;;;;;;;;;;;;;;;; Server Shortcut ;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;; Server Shortcuts ;;;;;;;;;;;;;;;;;;;;
;
; For typing `prod` and getting straight to a server, like in env-termux.
;
; prod_host : Branch to use on this machine.
; Imagine the command:
; `ssh prod_user@prod_host:prod_port`
;
; prod_host : Hostname for the production server.
; Example: myserver.com, mywebhost.net
; Default: hyperling.com
;
; prod_port : Provide the git host that the machine should poll.
; prod_port : Port for the production server.
; Example: 22, 222, 2222
; Default: 22
;
; prod_user : Port of the server host to use for SSH requests.
; prod_user : Username for accessing the production server.
; Example: jim, bob, jeff, anne
; Default: user
;
; For pushing MASTER directories to an SFTP server with `send-master`.
;
; Imagine the command:
; `rsync -auPhz --delete -e 'ssh -p prod_data_port' ./mydata-MASTER/ \
; prod_data_user@prod_data_host:/prod_data_dir/mydata-clone
; `
;
; prod_data_host : Branch to use on this machine.
; Example: sftp.myserver.com, sftp.mywebhost.net
; Default: hyperling.com
;
; prod_data_port : Provide the git host that the machine should poll.
; Example: 22, 222, 2222
; Default: 22
;
; prod_data_user : Port of the server host to use for SSH requests.
; Example: jim, bob, jeff, anne
; Default: user
;
; prod_data_dir : Port of the server host to use for SSH requests.
; Example: /srv/sftp/
; Default: /srv/sftp/
;
[global]
marker: '; {mark} MANAGED BY ANSIBLE | Generic Config'
state: present
@@ -143,6 +169,15 @@
prod_host: "{{ lookup('ini', 'prod_host file={{gen_file}} default=hyperling.com') }}"
prod_port: "{{ lookup('ini', 'prod_port file={{gen_file}} default=22') }}"
prod_user: "{{ lookup('ini', 'prod_user file={{gen_file}} default=user') }}"
prod_data_host: "{{ lookup('ini', 'prod_data_host file={{gen_file}} default=hyperling.com') }}"
prod_data_port: "{{ lookup('ini', 'prod_data_port file={{gen_file}} default=22') }}"
prod_data_user: "{{ lookup('ini', 'prod_data_user file={{gen_file}} default=user') }}"
prod_data_dir: "{{ lookup('ini', 'prod_data_dir file={{gen_file}} default=/srv/sftp') }}"
- name: General | Account Management | Provisioning Configuration | General | Boolean Check | Swap Block
set_fact:
swap_block: "{{ swap_block | bool }}"
when: swap_block in ("true", "false")
- name: General | Account Management | Provisioning Configuration | General | List
set_fact:
@@ -166,6 +201,10 @@
- { 'prod_host': "{{ prod_host }}" }
- { 'prod_port': "{{ prod_port }}" }
- { 'prod_user': "{{ prod_user }}" }
- { 'prod_data_host': "{{ prod_data_host }}" }
- { 'prod_data_port': "{{ prod_data_port }}" }
- { 'prod_data_user': "{{ prod_data_user }}" }
- { 'prod_data_dir': "{{ prod_data_dir }}" }
## Workstation ##
@@ -223,6 +262,11 @@
mobile: "{{ lookup('ini', 'mobile file={{wrk_file}} default=false') | bool }}"
redmode: "{{ lookup('ini', 'redmode file={{wrk_file}} default=true' ) | bool }}"
- name: General | Account Management | Provisioning Configuration | Workstation | Boolean Check | Editing
set_fact:
editing: "{{ editing | bool }}"
when: editing in ("true", "false")
- name: General | Account Management | Provisioning Configuration | Workstation | List
set_fact:
provision_variables: "{{ provision_variables | combine(item) }}"

View File

@@ -127,7 +127,7 @@
alias_cp: alias cp='cp -v'
alias_mv: alias mv='mv -v'
alias_rm: alias rm='echo "Use mv ~/TRASH/ instead!"'
export_path_additions: export PATH="~/bin:"{{ global_bin }}":$PATH"
export_path_additions: export PATH="~/bin:"{{ global_bin }}":"{{ shared_rc_bin }}":$PATH"
function_wttr: |
function weather() {
# 20210301 - Someone showed me an awesome weather API! Had to implement it!
@@ -145,7 +145,39 @@
fi
curl "https://wttr.in/${1//\ /+}"
}
export_PS1: export PS1='[\u@\h \w]\$ '
export_PS1: |
## Prompts ##
# Old Trusty
#export PS1='[\u@\h \w]\$ '
# 20251201 - Add time.
#export PS1='[\t \u@\h \w]\$ '
# 20251201 - Add colors.
# This helps to determine the color palette numbers:
# https://robotmoon.com/bash-prompt-generator/
# Colors have been moved to env-shared project's .rc_shared file.
if [[ "$USER" == "root" || $UID == 0 ]]; then
CLR_BRACKETS=$BOLD$YELLOW
CLR_TIME=$BOLD$ORANGE
CLR_USER=$BOLD$SCARLET
CLR_DIR=$BOLD$RED
CLR_PROMPT=$BOLD$GRAY
else
CLR_BRACKETS=$RESET
CLR_TIME=$BOLD$PURPLE
CLR_USER=$BOLD$ORANGE
CLR_DIR=$BOLD$GREEN
CLR_PROMPT=$RESET
fi
export PS1='\[$CLR_BRACKETS\][\[$CLR_TIME\]\t \[$CLR_USER\]\u@\h \[$CLR_DIR\]\w\[$CLR_BRACKETS\]]\[$CLR_PROMPT\]\$ \[$RESET\]'
export PS2='\[$CLR_BRACKETS\](\[$CLR_TIME\]>\[$CLR_USER\]^\[$CLR_DIR\].\[$CLR_USER\]^\[$CLR_BRACKETS\])\[$CLR_TIME\]> \[$RESET\]'
## End Prompts ##
alias_remount: |
alias remount='
sudo umount /mnt/*
@@ -259,6 +291,7 @@
}
function goodbye {
update -yg
bye
}
metasploit_aliases: |
alias metasploit="msfconsole"
@@ -297,7 +330,7 @@
alias trashed-cleanup="clean-trashed"
alias trashed-clean="clean-trashed"
function_check_trash: |
function check-trash() {
function check-trash-old() {
unset OPTIND
unset clean
unset network
@@ -397,9 +430,9 @@
return 0
}
alias check_trash="check-trash"
alias_clean_trash: alias clean-trash='check-trash --clean'
alias_trash_check: alias trash-check='check-trash'
alias_trash_clean: alias trash-clean='trash-check --clean'
alias_trash_check: alias trash-check='check-trash-old'
alias_clean_trash: alias clean-trash='check-trash-old --clean'
alias_trash_clean: alias trash-clean='clean-trash'
alias_clean_dir: |
function clean-dir() {
sudo du -hs
@@ -686,8 +719,6 @@
done
echo -e "\nDone!\n"
}
alias_clone: |
alias clone="rsync -auPhz --delete --exclude '.gradle' --exclude 'app/build'"
export_hyperling: |
export HYPERLING6="2a07:e03:3:80::1"
export HYPERLING4="185.130.47.173"
@@ -697,8 +728,19 @@
if [[ -e $DOCKER_SOURCE && $LOGNAME == "root" ]]; then
source $DOCKER_SOURCE
fi
alias_scan: |
alias scan="nmap -A -p- --script=vuln"
export_prod:
export PROD_HOST="{{ prod_host }}"
export PROD_PORT="{{ prod_port }}"
export PROD_USER="{{ prod_user }}"
export PROD_GIT_HOST="{{ git_host }}"
export PROD_GIT_PORT="{{ git_ssh_port }}"
export PROD_GIT_USER="{{ git_user }}"
export PROD_DATA_HOST="{{ prod_data_host }}"
export PROD_DATA_PORT="{{ prod_data_port }}"
export PROD_DATA_USER="{{ prod_data_user }}"
export PROD_DATA_DIR="{{ prod_data_dir }}"
alias_prod: |
alias prod="ssh -p {{ prod_port }} {{ prod_user }}@{{ prod_host }}"
function_clean_code: |
@@ -779,23 +821,12 @@
alias chmod='chmod -c'
alias_iftop: |
alias iftop='sudo iftop'
alias_ls: |
alias l='ls'
alias ll='ls -alh'
alias lh='ls -ash'
alias_progs: |
alias progs='ps -ef'
alias_nethogs: |
alias nethogs='sudo nethogs'
alias_ansible_facts: |
alias ansible-facts='ansible localhost -m setup --connection=local'
function_now: |
function now {
date "+%Y%m%d-%H%M%S"
}
function today {
date "+%Y%m%d"
}
function_backup: |
export BACKUP_DIR="/srv/backup"
function backup {
@@ -861,13 +892,6 @@
alias prod-backup="pull_prod_backups"
alias pull-prod="pull_prod_backups"
alias prod-pull="pull_prod_backups"
function_log: |
function log {
echo -e "$1"
}
function blog {
echo -e "\n\n$1\n\n"
}
function_debian_upgrade: |
function debian-upgrade {
typeset -l OLD NEW
@@ -1063,6 +1087,19 @@
status="$?"
return "$status"
}
function_loop: |
function loop {
cmd="$1"
while true; do
$cmd
done;
}
alias try="loop "
source_shared: |
if [ -f ~/.rc_shared ]; then
source ~/.rc_shared
fi
- name: General | Account Management | Users | Files | Common Variable
set_fact:
@@ -1083,6 +1120,7 @@
export domain="{{ domain }}"
{{ export_path_additions }}
{{ source_shared }}
{{ alias_cp }}
{{ alias_mv }}
{{ alias_rm }}
@@ -1116,10 +1154,9 @@
{{ function_code_reseed }}
{{ function_clean_filenames }}
{{ function_clean_filenames_tree }}
{{ alias_clone }}
{{ export_hyperling }}
{{ source_docker_env }}
{{ alias_scan }}
{{ export_prod }}
{{ alias_prod }}
{{ function_clean_code }}
{{ alias_kill_battery }}
@@ -1128,14 +1165,11 @@
{{ function_ansible_vars }}
{{ alias_permission_commands }}
{{ alias_iftop }}
{{ alias_ls }}
{{ alias_progs }}
{{ alias_nethogs }}
{{ alias_ansible_facts }}
{{ function_now }}
{{ function_backup }}
{{ function_pull_prod_backups }}
{{ function_log }}
{{ function_debian_upgrade }}
{{ function_ebook_convert }}
{{ alias_sudo }}
@@ -1146,12 +1180,17 @@
{{ alias_docker_other }}
{{ alias_flatpak_clean }}
{{ alias_commit }}
{{ function_loop }}
- name: General | Account Management | Users | Files | .bashrc
blockinfile:
path: "{{ item }}/.bashrc"
block: |
{{ rc_common }}
# Export all functions! #
eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')"
[[ $(whoami) != "root" ]] &&
echo "`date` - Ansible .bashrc loaded successfully!"
marker: '# {mark} MANAGED BY ANSIBLE | Aliases'
@@ -1181,31 +1220,6 @@
ignore_errors: yes
when: user_root.home != "" and user_user.home != ""
- name: General | Account Management | Users | Files | .vimrc
blockinfile:
path: "{{ item }}/.vimrc"
block: |
" Turn off syntax, flashy lights, etc. Make VIM into a basic editor.
syntax off
set nohlsearch
set noautoindent noautowrite noshowmatch wrapmargin=0 report=1 ts=3
set ignorecase
" Turn off auto-commenting.
autocmd Filetype * set fo-=c fo-=r fo-=o
" qq shortcut for immediately exiting all files without saving.
nnoremap qq :qa!<cr>
marker: '" {mark} MANAGED BY ANSIBLE | vimrc'
state: present
create: yes
backup: yes
loop:
- "{{ user_root.home }}"
- "{{ user_user.home }}"
ignore_errors: yes
when: user_root.home != "" and user_user.home != ""
- name: General | Account Management | Users | Files | Ownership
file:
path: "{{ user_user.home }}/{{ item }}"
@@ -1214,11 +1228,11 @@
loop:
- .bashrc
- .zshrc
- .vimrc
- name: General | Account Management | Users | Files | Helper Functions (Reset)
shell: "rm -v {{ global_bin }}/*.function"
ignore_errors: yes
- name: General | Account Management | Users | Files | Helper Functions
copy:
@@ -1229,3 +1243,50 @@
mode: 0755
with_fileglob:
- "functions/*.function"
- name: General | Account Management | Users | env-shared | Download
git:
repo: https://git.hyperling.com/me/env-shared
version: "{{ branch }}"
dest: "{{ shared_rc_install_dir }}"
clone: true
force: true
update: true
ignore_errors: yes
- name: General | Account Management | Users | env-shared | Install | .rc_shared
copy:
src: "{{ shared_rc_install_dir }}/rc_shared.sh"
dest: "{{ item }}/.rc_shared"
owner: root
group: "{{ root_group }}"
mode: 0755
loop:
- "{{ user_root.home }}"
- "{{ user_user.home }}"
ignore_errors: yes
when: user_root.home != "" and user_user.home != ""
- name: General | Account Management | Users | env-shared | Install | .vimrc
copy:
src: "{{ shared_rc_install_dir }}/vimrc.vim"
dest: "{{ item }}/.vimrc"
owner: root
group: "{{ root_group }}"
mode: 0755
loop:
- "{{ user_root.home }}"
- "{{ user_user.home }}"
ignore_errors: yes
when: user_root.home != "" and user_user.home != ""
- name: General | Account Management | Users | env-shared | Permissions
file:
path: "{{ user_user.home }}/{{ item }}"
owner: "{{ user }}"
mode: '0755'
loop:
- .rc_shared
- .vimrc
ignore_errors: yes

View File

@@ -6,6 +6,11 @@
metasploit_installer: msfinstall
when: ansible_system in ("Linux", "Darwin")
- name: General | Software | Metasploit | Check Install Status
stat:
path: /usr/bin/msfconsole
register: metasploit_status
- name: General | Software | Metasploit | Refresh Apt Files
shell: "{{ item }}"
loop:
@@ -13,7 +18,8 @@
- "mv -fv /usr/share/keyrings/metasploit-framework.gpg /tmp/apt/metasploit-framework.gpg.old"
- "mv -fv /etc/apt/sources.list.d/metasploit-framework.list /tmp/apt/metasploit-framework.list.old"
- "mv -fv /etc/apt/preferences.d/pin-metasploit.pref /tmp/apt/pin-metasploit.pref.old"
when: ansible_system in ("Linux")
when: ansible_system in ("Linux") and
not metasploit_status.stat.exists
ignore_errors: true
- name: General | Software | Metasploit | Install
@@ -24,4 +30,5 @@
- "mkdir -p {{ global_bin }}"
- "mv -fv ./msfinstall {{ global_bin }}/{{ metasploit_installer }}"
- yes y | "{{ global_bin }}/{{ metasploit_installer }}"
when: ansible_system in ("Linux", "Darwin")
when: ansible_system in ("Linux", "Darwin") and
not metasploit_status.stat.exists

View File

@@ -98,14 +98,15 @@
## Bluetooth ##
# Do people seriously depend on Bluetooth? Plug your devices in, silly!
# Hehe, I use it now for a few rare things so disabling this for now.
- name: General | Software | Services | Bluetooth | Disable
service:
name: "{{ bluetooth }}"
pattern: "{{ bluetooth_pattern }}"
state: stopped
enabled: no
ignore_errors: yes
#- name: General | Software | Services | Bluetooth | Disable
# service:
# name: "{{ bluetooth }}"
# pattern: "{{ bluetooth_pattern }}"
# state: stopped
# enabled: no
# ignore_errors: yes
## NTP ##

View File

@@ -126,8 +126,6 @@
- system-images;android-35;google_apis_playstore;x86_64
### 34 ###
- build-tools;34.0.0
- platforms;android-34
- sources;android-34
# Images
- system-images;android-34;google_apis;x86_64
- system-images;android-34;google_apis_playstore;x86_64
@@ -243,14 +241,20 @@
# These are safe to run multiple times, and uses the new `latest` version.
- name: Workstation | Linux | Software | Android | Install | Required Modules
shell: "yes | {{ android_sdkmanager_final }} --install '{{ item }}' --sdk_root={{ android_sdk_location }}"
shell: |
if ! {{ android_sdkmanager_final }} --list_installed | grep -q '{{ item }}'; then
yes | {{ android_sdkmanager_final }} --install '{{ item }}' --sdk_root={{ android_sdk_location }}
fi
loop: "{{ android_downloads_required }}"
become_user: "{{ user }}"
when: coding == true
# Add more versions for testing across all the important platforms.
- name: Workstation | Linux | Software | Android | Install | Additional Modules
shell: "yes | {{ android_sdkmanager_final }} --install '{{ item }}' --sdk_root={{ android_sdk_location }}"
shell: |
if ! {{ android_sdkmanager_final }} --list_installed | grep -q '{{ item }}'; then
yes | {{ android_sdkmanager_final }} --install '{{ item }}' --sdk_root={{ android_sdk_location }}
fi
loop: "{{ android_downloads_additional }}"
become_user: "{{ user }}"
when: coding == true and sdks == true

View File

@@ -44,11 +44,16 @@
- { app: "com.transmissionbt.Transmission", name: "transmission", extra: "" }
- { app: "app.grayjay.Grayjay", name: "grayjay", extra: "" }
- { app: "com.github.xournalpp.xournalpp", name: "xournal", extra: "" }
- { app: "network.loki.Session", name: "session", extra: "" }
- { app: "com.brave.Browser", name: "brave", extra: "" }
- { app: "net.ankiweb.Anki", name: "anki", extra: "" }
- { app: "app.organicmaps.desktop", name: "organic-maps", extra: "" }
flatpaks_coding:
- { app: "com.vscodium.codium", name: "codium-flatpak", extra: "" }
- { app: "com.google.AndroidStudio", name: "android-studio", extra: "" }
- { app: "io.dbeaver.DBeaverCommunity", name: "dbeaver", extra: "" }
- { app: "com.visualstudio.code-oss", name: "code-flatpak", extra: "" }
- { app: "org.gnome.Boxes", name: "boxes", extra: "" }
flatpaks_editing_video:
- { app: "org.shotcut.Shotcut", name: "shotcut", extra: "" }
- { app: "com.obsproject.Studio", name: "obs", extra: "" }
@@ -57,6 +62,7 @@
- { app: "org.tenacityaudio.Tenacity", name: "tenacity", extra: "" }
- { app: "io.lmms.LMMS", name: "lmms", extra: "" }
- { app: "net.sourceforge.VMPK", name: "vmpk", extra: "" }
- { app: "org.musicbrainz.Picard", name: "picard", extra: "" }
flatpaks_gaming:
- { app: "com.valvesoftware.Steam", name: "steam", extra: "" }
- { app: "com.play0ad.zeroad", name: "zeroad", extra: "" }

View File

@@ -34,10 +34,10 @@
- name: Workstation | Linux | Software | Lutris | Add PPA (Debian)
shell: "{{ item }}"
loop:
- "wget -q -O- https://download.opensuse.org/repositories/home:/strycore/Debian_12/Release.key \
- "wget -q -O- https://download.opensuse.org/repositories/home:/strycore/Debian_13/Release.key \
| gpg --dearmor \
| sudo tee {{ lutris_keyfile }} > /dev/null"
- "echo 'deb [signed-by={{ lutris_keyfile }}] https://download.opensuse.org/repositories/home:/strycore/Debian_12/ ./' \
- "echo 'deb [signed-by={{ lutris_keyfile }}] https://download.opensuse.org/repositories/home:/strycore/Debian_13/ ./' \
| sudo tee {{ lutris_source_list }} > /dev/null"
- "sudo apt update"
when: ansible_distribution in ("Debian") and gaming == true and not lutris_source_exists.stat.exists

View File

@@ -40,6 +40,7 @@
- "{{ evolution }}*"
- gparted
- hugo
- wireless-tools
state: present
- name: Workstation | Linux | Software | Packages | GS Connect (KDE Connect, Android Tool)

View File

@@ -0,0 +1,21 @@
# TBD:
# - Decide whether this should be added to local.yml since wall does not work with gnome-terminal.
---
- name: Workstation | Shared | Cron | Root | Shutdown Warnings
cron:
user: root
name: "Shutdown Warnings"
minute: "*"
hour: "19-23"
job: /usr/bin/wall "Shutting down soon! Please save your work!" && /usr/sbin/shutdown --show
state: present
- name: Workstation | Shared | Cron | Root | Shutdown
cron:
user: root
name: "Shutdown"
minute: "*/5"
hour: "20-23"
job: /usr/sbin/shutdown -h 4
state: present

View File

@@ -21,6 +21,7 @@
, 'com.valvesoftware.Steam.desktop'
, 'net.lutris.Lutris.desktop'
, 'mullvad-vpn.desktop'
, 'network.loki.Session.desktop'
, 'org.signal.Signal.desktop', 'signal-desktop.desktop'
, 'org.telegram.desktop.desktop'
, 'com.discordapp.Discord.desktop'
@@ -172,6 +173,7 @@
# End block for Dash To Dock.
# Apply dconf settings through RC files due to distros without working psutil.
# Use the command 'dconf watch /' then change settings to see find these values.
- name: Workstation | Account Management | GNOME | Settings
blockinfile:
path: "{{ user_user.home }}/{{ item }}"
@@ -215,7 +217,7 @@
dconf write /org/gnome/mutter/center-new-windows true && inc_dconf &&
dconf write /org/gnome/desktop/notifications/show-banners false && inc_dconf &&
dconf write /org/gnome/desktop/notifications/show-banners true && inc_dconf &&
dconf write /org/gnome/desktop/notifications/application/org-gnome-evolution-alarm-notify/enable-sound-alerts false && inc_dconf &&
dconf write /org/gnome/desktop/notifications/application/org-gnome-evolution-alarm-notify/enable false && inc_dconf &&
dconf write /org/gnome/desktop/notifications/application/org-gnome-evolution/enable-sound-alerts false && inc_dconf &&
@@ -281,6 +283,66 @@
#/org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/preserve-working-directory
#'never'
## Wellbeing ##
dconf write /org/gnome/desktop/screen-time-limits/daily-limit-enabled \
true && inc_dconf &&
dconf write /org/gnome/desktop/screen-time-limits/daily-limit-seconds \
"uint32 21600" && inc_dconf &&
dconf write /org/gnome/desktop/screen-time-limits/grayscale \
true && inc_dconf &&
dconf write /org/gnome/desktop/screen-time-limits/history-enabled \
true && inc_dconf &&
#dconf write /org/gnome/desktop/break-reminders/selected-breaks \
# "['eyesight', 'movement']" && inc_dconf &&
#dconf write /org/gnome/desktop/break-reminders/selected-breaks \
# "['movement']" && inc_dconf &&
dconf write /org/gnome/desktop/break-reminders/selected-breaks \
"@as []" && inc_dconf &&
dconf write /org/gnome/desktop/break-reminders/eyesight/duration-seconds \
"uint32 180" && inc_dconf &&
dconf write /org/gnome/desktop/break-reminders/eyesight/interval-seconds \
"uint32 1800" && inc_dconf &&
dconf write /org/gnome/desktop/break-reminders/eyesight/countdown \
false && inc_dconf &&
dconf write /org/gnome/desktop/break-reminders/eyesight/delay-seconds \
"uint32 180" && inc_dconf &&
dconf write /org/gnome/desktop/break-reminders/eyesight/fade-screen \
true && inc_dconf &&
dconf write /org/gnome/desktop/break-reminders/eyesight/notify \
false && inc_dconf &&
dconf write /org/gnome/desktop/break-reminders/eyesight/notify-overdue \
false && inc_dconf &&
dconf write /org/gnome/desktop/break-reminders/eyesight/notify-upcoming \
false && inc_dconf &&
dconf write /org/gnome/desktop/break-reminders/eyesight/play-sound \
false && inc_dconf &&
dconf write /org/gnome/desktop/break-reminders/eyesight/interval-seconds \
"uint32 1800" && inc_dconf &&
dconf write /org/gnome/desktop/break-reminders/movement/duration-seconds \
"uint32 180" && inc_dconf &&
dconf write /org/gnome/desktop/break-reminders/movement/interval-seconds \
"uint32 1800" && inc_dconf &&
dconf write /org/gnome/desktop/break-reminders/movement/countdown \
false && inc_dconf &&
dconf write /org/gnome/desktop/break-reminders/movement/delay-seconds \
"uint32 60" && inc_dconf &&
dconf write /org/gnome/desktop/break-reminders/movement/fade-screen \
false && inc_dconf &&
dconf write /org/gnome/desktop/break-reminders/movement/notify \
false && inc_dconf &&
dconf write /org/gnome/desktop/break-reminders/movement/notify-overdue \
false && inc_dconf &&
dconf write /org/gnome/desktop/break-reminders/movement/notify-upcoming \
false && inc_dconf &&
dconf write /org/gnome/desktop/break-reminders/movement/play-sound \
false && inc_dconf &&
## Success ##
sleep 0 ||