My scripts for home use. Work in Debian. It is may help you.

a fbab36fc4c Added script prints as the computer from the ship "Nostromo" 2 days ago
config 5303a3f199 Made multilanguage speech script. 3 days ago
convert fcb5e7a250 папка Downloads_for переименована Downloads.for. 7 months ago
lftp 146bd99d50 change dirs of wallpaper changer script. 6 days ago
list 146bd99d50 change dirs of wallpaper changer script. 6 days ago
opt 146bd99d50 change dirs of wallpaper changer script. 6 days ago
,backup_data1.sh 5a6266b104 из названий скриптов убрано auto. 7 months ago
,backup_data2.sh ffa5e85a41 bugfix 2 weeks ago
,backup_folders.sh 2a38ede6e2 fun_analize_return_code переименована в fun_analize_command. 7 months ago
,backup_open_data.sh 146bd99d50 change dirs of wallpaper changer script. 6 days ago
,backup_to_cloud.sh ffa5e85a41 bugfix 2 weeks ago
,clean.sh 71ae958baf оптимизирована очистка папок. 4 months ago
,conky_weather.sh bcd254b95a переименованы log_gen в dir_general. 5 months ago
,correct_disks.sh bac3407da5 fix bug when modification date not get correctly. 5 days ago
,correct_tvbox.sh 5303a3f199 Made multilanguage speech script. 3 days ago
,cp_to_flash59gb.sh 87127191e0 создан скрипт для копирования файлов на флешку. 5 months ago
,create_playlists.sh b53462ac9a переименованы некоторые переменные и файлы. 1 month ago
,file_delete_notify.sh f1afd2c72c folder /mail.ru renames to /cloud. 3 months ago
,find_files.sh 03b4ebe1b5 скрипт корректировки дисков теперь не перемещает файлы с 5 months ago
,find_string.sh ffa5e85a41 bugfix 2 weeks ago
,move_configs.sh 5303a3f199 Made multilanguage speech script. 3 days ago
,rkhunter.sh b307067b2b обновлен скрипт rkhunter 4 months ago
,rsync_no_e24.sh caa6bd8171 добавлено игнорирование ошибки 23 в ,sync_rsync. 5 months ago
,rsync_torrent_to_MediaX.sh caa6bd8171 добавлено игнорирование ошибки 23 в ,sync_rsync. 5 months ago
,shutdown.sh 20ff9ddd1a изменен механизм получения плейлистов. Теперь скрипт ищет 6 months ago
,speech.sh 5303a3f199 Made multilanguage speech script. 3 days ago
,sync_ftp.sh 5303a3f199 Made multilanguage speech script. 3 days ago
,sync_rsync.sh f1afd2c72c folder /mail.ru renames to /cloud. 3 months ago
,timer_today_info.sh 5303a3f199 Made multilanguage speech script. 3 days ago
,translate-shell.sh ffa5e85a41 bugfix 2 weeks ago
,transmission_controller.sh 5303a3f199 Made multilanguage speech script. 3 days ago
,upgrade.sh 2a38ede6e2 fun_analize_return_code переименована в fun_analize_command. 7 months ago
,wallpaper_changer.sh 146bd99d50 change dirs of wallpaper changer script. 6 days ago
,xdotool_getmouselocation.sh 5ed4faa7eb во всех возможных случаях установлена переменная $HOME 1 year ago
.gitignore a0ed06bfc3 удален auto_sync_tvbox. 7 months ago
README.md fbab36fc4c Added script prints as the computer from the ship "Nostromo" 2 days ago
echo_nostromo.sh fbab36fc4c Added script prints as the computer from the ship "Nostromo" 2 days ago
every_minutes.sh 5303a3f199 Made multilanguage speech script. 3 days ago
every_start_os.sh bac3407da5 fix bug when modification date not get correctly. 5 days ago
lib.sh 5303a3f199 Made multilanguage speech script. 3 days ago
nostromo.ogg fbab36fc4c Added script prints as the computer from the ship "Nostromo" 2 days ago
speech_en.sh 5303a3f199 Made multilanguage speech script. 3 days ago
speech_ru.sh 5303a3f199 Made multilanguage speech script. 3 days ago
uptime_counter.sh 5303a3f199 Made multilanguage speech script. 3 days ago

