Compare commits
39 Commits
main
...
2b7447ba26
| Author | SHA1 | Date | |
|---|---|---|---|
| 2b7447ba26 | |||
| e0bb2b3c66 | |||
| e70fdaabd5 | |||
| 4522811da1 | |||
| ec22eacbdb | |||
| 4031be218c | |||
| e280bd7a49 | |||
| 2954ce5af9 | |||
| cd7a290d61 | |||
| 89982bae39 | |||
| 9327ed23ac | |||
| 79a2c832b4 | |||
| 6a36811590 | |||
| 2e0dd78f68 | |||
| 861a9c6257 | |||
| 210e409428 | |||
| 44039bbd1b | |||
| a1bbcdc804 | |||
| 22a74506fd | |||
| 5d7318ec32 | |||
| cf676808c9 | |||
| 66ca4dcb98 | |||
| ea1716957b | |||
| 2e560c9f2b | |||
| c21d7415f5 | |||
| e3c61c5bcd | |||
| af3c665a43 | |||
| 8b52914683 | |||
| b3e9f7584f | |||
| 1a2572870f | |||
| d32c913a40 | |||
| b8fa688e52 | |||
| ea3ce8d023 | |||
| dd7325da39 | |||
| 195c315714 | |||
| b91b43b56d | |||
| a64f2253b6 | |||
| 7f21a0fc7b | |||
| 87aca38811 |
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
# Define file, folder, and other facts per OS.
|
# Define file, folder, and other facts per OS.
|
||||||
|
|
||||||
- name: General | Facts | System | Global
|
- name: General | Facts | System | Global [1/2]
|
||||||
set_fact:
|
set_fact:
|
||||||
lynis_install_dir: /usr/local/src/lynis
|
lynis_install_dir: /usr/local/src/lynis
|
||||||
dwm_install_dir: /usr/local/src/dwm
|
dwm_install_dir: /usr/local/src/dwm
|
||||||
@@ -10,7 +10,11 @@
|
|||||||
x_desktops: /usr/share/xsessions
|
x_desktops: /usr/share/xsessions
|
||||||
git_repo_http: https://{{ git_host }}/{{ git_user }}/{{ git_project }}
|
git_repo_http: https://{{ git_host }}/{{ git_user }}/{{ git_project }}
|
||||||
git_repo_ssh: ssh://git@{{ git_host }}:{{ git_ssh_port }}/{{ 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
|
- name: General | Facts | System | Linux
|
||||||
set_fact:
|
set_fact:
|
||||||
|
|||||||
@@ -12,12 +12,16 @@ if [[ -z "$HOSTNAME" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
EXTRA="$1"
|
EXTRA="$1"
|
||||||
TAG="System"
|
|
||||||
DATE="`date "+%Y%m%d-%H%M%S"`"
|
DATE="`date "+%Y%m%d-%H%M%S"`"
|
||||||
BACKUP_DIR="/srv/backup"
|
BACKUP_DIR="/srv/backup"
|
||||||
BASENAME="Backup"
|
BASENAME="Backup"
|
||||||
|
|
||||||
|
TAG="System"
|
||||||
BACKUP="$BACKUP_DIR/$BASENAME.$DATE.$HOSTNAME.$TAG.zip"
|
BACKUP="$BACKUP_DIR/$BASENAME.$DATE.$HOSTNAME.$TAG.zip"
|
||||||
|
|
||||||
|
TAG2="Data"
|
||||||
|
BACKUP2="${BACKUP//$TAG/$TAG2}"
|
||||||
|
|
||||||
## Initialization ##
|
## Initialization ##
|
||||||
|
|
||||||
echo "*** Creating Backup Directory ***"
|
echo "*** Creating Backup Directory ***"
|
||||||
@@ -31,15 +35,19 @@ sudo chown -Rv root:root "$BACKUP_DIR"
|
|||||||
echo "*** Removing Old Backups ***"
|
echo "*** Removing Old Backups ***"
|
||||||
cd "$BACKUP_DIR"
|
cd "$BACKUP_DIR"
|
||||||
sudo mv -v "$BASENAME"*"$TAG"* TRASH/
|
sudo mv -v "$BASENAME"*"$TAG"* TRASH/
|
||||||
|
sudo mv -v "$BASENAME"*"$TAG2"* TRASH/
|
||||||
sudo rm -v TRASH/*
|
sudo rm -v TRASH/*
|
||||||
|
|
||||||
## Main
|
## Main
|
||||||
|
|
||||||
|
# System Backup
|
||||||
|
|
||||||
echo "*** Creating backup at '$BACKUP' ***"
|
echo "*** Creating backup at '$BACKUP' ***"
|
||||||
sudo zip -rv "$BACKUP" \
|
sudo zip -rv "$BACKUP" \
|
||||||
/etc /var/{log,mail,spool} /srv /boot \
|
/etc /var/{log,mail,spool} /srv /boot \
|
||||||
/usr/local/etc $EXTRA \
|
/usr/local/etc $EXTRA \
|
||||||
-x "/srv/backup/*" -x "/srv/sftp/*"
|
-x "/srv/backup/*" -x "/srv/sftp/*" \
|
||||||
|
-x "*/.gradle/" -x "*/app/build/*"
|
||||||
status="$?"
|
status="$?"
|
||||||
|
|
||||||
if [[ "$status" != 0 ]]; then
|
if [[ "$status" != 0 ]]; then
|
||||||
@@ -54,4 +62,27 @@ else
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
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
|
exit 0
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# 2023-12-04 Hyperling
|
# 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
|
# Also see: compress-video.sh
|
||||||
|
|
||||||
## Setup ##
|
## Setup ##
|
||||||
@@ -36,7 +36,8 @@ function usage() {
|
|||||||
Compress audio to mp3. Can handle folders and work recursively.
|
Compress audio to mp3. Can handle folders and work recursively.
|
||||||
|
|
||||||
Parameters:
|
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.
|
-l LOCATION : The specific media or folder which needs compressed.
|
||||||
-r : Recursively shrink media based on the location passed.
|
-r : Recursively shrink media based on the location passed.
|
||||||
-f : Force the media to be shrunk even if a file already exists for it.
|
-f : Force the media to be shrunk even if a file already exists for it.
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ size=2000
|
|||||||
|
|
||||||
# Strings
|
# Strings
|
||||||
tag="shrunk"
|
tag="shrunk"
|
||||||
|
use_tag="Y"
|
||||||
date_YYYYMMDD="`date "+%Y%m%d"`"
|
date_YYYYMMDD="`date "+%Y%m%d"`"
|
||||||
location="."
|
location="."
|
||||||
search="ls"
|
search="ls"
|
||||||
@@ -28,7 +29,7 @@ function usage() {
|
|||||||
# Parameters:
|
# Parameters:
|
||||||
# 1) The exit status to use.
|
# 1) The exit status to use.
|
||||||
status=$1
|
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
|
cat <<- EOF
|
||||||
Compress JPG or PNG image(s). Can handle folders and work recursively.
|
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.
|
-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.
|
-d : Delete the original image if the compressed image is smaller.
|
||||||
-c : Clean the filename of underscores, dashes, 'IMG', etc.
|
-c : Clean the filename of underscores, dashes, 'IMG', etc.
|
||||||
|
-e | -t : Format timestamp to the expanded model.
|
||||||
-A : Resursively Force, Delete, and Clean.
|
-A : Resursively Force, Delete, and Clean.
|
||||||
-h : Display this usage text.
|
-h : Display this usage text.
|
||||||
-x : Enable BASH debugging.
|
-x : Enable BASH debugging.
|
||||||
-t : Format timestamp.
|
-n : No file extension.
|
||||||
EOF
|
EOF
|
||||||
exit $status
|
exit $status
|
||||||
}
|
}
|
||||||
|
|
||||||
## Parameters ##
|
## Parameters ##
|
||||||
|
|
||||||
while getopts ":s:l:rfFdcAhxt" opt; do
|
while getopts ":s:l:rfFdcetAhxn" opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
s) in_size="$OPTARG" && size="$in_size" ;;
|
s) in_size="$OPTARG" && size="$in_size" ;;
|
||||||
l) location="$OPTARG" ;;
|
l) location="$OPTARG" ;;
|
||||||
@@ -62,10 +64,11 @@ while getopts ":s:l:rfFdcAhxt" opt; do
|
|||||||
d) delete="Y" ;;
|
d) delete="Y" ;;
|
||||||
c) clean="Y" ;;
|
c) clean="Y" ;;
|
||||||
e) expand="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 ;;
|
h) usage 0 ;;
|
||||||
x) set -x ;;
|
x) set -x ;;
|
||||||
t) format_time="Y" ;;
|
n) use_tag="N" ;;
|
||||||
*) echo "ERROR: Option $OPTARG not recognized." >&2 && usage 1 ;;
|
*) echo "ERROR: Option $OPTARG not recognized." >&2 && usage 1 ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
@@ -114,6 +117,12 @@ $search "$location" | sort | while read image; do
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
new_image="${image//.$extension/}.$tag-$date_YYYYMMDD.$size.$extension"
|
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 ##
|
## Clean Filename ##
|
||||||
# Prevent directory from having its name cleaned too.
|
# Prevent directory from having its name cleaned too.
|
||||||
@@ -132,9 +141,7 @@ $search "$location" | sort | while read image; do
|
|||||||
# Date Data
|
# Date Data
|
||||||
new_image_exp="${TEMP:0:4}-${TEMP:4:2}-${TEMP:6:2}"
|
new_image_exp="${TEMP:0:4}-${TEMP:4:2}-${TEMP:6:2}"
|
||||||
# Time Data
|
# Time Data
|
||||||
if [[ "$format_time" == "Y" ]]; then
|
|
||||||
new_image_exp="${new_image_exp}_${TEMP:8:2}-${TEMP:10:2}-${TEMP:12:2}"
|
new_image_exp="${new_image_exp}_${TEMP:8:2}-${TEMP:10:2}-${TEMP:12:2}"
|
||||||
fi
|
|
||||||
# Remainder Data
|
# Remainder Data
|
||||||
if [[ "${TEMP:14:1}" == "." ]]; then
|
if [[ "${TEMP:14:1}" == "." ]]; then
|
||||||
SEP=""
|
SEP=""
|
||||||
@@ -156,7 +163,7 @@ $search "$location" | sort | while read image; do
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Skip if a compressed image was already created today.
|
# 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."
|
echo " SKIP: Image has already been shrunk previously, moving on."
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|||||||
1
setup.sh
1
setup.sh
@@ -130,6 +130,7 @@ echo "Installed!"
|
|||||||
if [[ "$show_facts" == "Y" ]]; then
|
if [[ "$show_facts" == "Y" ]]; then
|
||||||
echo "Showing Ansible Facts"
|
echo "Showing Ansible Facts"
|
||||||
ansible localhost -m setup --connection=local
|
ansible localhost -m setup --connection=local
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#echo "Adding Ansible Collections..."
|
#echo "Adding Ansible Collections..."
|
||||||
|
|||||||
@@ -101,22 +101,48 @@
|
|||||||
; Slows down the rate of services such as telegraf and cron.
|
; Slows down the rate of services such as telegraf and cron.
|
||||||
; Default: false
|
; Default: false
|
||||||
;
|
;
|
||||||
;;;;;;;;;;;;;;;;;;;; Server Shortcut ;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;; Server Shortcuts ;;;;;;;;;;;;;;;;;;;;
|
||||||
;
|
;
|
||||||
; For typing `prod` and getting straight to a server, like in env-termux.
|
; 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
|
; Example: myserver.com, mywebhost.net
|
||||||
; Default: hyperling.com
|
; 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
|
; Example: 22, 222, 2222
|
||||||
; Default: 22
|
; 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
|
; Example: jim, bob, jeff, anne
|
||||||
; Default: user
|
; 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]
|
[global]
|
||||||
marker: '; {mark} MANAGED BY ANSIBLE | Generic Config'
|
marker: '; {mark} MANAGED BY ANSIBLE | Generic Config'
|
||||||
state: present
|
state: present
|
||||||
@@ -143,6 +169,15 @@
|
|||||||
prod_host: "{{ lookup('ini', 'prod_host file={{gen_file}} default=hyperling.com') }}"
|
prod_host: "{{ lookup('ini', 'prod_host file={{gen_file}} default=hyperling.com') }}"
|
||||||
prod_port: "{{ lookup('ini', 'prod_port file={{gen_file}} default=22') }}"
|
prod_port: "{{ lookup('ini', 'prod_port file={{gen_file}} default=22') }}"
|
||||||
prod_user: "{{ lookup('ini', 'prod_user file={{gen_file}} default=user') }}"
|
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
|
- name: General | Account Management | Provisioning Configuration | General | List
|
||||||
set_fact:
|
set_fact:
|
||||||
@@ -166,6 +201,10 @@
|
|||||||
- { 'prod_host': "{{ prod_host }}" }
|
- { 'prod_host': "{{ prod_host }}" }
|
||||||
- { 'prod_port': "{{ prod_port }}" }
|
- { 'prod_port': "{{ prod_port }}" }
|
||||||
- { 'prod_user': "{{ prod_user }}" }
|
- { '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 ##
|
## Workstation ##
|
||||||
@@ -223,6 +262,11 @@
|
|||||||
mobile: "{{ lookup('ini', 'mobile file={{wrk_file}} default=false') | bool }}"
|
mobile: "{{ lookup('ini', 'mobile file={{wrk_file}} default=false') | bool }}"
|
||||||
redmode: "{{ lookup('ini', 'redmode file={{wrk_file}} default=true' ) | 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
|
- name: General | Account Management | Provisioning Configuration | Workstation | List
|
||||||
set_fact:
|
set_fact:
|
||||||
provision_variables: "{{ provision_variables | combine(item) }}"
|
provision_variables: "{{ provision_variables | combine(item) }}"
|
||||||
|
|||||||
@@ -127,7 +127,7 @@
|
|||||||
alias_cp: alias cp='cp -v'
|
alias_cp: alias cp='cp -v'
|
||||||
alias_mv: alias mv='mv -v'
|
alias_mv: alias mv='mv -v'
|
||||||
alias_rm: alias rm='echo "Use mv ~/TRASH/ instead!"'
|
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_wttr: |
|
||||||
function weather() {
|
function weather() {
|
||||||
# 20210301 - Someone showed me an awesome weather API! Had to implement it!
|
# 20210301 - Someone showed me an awesome weather API! Had to implement it!
|
||||||
@@ -145,7 +145,39 @@
|
|||||||
fi
|
fi
|
||||||
curl "https://wttr.in/${1//\ /+}"
|
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: |
|
||||||
alias remount='
|
alias remount='
|
||||||
sudo umount /mnt/*
|
sudo umount /mnt/*
|
||||||
@@ -259,6 +291,7 @@
|
|||||||
}
|
}
|
||||||
function goodbye {
|
function goodbye {
|
||||||
update -yg
|
update -yg
|
||||||
|
bye
|
||||||
}
|
}
|
||||||
metasploit_aliases: |
|
metasploit_aliases: |
|
||||||
alias metasploit="msfconsole"
|
alias metasploit="msfconsole"
|
||||||
@@ -686,8 +719,6 @@
|
|||||||
done
|
done
|
||||||
echo -e "\nDone!\n"
|
echo -e "\nDone!\n"
|
||||||
}
|
}
|
||||||
alias_clone: |
|
|
||||||
alias clone="rsync -auPhz --delete --exclude '.gradle' --exclude 'app/build'"
|
|
||||||
export_hyperling: |
|
export_hyperling: |
|
||||||
export HYPERLING6="2a07:e03:3:80::1"
|
export HYPERLING6="2a07:e03:3:80::1"
|
||||||
export HYPERLING4="185.130.47.173"
|
export HYPERLING4="185.130.47.173"
|
||||||
@@ -699,6 +730,19 @@
|
|||||||
fi
|
fi
|
||||||
alias_scan: |
|
alias_scan: |
|
||||||
alias scan="nmap -A -p- --script=vuln"
|
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: |
|
||||||
alias prod="ssh -p {{ prod_port }} {{ prod_user }}@{{ prod_host }}"
|
alias prod="ssh -p {{ prod_port }} {{ prod_user }}@{{ prod_host }}"
|
||||||
function_clean_code: |
|
function_clean_code: |
|
||||||
@@ -779,10 +823,6 @@
|
|||||||
alias chmod='chmod -c'
|
alias chmod='chmod -c'
|
||||||
alias_iftop: |
|
alias_iftop: |
|
||||||
alias iftop='sudo iftop'
|
alias iftop='sudo iftop'
|
||||||
alias_ls: |
|
|
||||||
alias l='ls'
|
|
||||||
alias ll='ls -alh'
|
|
||||||
alias lh='ls -ash'
|
|
||||||
alias_progs: |
|
alias_progs: |
|
||||||
alias progs='ps -ef'
|
alias progs='ps -ef'
|
||||||
alias_nethogs: |
|
alias_nethogs: |
|
||||||
@@ -1063,6 +1103,19 @@
|
|||||||
status="$?"
|
status="$?"
|
||||||
return "$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
|
- name: General | Account Management | Users | Files | Common Variable
|
||||||
set_fact:
|
set_fact:
|
||||||
@@ -1083,6 +1136,7 @@
|
|||||||
export domain="{{ domain }}"
|
export domain="{{ domain }}"
|
||||||
|
|
||||||
{{ export_path_additions }}
|
{{ export_path_additions }}
|
||||||
|
{{ source_shared }}
|
||||||
{{ alias_cp }}
|
{{ alias_cp }}
|
||||||
{{ alias_mv }}
|
{{ alias_mv }}
|
||||||
{{ alias_rm }}
|
{{ alias_rm }}
|
||||||
@@ -1116,10 +1170,10 @@
|
|||||||
{{ function_code_reseed }}
|
{{ function_code_reseed }}
|
||||||
{{ function_clean_filenames }}
|
{{ function_clean_filenames }}
|
||||||
{{ function_clean_filenames_tree }}
|
{{ function_clean_filenames_tree }}
|
||||||
{{ alias_clone }}
|
|
||||||
{{ export_hyperling }}
|
{{ export_hyperling }}
|
||||||
{{ source_docker_env }}
|
{{ source_docker_env }}
|
||||||
{{ alias_scan }}
|
{{ alias_scan }}
|
||||||
|
{{ export_prod }}
|
||||||
{{ alias_prod }}
|
{{ alias_prod }}
|
||||||
{{ function_clean_code }}
|
{{ function_clean_code }}
|
||||||
{{ alias_kill_battery }}
|
{{ alias_kill_battery }}
|
||||||
@@ -1128,7 +1182,6 @@
|
|||||||
{{ function_ansible_vars }}
|
{{ function_ansible_vars }}
|
||||||
{{ alias_permission_commands }}
|
{{ alias_permission_commands }}
|
||||||
{{ alias_iftop }}
|
{{ alias_iftop }}
|
||||||
{{ alias_ls }}
|
|
||||||
{{ alias_progs }}
|
{{ alias_progs }}
|
||||||
{{ alias_nethogs }}
|
{{ alias_nethogs }}
|
||||||
{{ alias_ansible_facts }}
|
{{ alias_ansible_facts }}
|
||||||
@@ -1146,6 +1199,7 @@
|
|||||||
{{ alias_docker_other }}
|
{{ alias_docker_other }}
|
||||||
{{ alias_flatpak_clean }}
|
{{ alias_flatpak_clean }}
|
||||||
{{ alias_commit }}
|
{{ alias_commit }}
|
||||||
|
{{ function_loop }}
|
||||||
|
|
||||||
- name: General | Account Management | Users | Files | .bashrc
|
- name: General | Account Management | Users | Files | .bashrc
|
||||||
blockinfile:
|
blockinfile:
|
||||||
@@ -1219,6 +1273,7 @@
|
|||||||
|
|
||||||
- name: General | Account Management | Users | Files | Helper Functions (Reset)
|
- name: General | Account Management | Users | Files | Helper Functions (Reset)
|
||||||
shell: "rm -v {{ global_bin }}/*.function"
|
shell: "rm -v {{ global_bin }}/*.function"
|
||||||
|
ignore_errors: yes
|
||||||
|
|
||||||
- name: General | Account Management | Users | Files | Helper Functions
|
- name: General | Account Management | Users | Files | Helper Functions
|
||||||
copy:
|
copy:
|
||||||
@@ -1229,3 +1284,36 @@
|
|||||||
mode: 0755
|
mode: 0755
|
||||||
with_fileglob:
|
with_fileglob:
|
||||||
- "functions/*.function"
|
- "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 | Permissions
|
||||||
|
file:
|
||||||
|
path: "{{ user_user.home }}/{{ item }}"
|
||||||
|
owner: "{{ user }}"
|
||||||
|
mode: '0755'
|
||||||
|
loop:
|
||||||
|
- .rc_shared
|
||||||
|
ignore_errors: yes
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
- { app: "com.transmissionbt.Transmission", name: "transmission", extra: "" }
|
- { app: "com.transmissionbt.Transmission", name: "transmission", extra: "" }
|
||||||
- { app: "app.grayjay.Grayjay", name: "grayjay", extra: "" }
|
- { app: "app.grayjay.Grayjay", name: "grayjay", extra: "" }
|
||||||
- { app: "com.github.xournalpp.xournalpp", name: "xournal", extra: "" }
|
- { app: "com.github.xournalpp.xournalpp", name: "xournal", extra: "" }
|
||||||
|
- { app: "network.loki.Session", name: "session", extra: "" } # TBD: Needs run like "flatpak run --socket=wayland network.loki.Session" on some systems.
|
||||||
flatpaks_coding:
|
flatpaks_coding:
|
||||||
- { app: "com.vscodium.codium", name: "codium-flatpak", extra: "" }
|
- { app: "com.vscodium.codium", name: "codium-flatpak", extra: "" }
|
||||||
- { app: "com.google.AndroidStudio", name: "android-studio", extra: "" }
|
- { app: "com.google.AndroidStudio", name: "android-studio", extra: "" }
|
||||||
@@ -57,6 +58,7 @@
|
|||||||
- { app: "org.tenacityaudio.Tenacity", name: "tenacity", extra: "" }
|
- { app: "org.tenacityaudio.Tenacity", name: "tenacity", extra: "" }
|
||||||
- { app: "io.lmms.LMMS", name: "lmms", extra: "" }
|
- { app: "io.lmms.LMMS", name: "lmms", extra: "" }
|
||||||
- { app: "net.sourceforge.VMPK", name: "vmpk", extra: "" }
|
- { app: "net.sourceforge.VMPK", name: "vmpk", extra: "" }
|
||||||
|
- { app: "org.musicbrainz.Picard", name: "picard", extra: "" }
|
||||||
flatpaks_gaming:
|
flatpaks_gaming:
|
||||||
- { app: "com.valvesoftware.Steam", name: "steam", extra: "" }
|
- { app: "com.valvesoftware.Steam", name: "steam", extra: "" }
|
||||||
- { app: "com.play0ad.zeroad", name: "zeroad", extra: "" }
|
- { app: "com.play0ad.zeroad", name: "zeroad", extra: "" }
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
- "{{ evolution }}*"
|
- "{{ evolution }}*"
|
||||||
- gparted
|
- gparted
|
||||||
- hugo
|
- hugo
|
||||||
|
- wireless-tools
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Packages | GS Connect (KDE Connect, Android Tool)
|
- name: Workstation | Linux | Software | Packages | GS Connect (KDE Connect, Android Tool)
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
, 'com.valvesoftware.Steam.desktop'
|
, 'com.valvesoftware.Steam.desktop'
|
||||||
, 'net.lutris.Lutris.desktop'
|
, 'net.lutris.Lutris.desktop'
|
||||||
, 'mullvad-vpn.desktop'
|
, 'mullvad-vpn.desktop'
|
||||||
|
, 'network.loki.Session.desktop'
|
||||||
, 'org.signal.Signal.desktop', 'signal-desktop.desktop'
|
, 'org.signal.Signal.desktop', 'signal-desktop.desktop'
|
||||||
, 'org.telegram.desktop.desktop'
|
, 'org.telegram.desktop.desktop'
|
||||||
, 'com.discordapp.Discord.desktop'
|
, 'com.discordapp.Discord.desktop'
|
||||||
@@ -172,6 +173,7 @@
|
|||||||
# End block for Dash To Dock.
|
# End block for Dash To Dock.
|
||||||
|
|
||||||
# Apply dconf settings through RC files due to distros without working psutil.
|
# 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
|
- name: Workstation | Account Management | GNOME | Settings
|
||||||
blockinfile:
|
blockinfile:
|
||||||
path: "{{ user_user.home }}/{{ item }}"
|
path: "{{ user_user.home }}/{{ item }}"
|
||||||
@@ -215,7 +217,7 @@
|
|||||||
|
|
||||||
dconf write /org/gnome/mutter/center-new-windows true && inc_dconf &&
|
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-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-alarm-notify/enable false && inc_dconf &&
|
||||||
dconf write /org/gnome/desktop/notifications/application/org-gnome-evolution/enable-sound-alerts false && inc_dconf &&
|
dconf write /org/gnome/desktop/notifications/application/org-gnome-evolution/enable-sound-alerts false && inc_dconf &&
|
||||||
@@ -281,6 +283,20 @@
|
|||||||
#/org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/preserve-working-directory
|
#/org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/preserve-working-directory
|
||||||
#'never'
|
#'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/break-reminders/selected-breaks \
|
||||||
|
"['eyesight', 'movement']" && 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 &&
|
||||||
|
|
||||||
## Success ##
|
## Success ##
|
||||||
|
|
||||||
sleep 0 ||
|
sleep 0 ||
|
||||||
|
|||||||
Reference in New Issue
Block a user