Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
544519bbfa | |||
1ab1594f6c | |||
ae4967bc04 | |||
0d72bc1ea9 | |||
de9c886af2 | |||
8033efce93 | |||
2d9317e9de | |||
b6066558e7 | |||
42306e4287 | |||
f3cb825981 | |||
1db8c0b7b0 | |||
116087928d | |||
b6e820570f |
@ -6,6 +6,7 @@
|
|||||||
set_fact:
|
set_fact:
|
||||||
sshfs: sshfs
|
sshfs: sshfs
|
||||||
tar: tar
|
tar: tar
|
||||||
|
iftop: iftop
|
||||||
|
|
||||||
- name: General | Facts | Packages | Parrot OS Fixes
|
- name: General | Facts | Packages | Parrot OS Fixes
|
||||||
set_fact:
|
set_fact:
|
||||||
|
@ -60,7 +60,8 @@ while getopts ":s:l:rfFdcAhx" opt; do
|
|||||||
F) super_force="Y" ;;
|
F) super_force="Y" ;;
|
||||||
d) delete="Y" ;;
|
d) delete="Y" ;;
|
||||||
c) clean="Y" ;;
|
c) clean="Y" ;;
|
||||||
A) recurse="Y" && search="find" && force="Y" && delete="Y" && clean="Y" ;;
|
e) expand="Y" ;;
|
||||||
|
A) recurse="Y" && search="find" && force="Y" && delete="Y" && expand="Y" ;;
|
||||||
h) usage 0 ;;
|
h) usage 0 ;;
|
||||||
x) set -x ;;
|
x) set -x ;;
|
||||||
*) echo "ERROR: Option $OPTARG not recognized." >&2 && usage 1 ;;
|
*) echo "ERROR: Option $OPTARG not recognized." >&2 && usage 1 ;;
|
||||||
@ -74,7 +75,7 @@ if [[ -n "$in_size" && "$size" != "$in_size" ]]; then
|
|||||||
usage 1
|
usage 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
convert_exe="`which convert`"
|
convert_exe="`which convert` -strip"
|
||||||
if [[ "$convert_exe" == "" ]]; then
|
if [[ "$convert_exe" == "" ]]; then
|
||||||
echo "ERROR: 'convert' command could not be found, "
|
echo "ERROR: 'convert' command could not be found, "
|
||||||
echo "please install 'imagemagick'."
|
echo "please install 'imagemagick'."
|
||||||
@ -123,13 +124,31 @@ $search "$location" | sort | while read image; do
|
|||||||
new_image_clean="${new_image_clean//-/}"
|
new_image_clean="${new_image_clean//-/}"
|
||||||
new_image_clean="${new_image_clean// /}"
|
new_image_clean="${new_image_clean// /}"
|
||||||
|
|
||||||
# Add directory back to the full path.
|
## Expanded Filename ##
|
||||||
|
# Add back in the dashes so that the year, month, date, and time are exposed.
|
||||||
|
TEMP="$new_image_clean"
|
||||||
|
# Date Data
|
||||||
|
new_image_exp="${TEMP:0:4}-${TEMP:4:2}-${TEMP:6:2}"
|
||||||
|
# Time Data
|
||||||
|
new_image_exp="${new_image_exp}_${TEMP:8:2}-${TEMP:10:2}-${TEMP:12:2}"
|
||||||
|
# Remainder Data
|
||||||
|
if [[ "${TEMP:14:1}" == "." ]]; then
|
||||||
|
SEP=""
|
||||||
|
else
|
||||||
|
SEP="_"
|
||||||
|
fi
|
||||||
|
new_image_exp="${new_image_exp}${SEP}${TEMP:14}"
|
||||||
|
unset TEMP SEP
|
||||||
|
|
||||||
|
# Add directory back to the full paths.
|
||||||
new_image_clean="$image_dirname/$new_image_clean"
|
new_image_clean="$image_dirname/$new_image_clean"
|
||||||
|
new_image_exp="$image_dirname/$new_image_exp"
|
||||||
|
|
||||||
# Delete the existing shrunk image if we are forcing a new compression.
|
# Delete the existing shrunk image if we are forcing a new compression.
|
||||||
if [[ -n "$force" && (-e "$new_image" || -e $new_image_clean) ]]; then
|
if [[ -n "$force" &&
|
||||||
|
(-e "$new_image" || -e $new_image_clean || -e $new_image_exp ) ]]; then
|
||||||
echo -n " FORCE: "
|
echo -n " FORCE: "
|
||||||
rm -v "$new_image" "$new_image_clean" 2>/dev/null
|
rm -v "$new_image" "$new_image_clean" "$new_image_exp" 2>/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Skip if a compressed image was already created today.
|
# Skip if a compressed image was already created today.
|
||||||
@ -138,10 +157,14 @@ $search "$location" | sort | while read image; do
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Whether or not to use the cleaned version or the normal version.
|
# Whether or not to use the cleaned version.
|
||||||
if [[ -n $clean ]]; then
|
if [[ -n $clean ]]; then
|
||||||
new_image="$new_image_clean"
|
new_image="$new_image_clean"
|
||||||
|
# Whether or not to use the expanded version.
|
||||||
|
elif [[ -n $expand ]]; then
|
||||||
|
new_image="$new_image_exp"
|
||||||
fi
|
fi
|
||||||
|
# Otherwise uses the same name as before.
|
||||||
|
|
||||||
###### TBD Instead of this, only alter the file names, and set a dirname var?
|
###### TBD Instead of this, only alter the file names, and set a dirname var?
|
||||||
#### Create a new directory if the directory names were altered.
|
#### Create a new directory if the directory names were altered.
|
||||||
|
@ -33,13 +33,13 @@ function usage {
|
|||||||
If nothing is provided, current directory (.) is assumed.
|
If nothing is provided, current directory (.) is assumed.
|
||||||
-v bitrate : The video bitrate to convert to.
|
-v bitrate : The video bitrate to convert to.
|
||||||
Defaults are based on the size passed.
|
Defaults are based on the size passed.
|
||||||
>= 2160: '30M'
|
>= 2160: '30M'
|
||||||
>= 1440: '12M'
|
>= 1440: '12M'
|
||||||
>= 1080: '5M'
|
>= 1080: '5M'
|
||||||
>= 720: '2000k'
|
>= 720: '2000k'
|
||||||
>= 480: '750k'
|
>= 480: '750k'
|
||||||
>= 360: '250k'
|
>= 360: '250k'
|
||||||
< 360: '100k'
|
< 360: '100k'
|
||||||
-a bitrate : The audio bitrate to convert to.
|
-a bitrate : The audio bitrate to convert to.
|
||||||
Defaults to '192k'.
|
Defaults to '192k'.
|
||||||
-c vcodec : The video codec you'd like to use, such as libopenh264.
|
-c vcodec : The video codec you'd like to use, such as libopenh264.
|
||||||
|
@ -200,6 +200,9 @@
|
|||||||
; mobile : Set to true if not using an amd64 processor.
|
; mobile : Set to true if not using an amd64 processor.
|
||||||
; Also used to disable tasks not helpful for Pinephone.
|
; Also used to disable tasks not helpful for Pinephone.
|
||||||
;
|
;
|
||||||
|
; redmode : Set to true/false for automatially using Night Light in GNOME.
|
||||||
|
; Default: true
|
||||||
|
;
|
||||||
[global]
|
[global]
|
||||||
marker: '; {mark} MANAGED BY ANSIBLE | Workstation Config'
|
marker: '; {mark} MANAGED BY ANSIBLE | Workstation Config'
|
||||||
state: present
|
state: present
|
||||||
@ -216,6 +219,7 @@
|
|||||||
vnc: "{{ lookup('ini', 'vnc file={{wrk_file}} default=false') }}"
|
vnc: "{{ lookup('ini', 'vnc file={{wrk_file}} default=false') }}"
|
||||||
bsd_gpu: "{{ lookup('ini', 'bsd_gpu file={{wrk_file}} default=false') }}"
|
bsd_gpu: "{{ lookup('ini', 'bsd_gpu file={{wrk_file}} default=false') }}"
|
||||||
mobile: "{{ lookup('ini', 'mobile file={{wrk_file}} default=false') }}"
|
mobile: "{{ lookup('ini', 'mobile file={{wrk_file}} default=false') }}"
|
||||||
|
redmode: "{{ lookup('ini', 'redmode file={{wrk_file}} default=true' ) }}"
|
||||||
|
|
||||||
- name: General | Account Management | Provisioning Configuration | Workstation | List
|
- name: General | Account Management | Provisioning Configuration | Workstation | List
|
||||||
set_fact:
|
set_fact:
|
||||||
@ -229,6 +233,7 @@
|
|||||||
- { 'vnc': "{{ vnc }}" }
|
- { 'vnc': "{{ vnc }}" }
|
||||||
- { 'bsd_gpu': "{{ bsd_gpu }}" }
|
- { 'bsd_gpu': "{{ bsd_gpu }}" }
|
||||||
- { 'mobile': "{{ mobile }}" }
|
- { 'mobile': "{{ mobile }}" }
|
||||||
|
- { 'redmode': "{{ redmode }}" }
|
||||||
|
|
||||||
# No longer mining, this is now considered deprecated.
|
# No longer mining, this is now considered deprecated.
|
||||||
### Miner ##
|
### Miner ##
|
||||||
|
@ -547,6 +547,7 @@
|
|||||||
done
|
done
|
||||||
echo -e "\nDone!"
|
echo -e "\nDone!"
|
||||||
'
|
'
|
||||||
|
alias code-sync='code-check'
|
||||||
alias_code_reset: |
|
alias_code_reset: |
|
||||||
alias code-reset='
|
alias code-reset='
|
||||||
ls -d ~/Code/* | while read project
|
ls -d ~/Code/* | while read project
|
||||||
@ -573,6 +574,7 @@
|
|||||||
nodejs-social-traveler-server dev
|
nodejs-social-traveler-server dev
|
||||||
misc-spare-change main
|
misc-spare-change main
|
||||||
flutter-buddy-website dev
|
flutter-buddy-website dev
|
||||||
|
flutter-sunset-alarm dev
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
function code-reseed {
|
function code-reseed {
|
||||||
@ -720,6 +722,8 @@
|
|||||||
alias_permission_commands: |
|
alias_permission_commands: |
|
||||||
alias chown='chown -c'
|
alias chown='chown -c'
|
||||||
alias chmod='chmod -c'
|
alias chmod='chmod -c'
|
||||||
|
alias_iftop: |
|
||||||
|
alias iftop='sudo iftop'
|
||||||
|
|
||||||
- name: General | Account Management | Users | Files | Common Variable
|
- name: General | Account Management | Users | Files | Common Variable
|
||||||
set_fact:
|
set_fact:
|
||||||
@ -783,6 +787,7 @@
|
|||||||
{{ function_update_sdks }}
|
{{ function_update_sdks }}
|
||||||
{{ function_ansible_vars }}
|
{{ function_ansible_vars }}
|
||||||
{{ alias_permission_commands }}
|
{{ alias_permission_commands }}
|
||||||
|
{{ alias_iftop }}
|
||||||
|
|
||||||
- name: General | Account Management | Users | Files | .bashrc
|
- name: General | Account Management | Users | Files | .bashrc
|
||||||
blockinfile:
|
blockinfile:
|
||||||
|
@ -56,6 +56,7 @@
|
|||||||
- "{{ cron }}"
|
- "{{ cron }}"
|
||||||
- "{{ encfs }}"
|
- "{{ encfs }}"
|
||||||
- rsync
|
- rsync
|
||||||
|
- "{{ iftop }}"
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: General | Software | Packages | Install Software (DEV)
|
- name: General | Software | Packages | Install Software (DEV)
|
||||||
|
@ -13,8 +13,9 @@
|
|||||||
git:
|
git:
|
||||||
repo: https://github.com/CISOfy/lynis
|
repo: https://github.com/CISOfy/lynis
|
||||||
dest: "{{ lynis_install_dir }}"
|
dest: "{{ lynis_install_dir }}"
|
||||||
clone: yes
|
clone: true
|
||||||
force: yes
|
force: true
|
||||||
|
update: true
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
|
|
||||||
- name: General | Tests | Lynis | Ensure Permissions (Looking at you Parrot OS!)
|
- name: General | Tests | Lynis | Ensure Permissions (Looking at you Parrot OS!)
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
android_url: "https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip"
|
android_url: "https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip"
|
||||||
android_download_file: "{{ user_user.home }}/Downloads/android-cmdline-tools.tar.xz"
|
android_download_file: "{{ user_user.home }}/Downloads/android-cmdline-tools.tar.xz"
|
||||||
android_sdk_location: "{{ user_user.home }}/SDKs/Android/Sdk"
|
android_sdk_location: "{{ user_user.home }}/SDKs/Android/Sdk"
|
||||||
|
android_report_file: "{{ user_user.home }}/Reports/{{ ansible_hostname }}.sdk.android.txt"
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Android | Facts [2/3]
|
- name: Workstation | Linux | Software | Android | Facts [2/3]
|
||||||
set_fact:
|
set_fact:
|
||||||
@ -121,26 +122,107 @@
|
|||||||
become_user: "{{ user }}"
|
become_user: "{{ user }}"
|
||||||
when: coding == true and not android_sdkmanager_final_stat.stat.exists
|
when: coding == true and not android_sdkmanager_final_stat.stat.exists
|
||||||
|
|
||||||
|
# Regarding images to download; the `default` is the smallest, then `playstore`.
|
||||||
|
# The `google_apis` images are significantly larger than the `playstore` option.
|
||||||
|
#
|
||||||
|
# This script was used to download and test the sizes:
|
||||||
|
#
|
||||||
|
### #!/bin/bash
|
||||||
|
###
|
||||||
|
### cd /home/ling/SDKs/Android/Sdk/cmdline-tools/latest/bin
|
||||||
|
###
|
||||||
|
### # Actually to be used
|
||||||
|
### echo "35 Play Store"
|
||||||
|
### ./sdkmanager --install "system-images;android-35;google_apis_playstore;x86_64"
|
||||||
|
### echo "36 Play Store"
|
||||||
|
### ./sdkmanager --install "system-images;android-36;google_apis_playstore;x86_64"
|
||||||
|
###
|
||||||
|
### # FORTESTING file size
|
||||||
|
### echo "35 AOSP"
|
||||||
|
### ./sdkmanager --install "system-images;android-35;default;x86_64"
|
||||||
|
### echo "36 APIs Only"
|
||||||
|
### ./sdkmanager --install "system-images;android-36;google_apis;x86_64"
|
||||||
|
### echo "35 APIs Only"
|
||||||
|
### ./sdkmanager --install "system-images;android-35;google_apis;x86_64"
|
||||||
|
###
|
||||||
|
### exit 0
|
||||||
|
#
|
||||||
|
# These were the results:
|
||||||
|
#
|
||||||
|
### ~/SDKs/Android/Sdk/system-images]$ du -had2 | sort -h
|
||||||
|
### 1.7G ./android-35/default
|
||||||
|
### 2.2G ./android-35/google_apis_playstore
|
||||||
|
### 2.3G ./android-36/google_apis_playstore
|
||||||
|
### 3.5G ./android-35/google_apis
|
||||||
|
### 4.3G ./android-36/google_apis
|
||||||
|
### 6.6G ./android-36
|
||||||
|
### 7.3G ./android-35
|
||||||
|
### 14G .
|
||||||
|
|
||||||
# These are safe to run multiple times, and uses the new `latest` version.
|
# These are safe to run multiple times, and uses the new `latest` version.
|
||||||
- name: Workstation | Linux | Software | Android | Install Modules
|
- name: Workstation | Linux | Software | Android | Install Modules
|
||||||
shell: "yes | {{ android_sdkmanager_final }} --install '{{ item }}' --sdk_root={{ android_sdk_location }}"
|
shell: "yes | {{ android_sdkmanager_final }} --install '{{ item }}' --sdk_root={{ android_sdk_location }}"
|
||||||
loop:
|
loop:
|
||||||
# 34
|
### 36 ###
|
||||||
- build-tools;34.0.0
|
- build-tools;36.0.0
|
||||||
- platforms;android-34
|
- platforms;android-36
|
||||||
- sources;android-34
|
- sources;android-36
|
||||||
# 35
|
# Images
|
||||||
- build-tools;35.0.0
|
#- system-images;android-35;default;x86_64 # TODO: Switch once it exists.
|
||||||
- build-tools;35.0.1
|
- system-images;android-36;google_apis_playstore;x86_64
|
||||||
|
### 35 ###
|
||||||
- platforms;android-35
|
- platforms;android-35
|
||||||
- sources;android-35
|
- sources;android-35
|
||||||
# Images
|
# Images
|
||||||
#- system-images;android-35;default;x86_64
|
- system-images;android-35;default;x86_64
|
||||||
#- system-images;android-35;aosp_atd;x86_64
|
### 16 ###
|
||||||
- system-images;android-35;google_apis_playstore;x86_64
|
- platforms;android-16
|
||||||
|
- sources;android-16
|
||||||
|
# Images
|
||||||
|
- system-images;android-16;default;x86
|
||||||
become_user: "{{ user }}"
|
become_user: "{{ user }}"
|
||||||
when: coding == true
|
when: coding == true
|
||||||
|
|
||||||
|
# Remove any versions which used to be part of this script and no longer used.
|
||||||
|
- name: Workstation | Linux | Software | Android | Remove Modules
|
||||||
|
shell: "yes | {{ android_sdkmanager_final }} --uninstall '{{ item }}' --sdk_root={{ android_sdk_location }}"
|
||||||
|
loop:
|
||||||
|
### 36 ###
|
||||||
|
# Images
|
||||||
|
- system-images;android-36;google_apis;x86_64
|
||||||
|
### 35 ###
|
||||||
|
- build-tools;35.0.0
|
||||||
|
- build-tools;35.0.1
|
||||||
|
# Images
|
||||||
|
- system-images;android-35;aosp_atd;x86_64 # ATD = Automated Test Device
|
||||||
|
- system-images;android-35;google_apis;x86_64
|
||||||
|
- 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
|
||||||
|
### 16 ###
|
||||||
|
# Images
|
||||||
|
- system-images;android-16;google_apis;x86
|
||||||
|
### 15 ###
|
||||||
|
- platforms;android-15
|
||||||
|
- sources;android-15
|
||||||
|
# Images
|
||||||
|
- system-images;android-15;default;x86 # Not working in Android AVDs
|
||||||
|
become_user: "{{ user }}"
|
||||||
|
when: coding == true
|
||||||
|
|
||||||
|
# Report the currently installed packges.
|
||||||
|
- name: Workstation | Linux | Software | Android | Report Modules
|
||||||
|
shell: "{{ android_sdkmanager_final }} --list_installed --sdk_root={{ android_sdk_location }} > {{ android_report_file }}"
|
||||||
|
become_user: "{{ user }}"
|
||||||
|
when: coding == true
|
||||||
|
|
||||||
|
## Flutter and Licenses ##
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Android | Inform Flutter
|
- name: Workstation | Linux | Software | Android | Inform Flutter
|
||||||
shell: "{{ flutter }} config --android-sdk={{ android_sdk_location }}"
|
shell: "{{ flutter }} config --android-sdk={{ android_sdk_location }}"
|
||||||
become_user: "{{ user }}"
|
become_user: "{{ user }}"
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
flutter_url: "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.27.2-stable.tar.xz"
|
flutter_url: "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.27.2-stable.tar.xz"
|
||||||
flutter_download_file: "{{ user_user.home }}/Downloads/flutter.tar.xz"
|
flutter_download_file: "{{ user_user.home }}/Downloads/flutter.tar.xz"
|
||||||
flutter_sdk_location: "{{ user_user.home }}/SDKs/Flutter"
|
flutter_sdk_location: "{{ user_user.home }}/SDKs/Flutter"
|
||||||
flutter_report: "{{ user_user.home }}/Reports/flutter.txt"
|
flutter_report: "{{ user_user.home }}/Reports/{{ ansible_hostname }}.sdk.flutter.txt"
|
||||||
when: coding == true
|
when: coding == true
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Flutter | Facts [2/4]
|
- name: Workstation | Linux | Software | Flutter | Facts [2/4]
|
||||||
|
@ -217,7 +217,12 @@
|
|||||||
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 &&
|
||||||
dconf write /org/gnome/desktop/notifications/application/org-gnome-evolution/enable false && inc_dconf &&
|
dconf write /org/gnome/desktop/notifications/application/org-gnome-evolution/enable false && inc_dconf &&
|
||||||
|
|
||||||
dconf write /org/gnome/settings-daemon/plugins/color/night-light-enabled true
|
# Red Mode (Night Light)
|
||||||
|
typeset -l redmode
|
||||||
|
redmode="{{ redmode }}"
|
||||||
|
if [[ $redmode == "true" ]]; then
|
||||||
|
dconf write /org/gnome/settings-daemon/plugins/color/night-light-enabled true
|
||||||
|
fi
|
||||||
dconf write /org/gnome/settings-daemon/plugins/color/night-light-schedule-automatic false
|
dconf write /org/gnome/settings-daemon/plugins/color/night-light-schedule-automatic false
|
||||||
dconf write /org/gnome/settings-daemon/plugins/color/night-light-temperature "uint32 3170"
|
dconf write /org/gnome/settings-daemon/plugins/color/night-light-temperature "uint32 3170"
|
||||||
dconf write /org/gnome/settings-daemon/plugins/color/night-light-schedule-from 2.0
|
dconf write /org/gnome/settings-daemon/plugins/color/night-light-schedule-from 2.0
|
||||||
|
Reference in New Issue
Block a user