README.md

1. About.

This scripts is only home use on GPL 3.0 lisense. Scripts used and tested on my Debian 11 xfce.

2. Construction.

All scripts contain from 3 folders.

  • $HOME/.MYSCRIPTS - this folder with scripts.
  • $HOME/LOG - for logfiles and other temporary files. Generate automatically.
  • $HOME/RESOURSE - for data files. Media, text and other files. Not incduluded. if necessary, you must create the necessary files yourself.

Specific scripts:

  • $HOME/.MYSCRIPTS/every_start_os.sh - started evry start system. Consis apps to start.
  • $HOME/.MYSCRIPTS/every_minutes.sh started every minutes.
  • $HOME/.MYSCRIPTS/lib.sh - consist all function and conditition function. See point 5.

3. Installization.

3.1. Unpack repository to $HOME/.MYSCRIPTS folder.

Test: Path to lib.sh must be $HOME/.MYSCRIPTS/lib.sh.

3.2. Recomendation.

3.2.1. For work all scripts from the $HOME/.MYSCRIPTS folder without direction specifying the full path.

Add string:

PATH="$PATH:$HOME/.MYSCRIPTS"

to file $HOME/.bashrc

Test: After reload system. If you print "," in terminal all my scripts and aliase should be shown. An alias differs from a script in that it does not have a ".sh" at the end of the name.

3.2.2 For work script every_minutes.sh and every_day.sh

Add job to crontab. Command to add "crontab -e". The command "crontab -l" should look like this:

SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:<path_to_home>/.MYSCRIPTS

* * * * * <path_to_home>/.MYSCRIPTS/every_minutes.sh

- its not variable, its full path from root. Example /home/a/.MYSCRIPTS.

Test: Every minutes must be created and deleted lockfile /tmp/lockfile_every_minutes.

ATTENTION: Some scripts may fail because they are customized for me or don't have the correct paths or because they don't have the right applications. Therefore, just comment them out in every_minutes.sh. An Error.log file will appear on the desktop, which will indicate the script that did not work correctly and the line where the error occurred.

3.2.3 For work script every_start_os.sh which launches applications at system startup.

Add item "Setting" - "Session and Startup" - "Application Autostart" - "+" with this arguments:

Name: every_start_os.sh
Description: Start every_start_os.sh
Command: <path_to_home>/.MYSCRIPTS/every_start_os.sh
Trigger: on login.

- its not variable, its full path from root. Example /home/a/.MYSCRIPTS/every_start_os.sh

Test: Programms included in every_start_os.sh must be started.

ATTENTION: Some programs may not start because you do not have them. Just remove what you don't need and add what you need in the every_start_os.sh. Don't forget to add "&" at the end of each line.

4. Lockfiles.

lockfile_script

When run, most scripts create a lockfile /tmp/lockfile_script. This is done so that the scripts are executed in turn. No script will be run twice at the same time. After script work finished the lockfile /tmp/lockfile_script is deleted.

lockfile_every_minutes

Also, running the script every_minutes.sh creates a lockfile /tmp/lockfile_every_minutes. This is done so that this script is not launched several times at the same time. After script every_minutes.sh finished the lockfile /tmp/lockfile_every_minutes is deleted.

5. Function, about lib.sh

This file contains all the used functions. Its included in script "source $HOME/.MYSCRIPTS/lib.sh".

Functions

Functions are divided into simply functions, denoted by "fun_" at the beginning of the name.

Conditional functions

And conditional functions, denoted by "con_" at the beginning of the name. Conditional functions terminate the script execution if the condition is not met. But unlike functions fun_analize_command, they do not cause an error and stop the work of all scripts.

6. Specific tags to install pakage

#_sudo_apt_install_
#_sudo_dpkg_i_

These tags are required to write the necessary packages for this script to work. First tag specifies the packages to be installed from the repository. Second tag packages to manually install from folder. Use command to see all the packages that need to be installed for all scripts:

grep -r "#_sudo_apt_install" ~/.MYSCRIPTS/"

7. Setup or change language

In the script speech.sh setup language variable "lang". Posible variants: "ru" or "en". Example:

lang="en"

