Compare commits

..

10 Commits
main ... dev

7 changed files with 154 additions and 42 deletions

View File

@ -95,30 +95,39 @@
case $pkg_mgr in case $pkg_mgr in
apt) apt)
if [[ $distribution != "ParrotOS" ]]; then if [[ $distribution != "ParrotOS" ]]; then
echo "*** Apt ***" && echo -e "******* Apt *******\n*** Update Cache ***" &&
sudo apt update && sudo apt update &&
echo -e "\n*** Auto Remove ***" &&
sudo apt autoremove {{ update_accept_var }} && sudo apt autoremove {{ update_accept_var }} &&
echo -e "\n*** Clean ***" &&
sudo apt clean {{ update_accept_var }} && sudo apt clean {{ update_accept_var }} &&
echo -e "Cleaned!\n\n*** Configure DPKG ***" &&
sudo dpkg --configure -a && sudo dpkg --configure -a &&
echo -e "\n*** Fix Broken/Missing ***" &&
sudo apt --fix-broken --fix-missing install && sudo apt --fix-broken --fix-missing install &&
echo -e "\n*** Upgrade ***" &&
sudo apt dist-upgrade --allow-downgrades --fix-broken \ sudo apt dist-upgrade --allow-downgrades --fix-broken \
--fix-missing {{ update_accept_var }} || --fix-missing {{ update_accept_var }} ||
return 1 return 1
else else
echo "*** Parrot ***" echo -e "******* Parrot *******\n*** Update Cache ***" &&
sudo apt update && sudo apt update &&
echo -e "\n*** Auto Remove ***" &&
sudo apt autoremove {{ update_accept_var }} && sudo apt autoremove {{ update_accept_var }} &&
parrot_mirrors_suck=true && parrot_mirrors_suck=true &&
while [[ $parrot_mirrors_suck ]]; do while [[ $parrot_mirrors_suck ]]; do
unset parrot_mirrors_suck unset parrot_mirrors_suck
echo -e "\n*** Upgrade ***"
sudo parrot-upgrade sudo parrot-upgrade
if [[ $? != 0 ]]; then if [[ $? != 0 ]]; then
parrot_mirrors_suck=true parrot_mirrors_suck=true
echo -e "*** Update Cache, Again ***"
sudo apt update --fix-missing sudo apt update --fix-missing
fi fi
done || done ||
return 1 return 1
fi fi
echo -e "\n******* Mission Complete!! *******"
;; ;;
pacman) pacman)

View File

