chmod +x ~/Home/Downloads/<backup-home.sh> (or wherever you saved it)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| INF = float('inf') | |
| adj_matrix = [ | |
| [0, 5, 3, INF, 11, INF], | |
| [5, 0, 1, INF, INF, 2], | |
| [3, 1, 0, 1, 5, INF], | |
| [INF, INF, 1, 0, 9, 3], | |
| [11, INF, 5, 9, 0, INF], | |
| [INF, 2, INF, 3, INF, 0], | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def verify_card_number(nums): | |
| card_numbers=[] | |
| special_nums=[] | |
| stripped=nums.replace(" ", "").replace("-", "") | |
| for num in stripped: | |
| card_numbers.append(int(num)) | |
| check_digit = card_numbers.pop(-1) | |
| r_card_numbers = card_numbers[::-1] | |
| for num in r_card_numbers[0::2]: | |
| if num+num < 10: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| sudo swapoff -a;sudo zramctl --reset /dev/zram0;echo "ensure if a ZRAM line is configured that you remove it now";sleep 10;wait;sudo nano /etc/fstab;sudo systemctl mask --now systemd-zram-setup@zram0.service;sudo touch /etc/systemd/zram-generator.conf;echo "Here you are going to write vm.swappiness=0, save(ctrl+s), and then exit(ctrl+x, Enter)";sleep 10;wait;sudo nano /etc/sysctl.d/99-swappiness.conf;echo "ZRAM is OFF";sleep 3;wait;exit 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| read -n1 -p "1:NVTOP 2:NVIDIA-SMI DMON 3:NVIDIA-SMI PMON > " c; echo | |
| case $c in | |
| 1) nvtop ;; | |
| 2) read -n1 -p "1:FAST 2:SLOW > " d; echo | |
| case $d in | |
| 1) nvidia-smi dmon -s u ;; | |
| 2) nvidia-smi dmon -d 1 ;; | |
| esac |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| sudo adguardvpn-cli connect -l '<location>';sudo aguard-cli check-update;sudo adguard-cli start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test_settings = {'mouse': 'large', | |
| 'theme': 'hdr', | |
| 'resolution': '1920x1080', | |
| 'refresh': '60Hz', | |
| } | |
| settings = {} | |
| def add_setting(settings, key_value): | |
| key = key_value[0].lower() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Category(object): | |
| def __init__(self, name): | |
| self.name = name | |
| self.ledger = [] | |
| def __str__(self): | |
| return f'{self.cat_obj()}\n{self.transaction_list()}\nTotal: {self.get_balance()}' | |
| def transaction_list(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Rectangle: | |
| def __init__(self, width, height): | |
| self._width = width | |
| self._height = height | |
| def __str__(self): | |
| return f'Rectangle(width={self._width}, height={self._height})' | |
| def set_width(self, width): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class HashTable: | |
| def __init__(self): | |
| self.collection = {} | |
| def hash(self, str): | |
| self.str = str | |
| result = 0 | |
| for char in self.str: |