Compare commits
11
Commits
8d01548627
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e8d22cb46 | ||
|
|
3bc2185962 | ||
|
|
aa9ccbfd54 | ||
|
|
444b34bd31 | ||
|
|
e996cb9ef1 | ||
|
|
5b668e97f4 | ||
|
|
4b26e1b3ae | ||
|
|
5d3040da71 | ||
|
|
be4d8cd4f6 | ||
|
|
d24381ad1e | ||
|
|
ad8b4a1663 |
No files matched your search
@@ -448,4 +448,4 @@ set $refresh_i3status killall -SIGUSR1 i3status
|
|||||||
exec_always --no-startup-id "killall sunset-alarm; /home/ling/Code/sunset_alarm_cli/sunset-alarm -l 32:-111 -m 30 > ~/Reports/sunset-alarm.log 2>&1"
|
exec_always --no-startup-id "killall sunset-alarm; /home/ling/Code/sunset_alarm_cli/sunset-alarm -l 32:-111 -m 30 > ~/Reports/sunset-alarm.log 2>&1"
|
||||||
|
|
||||||
# Bedtime ;)
|
# Bedtime ;)
|
||||||
exec --no-startup-id "while true; do if [[ `date +'%H'` -ge 20 ]]; then fyi -w -u critical 'Bedtime' 'Go to sleep! >:)'; fi; sleep 150; done"
|
exec --no-startup-id "while true; do if [[ `date +'%H'` -ge 20 ]]; then fyi -w -u critical 'Bedtime' 'Go to sleep! >:)'; fi; sleep 600; done"
|
||||||
@@ -799,14 +799,25 @@
|
|||||||
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: |
|
||||||
|
function print_size_delete() {
|
||||||
|
f="$1"
|
||||||
|
if [[ -e "$f" ]]; then
|
||||||
|
du -hs "$f" && sh -c "rm -rf '$f'"
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
function clean-code() {
|
function clean-code() {
|
||||||
echo -e "******* Android *******\n*** Build Caches ***"
|
echo -e "******* Android *******\n*** Build Caches ***"
|
||||||
find $HOME/Code/android-*/app -maxdepth 1 -type d -name "build" \
|
find $HOME/Code/android-*/app -maxdepth 1 -type d -name "build" \
|
||||||
-exec du -hs {} \; -exec rm -rf {} \;
|
-exec du -hs {} \; -exec rm -rf {} \;
|
||||||
|
|
||||||
echo -e "\n*** Gradle Caches ***"
|
echo -e "\n*** Gradle Caches ***"
|
||||||
find $HOME/Code/android-*/ -maxdepth 1 -type d -name ".gradle" \
|
find $HOME/Code/android-*/ -maxdepth 1 -type d -name ".gradle" \
|
||||||
-exec du -hs {} \; -exec rm -rf {} \;
|
-exec du -hs {} \; -exec rm -rf {} \;
|
||||||
|
|
||||||
|
print_size_delete "$HOME/.gradle"
|
||||||
|
mkdir "$HOME/.gradle"
|
||||||
|
|
||||||
echo -e "******* Flutter *******"
|
echo -e "******* Flutter *******"
|
||||||
ls $HOME/Code | grep flutter | while read project; do
|
ls $HOME/Code | grep flutter | while read project; do
|
||||||
cd $HOME/Code/$project
|
cd $HOME/Code/$project
|
||||||
@@ -816,6 +827,10 @@
|
|||||||
done
|
done
|
||||||
cd
|
cd
|
||||||
|
|
||||||
|
print_size_delete "$HOME/.pub_cache"
|
||||||
|
print_size_delete "$HOME/.pub-cache"
|
||||||
|
mkdir "$HOME/.pub-cache"
|
||||||
|
|
||||||
echo -e "******* PDFs *******"
|
echo -e "******* PDFs *******"
|
||||||
find $HOME/Code/ebook-* -name "*.pdf" -exec du -h {} \; -delete | sort -h
|
find $HOME/Code/ebook-* -name "*.pdf" -exec du -h {} \; -delete | sort -h
|
||||||
|
|
||||||
|
|||||||
@@ -1,31 +1,78 @@
|
|||||||
---
|
---
|
||||||
# Cross-platform package management.
|
# Cross-platform package management.
|
||||||
|
|
||||||
- name: General | Software | Packages | Fix Parrot OS (zypper)
|
- name: General | Software | Packages | Fix Parrot OS
|
||||||
# They have zypper higher in the path, but it's really apt renamed.
|
block:
|
||||||
# Probably for "security", but package module does not use the ansible_pkg_mgr variable
|
|
||||||
# so resetting the value to apt doesn't work. Just going to move it.
|
- name: General | Software | Packages | Fix Parrot OS | zypper
|
||||||
ansible.builtin.shell: "mv `which zypper` `which zypper`.zz.`date +%Y%m%d`"
|
# They have zypper higher in the path, but it's really apt renamed.
|
||||||
register: parrotos_zypper_removed
|
# Probably for "security", but package module does not use the ansible_pkg_mgr variable
|
||||||
ignore_errors: true
|
# so resetting the value to apt doesn't work. Just going to move it.
|
||||||
|
ansible.builtin.shell: "mv `which zypper` `which zypper`.zz.`date +%Y%m%d`"
|
||||||
|
register: parrotos_zypper_removed
|
||||||
|
changed_when: parrotos_zypper_removed.rc == 0
|
||||||
|
ignore_errors: true
|
||||||
|
|
||||||
|
- name: General | Software | Packages | Fix Parrot OS | zypper | Exit Incoming
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "A silly zypper file was renamed successfully. Please try running Ansible again."
|
||||||
|
when: parrotos_zypper_removed is defined and not parrotos_zypper_removed.failed
|
||||||
|
|
||||||
|
- name: General | Software | Packages | Fix Parrot OS | zypper | Exiting
|
||||||
|
ansible.builtin.shell: exit 1
|
||||||
|
register: shell_check
|
||||||
|
changed_when: shell_check.rc == 0
|
||||||
|
when: parrotos_zypper_removed is defined and not parrotos_zypper_removed.failed
|
||||||
|
|
||||||
|
# More Parrot OS junk. They have a command called update in /usr/bin. Doesn't
|
||||||
|
# have sudo or anything in it. Hide it in preference for .bashrc update function.
|
||||||
|
- name: General | Software | Packages | Fix Parrot OS | update
|
||||||
|
ansible.builtin.shell: "mv `which update` `which update`.zz.`date +%Y%m%d`"
|
||||||
|
register: shell_check
|
||||||
|
changed_when: shell_check.rc == 0
|
||||||
|
ignore_errors: true
|
||||||
|
|
||||||
when: ansible_distribution == "Parrot OS"
|
when: ansible_distribution == "Parrot OS"
|
||||||
|
|
||||||
- name: General | Software | Packages | Fix Parrot OS (zypper), Exit Incoming
|
- name: General | Software | Packages | pacman
|
||||||
ansible.builtin.debug:
|
block:
|
||||||
msg: "A silly zypper file was renamed successfully. Please try running Ansible again."
|
|
||||||
when: ansible_distribution == "Parrot OS" and parrotos_zypper_removed is defined and not parrotos_zypper_removed.failed
|
|
||||||
|
|
||||||
- name: General | Software | Packages | Fix Parrot OS (zypper), Exiting
|
- name: General | Software | Packages | pacman | pacman.conf
|
||||||
ansible.builtin.shell: exit 1
|
ansible.builtin.lineinfile:
|
||||||
when: ansible_distribution == "Parrot OS" and parrotos_zypper_removed is defined and not parrotos_zypper_removed.failed
|
path: "/etc/pacman.conf"
|
||||||
|
regexp: '{{ item.key }}'
|
||||||
|
line: '{{ item.value }}'
|
||||||
|
state: present
|
||||||
|
create: true
|
||||||
|
backup: true
|
||||||
|
mode: "0644"
|
||||||
|
loop:
|
||||||
|
- { "key": '^[\#]?ParallelDownloads', "value": 'ParallelDownloads = 3'}
|
||||||
|
|
||||||
# More Parrot OS junk. They have a command called update in /usr/bin. Doesn't
|
# TBD / TODO: Do the mirrorlist files and distros based on facts in case ever using Arch, Manjaro, etc.
|
||||||
# have sudo or anything in it. Hide it in preference for .bashrc update function.
|
# Same with the blocklist for sites like Berkeley which rate limit VPNs.
|
||||||
- name: General | Software | Packages | Fix Parrot OS 2 (update)
|
- name: General | Software | Packages | pacman | Artix
|
||||||
ansible.builtin.shell: "mv `which update` `which update`.zz.`date +%Y%m%d`"
|
block:
|
||||||
ignore_errors: true
|
|
||||||
when: ansible_distribution == "Parrot OS"
|
|
||||||
|
|
||||||
|
- name: General | Software | Packages | pacman | Artix | rate-mirrors | Install
|
||||||
|
ansible.builtin.package:
|
||||||
|
name:
|
||||||
|
- rate-mirrors
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: General | Software | Packages | pacman | Artix | rate-mirrors | Update Lists
|
||||||
|
ansible.builtin.shell: |
|
||||||
|
set -o pipefail
|
||||||
|
{{ item }}
|
||||||
|
register: shell_check
|
||||||
|
changed_when: shell_check.rc == 0
|
||||||
|
loop:
|
||||||
|
- "sudo -u {{ user }} rate-mirrors artix | grep -v berkeley | tee /etc/pacman.d/mirrorlist"
|
||||||
|
- "sudo -u {{ user }} rate-mirrors arch | grep -v berkeley | tee /etc/pacman.d/mirrorlist-arch"
|
||||||
|
|
||||||
|
when: ansible_service_mgr == "runit"
|
||||||
|
|
||||||
|
when: ansible_pkg_mgr == "pacman"
|
||||||
|
|
||||||
- name: General | Software | Packages | Cache Refresh (Apt and Pacman)
|
- name: General | Software | Packages | Cache Refresh (Apt and Pacman)
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
@@ -35,6 +82,8 @@
|
|||||||
|
|
||||||
- name: General | Software | Packages | Cache Refresh (FreeBSD)
|
- name: General | Software | Packages | Cache Refresh (FreeBSD)
|
||||||
ansible.builtin.shell: pkg update
|
ansible.builtin.shell: pkg update
|
||||||
|
register: shell_check
|
||||||
|
changed_when: shell_check.rc == 0
|
||||||
when: ansible_system == "FreeBSD"
|
when: ansible_system == "FreeBSD"
|
||||||
|
|
||||||
- name: General | Software | Packages | Install Software
|
- name: General | Software | Packages | Install Software
|
||||||
|
|||||||
@@ -211,9 +211,9 @@
|
|||||||
- name: Workstation | Linux | Software | LLMs | Facts | Choices | Sort
|
- name: Workstation | Linux | Software | LLMs | Facts | Choices | Sort
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
llm_installs: >-
|
llm_installs: >-
|
||||||
{{ llm_choices | selectattr('size_mb', 'le', ansible_memtotal_mb) | list }}
|
{{ llm_installs | union(llm_choices | selectattr('size_mb', 'le', ansible_memtotal_mb) | list) }}
|
||||||
llm_removals: >-
|
llm_removals: >-
|
||||||
{{ llm_choices | selectattr('size_mb', 'gt', ansible_memtotal_mb) | list }}
|
{{ llm_removals | union(llm_choices | selectattr('size_mb', 'gt', ansible_memtotal_mb) | list) }}
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | LLMs | Facts | Merge | Print
|
- name: Workstation | Linux | Software | LLMs | Facts | Merge | Print
|
||||||
ansible.builtin.debug:
|
ansible.builtin.debug:
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
export JAVA_HOME="{{ user_user.home }}/SDKs/Java"
|
export JAVA_HOME="{{ user_user.home }}/SDKs/Java"
|
||||||
export PATH="$JAVA_HOME/bin:$PATH"
|
export PATH="$JAVA_HOME/bin:$PATH"
|
||||||
create: false
|
create: true
|
||||||
backup: false
|
backup: false
|
||||||
owner: "{{ user }}"
|
owner: "{{ user }}"
|
||||||
group: "{{ user }}"
|
group: "{{ user }}"
|
||||||
|
|||||||
@@ -205,6 +205,15 @@
|
|||||||
- name: Workstation | Linux | Software | Android | SDK
|
- name: Workstation | Linux | Software | Android | SDK
|
||||||
block:
|
block:
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Android | Gradle Permissions
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ user_user.home }}/.gradle"
|
||||||
|
state: directory
|
||||||
|
owner: "{{ user }}"
|
||||||
|
group: "{{ user }}"
|
||||||
|
mode: "0755"
|
||||||
|
when: user_user.home != ""
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Android | Download Commandline Tools
|
- name: Workstation | Linux | Software | Android | Download Commandline Tools
|
||||||
ansible.builtin.get_url:
|
ansible.builtin.get_url:
|
||||||
url: "{{ android_url }}"
|
url: "{{ android_url }}"
|
||||||
|
|||||||
@@ -46,116 +46,123 @@
|
|||||||
get_mime: false
|
get_mime: false
|
||||||
register: flutter_download_stat
|
register: flutter_download_stat
|
||||||
|
|
||||||
## Packages ##
|
- name: Workstation | Linux | Software | Flutter | Install Block
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Flutter | Necessities
|
|
||||||
ansible.builtin.package:
|
|
||||||
name:
|
|
||||||
- curl
|
|
||||||
- git
|
|
||||||
- unzip
|
|
||||||
- "{{ xz }}"
|
|
||||||
- zip
|
|
||||||
- "{{ mesa }}"
|
|
||||||
- "{{ mesa_utils }}"
|
|
||||||
state: present
|
|
||||||
when: coding
|
|
||||||
|
|
||||||
# https://docs.flutter.dev/get-started/install/linux/desktop
|
|
||||||
- name: Workstation | Linux | Software | Flutter | Linux App Dependencies
|
|
||||||
ansible.builtin.package:
|
|
||||||
name:
|
|
||||||
- clang
|
|
||||||
- cmake
|
|
||||||
- git
|
|
||||||
- "{{ ninja }}"
|
|
||||||
- pkg-config
|
|
||||||
- "{{ gtk3 }}"
|
|
||||||
- "{{ xz_libs }}"
|
|
||||||
- "{{ cpp }}"
|
|
||||||
state: present
|
|
||||||
when: coding
|
|
||||||
|
|
||||||
# https://docs.flutter.dev/get-started/install/linux/android
|
|
||||||
- name: Workstation | Linux | Software | Flutter | Android App Dependencies
|
|
||||||
ansible.builtin.package:
|
|
||||||
name:
|
|
||||||
- "{{ c_libs }}"
|
|
||||||
- "{{ cpp_libs }}"
|
|
||||||
- "{{ z_libs }}"
|
|
||||||
- "{{ bzip }}"
|
|
||||||
state: present
|
|
||||||
when: coding
|
|
||||||
|
|
||||||
## Install SDK ##
|
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Flutter | SDK
|
|
||||||
block:
|
block:
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Flutter | Download SDK
|
## Packages ##
|
||||||
ansible.builtin.get_url:
|
|
||||||
url: "{{ flutter_url }}"
|
|
||||||
dest: "{{ flutter_download_file }}"
|
|
||||||
owner: "{{ user }}"
|
|
||||||
group: "{{ user }}"
|
|
||||||
mode: '0664'
|
|
||||||
when: not flutter_download_stat.stat.exists
|
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Flutter | Create Folder
|
- name: Workstation | Linux | Software | Flutter | Necessities
|
||||||
|
ansible.builtin.package:
|
||||||
|
name:
|
||||||
|
- curl
|
||||||
|
- git
|
||||||
|
- unzip
|
||||||
|
- "{{ xz }}"
|
||||||
|
- zip
|
||||||
|
- "{{ mesa }}"
|
||||||
|
- "{{ mesa_utils }}"
|
||||||
|
state: present
|
||||||
|
|
||||||
|
# https://docs.flutter.dev/get-started/install/linux/desktop
|
||||||
|
- name: Workstation | Linux | Software | Flutter | Linux App Dependencies
|
||||||
|
ansible.builtin.package:
|
||||||
|
name:
|
||||||
|
- clang
|
||||||
|
- cmake
|
||||||
|
- git
|
||||||
|
- "{{ ninja }}"
|
||||||
|
- pkg-config
|
||||||
|
- "{{ gtk3 }}"
|
||||||
|
- "{{ xz_libs }}"
|
||||||
|
- "{{ cpp }}"
|
||||||
|
state: present
|
||||||
|
|
||||||
|
# https://docs.flutter.dev/get-started/install/linux/android
|
||||||
|
- name: Workstation | Linux | Software | Flutter | Android App Dependencies
|
||||||
|
ansible.builtin.package:
|
||||||
|
name:
|
||||||
|
- "{{ c_libs }}"
|
||||||
|
- "{{ cpp_libs }}"
|
||||||
|
- "{{ z_libs }}"
|
||||||
|
- "{{ bzip }}"
|
||||||
|
state: present
|
||||||
|
|
||||||
|
## Install SDK ##
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Flutter | SDK
|
||||||
|
block:
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Flutter | Pub Cache Permissions
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ user_user.home }}/.pub-cache"
|
||||||
|
state: directory
|
||||||
|
owner: "{{ user }}"
|
||||||
|
group: "{{ user }}"
|
||||||
|
mode: "0755"
|
||||||
|
when: user_user.home != ""
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Flutter | Download SDK
|
||||||
|
ansible.builtin.get_url:
|
||||||
|
url: "{{ flutter_url }}"
|
||||||
|
dest: "{{ flutter_download_file }}"
|
||||||
|
owner: "{{ user }}"
|
||||||
|
group: "{{ user }}"
|
||||||
|
mode: '0664'
|
||||||
|
when: not flutter_download_stat.stat.exists
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Flutter | Create Folder
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ flutter_sdk_location }}"
|
||||||
|
state: directory
|
||||||
|
owner: "{{ user }}"
|
||||||
|
group: "{{ user }}"
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Flutter | Extract SDK
|
||||||
|
ansible.builtin.unarchive:
|
||||||
|
src: "{{ flutter_download_file }}"
|
||||||
|
dest: "{{ flutter_sdk_location }}"
|
||||||
|
owner: "{{ user }}"
|
||||||
|
group: "{{ user }}"
|
||||||
|
|
||||||
|
become: true
|
||||||
|
become_user: "{{ user }}"
|
||||||
|
when: not flutter_sdk_stat.stat.exists
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Flutter | Delete Archive
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ flutter_sdk_location }}"
|
path: "{{ flutter_download_file }}"
|
||||||
state: directory
|
state: absent
|
||||||
owner: "{{ user }}"
|
|
||||||
group: "{{ user }}"
|
|
||||||
mode: '0755'
|
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Flutter | Extract SDK
|
## Configure Environment ##
|
||||||
ansible.builtin.unarchive:
|
|
||||||
src: "{{ flutter_download_file }}"
|
|
||||||
dest: "{{ flutter_sdk_location }}"
|
|
||||||
owner: "{{ user }}"
|
|
||||||
group: "{{ user }}"
|
|
||||||
|
|
||||||
become: true
|
- name: Workstation | Linux | Software | Flutter | Modify PATH (profiles)
|
||||||
become_user: "{{ user }}"
|
ansible.builtin.blockinfile:
|
||||||
when: coding
|
path: "{{ user_user.home }}/{{ item }}"
|
||||||
and not flutter_sdk_stat.stat.exists
|
block: |
|
||||||
|
export FLUTTER_HOME="{{ flutter_home }}"
|
||||||
|
export PATH="{{ flutter_bin }}:$PATH"
|
||||||
|
marker: '# {mark} MANAGED BY ANSIBLE | Flutter'
|
||||||
|
state: present
|
||||||
|
create: true
|
||||||
|
backup: true
|
||||||
|
mode: "0755"
|
||||||
|
loop:
|
||||||
|
- ".bash_profile"
|
||||||
|
- ".zprofile"
|
||||||
|
- ".profile"
|
||||||
|
when: user_user.home != ""
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Flutter | Delete Archive
|
## Test SDK ##
|
||||||
ansible.builtin.file:
|
|
||||||
path: "{{ flutter_download_file }}"
|
|
||||||
state: absent
|
|
||||||
when: coding
|
|
||||||
|
|
||||||
## Configure Environment ##
|
- name: Workstation | Linux | Software | Flutter | Doctor Report
|
||||||
|
ansible.builtin.shell: "{{ item }}"
|
||||||
|
loop: "{{ flutter_report_commands }}"
|
||||||
|
become: true
|
||||||
|
become_user: "{{ user }}"
|
||||||
|
register: shell_check
|
||||||
|
changed_when: shell_check.rc == 0
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Flutter | Modify PATH (profiles)
|
|
||||||
ansible.builtin.blockinfile:
|
|
||||||
path: "{{ user_user.home }}/{{ item }}"
|
|
||||||
block: |
|
|
||||||
export FLUTTER_HOME="{{ flutter_home }}"
|
|
||||||
export PATH="{{ flutter_bin }}:$PATH"
|
|
||||||
marker: '# {mark} MANAGED BY ANSIBLE | Flutter'
|
|
||||||
state: present
|
|
||||||
create: true
|
|
||||||
backup: true
|
|
||||||
mode: "0755"
|
|
||||||
loop:
|
|
||||||
- ".bash_profile"
|
|
||||||
- ".zprofile"
|
|
||||||
- ".profile"
|
|
||||||
when: coding
|
|
||||||
and user_user.home != ""
|
|
||||||
|
|
||||||
## Test SDK ##
|
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Flutter | Doctor Report
|
|
||||||
ansible.builtin.shell: "{{ item }}"
|
|
||||||
loop: "{{ flutter_report_commands }}"
|
|
||||||
become: true
|
|
||||||
become_user: "{{ user }}"
|
|
||||||
register: shell_check
|
|
||||||
changed_when: shell_check.rc == 0
|
|
||||||
when: coding
|
when: coding
|
||||||
|
|
||||||
## Uninstall SDK ##
|
## Uninstall SDK ##
|
||||||
|
|||||||
Reference in new issue
Block a user