@ -35,11 +35,11 @@
; ;
; user : Provide the name of the user account. ; user : Provide the name of the user account.
; Example: tom, jerry, kim, sarah ; Example: tom, jerry, kim, sarah
; Default: ling ; Default: user
; ;
; user_desc : Provide the description of the user account. ; user_desc : Provide the description of the user account.
; Example: Thomas, Jerry, Kimberly, Sarah ; Example: Thomas, Jerry, Kimberly, Sarah
; Default: Hyperling ; Default: User
; ;
; sshd_port : Determine the port which SSHD should listen on. ; sshd_port : Determine the port which SSHD should listen on.
; Example: 12345 ; Example: 12345
@ -101,6 +101,22 @@
; 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 ;;;;;;;;;;;;;;;;;;;;
;
; For typing `prod` and getting straight to a server, like in env-termux.
;
; prod_host : Branch to use on this machine.
; Example: myserver.com, mywebhost.net
; Default: hyperling.com
;
; prod_port : Provide the git host that the machine should poll.
; Example: 22, 222, 2222
; Default: 22
;
; prod_user : Port of the server host to use for SSH requests.
; Example: jim, bob, jeff, anne
; Default: user
;
[global] [global]
marker: '; {mark} MANAGED BY ANSIBLE | Generic Config' marker: '; {mark} MANAGED BY ANSIBLE | Generic Config'
state: present state: present
@ -124,6 +140,9 @@
git_user: "{{ lookup('ini', 'git_user file={{gen_file}} default=me') }}" git_user: "{{ lookup('ini', 'git_user file={{gen_file}} default=me') }}"
git_project: "{{ lookup('ini', 'git_project file={{gen_file}} default=env-ansible') }}" git_project: "{{ lookup('ini', 'git_project file={{gen_file}} default=env-ansible') }}"
git_ssh_port: "{{ lookup('ini', 'git_ssh_port file={{gen_file}} default=22') }}" git_ssh_port: "{{ lookup('ini', 'git_ssh_port file={{gen_file}} default=22') }}"
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') }}"
- name: General | Account Management | Provisioning Configuration | General | List - name: General | Account Management | Provisioning Configuration | General | List
set_fact: set_fact:
@ -144,6 +163,9 @@
- { 'git_user': "{{ git_user }}" } - { 'git_user': "{{ git_user }}" }
- { 'git_project': "{{ git_project }}" } - { 'git_project': "{{ git_project }}" }
- { 'git_ssh_port': "{{ git_ssh_port }}" } - { 'git_ssh_port': "{{ git_ssh_port }}" }
- { 'prod_host': "{{ prod_host }}" }
- { 'prod_port': "{{ prod_port }}" }
- { 'prod_user': "{{ prod_user }}" }
## Workstation ## ## Workstation ##
@ -159,6 +181,10 @@
; coding : Set to true for installation of code editors (VSCode, PyCharm, Android Studio) ; coding : Set to true for installation of code editors (VSCode, PyCharm, Android Studio)
; ;
; editing : Set to true for installation of Audio/Video editors (Shotcut, Audacity, OBS Stdio, GIMP) ; editing : Set to true for installation of Audio/Video editors (Shotcut, Audacity, OBS Stdio, GIMP)
; Set to video for only the video related portions.
; - Shotcut, OpenShot, OBS Studio, etc.
; Set to audio for only the music related portions.
; - Audacity (or similar), LMMS, VMPK, etc.
; ;
; gaming : Set to true for installation of gaming software (Steam, Lutris) ; gaming : Set to true for installation of gaming software (Steam, Lutris)
; ;

View File