8. Description all scripts

  • ,backup_data1.sh - this script for pack, encrypt my temp data from backup folder. After they are manually copied to the cloud.

  • ,create_playlists.sh - this script for create playlist to Ace Stream Player. Used php scripts. See more http://omt56v4jxa4hurbwk44vqbbcwn3eavuynyc24c25cy7grucjh24q.b32.i2p/trash/ttv-list/

  • ,sync_ftp.sh - this script for lfpt sync Its copied data from my mobile devices to PC.

  • convert - this folder contain convert files.

  • ,backup_data2.sh - this script for pack, encrypt my documents. The script only works if the checksum of the document folder has changed. After they are manually copied to the cloud.

  • ,file_delete_notify.sh - this script prints to the Desktop a list of deleted files in a specific folder. Useful for the documents folder so you don't accidentally delete the files you need.

  • ,sync_rsync.sh - this script for synchronizing folders between logical drives. This is used for backing up documents.

  • every_minutes.sh - see point 2.

  • ,backup_folders.sh - this script for manualy pack, encrypt different folder. May backup root folder.

  • ,find_files.sh - this script to search for files in pre-installed folders.

  • ,timer_today_info.sh - this script announces the current time, the uptime of the current session and the uptime for the whole day by voice messages.

  • every_start_os.sh - see point 2.

  • ,backup_open_data.sh - this script copies new files to a folder for later upload to the cloud. New files are files created after the specified date.

  • ,find_string.sh - this script to search for string in pre-installed files. May use 4 arguments for search.

  • ,translate-shell.sh - this script does a translation based on the translate-shell application.

  • lftp - this folder contain config file for lftp app.

  • ,backup_to_cloud.sh - this script is just a simple shell to run ,backup_data1.sh, ,backup_data2.sh and ,backup_open_data.sh. Launches monthly.

  • ,move_configs.sh - this script is to move manually created files to desired folders.

  • ,transmission_controller.sh - this script controls the transmission client. He finds a new torrent. Informs about its readiness by voice message. Then checks the torrent. The floor after the distribution is completed deletes the torrent. Deletes only the torrent, not the data.

  • lib.sh - see point 2, 5.

  • ,clean.sh - this script cleans the computer from unnecessary files.

  • ,rkhunter.sh - this script to check the computer using rkhunter.

  • ,upgrade.sh - this script for upgrade Debian OS.

  • list - this folder contain lists files for rsync app.

  • ,conky_weather.sh - this script gets the weather forecast and prints it out using conky.

  • ,rsync_no_e24.sh - this is an intermediate script for synchronization, but ignoring error 24.

  • ,wallpaper_changer.sh - this is a script to change wallpaper in xfce. With the arguments "del" file, the disliked wallpaper can be deleted.

  • opt - this folder contains scripts for various purposes that are not constantly used.

  • ,correct_disks.sh -this script adjusts the space of logical disks. When the volume exceeds the minimum allowable value, the script deletes the oldest file from the specified folder. Deletion occurs until the volume of the logical disk is below the minimum allowable value. Inside folders, not the oldest files are deleted, but the files with the lowest name. This is done so that the series first deleted episode 1, and then 2.

  • ,rsync_torrent_to_MediaX.sh - this script moves torrents to a MediaX folder. Normal relocation occurs, but files ending with "*.part" are not ignored.

  • ,xdotool_getmouselocation.sh - this script to get mouse coordinates and write them to a file. Used with hotkeys.

  • uptime_counter.sh - this script calculates the uptime for the whole day. The calculation is based on London time, since the change of date there exactly falls on the time when I sleep in my time zone.

  • ,correct_tvbox.sh - this script adjusts the folder size on the tv box. If the size is exceeded, the script deletes the oldest file. Deletion occurs until the size is less than the minimum allowable size.

  • ,shutdown.sh - this script to shutdown the computer. This is only executed when other scripts are not running.

  • ,cp_to_flash59gb.sh - this script moves torrents to a flash drive. Normal relocation occurs, but files ending with "*.part" are not ignored.

  • ,speech.sh - this script speaks all arguments on the command line. If there are no arguments, then he is silent. If the argument is OK it says "Операция выполнена".

  • config - this folder contains configuration files for other apps etc conky, bash_aliases.

  • echo_nostromo.sh and nostromo.ogg - this script prints as the computer from the ship "Nostromo" printed in the movie "Alien".