Compare commits

..
8 Commits
5 changed files with 85 additions and 24 deletions

No files matched your search

+1 -1
View File
@@ -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"
# 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"
+12
View File
@@ -799,14 +799,23 @@
alias_prod: |
alias prod="ssh -p {{ prod_port }} {{ prod_user }}@{{ prod_host }}"
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() {
echo -e "******* Android *******\n*** Build Caches ***"
find $HOME/Code/android-*/app -maxdepth 1 -type d -name "build" \
-exec du -hs {} \; -exec rm -rf {} \;
echo -e "\n*** Gradle Caches ***"
find $HOME/Code/android-*/ -maxdepth 1 -type d -name ".gradle" \
-exec du -hs {} \; -exec rm -rf {} \;
print_size_delete "$HOME/.gradle"
echo -e "******* Flutter *******"
ls $HOME/Code | grep flutter | while read project; do
cd $HOME/Code/$project
@@ -816,6 +825,9 @@
done
cd
print_size_delete "$HOME/.pub_cache"
print_size_delete "$HOME/.pub-cache"
echo -e "******* PDFs *******"
find $HOME/Code/ebook-* -name "*.pdf" -exec du -h {} \; -delete | sort -h
+69 -20
View File
@@ -1,31 +1,78 @@
---
# Cross-platform package management.
- name: General | Software | Packages | Fix Parrot OS (zypper)
# They have zypper higher in the path, but it's really apt renamed.
# 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.
ansible.builtin.shell: "mv `which zypper` `which zypper`.zz.`date +%Y%m%d`"
register: parrotos_zypper_removed
ignore_errors: true
- name: General | Software | Packages | Fix Parrot OS
block:
- name: General | Software | Packages | Fix Parrot OS | zypper
# They have zypper higher in the path, but it's really apt renamed.
# 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.
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"
- 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: ansible_distribution == "Parrot OS" and parrotos_zypper_removed is defined and not parrotos_zypper_removed.failed
- name: General | Software | Packages | pacman
block:
- name: General | Software | Packages | Fix Parrot OS (zypper), Exiting
ansible.builtin.shell: exit 1
when: ansible_distribution == "Parrot OS" and parrotos_zypper_removed is defined and not parrotos_zypper_removed.failed
- name: General | Software | Packages | pacman | pacman.conf
ansible.builtin.lineinfile:
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
# have sudo or anything in it. Hide it in preference for .bashrc update function.
- name: General | Software | Packages | Fix Parrot OS 2 (update)
ansible.builtin.shell: "mv `which update` `which update`.zz.`date +%Y%m%d`"
ignore_errors: true
when: ansible_distribution == "Parrot OS"
# TBD / TODO: Do the mirrorlist files and distros based on facts in case ever using Arch, Manjaro, etc.
# Same with the blocklist for sites like Berkeley which rate limit VPNs.
- name: General | Software | Packages | pacman | Artix
block:
- 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)
ansible.builtin.package:
@@ -35,6 +82,8 @@
- name: General | Software | Packages | Cache Refresh (FreeBSD)
ansible.builtin.shell: pkg update
register: shell_check
changed_when: shell_check.rc == 0
when: ansible_system == "FreeBSD"
- name: General | Software | Packages | Install Software
+2 -2
View File
@@ -211,9 +211,9 @@
- name: Workstation | Linux | Software | LLMs | Facts | Choices | Sort
ansible.builtin.set_fact:
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_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
ansible.builtin.debug:
@@ -29,7 +29,7 @@
export JAVA_HOME="{{ user_user.home }}/SDKs/Java"
export PATH="$JAVA_HOME/bin:$PATH"
create: false
create: true
backup: false
owner: "{{ user }}"
group: "{{ user }}"