@ -281,16 +281,20 @@
unset OPTIND unset OPTIND
unset clean unset clean
unset network unset network
du_params="-ha"
while (( $# > 0 )); do while (( $# > 0 )); do
case $1 in case $1 in
-c | -y | --clean ) -c | -y | --clean )
clean="Y" ;; clean="Y" ;;
-n | -net | --network ) -n | -net | --network )
network="Y" ;; network="Y" ;;
-s | -sum | --summarize )
du_params="-sh" ;;
* ) * )
echo " echo "
ERROR: Option '$1' with value '$2' not recognized. ERROR: Option '$1' with value '$2' not recognized.
$PROG [-c|-y|--clean] [-n|-net|--network] $PROG [-c | -y | --clean] [-n | -net | --network] \
[-s | -sum | --summarize]
" >&2 " >&2
return 1 return 1
;; ;;
@ -318,8 +322,8 @@
echo "Checking $dir..." echo "Checking $dir..."
$sudo find $dir -name TRASH | while read trash; do $sudo find $dir -name TRASH | while read trash; do
if [[ "$trash" != "" && `$sudo ls -a $trash` ]]; then if [[ "$trash" != "" && `$sudo ls -a $trash` ]]; then
echo "Found $trash with contents:" echo "Found $trash:"
$sudo du -ha $trash | sort -h $sudo du $du_params $trash | sort -h
if [[ "$clean" == "Y" ]]; then if [[ "$clean" == "Y" ]]; then
echo "Cleaning trash..." echo "Cleaning trash..."
$sudo sh -c "cd $trash; rm -rfv ..?* .[!.]* *" $sudo sh -c "cd $trash; rm -rfv ..?* .[!.]* *"
@ -328,8 +332,8 @@
done done
$sudo find $dir $maxdepth -name "*"Trash"*" | while read trash; do $sudo find $dir $maxdepth -name "*"Trash"*" | while read trash; do
if [[ "$trash" != "" && `$sudo ls -a $trash` ]]; then if [[ "$trash" != "" && `$sudo ls -a $trash` ]]; then
echo "Found $trash with contents:" echo "Found $trash:"
$sudo du -ha $trash | sort -h $sudo du $du_params $trash | sort -h
if [[ "$clean" == "Y" ]]; then if [[ "$clean" == "Y" ]]; then
echo "Cleaning trash..." echo "Cleaning trash..."
$sudo sh -c "cd $trash; rm -rfv ..?* .[!.]* *" $sudo sh -c "cd $trash; rm -rfv ..?* .[!.]* *"
@ -345,8 +349,8 @@
echo "Checking $dir..." echo "Checking $dir..."
sudo find $dir -name TRASH | while read trash; do sudo find $dir -name TRASH | while read trash; do
if [[ "$trash" != "" && `sudo ls -a $trash` ]]; then if [[ "$trash" != "" && `sudo ls -a $trash` ]]; then
echo "Found $trash with contents:" echo "Found $trash:"
sudo du -ha $trash | sort -h sudo du $du_params $trash | sort -h
if [[ "$clean" == "Y" ]]; then if [[ "$clean" == "Y" ]]; then
echo "Cleaning trash..." echo "Cleaning trash..."
sudo sh -c "cd $trash; rm -rfv ..?* .[!.]* *" sudo sh -c "cd $trash; rm -rfv ..?* .[!.]* *"
@ -355,8 +359,8 @@
done done
sudo find $dir -name .Trash"*" | while read trash; do sudo find $dir -name .Trash"*" | while read trash; do
if [[ "$trash" != "" && `sudo ls -a $trash` ]]; then if [[ "$trash" != "" && `sudo ls -a $trash` ]]; then
echo "Found $trash with contents:" echo "Found $trash:"
sudo du -ha $trash | sort -h sudo du $du_params $trash | sort -h
if [[ "$clean" == "Y" ]]; then if [[ "$clean" == "Y" ]]; then
echo "Cleaning trash..." echo "Cleaning trash..."
sudo sh -c "cd $trash; rm -rfv ..?* .[!.]* *" sudo sh -c "cd $trash; rm -rfv ..?* .[!.]* *"
@ -543,7 +547,7 @@
echo -e "\nDone!\n" echo -e "\nDone!\n"
} }
alias_clone: | alias_clone: |
alias clone="rsync -auPhz --delete" 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"
@ -555,6 +559,20 @@
fi fi
alias_scan: | alias_scan: |
alias scan="nmap -A -p- --script=vuln" alias scan="nmap -A -p- --script=vuln"
alias_prod: |
alias prod="ssh -p {{ prod_port }} {{ prod_user }}@{{ prod_host }}"
function_clean_code: |
function clean-code {
echo -e "******* Android *******\n*** Build Caches ***"
find ~/Code/android-*/app -maxdepth 1 -type d -name "build" \
-exec du -hs {} \; -exec rm -rf {} \;
echo -e "\n*** Gradle Caches ***"
find ~/Code/android-*/ -maxdepth 1 -type d -name ".gradle" \
-exec du -hs {} \; -exec rm -rf {} \;
echo -e "\n*** Done! ***"
}
alias code-clean="clean-code"
- name: General | Account Management | Users | Files | Common Variable - name: General | Account Management | Users | Files | Common Variable
set_fact: set_fact:
@ -596,6 +614,8 @@
{{ export_hyperling }} {{ export_hyperling }}
{{ source_docker_env }} {{ source_docker_env }}
{{ alias_scan }} {{ alias_scan }}
{{ alias_prod }}
{{ function_clean_code }}
- name: General | Account Management | Users | Files | .bashrc - name: General | Account Management | Users | Files | .bashrc
blockinfile: blockinfile:

View File

@ -44,7 +44,7 @@
- shotcut - shotcut
- obs-studio - obs-studio
state: present state: present
when: editing == true when: editing in (true, "video")
- name: Workstation | FreeBSD | Software | Packages | Editing | Install - name: Workstation | FreeBSD | Software | Packages | Editing | Install
package: package:
@ -53,7 +53,7 @@
- shotcut - shotcut
- obs-studio - obs-studio
state: absent state: absent
when: not editing == true when: not editing in (true, "video")
# Gaming # # Gaming #

View File

@ -40,17 +40,18 @@
- { app: "org.signal.Signal", name: "signal", extra: "" } - { app: "org.signal.Signal", name: "signal", extra: "" }
- { app: "org.mozilla.firefox", name: "firefox-flatpak", extra: "" } - { app: "org.mozilla.firefox", name: "firefox-flatpak", extra: "" }
- { app: "com.transmissionbt.Transmission", name: "transmission", extra: "" } - { app: "com.transmissionbt.Transmission", name: "transmission", extra: "" }
- { app: "org.gimp.GIMP", name: "gimp", extra: "" }
flatpaks_coding: flatpaks_coding:
- { app: "com.vscodium.codium", name: "codium", extra: "" } - { app: "com.vscodium.codium", name: "codium", extra: "" }
- { app: "com.google.AndroidStudio", name: "android-studio", extra: "" } - { app: "com.google.AndroidStudio", name: "android-studio", extra: "" }
- { app: "io.dbeaver.DBeaverCommunity", name: "dbeaver", extra: "" } - { app: "io.dbeaver.DBeaverCommunity", name: "dbeaver", extra: "" }
- { app: "org.godotengine.Godot", name: "godot", extra: "" } - { app: "org.godotengine.Godot", name: "godot", extra: "" }
- { app: "com.visualstudio.code-oss", name: "code", extra: "" } - { app: "com.visualstudio.code-oss", name: "code", extra: "" }
flatpaks_editing: flatpaks_editing_video:
- { app: "org.shotcut.Shotcut", name: "shotcut", extra: "" } - { app: "org.shotcut.Shotcut", name: "shotcut", extra: "" }
- { app: "com.obsproject.Studio", name: "obs", extra: "" } - { app: "com.obsproject.Studio", name: "obs", extra: "" }
- { app: "org.gimp.GIMP", name: "gimp", extra: "" }
- { app: "org.openshot.OpenShot", name: "openshot", extra: "" } - { app: "org.openshot.OpenShot", name: "openshot", extra: "" }
flatpaks_editing_audio:
- { 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: "" }
@ -158,14 +159,62 @@
# Media Editors # # Media Editors #
- name: Workstation | Linux | Flatpak Distro | Flatpak | Audio/Video Editors | Installs - name: Workstation | Linux | Flatpak Distro | Flatpak | Video Editors | Installs
flatpak: flatpak:
name: "{{ item.app }}" name: "{{ item.app }}"
remote: flathub remote: flathub
state: present state: present
loop: "{{ flatpaks_editing }}" loop: "{{ flatpaks_editing_video }}"
ignore_errors: yes ignore_errors: yes
when: editing == true when: editing in (true, "video")
- name: Workstation | Linux | Flatpak Distro | Flatpak | Video Editors | Executables
blockinfile:
path: "{{ flatpak_exec_dir }}/{{ item.name }}"
block: |
{{ item.extra }} {{ flatpak_exec }} {{ item.app }}
marker: '{mark}'
marker_begin: "#!{{ bash_exec.stdout }}"
marker_end: "exit 0"
state: present
create: yes
loop: "{{ flatpaks_editing_video }}"
become_user: "{{ user }}"
when: editing in (true, "video")
- name: Workstation | Linux | Flatpak Distro | Flatpak | Video Editors | Executable Permissions
file:
path: "{{ flatpak_exec_dir }}/{{ item.name }}"
state: file
mode: '0755'
loop: "{{ flatpaks_editing_video }}"
when: editing in (true, "video")
- name: Workstation | Linux | Flatpak Distro | Flatpak | Video Editor Uninstalls
flatpak:
name: "{{ item.app }}"
remote: flathub
state: absent
loop: "{{ flatpaks_editing_video }}"
ignore_errors: yes
when: not editing in (true, "video")
- name: Workstation | Linux | Flatpak Distro | Flatpak | Video Editors | Remove Executables
file:
path: "{{ flatpak_exec_dir }}/{{ item.name }}"
state: absent
loop: "{{ flatpaks_editing_video }}"
ignore_errors: yes
when: not editing in (true, "video")
- name: Workstation | Linux | Flatpak Distro | Flatpak | Audio Editors | Installs
flatpak:
name: "{{ item.app }}"
remote: flathub
state: present
loop: "{{ flatpaks_editing_audio }}"
ignore_errors: yes
when: editing in (true, "audio")
- name: Workstation | Linux | Flatpak Distro | Flatpak | Audio/Video Editors | Executables - name: Workstation | Linux | Flatpak Distro | Flatpak | Audio/Video Editors | Executables
blockinfile: blockinfile:
@ -177,34 +226,34 @@
marker_end: "exit 0" marker_end: "exit 0"
state: present state: present
create: yes create: yes
loop: "{{ flatpaks_editing }}" loop: "{{ flatpaks_editing_audio }}"
become_user: "{{ user }}" become_user: "{{ user }}"
when: editing == true when: editing in (true, "audio")
- name: Workstation | Linux | Flatpak Distro | Flatpak | Audio/Video Editors | Executable Permissions - name: Workstation | Linux | Flatpak Distro | Flatpak | Audio/Video Editors | Executable Permissions
file: file:
path: "{{ flatpak_exec_dir }}/{{ item.name }}" path: "{{ flatpak_exec_dir }}/{{ item.name }}"
state: file state: file
mode: '0755' mode: '0755'
loop: "{{ flatpaks_editing }}" loop: "{{ flatpaks_editing_audio }}"
when: editing == true when: editing in (true, "audio")
- name: Workstation | Linux | Flatpak Distro | Flatpak | Audio/Video Editor Uninstalls - name: Workstation | Linux | Flatpak Distro | Flatpak | Audio/Video Editor Uninstalls
flatpak: flatpak:
name: "{{ item.app }}" name: "{{ item.app }}"
remote: flathub remote: flathub
state: absent state: absent
loop: "{{ flatpaks_editing }}" loop: "{{ flatpaks_editing_audio }}"
ignore_errors: yes ignore_errors: yes
when: not editing == true when: not editing in (true, "audio")
- name: Workstation | Linux | Flatpak Distro | Flatpak | Audio/Video Editors | Remove Executables - name: Workstation | Linux | Flatpak Distro | Flatpak | Audio/Video Editors | Remove Executables
file: file:
path: "{{ flatpak_exec_dir }}/{{ item.name }}" path: "{{ flatpak_exec_dir }}/{{ item.name }}"
state: absent state: absent
loop: "{{ flatpaks_editing }}" loop: "{{ flatpaks_editing_audio }}"
ignore_errors: yes ignore_errors: yes
when: not editing == true when: not editing in (true, "audio")
# Gaming # # Gaming #

View File

@ -24,7 +24,7 @@
name: name:
- "{{ ffmpeg }}" - "{{ ffmpeg }}"
state: present state: present
when: editing == true when: editing in (true, "video", "audio")
## Other Stuff ## Other Stuff
@ -38,6 +38,8 @@
- "{{ appimagelauncher }}" - "{{ appimagelauncher }}"
- "{{ evolution }}" - "{{ evolution }}"
- "{{ evolution }}*" - "{{ evolution }}*"
- adb
- fastboot
state: present state: present
# Lutris # # Lutris #

View File

@ -22,13 +22,19 @@
status: present status: present
when: coding == true when: coding == true
- name: Workstation | Mac OS | Software | Brew | Install Packages (Editing) - name: Workstation | Mac OS | Software | Brew | Install Packages (Editing:Video)
package:
name:
- shotcut
status: present
when: editing in (true, "video")
- name: Workstation | Mac OS | Software | Brew | Install Packages (Editing:Audio)
package: package:
name: name:
- audacity - audacity
- shotcut
status: present status: present
when: editing == true when: editing in (true, "audio")
- name: Workstation | Mac OS | Software | Brew | Install Packages (Gaming) - name: Workstation | Mac OS | Software | Brew | Install Packages (Gaming)
package: package: